Mystery Unification

Writing a binding as

V1 = V2, V2 = V3, .... Vn-1 = Vn, Vn = <value>

is just (SWI-)Prolog’s way to say that two variables have exactly the same value (as in ==). In Prolog is generally not observable whether two terms are equal because they have been unified or simply because they happen to have the same value. Thus, X = 7, X = Y is internally exactly the same as X = 7, Y = 7.

1 Like