I’m working on adding chr to a program for abductive reasoning. I use this to ask what conditions are necessary for a predicate to be true.
Up to now the program made use of negation as failure to consider unproven facts as false, but with chr it doesn’t work.
A simple example:
:- use_module(library(chr)). :- chr_constraint professor/1, rich/1, has_student/2. professor(X), rich(X) ==> fail. happy(X):- rich(X). happy(X):- professor(X), has_good_students(X). has_good_students(X):- \+ has_student(X, bad_student).
In my mind this should have answered with two possibilities to the query
- professor(bob), not has_student(X, bad_student).
The second option is missing. I must be missing something.
It’s the first time I reason with chr.