Node:State Info, Next:Meta Logic, Previous:Exception, Up:Built Intro
listing
Lists onto the current output stream all the clauses in the
database (in the type-in module; see Module Spec).
Clauses listed onto a file can be consulted back.
listing(:Spec)
| ?- listing([concatenate/3, reverse, m:go/[2,3], bar:_]).
current_atom(?Atom) meta-logical
Atom is an atom known to SICStus Prolog. Can be used to
enumerate (through backtracking) all currently known atoms,
and return each one as Atom.
current_predicate(?Name,:Head)
current_predicate(?Name,-Head)
Name is the name of a user defined or library predicate, and
Head is the most general goal for that predicate,
possibly prefixed by a module name. This predicate can be
used to enumerate all user defined or library predicates through
backtracking.
current_predicate(?Name/?Arity) ISO
Name is the name of a user defined or library predicate,
possibly prefixed by a module name and Arity is its
arity. This predicate can be used to enumerate all user
defined or library predicates through backtracking.
predicate_property(:Head,?Property)
predicate_property(-Head,?Property)
Head is the most general goal for an existing predicate, possibly prefixed by a module name, and Property is a property of that predicate, where the possible properties are
built_in
(for built-in predicates)
or compiled
or interpreted
(for user defined
predicates) or fd_constraint
for FD predicates
see Defining Primitive Constraints.
dynamic
for predicates that have been
declared dynamic (see Dynamic Declarations),
multifile
for predicates that have been
declared multifile (see Multifile Declarations),
volatile
for predicates that have been
declared volatile (see Volatile Declarations),
(block Term)
for predicates
that have block declarations (see Block Declarations),
exported
or terms
imported_from(ModuleFrom)
for predicates
exported or imported from modules (see Module Intro),
(meta_predicate Term)
for predicates
that have meta-predicate declarations (see Meta Decl).
This predicate can be used to enumerate all existing
predicates and their properties through backtracking.
current_module(?Module)
Module is a module in the system. It can be used to
backtrack through all modules present in the system.
current_module(?Module, ?File)
Module is the module defined in File.
module(+Module)
The type-in module is set to Module.
set_prolog_flag(+FlagName,+NewValue) ISO
prolog_flag(+FlagName,?OldValue,?NewValue)
OldValue is the value of the Prolog flag FlagName, and the new value of FlagName is set to NewValue. The possible Prolog flag names and values are:
agc_margin
argv
% sicstus -a hello world 2001
then the value will be [hello,world,'2001']
.
bounded ISO
false
, indicating that the domain of
integers is practically unbounded.
char_conversion ISO
on
, unquoted characters in terms and
programs read in will be converted, as specified by previous
invocations of char_conversion/2
. If the flag is off
no
conversion will take place. The default value is on
.
compiling
compile/1
and fcompile/1
operate (see Load Intro).
compactcode
fastcode
profiledcode
debugcode
debugging
debug/0
, nodebug/0
,
tracee/0
, notrace/0
, zip/0
, nozip/0
(see Debug Pred). The flag describes the mode the debugger is in, or
is required to be switched to:
trace
debug
zip
off
debug ISO
debug
, prescribed by the ISO Prolog standard, is a
simplified form of the debugging
flag:
off
on
(The flags debugging
and debug
have no effect in
runtime systems.)
double_quotes ISO only
codes
chars
atom
character_escapes
on
or off
. If this flag is on
, a backslash
occurring inside integers in 0'
notation or inside quoted
atoms or strings has special meaning, and indicates the
start of an escape sequence (see Escape Sequences). This flag
is relevant when reading as well as when writing terms, and is
initially on
.
debugger_print_options
write_term/3
(see Term I/O), to be used in the debugger's messages. The initial
value is
[quoted(true),numbervars(true),portrayed(true),max_depth(10)]
.
discontiguous_warnings
on
or off
. Enable or disable warning messages when
clauses are not together in source files. Initially on
.
(This warning is always disabled in runtime systems.)
fileerrors
on
or off
. Enables or disables raising of file error
exceptions. Equivalent to fileerrors/0
and
nofileerrors/0
, respectively (see Stream Pred). Initially
on
(enabled).
gc
on
or off
. Enables or disables garbage collection
of the global stack. Initially on
(enabled).
gc_margin
gc_trace
verbose
terse
off
host_type
'x86-linux-glibc2.1'
or 'sparc-solaris-5.7'
.
informational
on
or off
. Enables or disables the printing of
informational messages. Initially on
(printing enabled) in
development systems, unless the --noinfo
command line option
was used; off
(printing disabled) in runtime systems.
integer_rounding_function ISO
toward_zero
, indicating that the
integer division ((//)/2
) and integer remainder (rem/2
)
arithmetic functions use rounding toward zero; see Arithmetic.
language
iso
or sicstus
. Selects the execution mode specified.
Initially sicstus
, unless the --iso
command line
option was used.
max_arity ISO
max_integer ISO
prolog_flag/3
and current_prolog_flag/2
will fail, when
accessing this flag.
min_integer ISO
prolog_flag/3
and current_prolog_flag/2
will fail, when
accessing this flag.
redefine_warnings
on
or off
. Enable or disable warning messages when :
.po
file is being loaded.
Initially on
. (This warning is always disabled in runtime
systems.)
single_var_warnings
on
or off
. Enable or disable warning messages when a
clause containing variables not beginning with _
occurring once only is compiled or consulted. Initially
on
.
source_info
emacs
or on
or off
. If not off
while
source code is being loaded, information about line numbers
and file names are stored with the loaded code. If the value is
on
while debugging, this information is used to print the
source code location while prompting for a debugger command. If
the value is on
while printing an uncaught error exception
message, the information is used to print the source code location
of the culprit goal or one of its ancestors, as far as it
can be determined. If the value is emacs
in any of these cases,
the appropriate line of code is instead highlighted, and no extra text
is printed. The value is off
initially, and that is its only
available value in runtime systems.
syntax_errors
read/[1,2]
.
dec10
error
fail
quiet
system_type
development
in development
systems and runtime
in runtime systems.
toplevel_print_options
write_term/3
(see Term I/O), to be used when the top-level displays
variable bindings, answer constraints. It is also used when
messages are displayed. The initial value is
[quoted(true),numbervars(true),portrayed(true),max_depth(10)]
.
typein_module
module/1
.
unknown ISO
unknown/2
(see Debug Pred).
trace
fail
warning
error
user_input
user_input
and
SP_stdin
. It is initially set to a stream connected to UNIX
stdin
.
user_output
user_output
and SP_stdout
. It is initially set to a stream
connected to UNIX stdout
.
user_error
user_error
and SP_stderr
. It is initially set to a stream
connected to UNIX stderr
.
version
'SICStus 3 #0: Wed Mar 15 12:29:29 MET 1995'
.
wcx
prolog_flag(?FlagName,?Value)
current_prolog_flag(?FlagName,?Value) ISO
Value is the current value of the Prolog flag FlagName. Can
be used to enumerate all Prolog flags and their values by
backtracking.
prolog_load_context(?Key,?Value)
This predicate gives access to context variables during compilation and loading of Prolog files. It unifies Value with the value of the variable identified by Key. Possible keys are:
source
.po
or .ql
file, the corresponding
source file name is returned.
file
source
key. In included files this is the absolute path
name of the file being included.
directory
module
user:term_expansion/[2,4]
and need to access the source module at compile time.
stream
term_position
statistics
Displays on the standard error stream statistics relating to
memory usage, run time, garbage collection of the global stack and
stack shifts. The printing is handled by print_message/2
;
see Messages and Queries.
statistics(?Key,?Value)
global_stack
[size used,free]
local_stack
[size used,free]
trail
[size used,free]
choice
[size used,free]
core
memory
[size used,0]
heap
program
[size used,size free]
runtime
[since start of Prolog,since previous statistics]
These refer to CPU time used while executing, excluding time spent
garbage collecting, stack shifting, or in system calls.
The second element is the time since the last call to
statistics/2
with this key. It is not affected by calls to
statistics/0
.
walltime
[since start of Prolog,since previous statistics]
These refer to absolute time elapsed.
The second element is the time since the last call to
statistics/2
with this key. It is not affected by calls to
statistics/0
.
garbage_collection
[no. of GCs,bytes freed,time spent]
stack_shifts
[no. of global shifts,no. of local/trailtrail shifts,time spent]
atoms
[no. of atoms,bytes used,atoms free]
The number of atoms free is the number of atoms allocated (the
first element in the list) subtracted from the maximum number of atoms,
i.e. 262143 (33554431) on 32-bit (64-bit) architectures. Note that
atom garbage collection may be able to reclaim some of the
allocated atoms.
atom_garbage_collection
[no. of AGCs,bytes freed,time spent]
Times are in milliseconds, sizes of areas in bytes.
trimcore
Trims the stacks, reclaims any dead clauses and predicates, defragmentizes Prolog's memory, and attempts to return any unused memory to the operating system. It is called automatically at every top-level query, except the stacks are not trimmed then.