spwin.exe) on Windows now saves and reads the command history (see Command Line Editing).
write/[1,2]is now much faster when writing atomic terms.
assertz/1and friends are now faster when asserting facts, i.e. clauses without bodies.
library(terms): the new predicate
term_hash/3allows 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 fewer 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).
spldwill embed the license into the executable.
user:error_exception/1is now called with the exception term specified by ISO Prolog, i.e. the same term that is seen by
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/1is the second argument of the
Please note: This is an incompatible change. Old code that
user:error_exception/1 may need to be updated.
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/0is 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 runtime with the
SP_USE_MALLOC set to
SICStus runtimes built with the new
--memhook=malloc; and when calling
SP_set_memalloc_hooks() with the new option
See SP_set_memalloc_hooks in the SICStus Prolog Manual.
library(clpfd): unification with domain variables as well as propositional combinations of arithmetic constraints have been accelerated.