This library is intended to be activated using the directive below in
files that are designed for use with SICStus Prolog 3. The changes are
in effect until the end of the file and in each file loaded from this
file.
:- expects_dialect(sicstus).
This library only provides compatibility with version 3 of SICStus
Prolog. For SICStus Prolog 4 compatibility, use
library(dialect/sicstus4) instead.
- To be done
- - The dialect-compatibility packages are developed in a
`demand-driven' fashion. Please contribute to this package.
- if(:If, :Then, :Else)
- Same as SWI-Prolog soft-cut construct. Normally, this is
translated using goal-expansion. If either term contains a !, we
use meta-calling for full compatibility (i.e., scoping the cut).
- rename_module(?SICStusModule, ?RenamedSICSTusModule) is nondet[multifile]
- True if RenamedSICSTusModule is the name that we use for the
SICStus native module SICStusModule. We do this in places where
the module-name conflicts. All explicitely qualified goals are
mapped to the SICStus equivalent of the module.
- use_module(+Module, -File, +Imports) is det
- use_module(-Module, +File, +Imports) is det
- This predicate can be used to import from a named module while
the file-location of the module is unknown or to get access to
the module-name loaded from a file.
If both Module and File are given, we use Module and try to
unify File with the absolute canonical path to the file from
which Module was loaded. However, we succeed regardless of the
success of this unification.
- bb_put(:Name, +Value) is det
- bb_get(:Name, -Value) is semidet
- bb_delete(:Name, -Value) is semidet
- bb_update(:Name, -Old, +New) is semidet
- SICStus compatible blackboard routines. The implementations only
deal with cases where the module-sensitive key is unknown and
meta-calling. Simple cases are directly mapped to SWI-Prolog
non-backtrackable global variables.
- is_mutable(@Term) is det
- True if Term is bound to a mutable term.
- Compatibility
- - sicstus
- create_mutable(?Value, -Mutable) is det
- Create a mutable term with the given initial Value.
- Compatibility
- - sicstus
- get_mutable(?Value, +Mutable) is semidet
- True if Value unifies with the current value of Mutable.
- Compatibility
- - sicstus
- update_mutable(?Value, !Mutable) is det
- Set the value of Mutable to Value. The old binding is
restored on backtracking.
- See also
- - setarg/3.
- Compatibility
- - sicstus
- read_line(-Codes) is det
- read_line(+Stream, -Codes) is det
- Read a line from the given or current input. The line read does
not include the line-termination character. Unifies Codes with
end_of_file
if the end of the input is reached.
- See also
- - The SWI-Prolog primitive is read_line_to_codes/2.
- Compatibility
- - sicstus
- trimcore is det
- Trims the stacks and releases unused heap memory to the
operating system where possible. Other tasks of the SICStus
trimcore/0 are automatically scheduled by SWI-Prolog.
- prolog_flag(+Flag, -Old, +New) is semidet
- Query and set a Prolog flag. Use the debug/1 topic
prolog_flag
to find the flags accessed using this predicate.
Re-exported predicates
The following predicates are exported from this file while their implementation is defined in imported modules or non-module files loaded by this module.
- bb_put(:Name, +Value) is det
- bb_get(:Name, -Value) is semidet
- bb_delete(:Name, -Value) is semidet
- bb_update(:Name, -Old, +New) is semidet
- SICStus compatible blackboard routines. The implementations only
deal with cases where the module-sensitive key is unknown and
meta-calling. Simple cases are directly mapped to SWI-Prolog
non-backtrackable global variables.
- bb_put(:Name, +Value) is det
- bb_get(:Name, -Value) is semidet
- bb_delete(:Name, -Value) is semidet
- bb_update(:Name, -Old, +New) is semidet
- SICStus compatible blackboard routines. The implementations only
deal with cases where the module-sensitive key is unknown and
meta-calling. Simple cases are directly mapped to SWI-Prolog
non-backtrackable global variables.
- bb_put(:Name, +Value) is det
- bb_get(:Name, -Value) is semidet
- bb_delete(:Name, -Value) is semidet
- bb_update(:Name, -Old, +New) is semidet
- SICStus compatible blackboard routines. The implementations only
deal with cases where the module-sensitive key is unknown and
meta-calling. Simple cases are directly mapped to SWI-Prolog
non-backtrackable global variables.
- read_line(-Codes) is det
- read_line(+Stream, -Codes) is det
- Read a line from the given or current input. The line read does
not include the line-termination character. Unifies Codes with
end_of_file
if the end of the input is reached.
- See also
- - The SWI-Prolog primitive is read_line_to_codes/2.
- Compatibility
- - sicstus
- block +Heads
- Declare predicates to suspend on certain modes. The argument is,
like meta_predicate/1, a comma-separated list of modes
(BlockSpecs). Calls to the predicate is suspended if at least one
of the conditions implies by a blockspec evaluated to
true
. A
blockspec evaluated to true
iff all arguments specified as `-' are
unbound.
Multiple BlockSpecs for a single predicate can appear in one or more
:- block
declarations. The predicate is suspended untill all mode
patterns that apply to it are satisfied.
The implementation is realised by creating a wrapper that checks the
block conditions and either calls the original predicate immediately
(if none of the block conditions were true) or uses attributed
variables to delay re-evaluating the block condition until any of
the arguments in question are bound.
- Compatibility
- - SICStus Prolog
Undocumented predicates
The following predicates are exported, but not or incorrectly documented.
- statistics(Arg1, Arg2)
- sicstus_is_readable_stream(Arg1)