Class Disjunction
- java.lang.Object
-
- org.projog.core.predicate.AbstractPredicateFactory
-
- org.projog.core.predicate.builtin.compound.Disjunction
-
- All Implemented Interfaces:
KnowledgeBaseConsumer,PredicateFactory,PreprocessablePredicateFactory
public final class Disjunction extends AbstractPredicateFactory implements PreprocessablePredicateFactory
X;Y- disjunction.X;Yspecifies a disjunction of goals.X;Ysucceeds if eitherXsucceeds orYsucceeds. IfXfails then an attempt is made to satisfyY. IfYfails the entire disjunction fails.Note: The behaviour of this predicate changes when its first argument is of the form
->/2, i.e. the "if/then" 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:
IfThen
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classDisjunction.DisjunctionPredicateprivate classDisjunction.OptimisedDisjunctionprivate static classDisjunction.OptimisedIfThenElse
-
Constructor Summary
Constructors Constructor Description Disjunction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private Disjunction.DisjunctionPredicatecreateDisjunction(Term firstArg, Term secondArg)private PredicatecreateIfThenElse(Term ifThenTerm, Term elseTerm)protected PredicategetPredicate(Term firstArg, Term secondArg)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
-
preprocess
public PredicateFactory preprocess(Term term)
- Specified by:
preprocessin interfacePreprocessablePredicateFactory
-
getPredicate
protected Predicate getPredicate(Term firstArg, Term secondArg)
- Overrides:
getPredicatein classAbstractPredicateFactory
-
createDisjunction
private Disjunction.DisjunctionPredicate createDisjunction(Term firstArg, Term secondArg)
-
-