org.deri.iris.rules.compiler
Class Builtin

java.lang.Object
  extended by org.deri.iris.rules.compiler.RuleElement
      extended by org.deri.iris.rules.compiler.Builtin

public class Builtin
extends RuleElement

A compiled rule element representing a built-in predicate.


Field Summary
 
Fields inherited from class org.deri.iris.rules.compiler.RuleElement
mOutputVariables
 
Constructor Summary
Builtin(List<IVariable> inputVariables, IBuiltinAtom builtinAtom, boolean positive, IEquivalentTerms equivalentTerms, Configuration configuration)
          Constructor.
 
Method Summary
protected  ITuple makeResultTuple(ITuple inputTuple, ITuple builtinOutputTuple)
          Transform the input tuple (from previous rule elements) and the tuple produced by the built-in atom in to a tuple to pass on to the next rule element.
 IRelation process(IRelation leftRelation)
          Called to process tuples from previous literals.
 
Methods inherited from class org.deri.iris.rules.compiler.RuleElement
getDeltaSubstitution, getOutputVariables
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Builtin

public Builtin(List<IVariable> inputVariables,
               IBuiltinAtom builtinAtom,
               boolean positive,
               IEquivalentTerms equivalentTerms,
               Configuration configuration)
        throws EvaluationException
Constructor.

Parameters:
inputVariables - The variables from proceeding literals. Can be null if this is the first literal.
builtinAtom - The built-in atom object at this position in the rule.
positive - true, if the built-in is positive, false if it is negative.
equivalentTerms - The equivalent terms.
Throws:
EvaluationException - If constructed terms are used with a built-in or there are unbound variables.
Method Detail

process

public IRelation process(IRelation leftRelation)
                  throws EvaluationException
Description copied from class: RuleElement
Called to process tuples from previous literals.

Specified by:
process in class RuleElement
Returns:
The output relation for this literal.
Throws:
EvaluationException

makeResultTuple

protected ITuple makeResultTuple(ITuple inputTuple,
                                 ITuple builtinOutputTuple)
Transform the input tuple (from previous rule elements) and the tuple produced by the built-in atom in to a tuple to pass on to the next rule element.

Parameters:
inputTuple - The tuple produced b previous literals.
builtinOutputTuple - The output of the built-in atom.
Returns:
The tuple to pass on to the next rule element.