diff --git a/packages/CLPBN/clpbn/ground_factors.yap b/packages/CLPBN/clpbn/ground_factors.yap index 584068019..4454b64b2 100644 --- a/packages/CLPBN/clpbn/ground_factors.yap +++ b/packages/CLPBN/clpbn/ground_factors.yap @@ -142,6 +142,7 @@ add_factor(factor(Type, Id, Ks, _, _Phi, Constraints), NKs) :- %writeln(+Ks), ( Ks = [K,Els], var(Els) -> + % aggregate factor once(run(Constraints)), avg_factors(K, Els, 0.0, NewKeys, NewId), NKs = [K|NewKeys] @@ -150,8 +151,13 @@ add_factor(factor(Type, Id, Ks, _, _Phi, Constraints), NKs) :- NKs = Ks, Id = NewId ), - \+ f(Type, NewId, NKs), - assert(f(Type, NewId, NKs)). + ( + f(Type, NewId, NKs) + -> + true + ; + assert(f(Type, NewId, NKs)) + ). run([Goal|Goals]) :- call(user:Goal), diff --git a/packages/real b/packages/real index 4d3759739..6575e08bd 160000 --- a/packages/real +++ b/packages/real @@ -1 +1 @@ -Subproject commit 4d3759739bd256a5a2d0c75ae4921c9147ad5d30 +Subproject commit 6575e08bd063e0d0476a1bdbfe216684b4d5e6e4