Did you know ... Search Documentation:
sicstus.pl -- SICStus 3 compatibility library
PublicShow source

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

Source bb_put(:Name, +Value) is det
Source bb_get(:Name, -Value) is semidet
Source bb_delete(:Name, -Value) is semidet
Source 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.
Source is_mutable(@Term) is det
True if Term is bound to a mutable term.
Compatibility
- sicstus
Source create_mutable(?Value, -Mutable) is det
Create a mutable term with the given initial Value.
Compatibility
- sicstus
Source get_mutable(?Value, +Mutable) is semidet
True if Value unifies with the current value of Mutable.
Compatibility
- sicstus
Source 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
Source read_line(-Codes) is det
Source 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
Source 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.
Source 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.

Source bb_put(:Name, +Value) is det
Source bb_get(:Name, -Value) is semidet
Source bb_delete(:Name, -Value) is semidet
Source 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.
Source bb_put(:Name, +Value) is det
Source bb_get(:Name, -Value) is semidet
Source bb_delete(:Name, -Value) is semidet
Source 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.
Source bb_put(:Name, +Value) is det
Source bb_get(:Name, -Value) is semidet
Source bb_delete(:Name, -Value) is semidet
Source 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.
Source read_line(-Codes) is det
Source 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
Source 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.

Source statistics(Arg1, Arg2)
Source sicstus_is_readable_stream(Arg1)