LBJ2.infer
Class QuantifiedConstraintInvocation

java.lang.Object
  extended by LBJ2.infer.Constraint
      extended by LBJ2.infer.FirstOrderConstraint
          extended by LBJ2.infer.QuantifiedConstraintInvocation

public class QuantifiedConstraintInvocation
extends FirstOrderConstraint

Represents the invocation of a parameterized constraint nested inside at least one quantification expression, where the parameter is a function of the quantification variables.


Field Summary
protected  FirstOrderConstraint constraint
          The latest result of invoking parameterized.
protected  ParameterizedConstraint parameterized
          The parameterized constraint that has been invoked.
protected  InvocationArgumentReplacer replacer
          The implementation of the function that computes the parameter.
 
Constructor Summary
QuantifiedConstraintInvocation(ParameterizedConstraint p, InvocationArgumentReplacer iar)
          Initializing constructor.
 
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 QuantifiedConstraintInvocations are equivalent when their children are equivalent.
 boolean evaluate()
          If this method is called without first calling setQuantificationVariables(Vector), false will be returned.
 Constraint[] getChildren()
          Returns the children of this constraint in an array.
 int hashCode()
          The hash code of a QuantifiedConstraintInvocation is the sum of the hash codes of its children.
 PropositionalConstraint propositionalize()
          If this method is called without first calling setQuantificationVariables(Vector), the constant representing false will be returned.
 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 java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parameterized

protected ParameterizedConstraint parameterized
The parameterized constraint that has been invoked.


replacer

protected InvocationArgumentReplacer replacer
The implementation of the function that computes the parameter.


constraint

protected FirstOrderConstraint constraint
The latest result of invoking parameterized.

Constructor Detail

QuantifiedConstraintInvocation

public QuantifiedConstraintInvocation(ParameterizedConstraint p,
                                      InvocationArgumentReplacer iar)
Initializing constructor.

Parameters:
p - The invoked constraint.
iar - The parameter function implementation.
Method Detail

evaluate

public boolean evaluate()
If this method is called without first calling setQuantificationVariables(Vector), false will be returned.

Specified by:
evaluate in class Constraint

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.

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.

propositionalize

public PropositionalConstraint propositionalize()
If this method is called without first calling setQuantificationVariables(Vector), the constant representing false will be returned.

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

hashCode

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

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

equals

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

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

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.