This chapter defines the terminology which is used throughout the manual and in related documentation.
This denotes an input argument. Such an argument must be instantiated before a built-in is called.
This denotes an output argument. Such an argument must be not instantiated before a built-in is called.
This denotes an input or an output argument. Such an argument may be either instantiated or not when a built-in is called.
An array specification is a compound term the form Name(Dim_1,...,Dim_n), where Name is the array name, the arity denotes the number of dimensions and the arguments are integers indicating the size in each dimension. An array element is selected with a similar term.
Arity is the number of arguments to a term. Atoms are considered as functors with zero arity. The notation Name/Arity is used to specify a functor of name Name with arity Arity.
An arbitrary name chosen by the user to represent objects from the problem domain. A Prolog atom corresponds to an identifier in other languages.
An atom, string or a number. A terms which does not contain other terms.
A clause body can either be of the form
Goal_1, Goal_2, ..., Goal_kand the clause is called a regular clause, or only
Goaland then the clause is an iterative clause; each Goal_i must be a callable term.
These are predicates provided for the user by the ECLiPSe system, they are either written in Prolog or in the implementation language (usually ``C'').
A callable term is either a compound term or an atom.
Compound terms are of the form
f(t_1, t_2, ..., t_n)where f is the functor of the compound term and t_i are terms, n is its arity. Lists and Pairs are also compound terms.
Each atom created within ECLiPSe is assigned a unique identifier called the dictionary identifier or DID.
A difference list is a special kind of a list. Instead of being ended by nil, a difference list has an uninstantiated tail so that new elements can be appended to it in constant time. A difference list is written as List - Tail where List is the beginning of the list and Tail is its uninstantiated tail. Programs that use difference lists are usually more efficient and always much less readable than programs without them.
These are procedures which can be modified clause-wise, by adding or removing one clause at a time. Note that this class of procedure is equivalent to interpreted procedures in other Prolog systems. See also static procedures.
An ElemSpec specifies a global variable (an atom) or an array element (a ground compound term with as much arguments (integers) as the number of dimensions of the array).
These are procedures which are defined in a language other than Prolog, and explicitly connected to Prolog predicates by the user.
A fact or unit clause is a term of the form:
Head.where Head is a structure or an atom. A fact may be considered to be a rule whose body is always true.
A functor is characterised by its name which is an atom, and its arity which is its number of arguments.
A term is ground when it does not contain any uninstantiated variables.
A head is a structure or an atom.
A variable is instantiated when it has been bound to an atomic or a compound term as opposed to being uninstantiated or free. See also ground.
A list is a special type of term within Prolog. It is a recursive data structure consisting of pairs (whose tails are lists). A list is either the atom [] called nil as in LISP, or a pair whose tail is a list. The notation :
[a , b , c]is shorthand for:
[a | [b | [c | []]]]
The notation Name/Arity is used to specify a functor of name Name with arity Arity.
A pair is a compound term with the functor ./2 ( dot) which is written as :
[H|T]H is the head of the pair and T its tail.
A predicate is another term for a procedure.
This is similar to the notation Name/Arity. Some built-ins allow the arity to be omitted and to specify Name only. This stands for all (visible) predicates with that name and any arity.
A program clause or clause is either the term
Head :- Body.i.e. a compound term with the functor :-/2, or only a fact.
A query has the same form as Body and is also called a goal. Such clauses occur mainly as input to the top level Prolog loop and in files being compiled, then they have the form
:- Goal_1, ..., Goal_k.or
?- Goal_1, ..., Goal_k.
A regular (Prolog) procedure is a sequence of user clauses whose heads have the same functor, which then identifies the user procedure.
Apart from regular procedures ECLiPSe recognises simple procedures which are written not in Prolog but in the implementation language, i.e. C and which are deterministic. There is a functor associated with each simple procedure, so that any procedure recognisable by ECLiPSe is identified by a functor, or a compound term with this functor (or atom).
The SpecList notation means a sequence of terms of the form:
name_1/a_1, name_2/a_2, ..., name_k/a_k.The SpecList notation is used in many built-ins, for example, to specify a list of procedures in the global/1 predicate.
These are procedures which can only be changed as a whole unit, i.e. removed or replaced.
This is an I/O channel identifier and can be a physical stream number, one of the reserved stream identifiers or a user defined stream name (defined using set_stream/2 or open/3). The reserved stream identifiers are:
input, output, error, toplevel_input, toplevel_output, answer_output, debug_input, debug_output, user, null, stdin, stdout, stderr.
Compound terms which are not pairs are also called structures.
A term is the basic data type in Prolog. It is either a variable, a constant, i.e. an atom, a number or a string, or a compound term.
The notation Pred/N1, N2 is often used in this documentation as a shorthand for Pred/N1, Pred/N2.