]> Repositorios git - scryer-prolog.git/commitdiff
polish freeze.pl and dif.pl
authorMark Thom <[email protected]>
Sat, 16 Feb 2019 04:04:20 +0000 (21:04 -0700)
committerMark Thom <[email protected]>
Sat, 16 Feb 2019 04:04:20 +0000 (21:04 -0700)
src/prolog/lib/dif.pl
src/prolog/lib/freeze.pl

index 82aa5f1c054e50d7af4b0e19eabd2541dbbcf0f2..9031113880b17ea74296810894d09aefd08c611f 100644 (file)
@@ -1,7 +1,6 @@
 :- module(dif, [dif/2]).
 
 :- use_module(library(atts)).
-:- use_module(library(control), [(\=)/2]).
 
 :- attribute dif/2.
 
index ab95dbf3aef05f621ac0242eb640f096b478f054..ae0669d05135ab93b50b230711d84adf9d12d6e7 100644 (file)
@@ -21,13 +21,13 @@ freeze(X, Goal) :-
     put_atts(Fresh, frozen(Goal)),
     Fresh = X.
 
-gather_freeze_goals(Attrs, _) :-
+gather_freeze_goals(Attrs, _, _) :-
     var(Attrs), !.
-gather_freeze_goals([frozen(X) | Attrs], [frozen(X) | Goals]) :-
-    gather_freeze_goals(Attrs, Goals).
-gather_freeze_goals([_ | Attrs], Goals) :-
-    gather_freeze_goals(Attrs, Goals).
+gather_freeze_goals([frozen(X) | Attrs], Var, [frozen(Var, X) | Goals]) :-
+    gather_freeze_goals(Attrs, Var, Goals).
+gather_freeze_goals([_ | Attrs], Var, Goals) :-
+    gather_freeze_goals(Attrs, Var, Goals).
 
 attribute_goals(X, Goals) :-
     '$get_attr_list'(X, Attrs),
-    gather_freeze_goals(Attrs, Goals).
+    gather_freeze_goals(Attrs, X, Goals).