|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectLBJ2.infer.Constraint
LBJ2.infer.PropositionalConstraint
LBJ2.infer.PropositionalNAryConstraint
LBJ2.infer.PropositionalConjunction
public class PropositionalConjunction
Represents the conjunction of two propositional constraints.
| Field Summary |
|---|
| Fields inherited from class LBJ2.infer.PropositionalNAryConstraint |
|---|
children |
| Constructor Summary | |
|---|---|
private |
PropositionalConjunction()
Default constructor. |
|
PropositionalConjunction(PropositionalConstraint c1,
PropositionalConstraint c2)
If either of the arguments is itself a PropositionalConjunction, its contents are flattened into
this PropositionalConjunction. |
| Method Summary | |
|---|---|
void |
add(PropositionalConstraint c)
If the given constraint has the same type as this constraint, its terms are merged into this constraint; otherwise, it is added as a new term. |
PropositionalConstraint |
CNF()
Produces a new, logically simplified version of this constraint in conjunctive normal form (CNF). |
boolean |
containsAll(PropositionalConjunction c)
Determines whether this conjunction contains all of the terms that the given conjunction contains. |
PropositionalConstraint |
distribute(PropositionalDisjunction d)
Distributes the given disjunction over this conjunction. |
PropositionalConstraint |
DNF()
Produces a new, logically simplified version of this constraint in disjunctive normal form (DNF). |
boolean |
equals(java.lang.Object o)
Two PropositionalConjunctions are equivalent when they are
topologically equivalent, respecting the associativity and commutivity
of conjunction. |
boolean |
evaluate()
Determines whether the constraint is satisfied. |
PropositionalConstraint |
factor()
Factoring a conjunction is the opposite of distributing a disjunction over a conjunction. |
int |
hashCode()
The hash code of a PropositionalConjunction is the sum of
the hash codes of its children plus one. |
PropositionalConstraint[] |
intersect(PropositionalConstraint c)
The intersection of two conjunctions is the set of all terms that are common to both conjunctions; the intersection of a conjunction and some other constraint c is c if c is contained in the conjunction and the empty set otherwise. |
boolean |
moreGeneralThan(PropositionalConstraint c)
Compares topology to determine if this constraint is more general than the given constraint; note: this method is not required to be correct when it answers false. |
boolean |
moreSpecificThan(PropositionalAtLeast c)
Compares topology to determine if this constraint is more specific than the given at-least; note: this method is not required to be correct when it answers false. |
boolean |
moreSpecificThan(PropositionalConjunction c)
Compares topology to determine if this constraint is more specific than the given conjunction; note: this method is not required to be correct when it answers false. |
boolean |
moreSpecificThan(PropositionalConstant c)
Compares topology to determine if this constraint is more specific than the given constant; note: this method is not required to be correct when it answers false. |
boolean |
moreSpecificThan(PropositionalDisjunction c)
Compares topology to determine if this constraint is more specific than the given disjunction; note: this method is not required to be correct when it answers false. |
boolean |
moreSpecificThan(PropositionalDoubleImplication c)
Compares topology to determine if this constraint is more specific than the given double implication; note: this method is not required to be correct when it answers false. |
boolean |
moreSpecificThan(PropositionalImplication c)
Compares topology to determine if this constraint is more specific than the given implication; note: this method is not required to be correct when it answers false. |
boolean |
moreSpecificThan(PropositionalNegation c)
Compares topology to determine if this constraint is more specific than the given negation; note: this method is not required to be correct when it answers false. |
boolean |
moreSpecificThan(PropositionalVariable c)
Compares topology to determine if this constraint is more specific than the given variable; note: this method is not required to be correct when it answers false. |
PropositionalConstraint |
negate()
Uses DeMorgan's law to compute the negation of this constraint by distributing that negation to each child. |
void |
runVisit(Inference infer)
Calls the appropriate visit(·) method of the given
Inference for this Constraint, as per the
visitor pattern. |
PropositionalConstraint |
simplify()
Produces a new, logically simplified version of this constraint, preserving variable consolidation. |
PropositionalConstraint |
simplify(boolean d)
Same as simplify(), except this method gives the caller the
ability to optionally leave double implications that are immediate
children of this conjunction in tact. |
PropositionalConstraint |
subtract(PropositionalConstraint[] terms)
Subtraction from a conjunction simply removes all of the specified terms from it; this method returns a new constraint representing the subtraction. |
void |
write(java.lang.StringBuffer buffer)
Creates a string respresentation of this constraint using the string representations of the objects involved. |
| Methods inherited from class LBJ2.infer.PropositionalNAryConstraint |
|---|
clone, consolidateVariables, contains, getChildren, size |
| Methods inherited from class LBJ2.infer.PropositionalConstraint |
|---|
toString |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
private PropositionalConjunction()
public PropositionalConjunction(PropositionalConstraint c1,
PropositionalConstraint c2)
PropositionalConjunction, its contents are flattened into
this PropositionalConjunction.
c1 - One constraint to disjunct.c2 - Another constraint to disjunct.| Method Detail |
|---|
public boolean evaluate()
evaluate in class Constraintpublic PropositionalConstraint simplify()
simplify in class PropositionalConstraintConstraint.consolidateVariables(java.util.AbstractMap)public PropositionalConstraint simplify(boolean d)
simplify(), except this method gives the caller the
ability to optionally leave double implications that are immediate
children of this conjunction in tact.
d - true iff double implications that are immediate
children of this conjunction are to be left in tact.
public PropositionalConstraint negate()
negate in class PropositionalConstraintpublic PropositionalConstraint CNF()
CNF in class PropositionalConstraintpublic PropositionalConstraint DNF()
DNF in class PropositionalConstraintpublic boolean moreGeneralThan(PropositionalConstraint c)
false.
moreGeneralThan in class PropositionalConstraintc - The given constraint.
true if a topological analysis determined that
this constraint is more general than the given constraint.public boolean moreSpecificThan(PropositionalImplication c)
false.
moreSpecificThan in class PropositionalConstraintc - The given implication.
true if a topological analysis determined that
this constraint is more specific than the given implication.public boolean moreSpecificThan(PropositionalDoubleImplication c)
false.
moreSpecificThan in class PropositionalConstraintc - The given double implication.
true if a topological analysis determined that
this constraint is more specific than the given double
implication.public boolean moreSpecificThan(PropositionalConjunction c)
false.
moreSpecificThan in class PropositionalConstraintc - The given conjunction.
true if a topological analysis determined that
this constraint is more specific than the given conjunction.public boolean moreSpecificThan(PropositionalDisjunction c)
false.
moreSpecificThan in class PropositionalConstraintc - The given disjunction.
true if a topological analysis determined that
this constraint is more specific than the given disjunction.public boolean moreSpecificThan(PropositionalAtLeast c)
false.
moreSpecificThan in class PropositionalConstraintc - The given at-least.
true if a topological analysis determined that
this constraint is more specific than the given disjunction.public boolean moreSpecificThan(PropositionalNegation c)
false.
moreSpecificThan in class PropositionalConstraintc - The given negation.
true if a topological analysis determined that
this constraint is more specific than the given negation.public boolean moreSpecificThan(PropositionalVariable c)
false.
moreSpecificThan in class PropositionalConstraintc - The given variable.
true if a topological analysis determined that
this constraint is more specific than the given variable.public boolean moreSpecificThan(PropositionalConstant c)
false.
moreSpecificThan in class PropositionalConstraintc - The given constant.
true if a topological analysis determined that
this constraint is more specific than the given constant.public void add(PropositionalConstraint c)
c - The constraint to add.public PropositionalConstraint factor()
public PropositionalConstraint[] intersect(PropositionalConstraint c)
c - The constraint to intersect with.
null if
there are none.public PropositionalConstraint subtract(PropositionalConstraint[] terms)
terms - The terms to remove.
public PropositionalConstraint distribute(PropositionalDisjunction d)
public boolean containsAll(PropositionalConjunction c)
c - The given conjunction.
true iff this conjunction contains all of the
terms that the given conjunction contains.public int hashCode()
PropositionalConjunction is the sum of
the hash codes of its children plus one.
hashCode in class java.lang.ObjectPropositionalConjunction.public boolean equals(java.lang.Object o)
PropositionalConjunctions are equivalent when they are
topologically equivalent, respecting the associativity and commutivity
of conjunction.
equals in class java.lang.Objecttrue iff the argument is an equivalent
PropositionalConjunction.public void runVisit(Inference infer)
visit(·) method of the given
Inference for this Constraint, as per the
visitor pattern.
runVisit in class Constraintinfer - The inference visiting this constraint.public void write(java.lang.StringBuffer buffer)
write in class PropositionalConstraintbuffer - The output of this method will be appended to this buffer.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||