Package org.sosy_lab.java_smt.api
Interface Model
- All Superinterfaces:
AutoCloseable,Evaluator,Iterable<Model.ValueAssignment>
- All Known Implementing Classes:
AbstractModel,CachingModel,DebuggingModel
This class provides a model with concrete evaluations for symbols and formulas from the
satisfiable solver environment.
This class is an extensions of Evaluator and provides more features:
- a listing of model assignments, i.e., the user can iterate over all available symbols and their assignments,
- a guaranteed availability even after applying any operation on the original prover stack, i .e., the model instance stays constant and remains valid for one given satisfiable prover environment.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionasList()Build a list of assignments that stays valid after closing the model.voidclose()Free resources associated with this model (existingModel.ValueAssignmentinstances stay valid, butEvaluator.evaluate(Formula)etc.default Iterator<Model.ValueAssignment>iterator()Iterate over all values present in the model.toString()Pretty-printing of the model values.Methods inherited from interface org.sosy_lab.java_smt.api.Evaluator
eval, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluateMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
iterator
Iterate over all values present in the model. Note that iterating multiple times may be inefficient for some solvers, it is recommended to useBasicProverEnvironment.getModelAssignments()instead in this case.The iteration includes value assignments for...
- all relevant free variables of simple type. If a variable is irrelevant for
satisfiability, it can be
nullor missing in the iteration. - (nested) arrays with all accesses. If an array access is applied within a quantified context, some value assignments can be missing in the iteration. Please use a direct evaluation query to get the evaluation in such a case.
- uninterpreted functions with all applications. If an uninterpreted function is applied within a quantified context, some value assignments can be missing in the iteration. Please use a direct evaluation query to get the evaluation in such a case.
- Specified by:
iteratorin interfaceIterable<Model.ValueAssignment>
- all relevant free variables of simple type. If a variable is irrelevant for
satisfiability, it can be
-
asList
ImmutableList<Model.ValueAssignment> asList()Build a list of assignments that stays valid after closing the model. -
toString
String toString()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.
-
close
void close()Free resources associated with this model (existingModel.ValueAssignmentinstances stay valid, butEvaluator.evaluate(Formula)etc. anditerator()must not be called again).- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceEvaluator
-