hypofinds(expression,sentence,dataset,dataset,dataset,ruleset) → expressionlist

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 derives all instances of the query using the facts in the add list, the facts in the specified dataset minus the facts in the delete list, and the rules in the specified ruleset. It returns a list of all instances of the aspect for each query instance it finds; if it fails to derive any instances of the query, it returns [].

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: hypofinds('Z',read('g(art,Z)'),[],[],repository,library) Exit: [cal,cam] Call: hypofinds('X',read('g(art,cal)'),[],[],repository,library) Exit: [art] Call: hypofinds(read('answer(X,Z)'),read('g(X,Z)'),[],[],repository,library) Exit: [answer(art,cal), answer(art,cam)] Call: hypofinds(read('answer(X,Z)'),read('p(X,Y) & p(Y,Z)'),[],[],repository,library) Exit: [answer(art,cal), answer(art,cam)] Call: hypofinds('Z',read('g(bob,Z)'),[],[],repository,library) Exit: []

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

Comments and complaints to genesereth@stanford.edu.