public final class InterpretedUserDefinedPredicate extends Object implements Predicate
evaluate()
Constructor and Description |
---|
InterpretedUserDefinedPredicate(Iterator<ClauseAction> clauseActions,
SpyPoints.SpyPoint spyPoint,
Term[] queryArgs) |
Modifier and Type | Method and Description |
---|---|
boolean |
couldReevaluationSucceed()
Could the next re-evaluation of this instance succeed?
|
boolean |
evaluate()
Evaluates a user defined predicate.
|
public InterpretedUserDefinedPredicate(Iterator<ClauseAction> clauseActions, SpyPoints.SpyPoint spyPoint, Term[] queryArgs)
public boolean evaluate()
The process for evaluating a user defined predicate is as follows:
queryArgs
).true
is returned.false
is returned.evaluate()
has returned true
subsequent invocations of evaluate()
will attempt to
re-evaluate the antecedent of the previously successfully evaluated clause. If the body of the clause is
successfully re-evaluated then true
is returned. If the body of the clause is not successfully
re-evaluated then the arguments in the query are backtracked and the method continues to iterate through the
clauses starting with the next clause in the sequence.evaluate
in interface Predicate
true
if it was possible to satisfy the clause, false
otherwisePredicateFactory.getPredicate(Term[])
public boolean couldReevaluationSucceed()
Predicate
Specifies whether a specific instance of a specific implementation of Predicate
, that has already had
Predicate.evaluate()
called on it at least once, could possibly return true
the next time
Predicate.evaluate()
is called on it. i.e. is it worth trying to continue to find solutions for the specific query
this particular instance represents and has been evaluating?
(Note: the difference between this method and PredicateFactory.isRetryable()
is that
PredicateFactory.isRetryable()
deals with whether, in general, a specific implementation (rather
than instance) of Predicate
could ever produce multiple answers for an individual query.)
couldReevaluationSucceed
in interface Predicate
true
if an attempt to re-evaluate this instance could possible succeed, false
otherwiseCopyright © 2024. All rights reserved.