public final class BooleanConstraintPredicate extends Object implements PredicateFactory, ConstraintFactory, KnowledgeBaseConsumer
Integer values are used to represent boolean values. 1 repesents true and 0 represents false.
#/\
and#\/
or#\
exclusive or#<==>
equivalent#==>
implicationModifier and Type | Method and Description |
---|---|
static BooleanConstraintPredicate |
and() |
org.projog.clp.Constraint |
createConstraint(Term[] args,
Set<org.projog.core.predicate.builtin.clp.ClpVariable> vars) |
static BooleanConstraintPredicate |
equivalent() |
Predicate |
getPredicate(Term[] args)
Returns a
Predicate to be used in the evaluation of a goal. |
boolean |
isRetryable()
Should instances of this implementation be re-evaluated when backtracking?
|
static BooleanConstraintPredicate |
leftImpliesRight() |
static BooleanConstraintPredicate |
not() |
static BooleanConstraintPredicate |
or() |
static BooleanConstraintPredicate |
rightImpliesLeft() |
void |
setKnowledgeBase(KnowledgeBase knowledgeBase)
Provides a reference to a
KnowledgeBase . |
static BooleanConstraintPredicate |
xor() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isAlwaysCutOnBacktrack
public static BooleanConstraintPredicate equivalent()
public static BooleanConstraintPredicate leftImpliesRight()
public static BooleanConstraintPredicate rightImpliesLeft()
public static BooleanConstraintPredicate and()
public static BooleanConstraintPredicate or()
public static BooleanConstraintPredicate xor()
public static BooleanConstraintPredicate not()
public Predicate getPredicate(Term[] args)
PredicateFactory
Predicate
to be used in the evaluation of a goal.getPredicate
in interface PredicateFactory
args
- the arguments to use in the evaluation of the goalPredicate.evaluate()
public boolean isRetryable()
PredicateFactory
Some goals (e.g. X is 1
) are only meant to be evaluated once (the statement is either true or false) while
others (e.g. repeat(3)
) are meant to be evaluated multiple times. For instances of Predicate
that
are designed to possibly have Predicate.evaluate()
called on them multiple times for the same individual
query this method should return true
. For instances of Predicate
that are designed to only be
evaluated once per individual query this method should return false
.
isRetryable
in interface PredicateFactory
true
if an attempt should be made to re-evaluate instances of implementing classes when
backtracking, false
otherwisepublic org.projog.clp.Constraint createConstraint(Term[] args, Set<org.projog.core.predicate.builtin.clp.ClpVariable> vars)
createConstraint
in interface ConstraintFactory
public void setKnowledgeBase(KnowledgeBase knowledgeBase)
KnowledgeBaseConsumer
KnowledgeBase
.setKnowledgeBase
in interface KnowledgeBaseConsumer
Copyright © 2024. All rights reserved.