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

Bug in negation #13

Closed
friguzzi opened this issue Feb 21, 2018 · 1 comment
Closed

Bug in negation #13

friguzzi opened this issue Feb 21, 2018 · 1 comment

Comments

@friguzzi
Copy link
Owner

friguzzi commented Feb 21, 2018

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

fixed

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

No branches or pull requests

1 participant