LBJ2.infer
Class Quantifier

java.lang.Object
  extended by LBJ2.infer.Constraint
      extended by LBJ2.infer.FirstOrderConstraint
          extended by LBJ2.infer.Quantifier
Direct Known Subclasses:
AtLeastQuantifier, AtMostQuantifier, ExistentialQuantifier, UniversalQuantifier

public abstract class Quantifier
extends FirstOrderConstraint

A quantifier is a first order constraint parameterized by an object taken from a Java Collection of objects.


Field Summary
protected  java.util.Collection collection
          The collection of objects to iterate over.
protected  FirstOrderConstraint constraint
          The constraint being quantified.
protected  java.util.Vector enclosingQuantificationSettings
          A list of the objects stored in the quantification variables of enclosing quantifiers.
protected  java.lang.String quantificationVariable
          The name of the quantification variable.
protected  QuantifierArgumentReplacer replacer
          The implementation of the functions that compute any parameters this quantifier may have.
 
Constructor Summary
Quantifier(java.lang.String q, java.util.Collection col, FirstOrderConstraint con)
          Initializing constructor.
Quantifier(java.lang.String q, java.util.Collection col, FirstOrderConstraint con, QuantifierArgumentReplacer qar)
          This constructor specifies a variable setter for when this quantifier is itself quantified.
 
Method Summary
 void consolidateVariables(java.util.AbstractMap m)
          Sets the variable map object stored in this object to the given argument; also instantiates all quantified variables and stores them in the map.
 boolean equals(java.lang.Object o)
          Two Quantifiers are equivalent when their children are equivalent.
 Constraint[] getChildren()
          Returns the children of this constraint in an array.
 int hashCode()
          The hash code of a Quantifier is the sum of the hash codes of its children plus three.
protected  int initialize()
          Makes sure that the enclosingQuantificationSettings vector exists, then adds a place holder for this quantifier's quantification variable setting.
 
Methods inherited from class LBJ2.infer.FirstOrderConstraint
propositionalize, setQuantificationVariables
 
Methods inherited from class LBJ2.infer.Constraint
evaluate, runVisit
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

quantificationVariable

protected java.lang.String quantificationVariable
The name of the quantification variable.


collection

protected java.util.Collection collection
The collection of objects to iterate over.


constraint

protected FirstOrderConstraint constraint
The constraint being quantified.


enclosingQuantificationSettings

protected java.util.Vector enclosingQuantificationSettings
A list of the objects stored in the quantification variables of enclosing quantifiers.


replacer

protected QuantifierArgumentReplacer replacer
The implementation of the functions that compute any parameters this quantifier may have.

Constructor Detail

Quantifier

public Quantifier(java.lang.String q,
                  java.util.Collection col,
                  FirstOrderConstraint con)
Initializing constructor.

Parameters:
q - The name of the quantification variable.
col - The collection of objects to iterate over.
con - The constraint being quantified.

Quantifier

public Quantifier(java.lang.String q,
                  java.util.Collection col,
                  FirstOrderConstraint con,
                  QuantifierArgumentReplacer qar)
This constructor specifies a variable setter for when this quantifier is itself quantified.

Parameters:
q - The name of the quantification variable.
col - The collection of objects to iterate over.
con - The constraint being quantified.
qar - The variable setter.
Method Detail

getChildren

public Constraint[] getChildren()
Returns the children of this constraint in an array.

Specified by:
getChildren in class Constraint
Returns:
The children of this constraint in an array.

initialize

protected int initialize()
Makes sure that the enclosingQuantificationSettings vector exists, then adds a place holder for this quantifier's quantification variable setting.

Returns:
The index of this quantifier's quantification variable.

consolidateVariables

public void consolidateVariables(java.util.AbstractMap m)
Sets the variable map object stored in this object to the given argument; also instantiates all quantified variables and stores them in the map.

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

hashCode

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

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

equals

public boolean equals(java.lang.Object o)
Two Quantifiers are equivalent when their children are equivalent.

Overrides:
equals in class java.lang.Object
Returns:
true iff the argument is an equivalent Quantifier.