Class CachingModel
- java.lang.Object
-
- org.sosy_lab.java_smt.basicimpl.CachingModel
-
- All Implemented Interfaces:
AutoCloseable
,Iterable<Model.ValueAssignment>
,Evaluator
,Model
public class CachingModel extends Object implements Model
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.sosy_lab.java_smt.api.Model
Model.ValueAssignment
-
-
Constructor Summary
Constructors Constructor Description CachingModel(Model pDelegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImmutableList<Model.ValueAssignment>
asList()
Build a list of assignments that stays valid after closing the model.void
close()
Free resources associated with this model (existingModel.ValueAssignment
instances stay valid, butEvaluator.evaluate(Formula)
etc.<T extends Formula>
@Nullable Teval(T formula)
Evaluate a given formula substituting the values from the model and return it as formula.@Nullable BigInteger
evaluate(BitvectorFormula formula)
Type-safe evaluation for bitvector formulas.@Nullable Boolean
evaluate(BooleanFormula formula)
Type-safe evaluation for boolean formulas.@Nullable String
evaluate(EnumerationFormula formula)
Type-safe evaluation for enumeration formulas.@Nullable FloatingPointNumber
evaluate(FloatingPointFormula formula)
Type-safe evaluation for floating-point formulas.@Nullable Object
evaluate(Formula formula)
Evaluate a given formula substituting the values from the model.@Nullable BigInteger
evaluate(NumeralFormula.IntegerFormula formula)
Type-safe evaluation for integer formulas.@Nullable Rational
evaluate(NumeralFormula.RationalFormula formula)
Type-safe evaluation for rational formulas.@Nullable String
evaluate(StringFormula formula)
Type-safe evaluation for string formulas.String
toString()
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
-
-
-
-
Constructor Detail
-
CachingModel
public CachingModel(Model pDelegate)
-
-
Method Detail
-
asList
public ImmutableList<Model.ValueAssignment> asList()
Description copied from interface:Model
Build a list of assignments that stays valid after closing the model.
-
close
public void close()
Description copied from interface:Model
Free resources associated with this model (existingModel.ValueAssignment
instances stay valid, butEvaluator.evaluate(Formula)
etc. andModel.iterator()
must not be called again).
-
eval
public <T extends Formula> @Nullable T eval(T formula)
Description copied from interface:Evaluator
Evaluate 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
0
for 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 Object evaluate(Formula formula)
Description copied from interface:Evaluator
Evaluate 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
0
for the matching type) or just returnnull
.The formula does not need to be a variable, we also allow complex expression.
-
evaluate
public @Nullable BigInteger evaluate(NumeralFormula.IntegerFormula formula)
Description copied from interface:Evaluator
Type-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 formula)
Description copied from interface:Evaluator
Type-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 formula)
Description copied from interface:Evaluator
Type-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 formula)
Description copied from interface:Evaluator
Type-safe evaluation for bitvector formulas.The formula does not need to be a variable, we also allow complex expression.
-
evaluate
public @Nullable String evaluate(StringFormula formula)
Description copied from interface:Evaluator
Type-safe evaluation for string formulas.The formula does not need to be a variable, we also allow complex expression.
-
evaluate
public @Nullable String evaluate(EnumerationFormula formula)
Description copied from interface:Evaluator
Type-safe evaluation for enumeration formulas.The formula does not need to be a variable, we also allow complex expression.
-
evaluate
public @Nullable FloatingPointNumber evaluate(FloatingPointFormula formula)
Description copied from interface:Evaluator
Type-safe evaluation for floating-point formulas.The formula does not need to be a variable, we also allow complex expression.
-
toString
public String toString()
Description copied from interface:Model
Pretty-printing of the model values.Please only use this method for debugging and not for retrieving relevant information about the model. The returned model representation is not intended for further usage like parsing, because we do not guarantee any specific format, e.g., for arrays and uninterpreted functions, and we allow the SMT solver to include arbitrary additional information about the current solver state, e.g., any available symbol in the solver, even from other provers, and temporary internal symbols.
-
-