]> Repositorios git - scryer-prolog.git/commitdiff
remove residual goal for ground BDD
authorMarkus Triska <[email protected]>
Sun, 23 Apr 2023 07:20:46 +0000 (09:20 +0200)
committerMarkus Triska <[email protected]>
Sun, 23 Apr 2023 07:23:00 +0000 (09:23 +0200)
Example:

    ?- sat(X).
       X = 1.

src/lib/clpb.pl

index 1bdbbefc272a0d3f80f85cec8e1e2766aea7f17f..3b7ac007407e1b762acf2a3a40b3da360402150b 100644 (file)
@@ -1628,6 +1628,7 @@ skip_to_var_(Var, Weight, [Var0-Weight0|VWs0], VWs) -->
 
 attribute_goals(Var) -->
         { var_index_root(Var, _, Root) },
+        !,
         (   { root_get_formula_bdd(Root, Formula, BDD) } ->
             { del_bdd(Root) },
             (   { clpb_residuals(bdd) } ->
@@ -1655,6 +1656,10 @@ attribute_goals(Var) -->
             booleans(RestVs)
         ;   boolean(Var)  % the variable may have occurred only in taut/2
         ).
+attribute_goals(Var) -->
+        { get_atts(Var, clpb_bdd(BDD)),
+          ground(BDD),
+          put_atts(Var, -clpb_bdd(_)) }.
 
 del_clpb(Var) :-
         del_attr(Var, clpb),