5 Assumption handling
The rule in figure 5 contains an assumable clause with keyword notKnown. When this rule is fired, the assumable clause may be evaluated several times with different bindings for the variable ?value. If the subclause succeeds when the variable is bound to particular values (because an appropriate lowNaturalNumber clause is found on the database) then the assumable clause fails. If the subclause fails, the assumable clause succeeds, an assumption is generated and a clause with keyword highNaturalNumber is asserted to the database tagged with this assumption. An assumable clause with keyword notKnown can only succeed or fail; no variables can be bound so at most one assumption can be generated for each assumption context.
When the assumable clause with keyword total in figure 6 is evaluated, the subclause is evaluated and the resulting bindings of ?value are added up. The result is unified with ?totalValue, and the assumable clause succeeds on the assumption that this is the correct total. Further clauses may be asserted with keyword lowNaturalNumber, causing a different total and corresponding assumption to be generated when the rule is fired again. Thus there may be multiple assumptions corresponding to the same assumption context, but only one of them can ultimately be true.
Generated with CERN WebMaker