public class FirstOrderEqualityWithValue extends FirstOrderEquality
Modifier and Type | Field and Description |
---|---|
protected FirstOrderVariable |
left
The variable on the left of the equality.
|
protected String |
right
The value on the right of the equality.
|
equality, replacer, variableMap
Constructor and Description |
---|
FirstOrderEqualityWithValue(boolean e,
FirstOrderVariable l,
String r)
Initializing constructor.
|
FirstOrderEqualityWithValue(boolean e,
FirstOrderVariable l,
String r,
EqualityArgumentReplacer ear)
This constructor specifies a variable setter for when this equality is quantified.
|
Modifier and Type | Method and Description |
---|---|
void |
consolidateVariables(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(Object o)
Two
FirstOrderEqualityWithValue s are equivalent when their children are
equivalent. |
boolean |
evaluate()
Determines whether the constraint is satisfied.
|
int |
hashCode()
The hash code of a
FirstOrderEqualityWithValue is the sum of the hash codes of
its children plus 1. |
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. |
void |
setQuantificationVariables(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. |
getChildren
protected FirstOrderVariable left
protected String right
public FirstOrderEqualityWithValue(boolean e, FirstOrderVariable l, String r)
e
- Indicates whether this is an equality or an inequality.l
- The classifier application.r
- The value.public FirstOrderEqualityWithValue(boolean e, FirstOrderVariable l, String r, EqualityArgumentReplacer ear)
e
- Indicates whether this is an equality or an inequality.l
- The classifier application.r
- The value.ear
- An argument replacer.public void consolidateVariables(AbstractMap m)
consolidateVariables
in class Constraint
m
- The map in which to find unique copies of the variables.public void setQuantificationVariables(Vector o)
FirstOrderEquality
children.setQuantificationVariables
in class FirstOrderConstraint
o
- The new object references for the enclosing quantification variables, in order of
nesting.public boolean evaluate()
evaluate
in class Constraint
public PropositionalConstraint propositionalize()
propositionalize
in class FirstOrderConstraint
public int hashCode()
FirstOrderEqualityWithValue
is the sum of the hash codes of
its children plus 1.public boolean equals(Object o)
FirstOrderEqualityWithValue
s are equivalent when their children are
equivalent.public void runVisit(Inference infer)
visit(·)
method of the given Inference
for this Constraint
, as per the visitor pattern.runVisit
in class Constraint
infer
- The inference visiting this constraint.Copyright © 2016. All rights reserved.