friguzzi / cplint

cplint is a suite of programs for reasoning with probabilistic logic programs
Other
68 stars 13 forks source link

Negative Probability Values and Probability Bounds #45

Closed damianoazzolini closed 2 years ago

damianoazzolini commented 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
friguzzi commented 2 years ago

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