| java.lang.Object com.hp.hpl.jena.reasoner.rulesys.impl.oldCode.RuleState
RuleState | public class RuleState (Code) | | Part of the backward chaining rule interpreter. A RuleState represents
the state of a partially expanded search tree for a single Rule.
The RuleStates are linked back in an OR tree to a root goal which is
being satisfied. Each RuleState shares a pointer to a RuleInstance which
holds references for the rule being processed and the goal which the rule is
satisfying.
Encapuslation warning: this object is used in the tight inner loop of the engine so we access its
field pointers directly rather than through accessor methods.
author: Dave Reynolds version: $Revision: 1.9 $ on $Date: 2008/01/02 12:09:44 $ |
clauseIndex | int clauseIndex(Code) | | The clause number in the rule to be processed next.
|
functorMatch | protected Functor functorMatch(Code) | | functor node for object binding
|
goalState | protected GoalState goalState(Code) | | The continuation point for the rule clause being processed
|
isScheduled | protected boolean isScheduled(Code) | | Flag to indicate that rule state is scheduled on the agenda
|
objectBind | int objectBind(Code) | | binding offset for object field, -1 if none
|
predicateBind | int predicateBind(Code) | | binding offset for predicate field, -1 if none
|
ruleInstance | protected RuleInstance ruleInstance(Code) | | Reference to a package of information on the rule being processed
|
subjectBind | int subjectBind(Code) | | binding offset for subject field, -1 if none
|
RuleState | public RuleState(RuleState parent, TriplePattern clause, int index, BindingVector env)(Code) | | Normal constructor. Creates a new RuleState as an extension to an existing one.
Parameters: parent - the parent RuleState being expanded, can't be null Parameters: clause - the TriplePattern which forms the goal for this state Parameters: index - the index of the clause in the parent rule Parameters: env - the prebound enviornment to use |
close | public void close()(Code) | | Close a non-longer needed rule state. This will decrement
the reference count of the goal table entry (this might have been
the last RuleState working on that entry) and will close any
iterators in the goal state.
|
couldProcess | public boolean couldProcess()(Code) | | Return true if it seems worth scheduling this RuleState. This will be the case
if the RS can be immediately disposed of due to being complete or if there is a result known already.
|
createInitialState | public static RuleState createInitialState(Rule rule, GoalResults generator)(Code) | | Create the first RuleState for using a given rule to satisfy a goal.
Parameters: rule - the rule being instantiated Parameters: generator - the GoalTable entry that this rule should generate results for Parameters: engine - the parent rule engine the instantiated initial RuleState or null if a guard predicatefails so the rule is not applicable. |
getResult | public Triple getResult(BindingVector newenv)(Code) | | Return the final goal result, based on the given binding environment
|
newEnvironment | public BindingVector newEnvironment(Triple result)(Code) | | Return a new binding environment based on this one but extended
by the matches resulting from the given triple result for this state.
|
next | Object next()(Code) | | Return the next match for this clause (or FAIL or SUSPEND)
|
nextClauseIndex | protected int nextClauseIndex()(Code) | | Return the index of the next body clause to try.
Takes clause reordering into account.
|
|
|