|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.deri.iris.builtins.AbstractBuiltin
org.deri.iris.builtins.FunctionalBuiltin
public abstract class FunctionalBuiltin
Base class of functional built-in predicates. For this kind of built-in, the following properties must hold:
true or false
.
| Field Summary |
|---|
| Fields inherited from class org.deri.iris.builtins.AbstractBuiltin |
|---|
EMPTY_TERM |
| Constructor Summary | |
|---|---|
FunctionalBuiltin(IPredicate predicate,
ITerm... terms)
Creates a new functional builtin. |
|
| Method Summary | |
|---|---|
protected abstract ITerm |
computeResult(ITerm[] terms)
Computes the result when all terms but the term at the last position are known. |
protected ITerm |
evaluateTerms(ITerm[] terms,
int[] variableIndexes)
Evaluate the predicate once the terms and variable indexes have been found. |
int |
maxUnknownVariables()
The maximum number of unknown variables allowed such that the predicate can still be evaluated. |
protected boolean |
testForEquality(ITerm term1,
ITerm term2)
Tests for equality of two terms. |
| 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 |
|---|
public FunctionalBuiltin(IPredicate predicate,
ITerm... terms)
predicate - The predicate that identifies this built-in.terms - The terms of the instance.| Method Detail |
|---|
protected ITerm evaluateTerms(ITerm[] terms,
int[] variableIndexes)
throws EvaluationException
AbstractBuiltin
evaluateTerms in class AbstractBuiltinterms - The array of all terms for this evaluation.variableIndexes - the indexes of the terms which should be
computed (starting at 0)
EvaluationException
protected boolean testForEquality(ITerm term1,
ITerm term2)
term1 - The first term.term2 - The second term.
true if both terms are equal, false
otherwise.
protected abstract ITerm computeResult(ITerm[] terms)
throws EvaluationException
terms - The terms, where the terms at the last position is a
variable representing the result.
null if the operation is
unsuccessful.
EvaluationException - If an error occurs.public int maxUnknownVariables()
IBuiltinAtom
maxUnknownVariables in interface IBuiltinAtommaxUnknownVariables in class AbstractBuiltin
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||