]> Repositorios git - scryer-prolog.git/commitdiff
fix bug in dif/2 implementation
authorMark Thom <[email protected]>
Thu, 14 Feb 2019 08:19:11 +0000 (01:19 -0700)
committerMark Thom <[email protected]>
Thu, 14 Feb 2019 08:19:11 +0000 (01:19 -0700)
src/prolog/lib/dif.pl

index 4bb44c0d26f0d957941e97f87319d33057d3d8f1..7d36d0b83968bef0648dd1c35514425eb336d7e6 100644 (file)
@@ -35,9 +35,10 @@ 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 -> true
+dif(X, Y) :- X \== Y,
+             (   X \= Y -> true
              ;   term_variables(X, XVars), term_variables(Y, YVars),
-                (   XVars == [], YVars == [] -> true
+                (   XVars == [], YVars == [] -> false
                 ;   dif_set_variables(XVars, X, Y),
                     dif_set_variables(YVars, X, Y)
                 )