public final class Disjunction extends AbstractPredicateFactory implements PreprocessablePredicateFactory
X;Y
- disjunction.
X;Y
specifies a disjunction of goals. X;Y
succeeds if either X
succeeds
or Y
succeeds. If X
fails then an attempt is made to satisfy Y
. If
Y
fails 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 ->/2
predicate is the first argument of a
;/2
predicate then the resulting behaviour is a "if/then/else" statement of the form
((if->then);else)
.
IfThen
Constructor and Description |
---|
Disjunction() |
Modifier and Type | Method and Description |
---|---|
protected Predicate |
getPredicate(Term firstArg,
Term secondArg) |
PredicateFactory |
preprocess(Term term) |
getArithmeticOperators, getFileHandles, getKnowledgeBase, getOperands, getPredicate, getPredicate, getPredicate, getPredicate, getPredicate, getPredicates, getProjogListeners, getSpyPoints, getTermFormatter, init, isRetryable, setKnowledgeBase
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getPredicate, isAlwaysCutOnBacktrack, isRetryable
public PredicateFactory preprocess(Term term)
preprocess
in interface PreprocessablePredicateFactory
protected Predicate getPredicate(Term firstArg, Term secondArg)
getPredicate
in class AbstractPredicateFactory
Copyright © 2024. All rights reserved.