public class Proposition extends Predicate
expressions, maxOperands
factory, type
Constructor and Description |
---|
Proposition()
Creates a default logical Proposition.
|
Proposition(java.lang.String name)
Creates a logical Proposition with the given name.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
allConjunctsSubsume(Predicate other)
Tests whether all of this AND-Proposition's conjuncts subsume the
other Predicate.
|
java.lang.Boolean |
evaluate()
Executes this Proposition on its operands.
|
java.util.List<Predicate> |
getPredicates()
Returns the list of operand Predicates governed by this Proposition.
|
boolean |
isConsistent()
Reports whether this Proposition is consistent.
|
protected void |
nameCheck()
Validates the name of a logical Proposition and sets the expected
number of operands.
|
Predicate |
negate()
Returns the complement of this logical Proposition.
|
Proposition |
normalise()
Converts this Proposition into a term dominated by AND, OR or NOT.
|
protected boolean |
oneDisjunctSubsumes(Predicate other)
Tests whether one of this OR-Proposition's disjuncts subsumes the
other Predicate.
|
Predicate |
operand(int index)
Returns one of the operand Predicates at an index.
|
protected void |
rebindFalse()
Rebinds the unbound operands of this Proposition, so that it yields
false.
|
protected void |
rebindTrue()
Rebinds the unbound operands of this Proposition, so that it yields
true.
|
java.util.List<Predicate> |
refine()
Returns a list of refinements of this Proposition.
|
boolean |
subsumes(Predicate other)
Tests whether this Proposition subsumes another Predicate.
|
protected boolean |
subsumesAllDisjunctsOf(Proposition other)
Tests whether this Proposition subsumes all disjuncts of the other
OR-Proposition.
|
protected boolean |
subsumesOneConjunctOf(Proposition other)
Tests whether this Proposition subsumes one conjunct of the other
AND-Proposition.
|
protected void |
typeCheck()
Checks the types of the operands of this Proposition predicate.
|
isFalseConstant, rebind, rebind, setType, subsumesProposition
addExpression, assign, equals, getExpressions, getType, hashCode, isAssignable, isBound, resolve, setName, toString, unbind
getName, isBottom, isOrdered
safeEquals, safeHashCode, semanticError
public Proposition()
public Proposition(java.lang.String name)
name
- the name of this Proposition.protected void nameCheck()
protected void typeCheck()
public Predicate operand(int index)
public java.util.List<Predicate> getPredicates()
public Proposition normalise()
public boolean isConsistent()
isConsistent
in class Predicate
public boolean subsumes(Predicate other)
protected boolean oneDisjunctSubsumes(Predicate other)
other
- the other Predicate.protected boolean allConjunctsSubsume(Predicate other)
other
- the other Predicate.protected boolean subsumesOneConjunctOf(Proposition other)
subsumesOneConjunctOf
in class Predicate
other
- an AND-Proposition.protected boolean subsumesAllDisjunctsOf(Proposition other)
subsumesAllDisjunctsOf
in class Predicate
other
- an OR-Proposition.public Predicate negate()
public java.util.List<Predicate> refine()
public java.lang.Boolean evaluate()
protected void rebindTrue()
rebindTrue
in class Predicate
protected void rebindFalse()
rebindFalse
in class Predicate