]> Repositorios git - scryer-prolog.git/commitdiff
dif/2: Omit entailed residual goals, if the arguments are not unifiable.
authorMarkus Triska <[email protected]>
Sat, 22 Aug 2020 15:49:02 +0000 (17:49 +0200)
committerMarkus Triska <[email protected]>
Sat, 22 Aug 2020 15:50:15 +0000 (17:50 +0200)
This addresses #135.

src/lib/dif.pl

index ad3053ec3b3d1bcf569410b8a8411f642446c21a..bb92979af7a762029a1ec7399a90f9745be781ca 100644 (file)
@@ -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) -->