next up previous index
Next: Getting started with Up: No Title Previous: Reporting Problems

Terminology

   

This chapter defines the terminology which is used throughout the manual and in related documentation.

+X

  This denotes an input argument. Such an argument must be instantiated before a built-in is called.

-X

  This denotes an output argument. Such an argument must be not instantiated before a built-in is called.

?X

  This denotes an input or an output argument. Such an argument may be either instantiated or not when a built-in is called.

Array

  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

  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.  

Atom

An arbitrary name chosen by the user to represent objects from the problem domain. A Prolog atom corresponds to an identifier in other languages.  

Atomic

An atom, string or a number. A terms which does not contain other terms.  

Body

A clause body can either be of the form

Goal_1, Goal_2, ..., Goal_k
and the clause is called a regular clause, or only  
Goal
and then the clause is an iterative clause;   each Goal_i must be a callable term.

Built-in Procedures

  These are predicates provided for the user by the ECLiPSe system, they are either written in Prolog or in the implementation language (usually ``C'').

Clause

  See program clause or goal.

Callable Term

  A callable term is either a compound term or an atom.

Compound Term

  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.

DID

  Each atom created within ECLiPSe is assigned a unique identifier called the dictionary identifier or DID.

Difference List

  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.

Dynamic Procedures

  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.

ElemSpec

  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).

External Procedures

  These are procedures which are defined in a language other than Prolog, and explicitly connected to Prolog predicates by the user.

Fact

    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.

Functor

  A functor is characterised by its name which is an atom, and its arity which is its number of arguments.

Goal Clause

    See query.

Ground

  A term is ground when it does not contain any uninstantiated variables.

Head

  A head is a structure or an atom.

Instantiated

  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.

List

  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 | []]]]
   

Name/Arity

  The notation Name/Arity is used to specify a functor of name Name with arity Arity.

Pair

  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.    

Predicate

  A predicate is another term for a procedure.

PredSpec

  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.

Program Clause

A program clause or clause is either the term      

Head :- Body.
  i.e. a compound term with the functor :-/2, or only a fact.

Query

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.

Regular Prolog Procedure

  A regular (Prolog) procedure is a sequence of user clauses whose heads have the same functor, which then identifies the user procedure.

Simple Procedures

  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).

SpecList

  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.

Static Procedures

  These are procedures which can only be changed as a whole unit, i.e. removed or replaced.

Stream

  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.

Structures

Compound terms which are not pairs are also called structures.  

Term

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.



next up previous index
Next: Getting started with Up: No Title Previous: Reporting Problems



Micha Meier
Mon Mar 4 12:11:45 MET 1996