This commit is contained in:
Vitor Santos Costa
2019-04-02 15:32:50 +01:00
parent 63a514cad5
commit 10307c27fe
9 changed files with 59 additions and 14 deletions

View File

@@ -1330,7 +1330,7 @@ set_fact_probability(ID,Prob) :-
retract(ProblogTerm),
ProblogTerm =.. [ProblogName|ProblogTermArgs],
nth1(ProblogArity,ProblogTermArgs,_,KeepArgs),
NewLogProb is log(Prob),
(isnan(Prob) -> NewLogProb = 0.0 ; NewLogProb is log(Prob)),
nth1(ProblogArity,NewProblogTermArgs,NewLogProb,KeepArgs),
NewProblogTerm =.. [ProblogName|NewProblogTermArgs],
assertz(NewProblogTerm).