Go to the previous, next section.
When referring to keyboard characters, printing characters are written thus: a, while control characters are written like this: ^A. Thus ^C is the character you get by holding down the CTL key while you type c. Finally, the special control characters carriage-return, line-feed and space are often abbreviated to RET, LFD and SPC respectively.
When introducing a built-in predicate, we shall present its usage with a mode spec which has the form name(arg, ..., arg) where each arg denotes how that argument should be instantiated in goals, and has one of the following forms:
Mode specs are not only used in the manual, but are part of the syntax of the language as well. When used in the source code, however, the ArgName part must be omitted. That is, arg must be either :, +, -, or ?.
In the context of certain compiler declarations, we shall need the
following notation: Predicates in Prolog are distinguished by their name
and their arity. The notation name/arity
is
therefore used when it is necessary to refer to a predicate
unambiguously; e.g. concatenate/3
specifies the predicate which
is named "concatenate" and which takes 3 arguments. In general, a
predicate spec takes the form name/arity
. With
the introduction of the module system, this spec is only defined
relative to the "current" module. An absolute predicate spec must
include a module prefix: module:name/arity
.
The full Prolog system with top level, compiler, debugger etc. is known as the Development System. On some platforms, both a sequential and an OR-parallel Development System can be built. The OR-parallel Development System is also known as Muse.
OR-parallelism executes clauses and disjunctions of a predicate in parallel and is useful for search and all-solutions style programming. No change or annotations of the programs are necessary but sometimes more parallelism may be utilized if the program is modified. The main issue is to avoid side effects that might serialize the search. Except for some few exceptions Muse preserves the full functionality of SICStus Prolog. Muse is still an experimental system and is not formally supported.
It is possible to link user-written C code with a subset of SICStus Prolog to create stand-alone applications, called Runtime Systems. Only sequential Runtime Systems are available. When introducing a built-in predicate, any limitations on its use in Runtime Systems will be mentioned.
Whenever this manual documents a C function as part of SICStus Prolog's foreign language interface, the function prototype will be displayed in ANSI C syntax.
To aid programmers who wish to write standard compliant programs, built-in predicates that have a counterpart in the ISO Prolog Standard are annotated with [ISO] in this manual, where appropriate with a comment clarifying the difference between the SICStus and the prescribed ISO Prolog versions.
call_residue/2
has been modified so that
goals that are disjunctively blocked on several variables are returned
correctly in the second argument. See section Coroutining.
setarg/3
has been removed. Its
functionality is provided by the new built-ins create_mutable/2
,
get_mutable/2
, and update_mutable/2
, which implement a
timestamp technique for value-trailing with low-level
support. See section Modification of Terms.
unix/1
and plsys/1
have been
removed. Their functionality is provided by
prolog_flag(argv,X)
, by the new halt/1
built-in, and
by the new library(system)
module which also contains several new
predicates. See section Operating System Utilities.
library(sockets)
module. See section Socket IO.
time_out/3
has been moved to the new
library(timeout)
module. See section Timeout Predicate.
term_hash/4
, subsumes_chk/2
, and
term_subsumer/3
have been moved to the new library(terms)
module, which also contains operations for unification with occurs-check,
testing acyclicity, and getting the variables of a term.
See section Term Utilities.
+chars
, -chars
and [-chars]
for fast conversion between
C strings and Prolog lists of character codes. Several new interface functions
are available. See section Calling C from Prolog.
SP_term_ref
,
making the functions SP_show_term()
and SP_hide_term()
obsolete.
See section Calling Prolog from C.
library(gmlib)
has been replaced by
the Tcl/Tk based library(tcltk)
. A version of library(gmlib)
converted to SICStus Prolog release 3 is available from
`ftp://sics.se/archive/sicstus3/gmlib.tar.gz'. See section Tcl/Tk Interface.
library(objects)
module has been enhanced. See section Prolog Objects:
self
.
Prolog goals in methods must be prefixed by :.
library(charsio)
, the open_chars_stream/(3-4)
predicates
have been replaced by open_chars_stream/2
and
with_output_to_chars/(2-3)
. See section IO on Lists of Character Codes.
library(assoc)
module now implements AVL trees instead of
unbalanced binary trees. See section Association Lists.
library(atts)
implements
attributed variables, a general mechanism for associating logical variables
with arbitrary attributes. Comes with a number of hooks that make it
convenient to define and interface to constraint solvers.
See section Attributed Variables.
library(clpb)
and is implemented on top of library(atts)
. See section Boolean Constraint Solver.
library(clpq)
) and reals
(library(clpr)
), implemented on top of library(atts)
.
See section Constraint Logic Programming over Rationals or Reals.
user:goal_expansion/3
is a new hook predicate for macro-expansion.
See section Term and Goal Expansion.
bb_put/2
, bb_get/2
, bb_delete/2
, and bb_update/3
are new built-ins implementing blackboard primitives.
See section Blackboard Primitives.
prolog_load_context/2
(see section Information about the State of the Program) is a new built-in predicate
for accessing aspects of the context of files being loaded.
file_search_path/2
(see section Stream IO) is a new hook predicate
providing an alias expansion mechanism for filenames.
gcd/2
is a new built-in function. See section Arithmetic.
walltime
measures elapsed absolute time.
See section Information about the State of the Program.
Go to the previous, next section.