LBJ2.infer
Class PropositionalConstraint

java.lang.Object
  extended by LBJ2.infer.Constraint
      extended by LBJ2.infer.PropositionalConstraint
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
PropositionalBinaryConstraint, PropositionalConstant, PropositionalNAryConstraint, PropositionalNegation, PropositionalVariable

public abstract class PropositionalConstraint
extends Constraint
implements java.lang.Cloneable

All classes for representing propositional constraints are derived from this base class. A propositional constraint is:


Constructor Summary
PropositionalConstraint()
           
 
Method Summary
 java.lang.Object clone()
          This method returns a shallow clone.
abstract  PropositionalConstraint CNF()
          Produces a new, logically simplified version of this constraint in conjunctive normal form (CNF).
abstract  PropositionalConstraint DNF()
          Produces a new, logically simplified version of this constraint in disjunctive normal form (DNF).
abstract  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.
abstract  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.
abstract  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.
abstract  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.
abstract  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.
abstract  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.
abstract  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.
abstract  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.
abstract  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.
abstract  PropositionalConstraint negate()
          Produces a new propositional constraint equivalent to this constraint and that contains no negated constraints other than variables.
abstract  PropositionalConstraint simplify()
          Produces a new, logically simplified version of this constraint, preserving variable consolidation.
 java.lang.String toString()
          Creates a string respresentation of this constraint using the string representations of the objects involved.
abstract  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.Constraint
consolidateVariables, evaluate, getChildren, runVisit
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PropositionalConstraint

public PropositionalConstraint()
Method Detail

simplify

public abstract PropositionalConstraint simplify()
Produces a new, logically simplified version of this constraint, preserving variable consolidation.

Returns:
A logically simplified version of this constraint.
See Also:
Constraint.consolidateVariables(java.util.AbstractMap)

negate

public abstract PropositionalConstraint negate()
Produces a new propositional constraint equivalent to this constraint and that contains no negated constraints other than variables.

Returns:
A constraint representing the negation of this constraint.

CNF

public abstract PropositionalConstraint CNF()
Produces a new, logically simplified version of this constraint in conjunctive normal form (CNF).

Returns:
The conjunctive normal form of this constraint.

DNF

public abstract PropositionalConstraint DNF()
Produces a new, logically simplified version of this constraint in disjunctive normal form (DNF).

Returns:
The disjunctive normal form of this constraint.

moreGeneralThan

public abstract 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.

Parameters:
c - The given constraint.
Returns:
true if a topological analysis determined that this constraint is more general than the given constraint.

moreSpecificThan

public abstract 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.

Parameters:
c - The given implication.
Returns:
true if a topological analysis determined that this constraint is more specific than the given implication.

moreSpecificThan

public abstract 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.

Parameters:
c - The given double implication.
Returns:
true if a topological analysis determined that this constraint is more specific than the given double implication.

moreSpecificThan

public abstract 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.

Parameters:
c - The given conjunction.
Returns:
true if a topological analysis determined that this constraint is more specific than the given conjunction.

moreSpecificThan

public abstract 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.

Parameters:
c - The given disjunction.
Returns:
true if a topological analysis determined that this constraint is more specific than the given disjunction.

moreSpecificThan

public abstract 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.

Parameters:
c - The given at-least.
Returns:
true if a topological analysis determined that this constraint is more specific than the given disjunction.

moreSpecificThan

public abstract 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.

Parameters:
c - The given negation.
Returns:
true if a topological analysis determined that this constraint is more specific than the given negation.

moreSpecificThan

public abstract 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.

Parameters:
c - The given variable.
Returns:
true if a topological analysis determined that this constraint is more specific than the given variable.

moreSpecificThan

public abstract 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.

Parameters:
c - The given constant.
Returns:
true if a topological analysis determined that this constraint is more specific than the given constant.

toString

public java.lang.String toString()
Creates a string respresentation of this constraint using the string representations of the objects involved. This method employs the write(StringBuffer) method to compute its output.

Overrides:
toString in class java.lang.Object

write

public abstract void write(java.lang.StringBuffer buffer)
Creates a string respresentation of this constraint using the string representations of the objects involved.

Parameters:
buffer - The output of this method will be appended to this buffer.

clone

public java.lang.Object clone()
This method returns a shallow clone.

Overrides:
clone in class java.lang.Object
Returns:
A shallow clone.