friguzzi / cplint

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

Flexible probabilities with ProbLog syntax #43

Closed damianoazzolini closed 2 years ago

damianoazzolini commented 2 years ago

Flexible probabilities does not work using the ProbLog syntax. For example, the current program yields a wrong probability value (0.5) for the query smokes(1):

person(1).
person(2).
person(3).
friend_of(1,2,0.51).
friend_of(2,1,0.56).

0.5::fp(X) :- person(X).
smokes(X) :- fp(X).

P::influences(X,Y) :- friend_of(X,Y,P).
smokes(X) :- smokes(Y), influences(X,Y).

while, if the line with the flexible probability is rewritten as

influences(X,Y):P :- friend_of(X,Y,P).

the computed probability is correct (0.6275). Tested on cplint on swish (online).

friguzzi commented 2 years ago

solved with commit 6652d0989af761b4f3a0bf13fe4b3f05455d51ec