From 10d5c00f4bf0ce28a0464a27ce0b4d9ab87b079c Mon Sep 17 00:00:00 2001 From: Mark Thom Date: Fri, 15 Feb 2019 21:04:20 -0700 Subject: [PATCH] polish freeze.pl and dif.pl --- src/prolog/lib/dif.pl | 1 - src/prolog/lib/freeze.pl | 12 ++++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/prolog/lib/dif.pl b/src/prolog/lib/dif.pl index 82aa5f1c..90311138 100644 --- a/src/prolog/lib/dif.pl +++ b/src/prolog/lib/dif.pl @@ -1,7 +1,6 @@ :- module(dif, [dif/2]). :- use_module(library(atts)). -:- use_module(library(control), [(\=)/2]). :- attribute dif/2. diff --git a/src/prolog/lib/freeze.pl b/src/prolog/lib/freeze.pl index ab95dbf3..ae0669d0 100644 --- a/src/prolog/lib/freeze.pl +++ b/src/prolog/lib/freeze.pl @@ -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). -- 2.54.0