2 Glossary

abolish
To abolish a predicate is to retract all the predicate's clauses and to remove all information about it from the Prolog system, to make it as if that predicate had never existed.
advice-point
A special case of breakpoint, the advice breakpoint. It is distinguished from spypoints in that it is intended for non-interactive debugging, such as checking of program invariants, collecting information, profiling, etc.
alphanumeric
An alphanumeric character is any of the lowercase characters from `a' to `z', the uppercase characters from `A' to `Z', the numerals from `0' to `9', or underscore (`_').
ancestors
An ancestor of a goal is any goal that the system is trying to solve when it calls that goal. The most distant ancestor is the goal that was typed at the top-level prompt.
anonymous variable
An anonymous variable is one that has no unique name, and whose value is therefore inaccessible. An anonymous variable is denoted by an underscore (`_').
argument
See predicate, structure, and arity.
arity
The arity of a structure is its number of arguments. For example, the structure customer(jones,85) has an arity of 2.
atom
A character sequence used to uniquely denote some entity in the problem domain. A number is not an atom. Unless character escapes have been switched off, examples of legal atoms are:
          hello   *   :=   '#$%'   'New York'   'don\'t'
     

See Atoms. Atoms are recognized by the built-in predicate atom/1. Each Prolog atom is represented internally by a unique integer, represented in C as an SP_atom.

atomic term
Synonym for constant.
backtrace
A collection of information on the control flow of the program, gathered by the debugger. Also the display of this information produced by the debugger. The backtrace includes data on goals that were called but not exited and also on goals that exited nondeterminately.
backtracking
The process of reviewing the goals that have been satisfied and attempting to resatisfy these goals by finding alternative solutions.
binding
The process of assigning a value to a variable; used in unification.
blocked goal
A goal that is suspended because it is not instantiated enough.
body
The body of a clause consists of the part of a Prolog clause following the `:-' symbol.
breakpoint
A description of certain invocations in the program where the user wants the debugger to stop, or to perform some other actions. A breakpoint is specific if it applies to the calls of a specific predicate, possibly under some conditions; otherwise, it is generic. Depending on the intended usage, breakpoints can be classified as debugger breakpoints, also known as spypoints, or advice breakpoints, also called advice-points; see Advanced Debugging.
breakpoint spec
A term describing a breakpoint. Composed of a test part, specifying the conditions under which the breakpoint should be applied, and an action part, specifying the effects of the breakpoint on the execution.
buffer
A temporary workspace in Emacs that contains a file being edited.
built-in predicate
A predicate that comes with the system and that does not have to be explicitly loaded before it is used.
callable term
A callable term is either a compound term or an atom. Callable terms are recognized by the built-in predicate callable/1.
char-list
A char-list is a list of one-char atoms.
character code
An integer that is the numeric representation of a character. SICStus Prolog supports character codes in the range 0..2147483647 (i.e. 2^31-1). However, to be able to input or output character codes larger than 255, one needs to use the appropriate wide character external encoding.
character code set
A subset of the set {0, ..., 2^31-1} that can be handled by the external encoding. SICStus Prolog assumes that the character code set is an extension of the ASCII code set, i.e. it includes codes 0..127, and these codes are interpreted as ASCII characters
character-conversion mapping
SICStus Prolog maintains a character-conversion mapping, which is used while reading terms and programs. Initially, the mapping prescribes no character conversions. It can be modified by the built-in predicate char_conversion(In, Out), following which In will be converted to Out. Character coversion can be switched off by the char_conversion Prolog flag.
character-type mapping
A function mapping each element of the character code set to one of the character categories (layout, letter, symbol-char, etc.), required for parsing tokens.
choicepoints
A memory block representing outstanding choices for some goals or disjunctions.
clause
A fact or a rule. A rule comprises a head and a body. A fact consists of a head only, and is equivalent to a rule with the body true.
code-list
A code-list is a list of character codes.
conjunction
A series of goals connected by the connective “and” (that is, a series of goals whose principal operator is `,').
compactcode
Virtual code representation of compiled code. A reasonable compromise between performance and space requirement. A valid value for the compiling Prolog flag.
compile
To load a program (or a portion thereof) into Prolog through the compiler. Compiled code runs more quickly than interpreted code, but you cannot debug compiled code in as much detail as interpreted code.
compound term
A compound term is a term that is an atom together with one or more arguments. For example, in the term father(X), father is the name, and X is the first and only argument. The argument to a compound term can be another compound term, as in father(father(X)). Compound terms are recognized by the built-in predicate compound/1.
console-based executable
An executable that inherits the standard streams from the process that invoked it, e.g. a UNIX shell or a DOS-prompt.
constant
An integer (for example: 1, 20, -10), a floating-point number (for example: 12.35), or an atom. Constants are recognized by the built-in predicate atomic/1.
consult
To load a program (or a portion thereof) into Prolog through the interpreter. Interpreted code runs more slowly than compiled code, but you can debug interpreted code in more detail than compiled code.
creep
What the debugger does in trace mode, also known as single-stepping. It goes to the next port of a procedure box and prints the goal, then prompts you for input. See Basic Debug.
cursor
The point on the screen at which typed characters appear. This is usually highlighted by a line or rectangle the size of one space, which may or may not blink.
cut
Written as !. A built-in predicate that succeeds when encountered; if backtracking should later return to the cut, the goal that matched the head of the clause containing the cut fails immediately.
database
The Prolog database comprises all of the clauses that have been loaded or asserted into the Prolog system or that have been asserted, except those clauses that have been retracted or abolished.
database reference
A compound term denoting a unique reference to a dynamic clause.
debug
A mode of program execution in which the debugger stops to print the current goal only at predicates that have spypoints set on them (see leap).
debugcode
Interpreted representation of compiled code. A valid value for the compiling Prolog flag.
declaration
A declaration looks like a directive, but is not executed but conveys information about predicates about to be loaded.
deinit function
A function in a foreign resource that is called prior to unloading the resource.
determinate
A predicate is determinate if it can supply only one answer.
development system
A stand-alone executable with the full programming environment, including top-level, compiler, debugger etc. The default sicstus executable is a development system; new development systems containing pre-linked foreign resources can also be created.
directive
A directive is a goal preceded by the prefix operator `:-', whose intuitive meaning is “execute this as a query, but do not print out any variable bindings.”
disjunction
A series of goals connected by the connective “or” (that is, a series of goals whose principal operator is `;').
dynamic predicate
A predicate that can be modified while a program is running. The semantics of such updates is described in Modify Prog. A predicate must explicitly be declared to be dynamic or it must be added to the database via one of the assertion predicates.
encoded string
A sequence of bytes representing a sequence of possibly wide character codes, using the UTF-8 encoding.
escape sequence
A sequence of characters beginning with `\' inside certain syntactic tokens (see Escape Sequences).
export
A module exports a predicate so that other modules can import it.
extended runtime system
A stand-alone executable. In addition to the normal set of built-in runtime system predicates, extended runtime systems include the compiler. Extended runtime systems require the extended runtime library, available from SICS as an add-on product.
external encoding (of wide characters)
A way of encoding sequences of wide characters as sequences of (8-bit) bytes, used in stream input and output.
fact
A clause with no conditions—that is, with an empty body. A fact is a statement that a relationship exists between its arguments. Some examples, with possible interpretations, are:
          king(louis, france).   % Louis was king of France.
          have_beaks(birds).     % Birds have beaks.
          employee(nancy, data_processing, 55000).
                               % Nancy is an employee in the
                               % data processing department.
     

fastcode
Native code representation of compiled code. The fastest, but also the most space consuming representation. Only available for Sparc platforms. A valid value for the compiling Prolog flag.
file specification
An atom or a compound term denoting the name of a file. The rules for mapping such terms to absolute file names are described in Input Output.
floundered query
A query where all unsolved goals are blocked.
foreign predicate
A predicate that is defined in a language other than Prolog, and explicitly bound to Prolog predicates by the Foreign Language Interface.
foreign resource
A named set of foreign predicates.
functor
The functor of a compound term is its name and arity. For example, the compound term foo(a,b) is said to have “the functor foo of arity two”, which is generally written foo/2.

The functor of a constant is the term itself paired with zero. For example, the constant nl is said to have “the functor nl of arity zero”, which is generally written nl/0.

garbage collection
The freeing up of space for computation by making the space occupied by terms that are no longer available for use by the Prolog system.
generalized predicate spec
A generalized predicate spec is a term of one of the following forms. It is always interpreted wrt. a given module context:
Name
all predicates called Name no matter what arity, where Name is an atom for a specific name or a variable for all names, or
Name/Arity
the predicate of that name and arity, or
Name/[Arity,...,Arity]
the predicates of that name with one of the given arities, or
Module:Spec
specifying a particular module Module instead of the default module, where Module is an atom for a specific module or a variable for all modules, or
[Spec,...,Spec]
the set of all predicates covered by the Specs.

glue code
Interface code between the Prolog engine and foreign predicates. Automatically generated by the foreign language interface as part of building a linked foreign resource.
goal
A simple goal is a predicate call. When called, it will either succeed or fail.

A compound goal is a formula consisting of simple goals connected by connectives such as “and” (`,') or “or” (`;').

A goal typed at the top-level is called a query.

ground
A term is ground when it is free of (unbound) variables. Ground terms are recognized by the built-in predicate ground/1.
guarded clause
A clause of the form
          Head :- Goals, !, Goals.
     

head
The head of a clause is the single goal, which will be satisfied if the conditions in the body (if any) are true; the part of a rule before the `:-' symbol. The head of a list is the first element of the list.
extendible predicate
An extendible predicate is a dynamic, multifile predicate, to which new clauses can be added by the user.
hook predicate
A hook predicate is a predicate that somehow alters or customizes the behavior of a hookable predicate.
hookable predicate
A hookable predicate is a built-in predicate whose behavior is somehow altered or customized by a hook predicate.
import
Exported predicates in a module can be imported by other modules. Once a predicate has been imported by a module, it can be called, or exported, as if it were defined in that module.

There are two kinds of importation: predicate-importation, in which only specified predicates are imported from a module; and module-importation, in which all the predicates made exported by a module are imported.

indexing
The process of filtering a set of potentially matching clauses of a predicate given a goal. For interpreted and compiled code, indexing is done on the principal functor of the first argument. Indexing is coarse wrt. large integers and floats.
init function
A function in a foreign resource that is called upon loading the resource.
initialization
An initialization is a goal that is executed when the file in which the initialization is declared is loaded. An initialization is declared as a directive :- initialization Goal.
instantiation
A variable is instantiated if it is bound to a non-variable term; that is, to an atomic term or a compound term.
internal encoding (of wide characters)
A way of encoding wide character sequences internally within the Prolog system. SICStus Prolog uses a technique known as the UTF-8 encoding for this purpose.
interpret
Load a program or set of clauses into Prolog through the interpreter (also known as consulting). Interpreted code runs more slowly than compiled code, but more extensive facilities are available for debugging interpreted code.
invocation box
Same as procedure box.
large integer
An integer that is not a small integer.
leap
What the debugger does in debug mode. The debugger shows only the ports of predicates that have spypoints on them. It then normally prompts you for input, at which time you may leap again to the next spypoint (see trace).
leashing
Determines how frequently the debugger will stop and prompt you for input when you are tracing. A port at which the debugger stops is called a “leashed port”.
linked foreign resource
A foreign resource that is ready to be installed in an atomic operation, normally represented as a shared object or DLL.
list
A list is written as a set of zero or more terms between square brackets. If there are no terms in a list, it is said to be empty, and is written as `[]'. In this first set of examples, all members of each list are explicitly stated:
          [aa, bb,cc]  [X, Y]  [Name]  [[x, y], z]
     

In the second set of examples, only the first several members of each list are explicitly stated, while the rest of the list is represented by a variable on the right-hand side of the “rest of” operator, `|':

          [X | Y]  [a, b, c | Y]  [[x, y] | Rest]
     

`|' is also known as the “list constructor.” The first element of the list to the left of `|' is called the head of the list. The rest of the list, including the variable following `|' (which represents a list of any length), is called the tail of the list.

load
To load a Prolog clause or set of clauses, in source or binary form, from a file or set of files.
meta-call
The process of interpreting a callable term as a goal. This is done e.g. by the built-in predicate call/1.
meta-logical predicate
A predicate that performs operations that require reasoning about the current instantiation of terms or decomposing terms into their constituents. Such operations cannot be expressed using predicate definitions with a finite number of clauses.
meta-predicate
A meta-predicate is one that calls one or more of its arguments; more generally, any predicate that needs to assume some module in order to operate is called a meta-predicate. Some arguments of a meta-predicate are subject to module name expansion.
mode spec
A term name(arg, ..., arg) where each arg denotes how that argument should be instantiated in goals. See Mode Spec.
module
A module is a set of predicates in a module-file. The name of a module is an atom. Some predicates in a module are exported. The default module is user.
module name expansion
The process by which certain arguments of meta-predicates get prefixed by the source module. See Meta Exp.
module-file
A module-file is a file that is headed with a module declaration of the form:
          :- module(ModuleName, ExportedPredList).
     

which must appear as the first term in the file.

multifile predicate
A predicate whose definition is to be spread over more than one file. Such a predicate must be preceded by an explicit multifile declaration in all files containing clauses for it.
mutable term
A special form of compound term subject to destructive assignment. See Modify Term. Mutable terms are recognized by the built-in predicate is_mutable/1.
name clash
A name clash occurs when a module attempts to define or import a predicate that it has already defined or imported.
occurs-check
A test to ensure that binding a variable does not bind it to a term where that variable occurs.
one-char atom
An atom that consists of a single character.
operator
A notational convenience that allows you to express any compound term in a different format. For example, if likes in
          | ?- likes(sue, cider).
     

is declared an infix operator, the query above could be written:

          | ?- sue likes cider.
     

An operator does not have to be associated with a predicate. However, certain built-in predicates are declared as operators. For example,

          | ?- =..(X, Y).
     

can be written as

          | ?- X =.. Y.
     

because =.. has been declared an infix operator.

Those predicates that correspond to built-in operators are written using infix notation in the list of built-in predicates at the beginning of the part that contains the reference pages.

Some built-in operators do not correspond to built-in predicates; for example, arithmetic operators. See Standard Operators for a list of built-in operators.

pair
A compound term K-V. Pairs are used by the built-in predicate keysort/2 and by many library modules.
parent
The parent of the current goal is a goal that, in its attempt to obtain a successful solution to itself, is calling the current goal.
port
One of the seven key points of interest in the execution of a Prolog predicate. See Procedure Box for a definition.
pre-linked foreign resource
A linked foreign resource that is linked into a stand-alone executable as part of building the executable.
precedence
A number associated with each Prolog operator, which is used to disambiguate the structure of the term represented by an expression containing a number of operators. Operators of lower precedence are applied before those of higher precedence; the operator with the highest precedence is considered the principal functor of the expression. To disambiguate operators of the same precedence, the associativity type is also necessary. See Operators.
predicate
A functor that specifies some relationship existing in the problem domain. For example, < /2 is a built-in predicate specifying the relationship of one number being less than another. In contrast, the functor + /2 is not (normally used as) a predicate.

A predicate is either built-in or is implemented by a procedure.

predicate spec
A compound term name/arity or module:name/arity denoting a predicate.
procedure
A set of clauses in which the head of each clause has the same predicate. For instance, a group of clauses of the following form:
          connects(san_francisco, oakland, bart_train).
          connects(san_francisco, fremont, bart_train).
          connects(concord, daly_city, bart_train).
     

is identified as belonging to the predicate connects/3.

procedure box
A way of visualizing the execution of a Prolog procedure, A procedure box is entered and exited via ports.
profiledcode
Virtual code representation of compiled code, instrumented for profiling. A valid value for the compiling Prolog flag.
profiling
The process of gathering execution statistics of parts of the program, essentially counting the times selected program points have been reached.
program
A set of procedures designed to perform a given task.
PO file
A PO (Prolog object) file contains a binary representation of a set of modules, predicates, clauses and directives. They are portable between different platforms, except between 32-bit and 64-bit platforms. They are created by save_files/2, save_modules/2, and save_predicates/2.
QL file
A QL (quick load) file contains an intermediate representation of a compiled source file. They are portable between different platforms, but less efficient than PO files, and are therefore obsolescent. They are created by fcompile/1.
query
A query is a question put by the user to the Prolog system. A query is written as a goal followed by a full-stop in response to the Prolog system prompt. For example,
          | ?- father(edward, ralph).
     

refers to the predicate father/2. If a query has no variables in it, the system will respond either `yes' or `no'. If a query contains variables, the system will try to find values of those variables for which the query is true. For example,

          | ?- father(edward, X).
          X = ralph
     

After the system has found one answer, the user can direct the system to look for additional answers to the query by typing ;.

recursion
The process in which a running predicate calls itself, presumably with different arguments and for the purpose of solving some subset of the original problem.
region
The text between the cursor and a previously set mark in an Emacs buffer.
rule
A clause with one or more conditions. For a rule to be true, all of its conditions must also be true. For example,
          has_stiff_neck(ralph) :-
             hacker(ralph).
     

This rule states that if the individual ralph is a hacker, then he must also have a stiff neck. The constant ralph is replaced in

          has_stiff_neck(X) :-
             hacker(X).
     

by the variable X. X unifies with anything, so this rule can be used to prove that any hacker has a stiff neck.

runtime kernel
A shared object or DLL containing the SICStus virtual machine and other runtime support for stand-alone executables.
runtime system
A stand-alone executable with a restricted set of built-in predicates and no top-level. Stand-alone applications containing debugged Prolog code and destined for end-users are typically packaged as runtime systems.
saved-state
A snapshot of the state of Prolog saved in a file by save_program/[1,2]. The state consists of all predicates and modules except built-in predicates and clauses of volatile predicates, the current operator declarations, the current character-conversion mapping, the values of all writable Prolog flags except debug, debugging, double_quotes, char_conversion, informational, source_info, wcx, and the user_* stream aliases (see State Info), any blackboard data (see Blackboard Primitives), database data (see Database), and profiling data (see Profiling), but no information for source-linked debugging.
semantics
The relation between the set of Prolog symbols and their combinations (as Prolog terms and clauses), and their meanings. Compare syntax.
sentence
A clause or directive.
side-effect
A predicate that produces a side-effect is one that has any effect on the “outside world” (the user's terminal, a file, etc.), or that changes the Prolog database.
simple term
A simple term is a constant or a variable. Simple terms are recognized by the built-in predicate simple/1.
small integer
An integer in the range [-2^25,2^25-1] on 32-bit platforms, or [-2^56,2^56-1] on 64-bit platforms.
source code
The human-readable, as opposed to the machine-executable, representation of a program.
source module
The module that is the context of a file being loaded. For module-files, the source module is named in the file's module declaration. For other files, the source module is inherited from the context.
SP_term_ref
A “handle” object providing an interface from C to Prolog terms.
spypoint
A special case of breakpoint, the debugger breakpoint, intended for interactive debugging. Its simplest form, the plain spypoint instructs the debugger to stop at all ports of all invocations of a specified predicate. Conditional spypoints apply to a single predicate, but are more selective: the user can supply applicability tests and prescribe the actions to be carried out by the debugger. A generic spypoint is like a conditional spypoint, but not restricted to a single predicate. See Advanced Debugging.
stand-alone executable
A binary program that can be invoked from the operating system, containing the SICStus runtime kernel. A stand-alone executable is a development system (e.g. the default sicstus executable), or a runtime system. Both kinds are created by the application builder. A stand-alone executable does not itself contain any Prolog code; all Prolog code must be loaded upon startup.
static predicate
A predicate that can be modified only by being reloaded or by being abolished. See dynamic predicate.
stream
An input/output channel. See Input Output.
stream alias
A name assigned to a stream at the time of opening, which can be referred to in I/O predicates. Must be an atom. There are also three predefined aliases for the standard streams: user_input, user_output and user_error.
stream position
A term representing the current position of a stream. This position is determined by the current byte, character and line counts and line position. Standard term comparison on stream position terms works as expected. When SP1 and SP2 refer to positions in the same stream, SP1@<SP2 if and only if SP1 is before SP2 in the stream. You should not otherwise rely on their internal representation.
string
A special syntactic notation, which, by default, denotes a code-list, e.g.:
          "SICStus"
     

In iso execution mode, by setting the Prolog flag double_quotes, the meaning of strings can be changed. With an appropriate setting, a string can be made to denote a char-list, or an atom. Strings are not a separate data type.

subterm selector
A list of argument positions selecting a subterm within a term (i.e. the subterm can be reached from the term by successively selecting the argument positions listed in the selector). Example: within the term q, (r, s; t) the subterm s is selected by the selector [2, 1, 2].
syntax
The part of Prolog grammar dealing with the way in which symbols are put together to form legal Prolog terms. Compare semantics.
system encoding (of wide characters)
A way of encoding wide character strings, used or required by the operating system environment.
term
A basic data object in Prolog. A term can be a constant, a variable, or a compound term.
trace
A mode of program execution in which the debugger creeps to the next port and prints the goal.
type-in module
The module that is the context of queries.
unblocked goal
A goal that is not blocked.
unbound
A variable is unbound if it has not yet been instantiated.
unification
The process of matching a goal with the head of a clause during the evaluation of a query, or of matching arbitrary terms with one another during program execution.

The rules governing the unification of terms are:


unit clause
See fact.
UTF-8 encoding
See internal encoding
variable
A logical variable is a name that stands for objects that may or may not be determined at a specific point in a Prolog program. When the object for which the variable stands is determined in the Prolog program, the variable becomes instantiated. A logical variable may be unified with a constant, a compound term, or another variable. Variables become uninstantiated when the predicate they occur in backtracks past the point at which they were instantiated.

Variables may be written as any sequence of alphanumeric characters starting with either a capital letter or `_'; e.g.:

          X   Y   Z   Name   Position   _c   _305  One_stop
     

See Variables.

volatile
Predicate property. The clauses of a volatile predicate are not saved in saved-states.
windowed executable
An executable that pops up its own window when run, and that directs the standard streams to that window.
zip
Same as debug mode, except no debugging information is collected while zipping.