hypofindp(sentence,dataset,dataset,dataset,ruleset) → boolean
The hypofinds subroutine takes as arguments an expression (called the aspect), a sentence (called the query), two datasets (the add list and the delete list), another dataset, and a ruleset. It uses the facts in the dataset and the rules in the ruleset to derive an instance of the query. If it succeeds, it returns true; otherwise, it returns false.
Call: definefacts(repository,readdata('p(art,bob) p(bob,cal) p(bob,cam)'))
Exit: true
Call: definerules(library,readdata('g(X,Z) :- p(X,Y) & p(Y,Z)'))
Exit: true
Call: hypofindp(read('g(art,cal)'),[],[],repository,library)
Exit: true
Call: hypofindp(read('g(X,Z)'),[],[],repository,library)
Exit: true
Call: hypofindp(read(read('p(art,Y) & p(Y,cam)'),[],[],repository,library)
Exit: true
Call: hypofindp(read('g(bob,art)'),[],[],repository,library)
Exit: false
The hypofindp subroutine is used for hypothetical reasoning in situations where one wants answers based on additions to a dataset or deletions from that dataset but where it is inconvenient to modify the dataset (due to cost considerations or to allow multiple programs to access a dataset at the same time.
|