EpilogJS
What
versus
How
 

compfindp


compfindp(sentence,dataset,ruleset) → boolean

The compfindp subroutine takes as arguments a sentence (called the query), a 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: compfindp(read('g(art,cal)'),repository,library) Exit: true Call: compfindp(read('g(X,Z)'),repository,library) Exit: true Call: compfindp(read(read('p(art,Y) & p(Y,cam)'),repository,library) Exit: true Call: compfindp(read('g(bob,art)'),repository,library) Exit: false

See related subroutines compfindx, compfinds, and compfindg.




Comments and complaints to genesereth@stanford.edu.