ensure evidence does not go away, make sure YAP compiles

This commit is contained in:
Vitor Santos Costa 2013-04-15 19:12:53 -05:00
parent eeb53aef71
commit 78410ade1a
4 changed files with 10 additions and 6 deletions

View File

@ -144,7 +144,6 @@ create_new_variable(K, V, Vf0, Vff, C0, Cf) :-
Id =.. [Na,Dom],
Dist =.. [Na,Dom,NTVs],
{ V = K with Dist },
writeln(done),
add_stored_evidence(K, V),
add_variables(TVs, NTVs, Vf0, Vff, C0, Cf).

View File

@ -191,9 +191,9 @@ struct CmpLitLvTypes
if (types1.lid() < types2.lid()) {
return true;
}
if (types1.lid() == types2.lid()){
return types1.logVarTypes() < types2.logVarTypes();
}
// vsc if (types1.lid() == types2.lid()){
// return types1.logVarTypes() < types2.logVarTypes();
//}
return false;
}
};

View File

@ -134,7 +134,7 @@ ParfactorList::print() const
}
};
Parfactors pfVec (pfList_.begin(), pfList_.end());
std::sort (pfVec.begin(), pfVec.end(), sortByParams());
// vsc std::sort (pfVec.begin(), pfVec.end(), sortByParams());
for (size_t i = 0; i < pfVec.size(); i++) {
pfVec[i]->print();
std::cout << std::endl;

View File

@ -181,7 +181,12 @@ insert_atts(Var,Sk) :-
add_evidence(Sk,Var) :-
skolem(Sk,D),
once(nth0(E,D,Var)),
clpbn:put_atts(_V,[key(Sk),evidence(E)]).
clpbn:put_atts(V,[key(Sk),evidence(E)]),
( catch(b_getval(pfl_evidence, Vs), _, fail) ->
b_setval(pfl_evidence, [V|Vs])
;
b_setval(pfl_evidence, [V])
).
get_pfl_cpt(Id, Keys, Ev, NewKeys, Out) :-