Part of the backward chaining rule interpreter. Maintains an agenda containing
an ordered list of RuleStates awaiting processing (each RuleState
represents the tip of a partially expanded search tree).
This object does the top level scheduling of rule processing. By default
it batches up several results from the top rule in the agenda before
switching to expand other trees. The size of this batch is adjustable.
author: Dave Reynolds version: $Revision: 1.8 $ on $Date: 2008/01/02 12:09:45 $
Find the set of memoized solutions for the given goal
and return a GoalState that can traverse all the solutions.
Parameters: goal - the goal to be solved a GoalState which can iterate over all of the goal solutions
Stop the current work. This is called if the top level results iterator has
either finished or the calling application has had enough. We leave any completed
results in the GoalTable but clear out the agenda and all non-compelted results.
The main processing loop. Continues processing agenda items until either
a new solution to the top goal has been found or the agenda is empty and
so no more solutions are available.
Parameters: topGoalState - the top level GoalState whose values are being sought null if all processing is complete and no more solutions areavailable, otherwise returns the next result available for the topGoal.
Process a call to a builtin predicate
Parameters: clause - the Functor representing the call Parameters: env - the BindingEnvironment for this call Parameters: rule - the rule which is invoking this call true if the predicate succeeds