ensure evidence does not go away, make sure YAP compiles
This commit is contained in:
parent
eeb53aef71
commit
78410ade1a
@ -144,7 +144,6 @@ create_new_variable(K, V, Vf0, Vff, C0, Cf) :-
|
|||||||
Id =.. [Na,Dom],
|
Id =.. [Na,Dom],
|
||||||
Dist =.. [Na,Dom,NTVs],
|
Dist =.. [Na,Dom,NTVs],
|
||||||
{ V = K with Dist },
|
{ V = K with Dist },
|
||||||
writeln(done),
|
|
||||||
add_stored_evidence(K, V),
|
add_stored_evidence(K, V),
|
||||||
add_variables(TVs, NTVs, Vf0, Vff, C0, Cf).
|
add_variables(TVs, NTVs, Vf0, Vff, C0, Cf).
|
||||||
|
|
||||||
|
@ -191,9 +191,9 @@ struct CmpLitLvTypes
|
|||||||
if (types1.lid() < types2.lid()) {
|
if (types1.lid() < types2.lid()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (types1.lid() == types2.lid()){
|
// vsc if (types1.lid() == types2.lid()){
|
||||||
return types1.logVarTypes() < types2.logVarTypes();
|
// return types1.logVarTypes() < types2.logVarTypes();
|
||||||
}
|
//}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -134,7 +134,7 @@ ParfactorList::print() const
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
Parfactors pfVec (pfList_.begin(), pfList_.end());
|
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++) {
|
for (size_t i = 0; i < pfVec.size(); i++) {
|
||||||
pfVec[i]->print();
|
pfVec[i]->print();
|
||||||
std::cout << std::endl;
|
std::cout << std::endl;
|
||||||
|
@ -181,7 +181,12 @@ insert_atts(Var,Sk) :-
|
|||||||
add_evidence(Sk,Var) :-
|
add_evidence(Sk,Var) :-
|
||||||
skolem(Sk,D),
|
skolem(Sk,D),
|
||||||
once(nth0(E,D,Var)),
|
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) :-
|
get_pfl_cpt(Id, Keys, Ev, NewKeys, Out) :-
|
||||||
|
Reference in New Issue
Block a user