friguzzi/cplint

Bug in negation

Closed this issue · 1 comments

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).


*/

fixed