Note that there is a parse difference between -1
and -(1)
aka - 1
:
?- X= -1, write_canonical(X), integer(X). -1 X = -1.
?- X= -(1), write_canonical(X), integer(X). -(1) false.
?- X= - 1, write_canonical(X), integer(X). -(1) false.
However, in the is/2 expression, this doesn't matter:
?- X is -(1) + 1. X = 0.