fix needless check in dif/2 implementation

This commit is contained in:
Mark Thom
2019-02-14 16:12:24 -04:00
parent 8958a563de
commit 6b879467f3

View File

@@ -38,10 +38,8 @@ verify_attributes(Var, Value, Goals) :-
dif(X, Y) :- X \== Y, dif(X, Y) :- X \== Y,
( X \= Y -> true ( X \= Y -> true
; term_variables(X, XVars), term_variables(Y, YVars), ; term_variables(X, XVars), term_variables(Y, YVars),
( XVars == [], YVars == [] -> false dif_set_variables(XVars, X, Y),
; dif_set_variables(XVars, X, Y), dif_set_variables(YVars, X, Y)
dif_set_variables(YVars, X, Y)
)
). ).
gather_dif_goals(Attrs, _) :- gather_dif_goals(Attrs, _) :-
@@ -50,7 +48,7 @@ gather_dif_goals([dif(X, Y) | Attrs], Goal) :-
gather_dif_goals(Attrs, OldGoal), gather_dif_goals(Attrs, OldGoal),
( var(OldGoal), !, Goal = dif(X, Y) ( var(OldGoal), !, Goal = dif(X, Y)
; !, Goal = (dif(X, Y), OldGoal) ; !, Goal = (dif(X, Y), OldGoal)
). ).
gather_dif_goals([_ | Attrs], Goal) :- gather_dif_goals([_ | Attrs], Goal) :-
gather_dif_goals(Attrs, Goal). gather_dif_goals(Attrs, Goal).