public interface Model extends Iterable<Model.ValueAssignment>, AutoCloseable
| Modifier and Type | Interface and Description |
|---|---|
static class |
Model.ValueAssignment |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Free resources associated with this model (existing
Model.ValueAssignment instances stay
valid, but evaluate(Formula) etc. |
<T extends Formula> |
eval(T formula)
Evaluate a given formula substituting the values from the model and return it as formula.
|
@Nullable BigInteger |
evaluate(BitvectorFormula f)
Type-safe evaluation for bitvector formulas.
|
@Nullable Boolean |
evaluate(BooleanFormula f)
Type-safe evaluation for boolean formulas.
|
@Nullable Object |
evaluate(Formula f)
Evaluate a given formula substituting the values from the model.
|
@Nullable BigInteger |
evaluate(NumeralFormula.IntegerFormula f)
Type-safe evaluation for integer formulas.
|
@Nullable Rational |
evaluate(NumeralFormula.RationalFormula f)
Type-safe evaluation for rational formulas.
|
Iterator<Model.ValueAssignment> |
iterator()
Iterate over all values present in the model.
|
String |
toString()
Pretty-printing of the model values.
|
forEach, spliterator<T extends Formula> T eval(T formula)
If a value is not relevant to the satisfiability result, the solver can choose either to
insert an arbitrary value (e.g., the value 0 for the matching type) or just return
null.
The formula does not need to be a variable, we also allow complex expression. The solver will replace all symbols from the formula with their model values and then simplify the formula into a simple formula, e.g., consisting only of a numeral expression.
formula - Input formula to be evaluated.null if the solver does not provide a
better evaluation.@Nullable Object evaluate(Formula f)
If a value is not relevant to the satisfiability result, the model can choose either an
arbitrary value (e.g., the value 0 for the matching type) or just return
null.
The formula does not need to be a variable, we also allow complex expression.
f - Input formulaIllegalArgumentException - if a formula has unexpected type, e.g Array.@Nullable BigInteger evaluate(NumeralFormula.IntegerFormula f)
The formula does not need to be a variable, we also allow complex expression.
@Nullable Rational evaluate(NumeralFormula.RationalFormula f)
The formula does not need to be a variable, we also allow complex expression.
@Nullable Boolean evaluate(BooleanFormula f)
The formula does not need to be a variable, we also allow complex expression.
@Nullable BigInteger evaluate(BitvectorFormula f)
The formula does not need to be a variable, we also allow complex expression.
Iterator<Model.ValueAssignment> iterator()
BasicProverEnvironment.getModelAssignments() instead in this case.iterator in interface Iterable<Model.ValueAssignment>void close()
Model.ValueAssignment instances stay
valid, but evaluate(Formula) etc. and iterator() must not be called again).close in interface AutoCloseable