Class Limit
- java.lang.Object
-
- org.projog.core.predicate.AbstractPredicateFactory
-
- org.projog.core.predicate.builtin.compound.Limit
-
- All Implemented Interfaces:
KnowledgeBaseConsumer,PredicateFactory,PreprocessablePredicateFactory
public final class Limit extends AbstractPredicateFactory implements PreprocessablePredicateFactory
limit(N, X)- calls the goal represented by a term a maximum number of times.Evaluates the goal represented by
Xfor a maximum ofNattempts.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classLimit.LimitPredicateprivate static classLimit.OptimisedLimit
-
Constructor Summary
Constructors Constructor Description Limit()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static PredicategetLimitPredicate(PredicateFactory pf, Term maxAttempts, Term goal)PredicategetPredicate(Term maxAttempts, Term goal)PredicateFactorypreprocess(Term term)-
Methods inherited from class org.projog.core.predicate.AbstractPredicateFactory
getArithmeticOperators, getFileHandles, getKnowledgeBase, getOperands, getPredicate, getPredicate, getPredicate, getPredicate, 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
-
getPredicate
public Predicate getPredicate(Term maxAttempts, Term goal)
- Overrides:
getPredicatein classAbstractPredicateFactory
-
getLimitPredicate
private static Predicate getLimitPredicate(PredicateFactory pf, Term maxAttempts, Term goal)
-
preprocess
public PredicateFactory preprocess(Term term)
- Specified by:
preprocessin interfacePreprocessablePredicateFactory
-
-