LBJ2.infer
Class FirstOrderImplication

java.lang.Object
  extended by LBJ2.infer.Constraint
      extended by LBJ2.infer.FirstOrderConstraint
          extended by LBJ2.infer.FirstOrderBinaryConstraint
              extended by LBJ2.infer.FirstOrderImplication

public class FirstOrderImplication
extends FirstOrderBinaryConstraint

Represents an implication between two first order constraints.


Field Summary
 
Fields inherited from class LBJ2.infer.FirstOrderBinaryConstraint
left, right
 
Constructor Summary
FirstOrderImplication(FirstOrderConstraint l, FirstOrderConstraint r)
          Initializing constructor.
 
Method Summary
 boolean equals(java.lang.Object o)
          Two FirstOrderImplications are equivalent when they are topologically equivalent.
 boolean evaluate()
          Determines whether the constraint is satisfied.
 int hashCode()
          The hash code of a FirstOrderImplication is the sum of the hash codes of its children plus two.
 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.FirstOrderBinaryConstraint
consolidateVariables, getChildren, setQuantificationVariables
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FirstOrderImplication

public FirstOrderImplication(FirstOrderConstraint l,
                             FirstOrderConstraint r)
Initializing constructor.

Parameters:
l - The constraint on the left of the operator.
r - The constraint on the right of the operator.
Method Detail

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

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

equals

public boolean equals(java.lang.Object o)
Two FirstOrderImplications are equivalent when they are topologically equivalent.

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

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.