friguzzi / cplint

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

Bug in `mc_mh_sample/4` #46

Closed damianoazzolini closed 2 years ago

damianoazzolini commented 2 years ago

With this program

:- use_module(library(mcintyre)).
:- mc.
:- begin_lpad.

0.7::a.
0.1::b.
0.2::c.

q:- a,b,c.
:- end_lpad.

and the query mc_mh_sample(q,b,10,Prob) I often get false as answer. This also happens with a higher number (100,1000) of samples.

friguzzi commented 2 years ago

This doesn't reproduce, I get forall(between(1,10000,_),mc_mh_sample(q,b,10,Prob)). true. What version of SWI are you using? I'm using 8.5.4-3-g7bf463db4

damianoazzolini commented 2 years ago

I get:

?- mc_mh_sample(q,b,2,Prob).
Prob = 0.

?- mc_mh_sample(q,b,2,Prob).
Prob = 0.

?- mc_mh_sample(q,b,2,Prob).
false.

?- mc_mh_sample(q,b,2,Prob).
false.

?- mc_mh_sample(q,b,2,Prob).
false.

?- mc_mh_sample(q,b,2,Prob).
Prob = 0.

?- mc_mh_sample(q,b,10,Prob).
false.

?- mc_mh_sample(q,b,10,Prob).
false.

SWI version: version 8.5.8-24-gba1bc35.

friguzzi commented 2 years ago

In the latest devel version on linux (8.5.10-15-g673a8f640) it work, can you try to update swipl?

damianoazzolini commented 2 years ago

I've updated SWI and the bugs its gone