dif/2: Succeed unconditionally if the arguments are not unifiable.

This addresses one part of #135.
This commit is contained in:
Markus Triska
2020-08-22 17:47:42 +02:00
parent 62c9b8390b
commit e75ebd9b6e

View File

@@ -38,11 +38,14 @@ verify_attributes(Var, Value, Goals) :-
% Probably the world's worst dif/2 implementation. I'm open to
% suggestions for improvement.
dif(X, Y) :- X \== Y,
( term_variables(X, XVars), term_variables(Y, YVars),
dif_set_variables(XVars, X, Y),
dif_set_variables(YVars, X, Y)
).
dif(X, Y) :-
X \== Y,
( X \= Y -> true
; ( term_variables(X, XVars), term_variables(Y, YVars),
dif_set_variables(XVars, X, Y),
dif_set_variables(YVars, X, Y)
)
).
gather_dif_goals([]) --> [].
gather_dif_goals([(X \== Y) | Goals]) -->