A Z3-based implementation of AbstractSolver. Encapsulates a z3::solver and a z3::context.
More...
|
|
| Z3Solver (bool isIncremental=true, std::optional< std::istream * > inOpt=std::nullopt) |
| |
|
void | asrt (const Constraint *assertion) |
| | Inserts an assertion into the topmost solver context.
|
| |
|
void | asrt (const z3::expr &assert) |
| | Adds a Z3 assertion to the solver context.
|
| |
| std::optional< bool > | checkSat () |
| |
| std::optional< bool > | checkSat (const std::vector< const Constraint * > &asserts) override |
| |
| std::optional< bool > | checkSat (const z3::expr_vector &asserts) |
| |
| void | clearMemory () |
| |
| void | comment (cstring comment) override |
| |
|
const z3::context & | context () const |
| | Get the actual Z3 context that this class uses.
|
| |
| safe_vector< const Constraint * > | getAssertions () const |
| |
| SymbolicMapping | getSymbolicMapping () const override |
| |
|
const z3::solver & | getZ3Solver () const |
| | Get the actual Z3 solver backing this class.
|
| |
| bool | isInIncrementalMode () const override |
| |
|
z3::context & | mutableContext () const |
| | Get the actual Z3 context that this class uses. This context can be manipulated.
|
| |
|
z3::solver & | mutableSolver () |
| | Return a version of the solver that is mutable.
|
| |
|
void | pop () |
| | Removes the last solver context.
|
| |
|
void | push () |
| | Pushes new (empty) solver context.
|
| |
| void | reset () |
| |
| void | seed (unsigned seed) override |
| |
| void | timeout (unsigned tm) override |
| | Sets timeout for solver in milliseconds.
|
| |
| void | toJSON (JSONGenerator &) const override |
| | Saves solver state to the given JSON generator.
|
| |
|
| DECLARE_TYPEINFO (AbstractSolver) |
| |
|
template<typename T> |
| T & | as () |
| | Tries to convert the class to type T. A BUG occurs if the cast fails.
|
| |
|
template<typename T> |
| const T & | as () const |
| | Tries to convert the class to type T. A BUG occurs if the cast fails.
|
| |
|
template<typename T> |
| T * | checkedTo () |
| | Performs a checked cast. A BUG occurs if the cast fails.
|
| |
|
template<typename T> |
| const T * | checkedTo () const |
| | Performs a checked cast. A BUG occurs if the cast fails.
|
| |
| template<typename T> |
| bool | is () const noexcept |
| |
| virtual bool | isA (TypeId typeId) const noexcept=0 |
| |
|
template<typename T> |
| const T * | to () const noexcept |
| | Same as to, but returns const pointer to T.
|
| |
| template<typename T> |
| T * | to () noexcept |
| |
| virtual TypeId | typeId () const noexcept=0 |
| |
A Z3-based implementation of AbstractSolver. Encapsulates a z3::solver and a z3::context.
Obtains the first solution found by the solver in the last call to @checkSat.
A BUG occurs if the solver has no available solution. This can happen if the last call to @checkSat returned anything other than true, if there was no such previous call, or if the state in the solver has changed since the last such call (e.g., more assertions have been made).
Implements P4::AbstractSolver.