From: Markus Triska Date: Sat, 22 Aug 2020 15:49:02 +0000 (+0200) Subject: dif/2: Omit entailed residual goals, if the arguments are not unifiable. X-Git-Tag: v0.9.0~174^2~8^2 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=cc77ef680d270913a85e6b2d062ac1950233a9f2;p=scryer-prolog.git dif/2: Omit entailed residual goals, if the arguments are not unifiable. This addresses #135. --- diff --git a/src/lib/dif.pl b/src/lib/dif.pl index ad3053ec..bb92979a 100644 --- a/src/lib/dif.pl +++ b/src/lib/dif.pl @@ -49,7 +49,9 @@ dif(X, Y) :- gather_dif_goals([]) --> []. gather_dif_goals([(X \== Y) | Goals]) --> - [dif(X, Y)], + ( { X \= Y } -> [] + ; [dif(X, Y)] + ), gather_dif_goals(Goals). attribute_goals(X) -->