I have been staring at Prolog toplevel results like these for some time now:
?- reverse([X,Y,Z],[Y,Z,Y]).
X = Y, Y = Z.
And it just occurred to me: Shouldn't it say
?- reverse([X,Y,Z],[Y,Z,Y]).
X == Y, Y == Z.
Because =
is unification, and ==
is term equality. Which is what Prolog really wants to say: Those terms are equal! (They trivially unify, being unbound variables).
A bad case of historical raisins?
?- X = Y.
with answerX = Y
orY = X
orX = _quelconque, Y = _quelconque
. Now, take that answer and paste it back into the toplevel. With==
in place of=
this would be failure. – falseclpfd
(need to be turned on in SICStus, and in SWI you have to wrapQuery_0
ascall_residuevars(Query_0, Vs)
). What is displayed is called (the projection of) a (constraint) store. Much less nice for CHR. – false