From 8958a563dea9a511ad38a7f2d04f5c1f7f710a49 Mon Sep 17 00:00:00 2001 From: Mark Thom Date: Thu, 14 Feb 2019 01:19:11 -0700 Subject: [PATCH] fix bug in dif/2 implementation --- src/prolog/lib/dif.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/prolog/lib/dif.pl b/src/prolog/lib/dif.pl index 4bb44c0d..7d36d0b8 100644 --- a/src/prolog/lib/dif.pl +++ b/src/prolog/lib/dif.pl @@ -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) ) -- 2.54.0