SICStus Prolog now complies with Technical Corrigenda 1, 2 and 3 to the International Standard ISO/IEC 13211-1 (PROLOG: Part 1—General Core).
throw/1now throws its argument as is.
raise_exception/1however transforms SICStus error terms into ISO (
error/2) exceptions. Unless a forged SICStus error term is thrown by
throw/1, the net behavior is unchanged.
subsumes_term/2is a new standard built-in predicate, aliased by
terms:subsumeschk/2, and is now correct in case the arguments share variables.
term_variables/2is a new standard built-in predicate, aliased by
terms:term_variables_bag/2, and performs conformant error handling.
terms:term_variables/2has been renamed to
acyclic_term/2, previously in
library(terms), is now a standard built-in predicate.
false/0are now standard.
atom_chars/2now perform conformant error handling. The syntax for numbers has changed (plus sign is no longer allowed1). Full ISO syntax allowed in Codes/Chars, including layout and comments.
open/[3,4]now perform conformant error handling.
assert/1and similar predicates now perform conformant error handling when encountering an invalid goal.
X div Yis a new standard arithmetic expression, whose value is the integer quotient of X and Y, rounded downwards to the nearest integer.
xor(X,Y)is the standard syntax for
X \ Y.
X ^ Yis a new standard arithmetic expression, whose value is X raised to the power of Y, represented as a float if any of X and Y is a float; otherwise, as an integer.
piis a new standard arithmetic expression, whose value is approximately 3.14159.
+is a new standard prefix operator declared as
:-op(200, fy, [+]).
retract/1return a close equivalent to the asserted clause, as required by the standard. This also affects
singletons/1is now conformant. It now includes all named variables that occur only once in the read term, as required by the standard. It used to exclude some variables for which singleton warnings should not be emitted, e.g. ‘_A’. Any such filtering must now be performed by the caller instead.
singletons/1now order their entries by the order the variable occurred in the input term, i.e. in the same order as the
variables/1option. In previous releases the order was undefined, and unpredictable. The new ordering is permitted, but not (yet) required, by the standard.
read_term/[2,3], now correctly parses some valid input that used to give syntax error.
numbervars(true)(also used by
writeq/[1,2]and others), is now standard compliant and only affects terms
$VAR(N)when N is a non-negative integer. In particular it no longer does special processing when N is an atom.
To supply names for variables when writing a term you can use the new
variable_names/1 that takes a list of
Name=Variable pairs, exactly like the list produced
To get the legacy behavior, where
'$VAR'(Name) is written
as Name when Name is an atom, you can use the new option
legacy_numbervars(true) which behaves like
numbervars(true) did in earlier releases.
A term written by a previous
release will still be read correctly by this release. A term written
by this release will be read correctly by releases prior to 4.3,
except if the written term contains a prefix
+ operator with a
non-negative number as argument.