From c4448d066a9d4fcecbecc8292f9972389f0db698 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Thu, 13 Dec 2012 15:53:01 +0000 Subject: [PATCH] allow backtracking over possible values of constraints.a --- packages/CLPBN/clpbn/ground_factors.yap | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/CLPBN/clpbn/ground_factors.yap b/packages/CLPBN/clpbn/ground_factors.yap index 4454b64b2..d2732f238 100644 --- a/packages/CLPBN/clpbn/ground_factors.yap +++ b/packages/CLPBN/clpbn/ground_factors.yap @@ -109,7 +109,7 @@ collect(Keys, Factors) :- queue_in(K) :- queue(K), !. queue_in(K) :- - %writeln(+K), +% writeln(q+K), assert(queue(K)), fail. queue_in(_). @@ -139,7 +139,7 @@ do_propagate(_K) :- propagate. add_factor(factor(Type, Id, Ks, _, _Phi, Constraints), NKs) :- - %writeln(+Ks), +% writeln(+Ks), ( Ks = [K,Els], var(Els) -> % aggregate factor @@ -147,7 +147,7 @@ add_factor(factor(Type, Id, Ks, _, _Phi, Constraints), NKs) :- avg_factors(K, Els, 0.0, NewKeys, NewId), NKs = [K|NewKeys] ; - once(run(Constraints)), + run(Constraints), NKs = Ks, Id = NewId ),