From: Markus Triska Date: Wed, 8 Mar 2023 19:50:33 +0000 (+0100) Subject: ENHANCED: more compact definition of dif/2 X-Git-Tag: v0.9.2~170^2~1 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=c9ecfb11d9d2c39eb519d42f8d24cc51b2d4475e;p=scryer-prolog.git ENHANCED: more compact definition of dif/2 As outlined in #1753. --- diff --git a/src/lib/dif.pl b/src/lib/dif.pl index a59052ac..20842b27 100644 --- a/src/lib/dif.pl +++ b/src/lib/dif.pl @@ -59,11 +59,8 @@ verify_attributes(Var, Value, Goals) :- 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) - ) + ; term_variables(dif(X,Y), Vars), + dif_set_variables(Vars, X, Y) ). gather_dif_goals(_, []) --> [].