Class Once
- java.lang.Object
-
- org.projog.core.predicate.AbstractSingleResultPredicate
-
- org.projog.core.predicate.builtin.compound.Once
-
- All Implemented Interfaces:
KnowledgeBaseConsumer,PredicateFactory,PreprocessablePredicateFactory
public final class Once extends AbstractSingleResultPredicate implements PreprocessablePredicateFactory
once(X)- calls the goal represented by a term.The
once(X)goal succeeds if an attempt to satisfy the goal represented by the termXsucceeds. No attempt is made to retry the goal during backtracking - it is only evaluated once.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classOnce.OptimisedOnce
-
Constructor Summary
Constructors Constructor Description Once()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanevaluate(Term t)PredicateFactorypreprocess(Term term)-
Methods inherited from class org.projog.core.predicate.AbstractSingleResultPredicate
evaluate, evaluate, evaluate, evaluate, evaluate, getArithmeticOperators, getFileHandles, getKnowledgeBase, getOperands, getPredicate, getPredicates, getProjogListeners, getSpyPoints, getTermFormatter, init, isRetryable, setKnowledgeBase
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.projog.core.predicate.PredicateFactory
getPredicate, isAlwaysCutOnBacktrack, isRetryable
-
-
-
-
Method Detail
-
evaluate
protected boolean evaluate(Term t)
- Overrides:
evaluatein classAbstractSingleResultPredicate
-
preprocess
public PredicateFactory preprocess(Term term)
- Specified by:
preprocessin interfacePreprocessablePredicateFactory
-
-