Glossary

anonymous variable

A variable designated by an underscore "_", An anonymous variable may be used in a Prolog clause for an argument or a (sub-)term that appears only once. It allows you to avoid making up unneeded variable names. A cllause may use more than one anonymous variable because each use is taken to be a distinct argument or (sub-)term.

arguments

Directly occurring subterms of a structure, including structures used as predicates or goals. The term father(mary, john) has the arguments mary and john.

arity

The number of arguments of a Prolog structure. The structure father(X,Y) has arity two.

asciiz

A data structure composed of a linear array of ASCII characters that is null (a zero value byte) terminated.

atom

Equivalent to 'string'. Textual constants which may contain letters, digits, or symbols. Atoms beginning with digits or uppercase letters that occur in Prolog code or in terms that are input or output using the read or write predicates must be enclosed in single quotes (') or dollar signs ($). The empty string is denoted by two single quotes (''). The empty list is an atom denoted by the left square bracket followed by the right square bracket ([]).

atomic

A data type in Arity/Prolog32 which is numeric (an integer or float), an atom (also known as a string), or a database reference. Unbound variables and structures, including non-empty lists are not atomic.

B-tree

A method of database indexing where the access to data is made more efficient (than linear search) by dynamically organizing range tests in a tree structure. B-tree indexing provides the abillity to retrieve terms in sorted order.

backtracking

Backtracking is the computational step of processing which is associated with an attempt to resatisfy goals by trying the most recent untried alternative. Backtracking has the effect of releasing memory that was consumed by processing since the latest "choice point."

body

The clauses in a Prolog rule which appear after the neck symbol (:-). All of the goals in the body of a rule must be true in order for the head of the clause to be satisfied.

bound variables

A variable which has been unified with a structure or an atomic value. Also known as an instantiated variable.

choice point

A choice point is a record of the state of the current execution of a program where alternatives exist for the possible satisfaction of a goal. Choice points are created when a Prolog predicate is entered with multiple clauses or when ever backtracking causes a new clause to be tried and there are additional alternative clauses remaining. In addition, some evaluable predicates such as recorded/3, if/3, and repeat/0 create choice points. Cuts (!) and snips ([! !]) have the effect of removing choice points.

clause

A Prolog fact or rule. A Prolog predicate is composed of a set of clauses.

consult

To load a file into the Arity/Prolog32 database. When you consult a file, the predicates in the file are appended to predicates already in the database. See reconsult.

current code world

The world in which the clause predicates, such as assert/1, listing/0 or call/1, look to find predicates. A world is a namespace that may be used dynamically.

current data world

The world in which the database predicates, such as recordz/3 or recorded/3, look to find keys. A world is a namespace that may be used dynamically.

cut (!)

A program control structure which removes choice points that have been created since the invokation of the current predicate, including any alternative clauses of the predicate. A cut eliminates the ability to backtrack through a predicate.

database reference

A unique identifier, displayed as a tilde (~) followed by eight hexadecimal digits, which is assigned by Arity/Prolog32 to terms and clauses stored in the database.

fact

A fact is a Prolog clause which contains no goals that need to be satisfied for the clause to be true. A Prolog fact is equivalent to a Prolog rule that contains a neck (:-) followed by 'true' or by cut (!). If the latter, then the execution of the fact if successful will remove the choice point for the predicate.

free variable

A variable which is not unified with an atomic value or a structure. A free variable is a “placeholder” for a value but does not yet contain a value. Synonyms: unbound variable, uninstantiated variable.

functor

The name and arity of a structure. The functor of a structure designates its type. For example, the structure likes(mary,john) has the functor likes/2, where the name is 'likes' and arity is equal to 2.

goal

Goals are the individual calls to predicates on the right hand side of a clause (that is, the part of a clause after the neck ':-' ).

ground term

A Prolog term that is atomic or a structure with arguments that are atomic or are themselves ground terms. In other words, a ground term is not an unbound variable and does not contain any sub-terms which are unbound variables.

handle

The number assigned to an open file. The standard input and standard output may be treated as files and thus are also assigned handles (0 and 1, respectively).

hash table

A method of database indexing where data are stored efficiently on the basis of an internally computed function that computes an access code (a hash) from a key. Hash tables can be more efficient than B-trees in some cases but lack the ability to retrieve terms in a sorted order.

head of a list

See List.

head of a clause

The term in a Prolog clause which appears before the neck symbol (:-) or, in the case of a Prolog fact, the fact itself.

infix notation

An operator appearing between two values or expressions.

instantiated variables

A variable which has been unified with a structure or an atomic value. Also known as a bound variable.

instantiation

The binding of a variable to an atomic value or to a structure.

integer

A whole number in the range -2,147,483,648 to 2,147,483,647.

leashing

The practice of indicating which ports the debugger should stop at to accept commands.

list

Lists are Prolog structures which are used to represent and manipulate an ordered set of terms. Because processing on ordered sets is extremely common and important a special syntax was introduced to make the most common operations convenient. The empty list is represented by the atom []. The LISP-inspired "cons" functor used for constructing lists is '.'/2 and by convention its first argument is called the "head" and the second the "tail." A list is usually designated by a comma-separated set of terms within square brackets, such as [1, 2, 3]. Using the square bracket convention, the separation of a list into a "head term" and a "tail list" is designated by a vertical bar (|) such as [X, Y | Z]. Thus if [1, 2, 3] were to be unified with [X, Y | Z} then the following unifications would occur: X = 1, Y = 2 and Z = [3]. Lists of ascii characters have a special syntax in Prolog; Character lists are enclosed in double quotes. Thus, the following are equivalent: "abc" and [97, 98, 99].

neck

The symbol :- which separates the head of a clause from the body of a clause. Neck is an infix operator and is in reality the functor ':-'/2.

partition

Databases may have one or more partition. Partitions are used to improve locality of reference in larger databases. Partitions have no effect on program execution other than a possible increase in database efficiency.

ports

Used in debugging, a port refers to one of four states of execution of a goal. The four ports are call, exit, fail, and redo.

postfix notation

An operator that appears after a value or expression.

predicate

A collection of facts and rules having a specific name and arity.

prefix notation

An operator that appears before a value or expression.

principal functor

The outermost functor of a structure.

reconsult

Loading a file into the Arity/Prolog32 database with predicates in the file replacing duplicate predicates in the database.

recursion

A style of programming where a predicate's definition includes a direct or indirect call to itself. The use of cuts in recursion to remove choice points that are not needed is important to achieve efficiency in both execution time and in memory space consumption.

repeat-fail loop

A construct which forces alternate solutions to goals to be generated for as long as an exit condition is not met. Repeat-fail loops can be extremely efficient because interum memory use is released.

rule

A clause composed of a set of goals on the right hand side of a neck symbol. The goals on the right hand side are called the body of the clause. The body must be satisfied (found to be true) to make the rule clause true.

snips ([! !])

A program control operator which limits backtracking, but to a lesser extent than the cut. When the right hand side of a snips is encountered all of the choice points created during execution after the left hand side of the snips was encountered are removed. Thus backtracking will not attempt to resatisfy any goals between the two snips. Until the right hand side of the snips is encountered any choice points are unaffected.

spy point

A predicate in a Prolog program for which you want the debugger to display program execution information. You can set any number of spy points.

stand-alone program

A compiled program which runs independently of the Arity/Prolog32 interpreter.

string

See 'atom'

structure

A data type composed of a type (a functor) and arguments. The arguments to a structure are enclosed in parentheses. For example: animal(human,warm_blooded).

tail of a list

See List.

term

Prolog programs are built from and manipulate terms. Terms may be an unbound variable, an atomic value, or a structure, including a list.

thread

Arity/Prolog32 supports a multi-threaded execution model. Threads may be initiated during program initialization.

unification

Unification is the basic computational step within the execution of a Prolog program. Unification may succeed or fail. If successful, then the two terms that are unified become the same equivalent term. Unification is a recursive process that binds unbound values to terms, associates unbound variables together, checks for equality of atomic values, and matches structures. Structure matching verifies that the functors are the same and recursively calls unification on each corresponding argument of the structures.

unbound variable

A variable which is not unified with an atomic value or a structure. An unbound variable is a “placeholder” for a value but does not yet contain a value. Synonyms: free variable, uninstantiated variable.

uninstantiated variable

A variable which is not unified with an atomic value or a structure. An uninstantiated variable is a “placeholder” for a value but does not yet contain a value. Synonyms: free variable, unbound variable.

variable

A variable is a Prolog term which is designated by a name beginning with a capital letter or underscore. The value of a variable may or may not be instantiated.

workspace

A workspace is one of up to 4 databases that may be accessed by a program concurrently. Each Prolog thread has associated with it a current workspace which may be changed programmatically.

world

A named database space. You can have up to 16 different worlds in an application. By default programs have only one world used for interpreted code and for data. However, a code world and a data world may be assigned dynamically by a program during execution.