From b6d5b79789158fd2b7453365256b1c0675551ad6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Sun, 25 Mar 2012 21:40:29 +0100 Subject: [PATCH] force parent unification when binding two variables with same key --- packages/CLPBN/clpbn.yap | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/CLPBN/clpbn.yap b/packages/CLPBN/clpbn.yap index ea1731e83..321cadaaa 100644 --- a/packages/CLPBN/clpbn.yap +++ b/packages/CLPBN/clpbn.yap @@ -413,11 +413,12 @@ fresh_attvar(Var, NVar) :- % I will now allow two CLPBN variables to be bound together. %bind_clpbns(Key, Dist, Parents, Key, Dist, Parents). -bind_clpbns(Key, Dist, _Parents, Key1, Dist1, _Parents1) :- +bind_clpbns(Key, Dist, Parents, Key1, Dist1, Parents1) :- Key == Key1, !, get_dist(Dist,_Type,_Domain,_Table), get_dist(Dist1,_Type1,_Domain1,_Table1), - Dist = Dist1. + Dist = Dist1, + Parents = Parents1. bind_clpbns(Key, _, _, _, Key1, _, _, _) :- Key\=Key1, !, fail. bind_clpbns(_, _, _, _, _, _, _, _) :-