LBJ2.infer
Class FirstOrderConjunction

java.lang.Object
  extended by LBJ2.infer.Constraint
      extended by LBJ2.infer.FirstOrderConstraint
          extended by LBJ2.infer.FirstOrderNAryConstraint
              extended by LBJ2.infer.FirstOrderConjunction

public class FirstOrderConjunction
extends FirstOrderNAryConstraint

Represents the conjunction of first order constraints.


Field Summary
 
Fields inherited from class LBJ2.infer.FirstOrderNAryConstraint
children
 
Constructor Summary
FirstOrderConjunction(FirstOrderConstraint c1, FirstOrderConstraint c2)
          If either of the arguments is itself a FirstOrderConjunction, its contents are flattened into this FirstOrderConjunction.
 
Method Summary
 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.
 boolean equals(java.lang.Object o)
          Two FirstOrderConjunctions are equivalent when they are topologically equivalent, respecting the associativity and commutivity of disjunction.
 boolean evaluate()
          Determines whether the constraint is satisfied.
 int hashCode()
          The hash code of a FirstOrderConjunction is the sum of the hash codes of its children plus one.
 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.
 
Methods inherited from class LBJ2.infer.FirstOrderNAryConstraint
consolidateVariables, contains, getChildren, setQuantificationVariables, size
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FirstOrderConjunction

public FirstOrderConjunction(FirstOrderConstraint c1,
                             FirstOrderConstraint c2)
If either of the arguments is itself a FirstOrderConjunction, its contents are flattened into this FirstOrderConjunction.

Parameters:
c1 - One constraint to disjunct.
c2 - Another constraint to disjunct.
Method Detail

add

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

Specified by:
add in class FirstOrderNAryConstraint
Parameters:
c - The constraint to add.

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 FirstOrderConjunction is the sum of the hash codes of its children plus one.

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

equals

public boolean equals(java.lang.Object o)
Two FirstOrderConjunctions are equivalent when they are topologically equivalent, respecting the associativity and commutivity of disjunction.

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

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.