hypotransform(sentlist,sentlist,sentlist,dataset,dataset,dataset,ruleset) → boolean
The subroutine hypotransform 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 computes all instances of the conditions that can be derived 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. For each of these instances, it deletes from the dataset the corresponding instances of the deletions. Then, for each of the computed instances, it adds the corresponding instances of the additions.
Call: definefacts(repository,readdata('p(a,b) p(b,c) p(c,d)'))
Exit: p(b,a) p(c,b) p(d,c)
Exit: p(a,b) p(c,b) p(d,c)
The hypotransform subroutine is used for hypothetical reasoning in situations where one wants to transform datasets based on additions to a dataset or deletions from that dataset but where it is inconvenient to modify the dataset before the changes are computed.
Note that the condition, addition, and deletion instances are computed before any changes are made. Hence, performing additions and deletions does not change which additions and deletions are made. Ideally, there should be no overlap between additions and deletions. However, deletions are performed first and additions are performed second. Consequently, in the event of overlaps, the additions prevail.