write/[1,2]
is now much faster when writing atomic terms.
assertz/1
and friends are now faster when asserting facts,
i.e. clauses without bodies.
library(terms)
:
the new predicate term_hash/3
allows more control over
the hashing behavior and hash algorithm used.
Notable new features: a new, better, default hash algorithm and several other algorithms, including the 4.0.4 version, are available; it is possible to obtain a full 32-bit hash value; it is possible to get an instantiation error or hash value when the term being hashed is nonground.
term_hash/[2,4]
has been changed to use a better hash
function by default. The new hash function gives less collisions in
general, and gives the same value on all platforms.
Please note: The change of hash function is an incompatible change that may affect programs or data that depend on the old hash algorithm. The old behavior can be obtained as follows:
%% Pre 4.0.5 version term_hash_4_0_4(Term, Hash) :- term_hash(Term, [algorithm('sicstus-4.0.4')], Hash). term_hash_4_0_4(Term, Depth, Range, Value) :- term_hash(Term, [algorithm('sicstus-4.0.4'), depth(Depth), range(Range)], Hash).
library(debugger_examples)
updated.
user:error_exception/1
is now called with the
exception term specified by ISO Prolog, i.e. the same term that is
seen by catch/3
and on_exception/3
. It used to be called
with an internal representation of the exception.
This affects error exceptions, i.e. those with functor
error/2
. The old (pre 4.0.5) value passed to
user:error_exception/1
is the second argument of the
error/2
structure.
Please note: This is an incompatible change. Old code that
uses user:error_exception/1
may need to be rewritten.
If the old code looked like:
%% Pre 4.0.5 version user:error_exception(Old) :- do_something(Old).
it can be rewritten as follows (which will also work in older versions of SICStus Prolog):
%% >= 4.0.5 version user:error_exception(New) :- ( New = error(_, Old) -> true; Old = New), do_something(Old).
trimcore/0
is now more thorough when releasing memory back to
the operating system. This also affects the trimcore
-variant
used by the top-level.
malloc()
et al. as
memory manager instead of the default custom allocator.
malloc()
is selected when starting sicstus with the new option
-m; when initializing the SICStus run-time with the
environment variable SP_USE_MALLOC
set to yes
; for
SICStus run-times built with the new spld option
--memhook=malloc; and when calling
SP_set_memalloc_hooks()
with the new option
SP_SET_MEMALLOC_HOOKS_HINT_USE_MALLOC
.
See SP_set_memalloc_hooks for more information.
library(clpfd)
:
unification with domain variables as well as
propositional combinations of arithmetic constraints have been accelerated.