friguzzi / cplint

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

Bug in negation #13

Closed friguzzi closed 6 years ago

friguzzi commented 6 years ago

The following program gives wrong probability (1) for query tdm. Correct prob is 0.75 See also http://cplint.eu/p/baco_pita.pl http://cplint.eu/p/neg.pl The latter is working

:- use_module(library(pita)).
:- if(current_predicate(use_rendering/1)).
:- use_rendering(c3).
:- use_rendering(graphviz).
:- use_rendering(table,[header(['Multivalued variable index','Rule index','Grounding substitution'])]).
:- endif.
:- pita.
:- begin_lpad.

interest(brian,politics):0.5;interest(brian,sports):0.5.
interest(cheryl,politics):0.5;interest(cheryl,sports):0.5.

has_topic(P,politics):-P=p1.

topic_match(Post, Commenter) :- 
    has_topic(Post, politics), 
    interest(Commenter, politics).

tm:-
    topic_match(p1,brian),
    topic_match(p1,cheryl).

tdm:-
    \+ topic_match(p1,brian).

tdm:-
    %topic_match(p1,brian),
    \+ topic_match(p1,cheryl).
:- end_lpad.

/** <examples>

?- prob(tm,P).
?- prob(tdm,P).
?- prob((tdm,interest(brian,Ib),interest(cheryl,Ic)),P).

*/
friguzzi commented 6 years ago

fixed