Storm
A Modern Probabilistic Model Checker
|
#include <Z3SmtSolver.h>
Classes | |
class | Z3ModelReference |
Public Member Functions | |
Z3SmtSolver (storm::expressions::ExpressionManager &manager) | |
virtual | ~Z3SmtSolver () |
virtual void | push () override |
Pushes a backtracking point on the solver's stack. | |
virtual void | pop () override |
Pops a backtracking point from the solver's stack. | |
virtual void | pop (uint_fast64_t n) override |
Pops multiple backtracking points from the solver's stack in the same way as pop() does. | |
virtual void | reset () override |
Removes all assertions from the solver's stack. | |
virtual void | add (storm::expressions::Expression const &assertion) override |
Adds an assertion to the solver's stack. | |
virtual CheckResult | check () override |
Checks whether the conjunction of assertions that are currently on the solver's stack is satisfiable. | |
virtual CheckResult | checkWithAssumptions (std::set< storm::expressions::Expression > const &assumptions) override |
Checks whether the conjunction of assertions that are currently on the solver's stack together with the provided assumptions is satisfiable. | |
virtual CheckResult | checkWithAssumptions (std::initializer_list< storm::expressions::Expression > const &assumptions) override |
Checks whether the conjunction of assertions that are currently on the solver's stack together with the provided assumptions is satisfiable. | |
virtual storm::expressions::SimpleValuation | getModelAsValuation () override |
If the last call to check() or checkWithAssumptions() returned Sat, this method retrieves a model that satisfies all assertions on the solver's stack (as well as provided assumptions), provided that the solver was instantiated with support for model generation. | |
virtual std::shared_ptr< SmtSolver::ModelReference > | getModel () override |
If the last call to check() or checkWithAssumptions() returned Sat, this method retrieves a model that satisfies all assertions on the solver's stack (as well as provided assumptions), provided that the solver was instantiated with support for model generation. | |
virtual std::vector< storm::expressions::SimpleValuation > | allSat (std::vector< storm::expressions::Variable > const &important) override |
Performs AllSat over the (provided) important atoms. | |
virtual uint_fast64_t | allSat (std::vector< storm::expressions::Variable > const &important, std::function< bool(storm::expressions::SimpleValuation &)> const &callback) override |
Performs AllSat over the (provided) important atoms. | |
virtual uint_fast64_t | allSat (std::vector< storm::expressions::Variable > const &important, std::function< bool(ModelReference &)> const &callback) override |
Performs AllSat over the (provided) important atoms. | |
virtual std::vector< storm::expressions::Expression > | getUnsatAssumptions () override |
If the last call to checkWithAssumptions() returned Unsat, this function can be used to retrieve a subset of the assumptions such that the assertion stack and these assumptions are unsatisfiable. | |
virtual bool | setTimeout (uint_fast64_t milliseconds) override |
If supported by the solver, this will limit all subsequent satisfiability queries to the given number of milliseconds. | |
virtual bool | unsetTimeout () override |
If supported by the solver, this unsets a previous timeout. | |
virtual std::string | getSmtLibString () const override |
If supported by the solver, this function returns the current assertions in the SMT-LIB format. | |
![]() | |
SmtSolver (storm::expressions::ExpressionManager &manager) | |
Constructs a new Smt solver with the given options. | |
virtual | ~SmtSolver () |
Destructs the solver instance. | |
SmtSolver (SmtSolver const &other)=default | |
SmtSolver (SmtSolver &&other)=default | |
SmtSolver & | operator= (SmtSolver const &other)=delete |
SmtSolver & | operator= (SmtSolver &&other)=delete |
void | add (std::set< storm::expressions::Expression > const &assertions) |
Adds the given set of assertions to the solver's stack. | |
void | add (std::initializer_list< storm::expressions::Expression > const &assertions) |
Adds the given list of assertions to the solver's stack. | |
virtual std::vector< storm::expressions::Expression > | getUnsatCore () |
If the last call to check() returned Unsat, this function can be used to retrieve the unsatisfiable core of the assertions on the solver's stack, provided that the solver has been instantiated with support for the generation of unsatisfiable cores. | |
virtual void | setInterpolationGroup (uint_fast64_t group) |
Sets the current interpolation group. | |
virtual storm::expressions::Expression | getInterpolant (std::vector< uint_fast64_t > const &groupsA) |
If the last call to check() returned Unsat, the solver has been instantiated with support for interpolant generation and at least two non-empty interpolation groups have been added, the function can be used to retrieve an interpolant for the pair (A, B) of formulas where A is the conjunction of all the assertions in the groups provided as a parameter and B is the set of all other assertions. | |
storm::expressions::ExpressionManager const & | getManager () const |
Retrieves the expression manager associated with the solver. | |
storm::expressions::ExpressionManager & | getManager () |
Retrieves the expression manager associated with the solver. | |
Additional Inherited Members | |
![]() | |
enum class | CheckResult { Sat , Unsat , Unknown } |
possible check results More... | |
Definition at line 15 of file Z3SmtSolver.h.
storm::solver::Z3SmtSolver::Z3SmtSolver | ( | storm::expressions::ExpressionManager & | manager | ) |
Definition at line 60 of file Z3SmtSolver.cpp.
|
virtual |
Definition at line 80 of file Z3SmtSolver.cpp.
|
overridevirtual |
Adds an assertion to the solver's stack.
assertion | The assertion to add. |
Implements storm::solver::SmtSolver.
Definition at line 116 of file Z3SmtSolver.cpp.
|
overridevirtual |
Performs AllSat over the (provided) important atoms.
That is, this function returns all models of the assertions on the solver's stack.
important | The set of important atoms over which to perform all sat. |
Reimplemented from storm::solver::SmtSolver.
Definition at line 241 of file Z3SmtSolver.cpp.
|
overridevirtual |
Performs AllSat over the (provided) important atoms.
That is, this function determines all models of the assertions on the solver's stack. While doing so, every time a model is found, the provided callback is called and informed about the content of the current model. The callback function can signal to abort the enumeration process by returning false.
important | The set of important atoms over which to perform all sat. |
callback | A function to call for each found model. |
Reimplemented from storm::solver::SmtSolver.
|
overridevirtual |
Performs AllSat over the (provided) important atoms.
That is, this function determines all models of the assertions on the solver's stack. While doing so, every time a model is found, the provided callback is called and informed about the content of the current model. The callback function can signal to abort the enumeration process by returning false.
important | The set of important atoms over which to perform all sat. |
callback | A function to call for each found model. |
Reimplemented from storm::solver::SmtSolver.
Definition at line 255 of file Z3SmtSolver.cpp.
|
overridevirtual |
Checks whether the conjunction of assertions that are currently on the solver's stack is satisfiable.
Implements storm::solver::SmtSolver.
Definition at line 124 of file Z3SmtSolver.cpp.
|
overridevirtual |
Checks whether the conjunction of assertions that are currently on the solver's stack together with the provided assumptions is satisfiable.
The assumptions are, however, not added to the solver's stack, but are merely considered for this one call.
assumptions | The assumptions to add to the call. |
Implements storm::solver::SmtSolver.
Definition at line 171 of file Z3SmtSolver.cpp.
|
overridevirtual |
Checks whether the conjunction of assertions that are currently on the solver's stack together with the provided assumptions is satisfiable.
The assumptions are, however, not added to the solver's stack, but are merely considered for this one call.
assumptions | The assumptions to add to the call. |
Implements storm::solver::SmtSolver.
Definition at line 144 of file Z3SmtSolver.cpp.
|
overridevirtual |
If the last call to check() or checkWithAssumptions() returned Sat, this method retrieves a model that satisfies all assertions on the solver's stack (as well as provided assumptions), provided that the solver was instantiated with support for model generation.
Note that this function may throw an exception if it is not called immediately after a call to check() or checkWithAssumptions() that returned Sat depending on the implementation.
Reimplemented from storm::solver::SmtSolver.
Definition at line 207 of file Z3SmtSolver.cpp.
|
overridevirtual |
If the last call to check() or checkWithAssumptions() returned Sat, this method retrieves a model that satisfies all assertions on the solver's stack (as well as provided assumptions), provided that the solver was instantiated with support for model generation.
Note that this function may throw an exception if it is not called immediately after a call to check() or checkWithAssumptions() that returned Sat depending on the implementation.
Reimplemented from storm::solver::SmtSolver.
Definition at line 197 of file Z3SmtSolver.cpp.
|
overridevirtual |
If supported by the solver, this function returns the current assertions in the SMT-LIB format.
Reimplemented from storm::solver::SmtSolver.
Definition at line 381 of file Z3SmtSolver.cpp.
|
overridevirtual |
If the last call to checkWithAssumptions() returned Unsat, this function can be used to retrieve a subset of the assumptions such that the assertion stack and these assumptions are unsatisfiable.
This may only be called provided that the solver has been instantiated with support for the generation of unsatisfiable cores.
Reimplemented from storm::solver::SmtSolver.
Definition at line 339 of file Z3SmtSolver.cpp.
|
overridevirtual |
Pops a backtracking point from the solver's stack.
This deletes all assertions from the solver's stack that were added after the last call to push().
Implements storm::solver::SmtSolver.
Definition at line 92 of file Z3SmtSolver.cpp.
|
overridevirtual |
Pops multiple backtracking points from the solver's stack in the same way as pop() does.
n | The number of backtracking points to pop. |
Reimplemented from storm::solver::SmtSolver.
Definition at line 100 of file Z3SmtSolver.cpp.
|
overridevirtual |
Pushes a backtracking point on the solver's stack.
A following call to pop() deletes exactly those assertions from the solver's stack that were added after this call.
Implements storm::solver::SmtSolver.
Definition at line 84 of file Z3SmtSolver.cpp.
|
overridevirtual |
Removes all assertions from the solver's stack.
Implements storm::solver::SmtSolver.
Definition at line 108 of file Z3SmtSolver.cpp.
|
overridevirtual |
If supported by the solver, this will limit all subsequent satisfiability queries to the given number of milliseconds.
milliseconds | The amount of milliseconds before timing out. |
Reimplemented from storm::solver::SmtSolver.
Definition at line 359 of file Z3SmtSolver.cpp.
|
overridevirtual |
If supported by the solver, this unsets a previous timeout.
Reimplemented from storm::solver::SmtSolver.
Definition at line 370 of file Z3SmtSolver.cpp.