|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectkodkod.engine.Evaluator
public final class Evaluator
An evaluator for relational formulas and expressions with
respect to a given instance
and options
.
Note: you may observe surprising (though correct)
evaluator behavior if you do not use the same set of integer
options (i.e. intEncoding
and bitwidth
when evaluating and solving a formula. For example, suppose that
that an Instance i is a solution to a formula f found using options o.
If you create an evaluator e such that e.instance = i, but e.options
is an Options object with different integer settings than o,
e.evalate(f) may return false.
options: Options |
instance: Instance |
Constructor Summary | |
---|---|
Evaluator(Instance instance)
Constructs a new Evaluator for the given instance, using a default Options object. |
|
Evaluator(Instance instance,
Options options)
Constructs a new Evaluator for the given instance and options |
Method Summary | |
---|---|
TupleSet |
evaluate(Expression expression)
Evaluates the specified expession with respect to the relation-tuple mappings given by this.instance and using this.options. |
boolean |
evaluate(Formula formula)
Evaluates the specified formula with respect to the relation-tuple mappings given by this.instance and using this.options. |
int |
evaluate(IntExpression intExpr)
Evaluates the specified int expession with respect to the relation-tuple mappings given by this.instance and using this.options. |
Instance |
instance()
Returns this.instance. |
Options |
options()
Returns the Options object used by this evaluator. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Evaluator(Instance instance)
java.lang.NullPointerException
- - instance = nullthis.instance' = instance && this.options' = new Options() |
public Evaluator(Instance instance, Options options)
java.lang.NullPointerException
- - instance = null || options = nullthis.instance' = instance && this.options' = options |
Method Detail |
---|
public Options options()
public Instance instance()
public boolean evaluate(Formula formula)
HigherOrderDeclException
- - the formula contains a higher order declaration
UnboundLeafException
- - the formula contains an undeclared variable or
a relation not mapped by this.instancepublic TupleSet evaluate(Expression expression)
set
of tuples to which the expression evaluates given the
mappings in this.instance and the options in this.options.
HigherOrderDeclException
- - the expression contains a higher order declaration
UnboundLeafException
- - the expression contains an undeclared variable or
a relation not mapped by this.instancepublic int evaluate(IntExpression intExpr)
HigherOrderDeclException
- - intExpr contains a higher order declaration
UnboundLeafException
- - intExpr contains an undeclared variable or
a relation not mapped by this.instancepublic java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |