SICStus Prolog now complies with Technical Corrigenda 1 and 2 to the International Standard ISO/IEC 13211-1 (PROLOG: Part 1—General Core).

`throw/1`

now throws its argument as is.`raise_exception/1`

however 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.- In cases where the ISO and SICStus error term previously had different principal functors, the SICStus error term has been changed to correspond to the ISO one.
`subsumes_term/2`

is a new standard built-in predicate, aliased by`terms:subsumeschk/2`

, and is now correct in case the arguments share variables.`term_variables/2`

is a new standard built-in predicate, aliased by`terms:term_variables_bag/2`

, and performs conformant error handling.`terms:term_variables/2`

has been renamed to`terms:term_variables_set/2`

.`acyclic_term/2`

, previously in`library(terms)`

, is now a standard built-in predicate.- The built-in predicates
`callable/1`

,`ground/1`

,`retractall/1`

,`call/n`

,`false/0`

are now standard. - The built-in predicates
`number_codes/2`

,`number_chars/2`

,`atom_codes/2`

, and`atom_chars/2`

now perform conformant error handling. The syntax for numbers has changed (plus sign is no longer allowed^{1}). Full ISO syntax allowed in Codes/Chars, including layout and comments. - The built-in predicates
`length/2`

,`keysort/2`

,`sort/2`

,`compare/3`

, and`open/[3,4]`

now perform conformant error handling. - The built-in predicates
`call/1`

,`assert/1`

and similar predicates now perform conformant error handling when encountering an invalid goal. `X``div`

`Y`is 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``^`

`Y`is 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.`pi`

is a new standard arithmetic expression, whose value is approximately 3.14159.`+`

is a new standard prefix operator declared as`:-op(200, fy, [+])`

.- ‘
`|`’ can now be declared as an operator. The default, when it has not been declared as an operator, is to treat it like before, i.e. as a synonym for the standard infix ‘`;`’ when used as an operator. If ‘`|`’ is declared as an operator, you can no longer use ‘`|`’ to denote disjunction in clause bodies and grammar rules. So, declaring ‘`|`’ as an operator is not recommended.**Please note:**A future version of the ISO Prolog standard is likely to define ‘`|`’ as an operator. - Arithmetic error handling is now conformant. Previously, in many cases a domain error would be thrown where an evaluation error was required.
- Quoted atoms are no longer written with the non-conformant escape
sequences ‘
`\e`’ and ‘`\d`’. They are still allowed when reading, though. - Operators as immediate argument of an operator are now
bracketed when written, as required by the
standard. E.g.
`writeq(^(*,\+))`

outputs ‘`(*)^(\+)`’. `clause/[2,3]`

and`retract/1`

return a close equivalent to the asserted clause, as required by the standard. This also affects`listing/[0,1]`

.- The
`read_term/[2,3]`

option`singletons/1`

is 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. - The
`read_term/[2,3]`

options`variable_names/1`

and`singletons/1`

now order their entries by the order the variable occurred in the input term, i.e. in the same order as the`variables/1`

option. In previous releases the order was undefined, and unpredictable. The new ordering is permitted, but not (yet) required, by the standard. -
The Prolog parser,
`read_term/[2,3]`

, now correctly parses some valid input that used to give syntax error. - Back-quote, ‘
```’, can no longer be used for quoting atoms. Use the standard conformant single-quote ‘`'`’ instead. - The
`write_term/[2,3]`

option`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 option

`variable_names/1`

that takes a list of`Name``=`

`Variable`pairs, exactly like the list produced by the`read_term/[2,3]`

option`variable_names/1`

.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 negative zero floating point value is now written as ‘
`0.0`’, rather than ‘`-0.0`’. There is no difference in behavior between these two zero values so the distinction should no longer be detectable by Prolog code.

[1] 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.

Send feedback on this subject.