Closed damianoazzolini closed 2 years ago
Negative probabilities should not be allowed:
-0.3::a. ?- prob(a,P). P = -0.3
Also with flexible probabilities:
p(S,C,P):P:- P is (C - S) / C. q:- p(1.5,1,_). ? prob(q,P). P = -0.5
Moreover, with flexible probabilities it is possible to define a probability value > 1:
p(S,C,P):P:- P is (C - S) / C. q:- p(5,1,_). ? prob(q,P). P = -4
To avoid these problems one would need to insert a check for positivity, <1, in get_var_n. This would need to be checked for every call, thus slowing down execution. I would leave it as it is
Negative probabilities should not be allowed:
Also with flexible probabilities:
Moreover, with flexible probabilities it is possible to define a probability value > 1: