Class AbstractModel<TFormulaInfo,TType,TEnv>
- java.lang.Object
-
- org.sosy_lab.java_smt.basicimpl.AbstractModel<TFormulaInfo,TType,TEnv>
-
- All Implemented Interfaces:
AutoCloseable,Iterable<Model.ValueAssignment>,Model
- Direct Known Subclasses:
AbstractModel.CachingAbstractModel
public abstract class AbstractModel<TFormulaInfo,TType,TEnv> extends Object implements Model
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAbstractModel.CachingAbstractModel<TFormulaInfo,TType,TEnv>-
Nested classes/interfaces inherited from interface org.sosy_lab.java_smt.api.Model
Model.ValueAssignment
-
-
Field Summary
Fields Modifier and Type Field Description protected FormulaCreator<TFormulaInfo,TType,TEnv,?>creator
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractModel(FormulaCreator<TFormulaInfo,TType,TEnv,?> creator)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description <T extends Formula>
@Nullable Teval(T f)Evaluate a given formula substituting the values from the model and return it as formula.protected abstract @Nullable TFormulaInfoevalImpl(TFormulaInfo formula)Simplify the given formula and replace all symbols with their model values.@Nullable BigIntegerevaluate(BitvectorFormula f)Type-safe evaluation for bitvector formulas.@Nullable Booleanevaluate(BooleanFormula f)Type-safe evaluation for boolean formulas.@Nullable Objectevaluate(Formula f)Evaluate a given formula substituting the values from the model.@Nullable BigIntegerevaluate(NumeralFormula.IntegerFormula f)Type-safe evaluation for integer formulas.@Nullable Rationalevaluate(NumeralFormula.RationalFormula f)Type-safe evaluation for rational formulas.protected @Nullable ObjectevaluateImpl(TFormulaInfo f)Simplify the given formula and replace all symbols with their model values.StringtoString()Pretty-printing of the model values.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Field Detail
-
creator
protected final FormulaCreator<TFormulaInfo,TType,TEnv,?> creator
-
-
Constructor Detail
-
AbstractModel
protected AbstractModel(FormulaCreator<TFormulaInfo,TType,TEnv,?> creator)
-
-
Method Detail
-
eval
public <T extends Formula> @Nullable T eval(T f)
Description copied from interface:ModelEvaluate a given formula substituting the values from the model and return it as 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
0for the matching type) or just returnnull.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.
-
evaluate
public @Nullable BigInteger evaluate(NumeralFormula.IntegerFormula f)
Description copied from interface:ModelType-safe evaluation for integer formulas.The formula does not need to be a variable, we also allow complex expression.
-
evaluate
public @Nullable Rational evaluate(NumeralFormula.RationalFormula f)
Description copied from interface:ModelType-safe evaluation for rational formulas.The formula does not need to be a variable, we also allow complex expression.
-
evaluate
public @Nullable Boolean evaluate(BooleanFormula f)
Description copied from interface:ModelType-safe evaluation for boolean formulas.The formula does not need to be a variable, we also allow complex expression.
-
evaluate
public @Nullable BigInteger evaluate(BitvectorFormula f)
Description copied from interface:ModelType-safe evaluation for bitvector formulas.The formula does not need to be a variable, we also allow complex expression.
-
evaluate
public final @Nullable Object evaluate(Formula f)
Description copied from interface:ModelEvaluate a given formula substituting the values from the model.If a value is not relevant to the satisfiability result, the model can choose either an arbitrary value (e.g., the value
0for the matching type) or just returnnull.The formula does not need to be a variable, we also allow complex expression.
-
evalImpl
protected abstract @Nullable TFormulaInfo evalImpl(TFormulaInfo formula)
Simplify the given formula and replace all symbols with their model values. If a symbol is not set in the model and evaluation aborts, returnnull.
-
evaluateImpl
protected @Nullable Object evaluateImpl(TFormulaInfo f)
Simplify the given formula and replace all symbols with their model values. If a symbol is not set in the model and evaluation aborts, returnnull. Afterwards convert the formula into a Java object as far as possible, i.e., try to match a primitive or simple type.
-
-