Class IfThen
- java.lang.Object
-
- org.projog.core.predicate.AbstractPredicateFactory
-
- org.projog.core.predicate.builtin.compound.IfThen
-
- All Implemented Interfaces:
KnowledgeBaseConsumer,PredicateFactory,PreprocessablePredicateFactory
public final class IfThen extends AbstractPredicateFactory implements PreprocessablePredicateFactory
X->Y- ifXsucceeds thenYis evaluated.Note: The behaviour of this predicate changes when it is specified as the first argument of a structure of the form
;/2, i.e. the "disjunction" predicate. When a->/2predicate is the first argument of a;/2predicate then the resulting behaviour is a "if/then/else" statement of the form((if->then);else).- See Also:
Disjunction
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classIfThen.OptimisedIfThen
-
Constructor Summary
Constructors Constructor Description IfThen()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected PredicategetPredicate(Term conditionTerm, Term thenTerm)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
protected Predicate getPredicate(Term conditionTerm, Term thenTerm)
- Overrides:
getPredicatein classAbstractPredicateFactory
-
preprocess
public PredicateFactory preprocess(Term term)
- Specified by:
preprocessin interfacePreprocessablePredicateFactory
-
-