Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3

This commit is contained in:
Tiago Gomes
2012-11-16 00:57:41 +00:00
2 changed files with 9 additions and 3 deletions

View File

@@ -142,6 +142,7 @@ add_factor(factor(Type, Id, Ks, _, _Phi, Constraints), NKs) :-
%writeln(+Ks), %writeln(+Ks),
( Ks = [K,Els], var(Els) ( Ks = [K,Els], var(Els)
-> ->
% aggregate factor
once(run(Constraints)), once(run(Constraints)),
avg_factors(K, Els, 0.0, NewKeys, NewId), avg_factors(K, Els, 0.0, NewKeys, NewId),
NKs = [K|NewKeys] NKs = [K|NewKeys]
@@ -150,8 +151,13 @@ add_factor(factor(Type, Id, Ks, _, _Phi, Constraints), NKs) :-
NKs = Ks, NKs = Ks,
Id = NewId Id = NewId
), ),
\+ f(Type, NewId, NKs), (
assert(f(Type, NewId, NKs)). f(Type, NewId, NKs)
->
true
;
assert(f(Type, NewId, NKs))
).
run([Goal|Goals]) :- run([Goal|Goals]) :-
call(user:Goal), call(user:Goal),