LBJ2.infer
Class FirstOrderEqualityTwoValues

java.lang.Object
  extended by LBJ2.infer.Constraint
      extended by LBJ2.infer.FirstOrderConstraint
          extended by LBJ2.infer.FirstOrderEquality
              extended by LBJ2.infer.FirstOrderEqualityTwoValues

public class FirstOrderEqualityTwoValues
extends FirstOrderEquality

Represents the comparison of two String values.


Field Summary
protected  java.lang.String left
          The value on the left of the equality.
protected  java.lang.String right
          The value on the right of the equality.
 
Fields inherited from class LBJ2.infer.FirstOrderEquality
equality, replacer, variableMap
 
Constructor Summary
FirstOrderEqualityTwoValues(boolean e, java.lang.String l, java.lang.String r)
          Initializing constructor.
FirstOrderEqualityTwoValues(boolean e, java.lang.String l, java.lang.String r, EqualityArgumentReplacer ear)
          This constructor specifies a variable setter for when this equality is quantified.
 
Method Summary
 void consolidateVariables(java.util.AbstractMap m)
          Replaces all unquantified variables with the unique copy stored as a value of the given map; also instantiates all quantified variables and stores them in the given map.
 boolean equals(java.lang.Object o)
          Two FirstOrderEqualityTwoValuess are equivalent when their children are equivalent in either order.
 boolean evaluate()
          Determines whether the constraint is satisfied.
 int hashCode()
          The hash code of a FirstOrderEqualityTwoValues is the sum of the hash codes of its children.
 PropositionalConstraint propositionalize()
          Transforms this first order constraint into a propositional constraint.
 void runVisit(Inference infer)
          Calls the appropriate visit(·) method of the given Inference for this Constraint, as per the visitor pattern.
 void setQuantificationVariables(java.util.Vector o)
          This method sets the given quantification variables to the given object references and evaluates the expressions involving those variables in this constraint's FirstOrderEquality children.
 
Methods inherited from class LBJ2.infer.FirstOrderEquality
getChildren
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

left

protected java.lang.String left
The value on the left of the equality.


right

protected java.lang.String right
The value on the right of the equality.

Constructor Detail

FirstOrderEqualityTwoValues

public FirstOrderEqualityTwoValues(boolean e,
                                   java.lang.String l,
                                   java.lang.String r)
Initializing constructor.

Parameters:
e - Indicates whether this is an equality or an inequality.
l - The left value.
r - The right value.

FirstOrderEqualityTwoValues

public FirstOrderEqualityTwoValues(boolean e,
                                   java.lang.String l,
                                   java.lang.String r,
                                   EqualityArgumentReplacer ear)
This constructor specifies a variable setter for when this equality is quantified.

Parameters:
e - Indicates whether this is an equality or an inequality.
l - The left value.
r - The right value.
ear - An argument replacer.
Method Detail

consolidateVariables

public void consolidateVariables(java.util.AbstractMap m)
Replaces all unquantified variables with the unique copy stored as a value of the given map; also instantiates all quantified variables and stores them in the given map.

Specified by:
consolidateVariables in class Constraint
Parameters:
m - The map in which to find unique copies of the variables.

setQuantificationVariables

public void setQuantificationVariables(java.util.Vector o)
This method sets the given quantification variables to the given object references and evaluates the expressions involving those variables in this constraint's FirstOrderEquality children.

Specified by:
setQuantificationVariables in class FirstOrderConstraint
Parameters:
o - The new object references for the enclosing quantification variables, in order of nesting.

evaluate

public boolean evaluate()
Determines whether the constraint is satisfied.

Specified by:
evaluate in class Constraint

propositionalize

public PropositionalConstraint propositionalize()
Transforms this first order constraint into a propositional constraint.

Specified by:
propositionalize in class FirstOrderConstraint
Returns:
The propositionalized constraint.

hashCode

public int hashCode()
The hash code of a FirstOrderEqualityTwoValues is the sum of the hash codes of its children.

Overrides:
hashCode in class java.lang.Object
Returns:
The hash code for this FirstOrderEqualityTwoValues.

equals

public boolean equals(java.lang.Object o)
Two FirstOrderEqualityTwoValuess are equivalent when their children are equivalent in either order.

Overrides:
equals in class java.lang.Object
Returns:
true iff the argument is a FirstOrderEqualityTwoValues involving the same children.

runVisit

public void runVisit(Inference infer)
Calls the appropriate visit(·) method of the given Inference for this Constraint, as per the visitor pattern.

Specified by:
runVisit in class Constraint
Parameters:
infer - The inference visiting this constraint.