org.deri.iris.rules.compiler
Class RuleElement

java.lang.Object
  extended by org.deri.iris.rules.compiler.RuleElement
Direct Known Subclasses:
Builtin, BuiltinForConstructedTermArguments, Differ, EquivalenceResolver, FirstSubgoal, HeadSubstituter

public abstract class RuleElement
extends Object

A base class for all compiled rule elements.


Field Summary
protected  List<IVariable> mOutputVariables
          The variable bindings for tuples output from this rule element.
 
Constructor Summary
RuleElement()
          Default constructor.
 
Method Summary
 RuleElement getDeltaSubstitution(IFacts deltas)
          Create a substitute rule element that will use the corresponding delta if it exists.
 List<IVariable> getOutputVariables()
          Get the variable bindings for tuples output from this rule element.
abstract  IRelation process(IRelation input)
          Called to process tuples from previous literals.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mOutputVariables

protected List<IVariable> mOutputVariables
The variable bindings for tuples output from this rule element.

Constructor Detail

RuleElement

public RuleElement()
Default constructor.

Method Detail

process

public abstract IRelation process(IRelation input)
                           throws EvaluationException
Called to process tuples from previous literals.

Parameters:
previous - The relation of tuples from the previous rule element. This should be null if this element represents the first literal.
Returns:
The output relation for this literal.
Throws:
EvaluationException

getDeltaSubstitution

public RuleElement getDeltaSubstitution(IFacts deltas)
Create a substitute rule element that will use the corresponding delta if it exists.

Parameters:
deltas - The Deltas from the last round of iterative evaluation.
Returns:
A substitute rule element if possible.

getOutputVariables

public List<IVariable> getOutputVariables()
Get the variable bindings for tuples output from this rule element.

Returns:
The list of variables in term order.