public abstract class Predicate extends Function
expressions, maxOperands
factory, type
Constructor and Description |
---|
Predicate()
Creates a default Predicate.
|
Predicate(java.lang.String name)
Creates a named Predicate.
|
Modifier and Type | Method and Description |
---|---|
abstract java.lang.Boolean |
evaluate()
Evaluates this Predicate.
|
boolean |
isConsistent()
Reports whether this Predicate is consistent.
|
boolean |
isFalseConstant()
Reports whether this Predicate is the boolean constant false.
|
Predicate |
negate()
Returns the complement of this Predicate.
|
Predicate |
normalise()
Returns this Predicate in normal form.
|
void |
rebind()
Rebinds this Predicate, so that it may be tested for satisfaction.
|
void |
rebind(java.lang.Object result)
Rebinds the unbound operands of this Predicate, so that it yields the
expected true or false result.
|
protected abstract void |
rebindFalse()
Rebinds the unbound operands of this Predicate, so that it yields false.
|
protected abstract void |
rebindTrue()
Rebinds the unbound operands of this Predicate, so that it yields true.
|
java.util.List<Predicate> |
refine()
Returns a list of refinements of this Predicate.
|
Predicate |
setType(java.lang.String type)
Sets the type of this Predicate.
|
abstract boolean |
subsumes(Predicate other)
Tests whether this Predicate subsumes the other Predicate.
|
protected boolean |
subsumesAllDisjunctsOf(Proposition other)
Tests whether this Predicate subsumes all disjuncts of the other
OR-Proposition.
|
protected boolean |
subsumesOneConjunctOf(Proposition other)
Tests whether this Predicate subsumes one conjunct of the other
AND-Proposition.
|
protected boolean |
subsumesProposition(Proposition other)
Tests whether this Predicate subsumes the other Proposition.
|
addExpression, assign, equals, getExpressions, getType, hashCode, isAssignable, isBound, nameCheck, operand, resolve, setName, toString, typeCheck, unbind
getName, isBottom, isOrdered
safeEquals, safeHashCode, semanticError
public Predicate()
public Predicate(java.lang.String name)
name
- the name of this Predicate.public Predicate setType(java.lang.String type)
setType
in class Expression
type
- the type to set.public abstract java.lang.Boolean evaluate()
evaluate
in class Expression
public boolean isConsistent()
public boolean isFalseConstant()
public Predicate negate()
public Predicate normalise()
public java.util.List<Predicate> refine()
public abstract boolean subsumes(Predicate other)
other
- the other Predicate.protected boolean subsumesProposition(Proposition other)
other
- the other Proposition.protected boolean subsumesOneConjunctOf(Proposition other)
other
- an AND-Proposition.protected boolean subsumesAllDisjunctsOf(Proposition other)
other
- an OR-Proposition.public void rebind()
public void rebind(java.lang.Object result)
rebind
in class Expression
result
- the expected true or false result of this Predicate.protected abstract void rebindTrue()
protected abstract void rebindFalse()