public abstract class AbstractModel<TFormulaInfo,TType,TEnv> extends Object implements Model
| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractModel.CachingAbstractModel<TFormulaInfo,TType,TEnv> |
Model.ValueAssignment| Modifier and Type | Field and Description |
|---|---|
protected FormulaCreator<TFormulaInfo,TType,TEnv,?> |
creator |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractModel(FormulaCreator<TFormulaInfo,TType,TEnv,?> creator) |
| Modifier and Type | Method and Description |
|---|---|
<T extends Formula> |
eval(T f)
Evaluate a given formula substituting the values from the model and return it as formula.
|
protected abstract TFormulaInfo |
evalImpl(TFormulaInfo formula)
Simplify the given formula and replace all symbols with their model values.
|
@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.
|
protected @Nullable Object |
evaluateImpl(TFormulaInfo f)
Simplify the given formula and replace all symbols with their model values.
|
String |
toString()
Pretty-printing of the model values.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorprotected final FormulaCreator<TFormulaInfo,TType,TEnv,?> creator
protected AbstractModel(FormulaCreator<TFormulaInfo,TType,TEnv,?> creator)
public <T extends Formula> T eval(T f)
ModelIf 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.
public @Nullable BigInteger evaluate(NumeralFormula.IntegerFormula f)
ModelThe formula does not need to be a variable, we also allow complex expression.
public @Nullable Rational evaluate(NumeralFormula.RationalFormula f)
ModelThe formula does not need to be a variable, we also allow complex expression.
public @Nullable Boolean evaluate(BooleanFormula f)
ModelThe formula does not need to be a variable, we also allow complex expression.
public @Nullable BigInteger evaluate(BitvectorFormula f)
ModelThe formula does not need to be a variable, we also allow complex expression.
public final @Nullable Object evaluate(Formula f)
ModelIf 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.
protected abstract TFormulaInfo evalImpl(TFormulaInfo formula)
null.protected @Nullable Object evaluateImpl(TFormulaInfo f)
null. Afterwards convert the
formula into a Java object as far as possible, i.e., try to match a primitive or simple type.