Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Negative Probability Values and Probability Bounds #45

Closed
damianoazzolini opened this issue Mar 31, 2022 · 1 comment
Closed

Negative Probability Values and Probability Bounds #45

damianoazzolini opened this issue Mar 31, 2022 · 1 comment

Comments

@damianoazzolini
Copy link
Collaborator

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
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants