?nonvar is @evaluable_arithmetic_expression [ISO]

This operator forces prolog to evaluate it's two arguments as arithmetic expressions and unifies the first argument and the value of the second argument. The first argument can be a variable (possibly empty) and the second argument must evaluate to a value. If the left operand has a value then that value is compared with the value of the arithmetic expression on the right side.

see also: arithmetic in Prolog is_string/2

Examples
X is 5, X is X + 10. fails, this shall always fail because X is first unfied with the value 5 and then it is unified with 15, this is mismatch
X = atan(1.0), Y is cos(X) ** 2. succeeds, Y is 0.5
foo is 77. fails
X is N / 0. instantiation error exception

 

 

info@trinc-prolog.com