LBJ2.infer
Class FirstOrderNAryConstraint

java.lang.Object
  extended by LBJ2.infer.Constraint
      extended by LBJ2.infer.FirstOrderConstraint
          extended by LBJ2.infer.FirstOrderNAryConstraint
Direct Known Subclasses:
FirstOrderConjunction, FirstOrderDisjunction

public abstract class FirstOrderNAryConstraint
extends FirstOrderConstraint

Represents a first order constraint with an arbitrary number of arguments, usually assumed to be greater than or equal to 2.


Field Summary
protected  java.util.HashSet children
          The children of the operator.
 
Constructor Summary
FirstOrderNAryConstraint()
          Default constructor.
 
Method Summary
abstract  void add(FirstOrderConstraint 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.
 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 contains(FirstOrderConstraint c)
          Determines whether the given constraint is a term of this constraint.
 Constraint[] getChildren()
          Returns the children of this constraint in an array.
 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.
 int size()
          Returns the number of terms in this constraint.
 
Methods inherited from class LBJ2.infer.FirstOrderConstraint
propositionalize
 
Methods inherited from class LBJ2.infer.Constraint
evaluate, runVisit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

children

protected java.util.HashSet children
The children of the operator.

Constructor Detail

FirstOrderNAryConstraint

public FirstOrderNAryConstraint()
Default constructor.

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.

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.

contains

public boolean contains(FirstOrderConstraint c)
Determines whether the given constraint is a term of this constraint.

Parameters:
c - The given constraint.
Returns:
true iff the given constraint is contained in this constraint.

size

public int size()
Returns the number of terms in this constraint.

Returns:
The number of terms in this constraint.

add

public abstract void add(FirstOrderConstraint 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.

Parameters:
c - The constraint to add.