org.deri.iris.builtins
Class MaxBuiltin

java.lang.Object
  extended by org.deri.iris.builtins.AbstractBuiltin
      extended by org.deri.iris.builtins.ArithmeticBuiltin
          extended by org.deri.iris.builtins.MaxBuiltin
All Implemented Interfaces:
Comparable<IAtom>, IAtom, IBuiltinAtom

public class MaxBuiltin
extends ArithmeticBuiltin

Represents an x = max(y,z) operation. At evaluation time only the result can be unknown.

The syntax in Datalog will be, e.g. p(?max) :- q(?x,?y), MAX(?x, ?y, ?max).


Field Summary
 
Fields inherited from class org.deri.iris.builtins.AbstractBuiltin
EMPTY_TERM
 
Constructor Summary
MaxBuiltin(ITerm... terms)
          Constructor.
 
Method Summary
protected  ITerm computeMissingTerm(int missingTermIndex, ITerm[] terms)
          Compute the missing term when the other two are known.
 
Methods inherited from class org.deri.iris.builtins.ArithmeticBuiltin
evaluateTerms, maxUnknownVariables, testForEquality
 
Methods inherited from class org.deri.iris.builtins.AbstractBuiltin
compareTo, equals, evaluate, getPredicate, getTuple, hashCode, isBuiltin, isGround, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MaxBuiltin

public MaxBuiltin(ITerm... terms)
Constructor. Three terms must be passed to the constructor, otherwise an exception will be thrown.

Parameters:
t - the terms
Method Detail

computeMissingTerm

protected ITerm computeMissingTerm(int missingTermIndex,
                                   ITerm[] terms)
Description copied from class: ArithmeticBuiltin
Compute the missing term when the other two are known.

Specified by:
computeMissingTerm in class ArithmeticBuiltin
terms - The collection of all terms.
Returns:
The computed value.