public class AtMostQuantifier extends Quantifier
Modifier and Type | Field and Description |
---|---|
protected int |
m
The maximum number of objects for which the constraint must hold.
|
collection, constraint, enclosingQuantificationSettings, quantificationVariable, replacer
Constructor and Description |
---|
AtMostQuantifier(String q,
Collection col,
FirstOrderConstraint con,
int m)
Initializing constructor.
|
AtMostQuantifier(String q,
Collection col,
FirstOrderConstraint con,
int m,
QuantifierArgumentReplacer qar)
This constructor specifies a variable setter for when this quantifier is itself quantified.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o)
Two
AtMostQuantifier s are equivalent when their children are equivalent. |
boolean |
evaluate()
Determines whether the constraint is satisfied.
|
int |
hashCode()
The hash code of a
AtMostQuantifier is the sum of the hash codes of its
children. |
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 children.
|
consolidateVariables, getChildren, initialize
public AtMostQuantifier(String q, Collection col, FirstOrderConstraint con, int m)
q
- The name of the quantification variable.col
- The collection of objects to iterate over.con
- The constraint being quantified.m
- The number of objects for which the constraint must hold.public AtMostQuantifier(String q, Collection col, FirstOrderConstraint con, int m, QuantifierArgumentReplacer qar)
q
- The name of the quantification variable.col
- The collection of objects to iterate over.con
- The constraint being quantified.m
- The number of objects for which the constraint must hold.qar
- The variable setter.public boolean evaluate()
evaluate
in class Constraint
public void setQuantificationVariables(Vector o)
setQuantificationVariables
in class FirstOrderConstraint
o
- The new object references for the enclosing quantification variables, in order of
nesting.public PropositionalConstraint propositionalize()
propositionalize
in class FirstOrderConstraint
public int hashCode()
AtMostQuantifier
is the sum of the hash codes of its
children.hashCode
in class Quantifier
AtMostQuantifier
.public boolean equals(Object o)
AtMostQuantifier
s are equivalent when their children are equivalent.equals
in class Quantifier
true
iff the argument is an equivalent AtMostQuantifier
.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.