Z3
 
Loading...
Searching...
No Matches
Data Structures | Public Member Functions | Friends
solver Class Reference

#include <z3++.h>

+ Inheritance diagram for solver:

Data Structures

class  cube_generator
 
class  cube_iterator
 
struct  simple
 
struct  translate
 

Public Member Functions

 solver (context &c)
 
 solver (context &c, simple)
 
 solver (context &c, Z3_solver s)
 
 solver (context &c, char const *logic)
 
 solver (context &c, solver const &src, translate)
 
 solver (solver const &s)
 
 solver (solver const &s, simplifier const &simp)
 
 ~solver () override
 
 operator Z3_solver () const
 
solver & operator= (solver const &s)
 
void set (params const &p)
 
void set (char const *k, bool v)
 
void set (char const *k, unsigned v)
 
void set (char const *k, double v)
 
void set (char const *k, symbol const &v)
 
void set (char const *k, char const *v)
 
void push ()
 Create a backtracking point.
 
void pop (unsigned n=1)
 
void reset ()
 
void add (expr const &e)
 
void add (expr const &e, expr const &p)
 
void add (expr const &e, char const *p)
 
void add (expr_vector const &v)
 
void from_file (char const *file)
 
void from_string (char const *s)
 
check_result check ()
 
check_result check (unsigned n, expr *const assumptions)
 
check_result check (expr_vector const &assumptions)
 
model get_model () const
 
check_result consequences (expr_vector &assumptions, expr_vector &vars, expr_vector &conseq)
 
std::string reason_unknown () const
 
stats statistics () const
 
expr_vector unsat_core () const
 
expr_vector assertions () const
 
expr_vector non_units () const
 
expr_vector units () const
 
expr_vector trail () const
 
expr_vector trail (array< unsigned > &levels) const
 
expr congruence_root (expr const &t) const
 
expr congruence_next (expr const &t) const
 
expr congruence_explain (expr const &a, expr const &b) const
 
void set_initial_value (expr const &var, expr const &value)
 
void set_initial_value (expr const &var, int i)
 
void set_initial_value (expr const &var, bool b)
 
void solve_for (expr_vector const &vars, expr_vector &terms, expr_vector &guards)
 
void import_model_converter (solver const &src)
 
expr proof () const
 
std::string to_smt2 (char const *status="unknown")
 
std::string dimacs (bool include_names=true) const
 
param_descrs get_param_descrs ()
 
expr_vector cube (expr_vector &vars, unsigned cutoff)
 
cube_generator cubes ()
 
cube_generator cubes (expr_vector &vars)
 
- Public Member Functions inherited from object
 object (context &c)
 
virtual ~object ()=default
 
context & ctx () const
 
Z3_error_code check_error () const
 

Friends

std::ostream & operator<< (std::ostream &out, solver const &s)
 

Additional Inherited Members

- Protected Attributes inherited from object
context * m_ctx
 

Detailed Description

Definition at line 3107 of file z3++.h.

Constructor & Destructor Documentation

◆ solver() [1/7]

solver ( context &  c)
inline

Definition at line 3117 of file z3++.h.

3117:object(c) { init(Z3_mk_solver(c)); check_error(); }
Z3_error_code check_error() const
Definition z3++.h:568
object(context &c)
Definition z3++.h:565
Z3_solver Z3_API Z3_mk_solver(Z3_context c)
Create a new solver. This solver is a "combined solver" (see combined_solver module) that internally ...

Referenced by Solver::__del__(), Solver::assert_and_track(), Solver::assert_exprs(), Solver::check(), Solver::model(), Solver::num_scopes(), Solver::pop(), Solver::push(), Solver::reset(), and Solver::set().

◆ solver() [2/7]

solver ( context &  c,
simple   
)
inline

Definition at line 3118 of file z3++.h.

3118:object(c) { init(Z3_mk_simple_solver(c)); check_error(); }
Z3_solver Z3_API Z3_mk_simple_solver(Z3_context c)
Create a new incremental solver.

Referenced by Solver::__del__(), Solver::assert_and_track(), Solver::assert_exprs(), Solver::check(), Solver::model(), Solver::num_scopes(), Solver::pop(), Solver::push(), Solver::reset(), and Solver::set().

◆ solver() [3/7]

solver ( context &  c,
Z3_solver  s 
)
inline

◆ solver() [4/7]

solver ( context &  c,
char const *  logic 
)
inline

Definition at line 3120 of file z3++.h.

3120:object(c) { init(Z3_mk_solver_for_logic(c, c.str_symbol(logic))); check_error(); }
Z3_solver Z3_API Z3_mk_solver_for_logic(Z3_context c, Z3_symbol logic)
Create a new solver customized for the given logic. It behaves like Z3_mk_solver if the logic is unkn...

Referenced by Solver::__del__(), Solver::assert_and_track(), Solver::assert_exprs(), Solver::check(), Solver::model(), Solver::num_scopes(), Solver::pop(), Solver::push(), Solver::reset(), and Solver::set().

◆ solver() [5/7]

solver ( context &  c,
solver const &  src,
translate   
)
inline

Definition at line 3121 of file z3++.h.

3121: object(c) { Z3_solver s = Z3_solver_translate(src.ctx(), src, c); check_error(); init(s); }
Z3_solver Z3_API Z3_solver_translate(Z3_context source, Z3_solver s, Z3_context target)
Copy a solver s from the context source to the context target.
System.IntPtr Z3_solver

Referenced by Solver::__del__(), Solver::assert_and_track(), Solver::assert_exprs(), Solver::check(), Solver::model(), Solver::num_scopes(), Solver::pop(), Solver::push(), Solver::reset(), and Solver::set().

◆ solver() [6/7]

solver ( solver const &  s)
inline

◆ solver() [7/7]

solver ( solver const &  s,
simplifier const &  simp 
)
inline

Definition at line 3579 of file z3++.h.

3579:object(s) { init(Z3_solver_add_simplifier(s.ctx(), s, simp)); }
Z3_solver Z3_API Z3_solver_add_simplifier(Z3_context c, Z3_solver solver, Z3_simplifier simplifier)
Attach simplifier to a solver. The solver will use the simplifier for incremental pre-processing.

Referenced by Solver::__del__(), Solver::assert_and_track(), Solver::assert_exprs(), Solver::check(), Solver::model(), Solver::num_scopes(), Solver::pop(), Solver::push(), Solver::reset(), and Solver::set().

◆ ~solver()

~solver ( )
inlineoverride

Definition at line 3124 of file z3++.h.

3124{ Z3_solver_dec_ref(ctx(), m_solver); }
context & ctx() const
Definition z3++.h:567
void Z3_API Z3_solver_dec_ref(Z3_context c, Z3_solver s)
Decrement the reference counter of the given solver.

Member Function Documentation

◆ add() [1/4]

void add ( expr const &  e)
inline

Definition at line 3152 of file z3++.h.

3152{ assert(e.is_bool()); Z3_solver_assert(ctx(), m_solver, e); check_error(); }
void Z3_API Z3_solver_assert(Z3_context c, Z3_solver s, Z3_ast a)
Assert a constraint into the solver.

Referenced by Solver::__iadd__(), solver::add(), and solver::add().

◆ add() [2/4]

void add ( expr const &  e,
char const *  p 
)
inline

Definition at line 3158 of file z3++.h.

3158 {
3159 add(e, ctx().bool_const(p));
3160 }
void add(expr const &e)
Definition z3++.h:3152

Referenced by Solver::__iadd__().

◆ add() [3/4]

void add ( expr const &  e,
expr const &  p 
)
inline

Definition at line 3153 of file z3++.h.

3153 {
3154 assert(e.is_bool()); assert(p.is_bool()); assert(p.is_const());
3155 Z3_solver_assert_and_track(ctx(), m_solver, e, p);
3156 check_error();
3157 }
void Z3_API Z3_solver_assert_and_track(Z3_context c, Z3_solver s, Z3_ast a, Z3_ast p)
Assert a constraint a into the solver, and track it (in the unsat) core using the Boolean constant p.

Referenced by Solver::__iadd__().

◆ add() [4/4]

void add ( expr_vector const &  v)
inline

Definition at line 3161 of file z3++.h.

3161 {
3162 check_context(*this, v);
3163 for (unsigned i = 0; i < v.size(); ++i)
3164 add(v[i]);
3165 }
friend void check_context(object const &a, object const &b)
Definition z3++.h:571

Referenced by Solver::__iadd__().

◆ assertions()

expr_vector assertions ( ) const
inline

Definition at line 3200 of file z3++.h.

3200{ Z3_ast_vector r = Z3_solver_get_assertions(ctx(), m_solver); check_error(); return expr_vector(ctx(), r); }
Z3_ast_vector Z3_API Z3_solver_get_assertions(Z3_context c, Z3_solver s)
Return the set of asserted formulas on the solver.
System.IntPtr Z3_ast_vector
ast_vector_tpl< expr > expr_vector
Definition z3++.h:77

Referenced by solver::to_smt2().

◆ check() [1/3]

check_result check ( )
inline

Definition at line 3169 of file z3++.h.

3169{ Z3_lbool r = Z3_solver_check(ctx(), m_solver); check_error(); return to_check_result(r); }
Z3_lbool Z3_API Z3_solver_check(Z3_context c, Z3_solver s)
Check whether the assertions in a given solver are consistent or not.
Z3_lbool
Lifted Boolean type: false, undefined, true.
Definition z3_api.h:58
check_result to_check_result(Z3_lbool l)
Definition z3++.h:178

◆ check() [2/3]

check_result check ( expr_vector const &  assumptions)
inline

Definition at line 3180 of file z3++.h.

3180 {
3181 unsigned n = assumptions.size();
3182 array<Z3_ast> _assumptions(n);
3183 for (unsigned i = 0; i < n; ++i) {
3184 check_context(*this, assumptions[i]);
3185 _assumptions[i] = assumptions[i];
3186 }
3187 Z3_lbool r = Z3_solver_check_assumptions(ctx(), m_solver, n, _assumptions.ptr());
3188 check_error();
3189 return to_check_result(r);
3190 }
Z3_lbool Z3_API Z3_solver_check_assumptions(Z3_context c, Z3_solver s, unsigned num_assumptions, Z3_ast const assumptions[])
Check whether the assertions in the given solver and optional assumptions are consistent or not.

◆ check() [3/3]

check_result check ( unsigned  n,
expr *const  assumptions 
)
inline

Definition at line 3170 of file z3++.h.

3170 {
3171 array<Z3_ast> _assumptions(n);
3172 for (unsigned i = 0; i < n; ++i) {
3173 check_context(*this, assumptions[i]);
3174 _assumptions[i] = assumptions[i];
3175 }
3176 Z3_lbool r = Z3_solver_check_assumptions(ctx(), m_solver, n, _assumptions.ptr());
3177 check_error();
3178 return to_check_result(r);
3179 }

◆ congruence_explain()

expr congruence_explain ( expr const &  a,
expr const &  b 
) const
inline

Definition at line 3226 of file z3++.h.

3226 {
3227 check_context(*this, a);
3228 check_context(*this, b);
3229 Z3_ast r = Z3_solver_congruence_explain(ctx(), m_solver, a, b);
3230 check_error();
3231 return expr(ctx(), r);
3232 }
Z3_ast Z3_API Z3_solver_congruence_explain(Z3_context c, Z3_solver s, Z3_ast a, Z3_ast b)
retrieve explanation for congruence.
System.IntPtr Z3_ast

◆ congruence_next()

expr congruence_next ( expr const &  t) const
inline

Definition at line 3220 of file z3++.h.

3220 {
3221 check_context(*this, t);
3222 Z3_ast r = Z3_solver_congruence_next(ctx(), m_solver, t);
3223 check_error();
3224 return expr(ctx(), r);
3225 }
Z3_ast Z3_API Z3_solver_congruence_next(Z3_context c, Z3_solver s, Z3_ast a)
retrieve the next expression in the congruence class. The set of congruent siblings form a cyclic lis...

◆ congruence_root()

expr congruence_root ( expr const &  t) const
inline

Definition at line 3214 of file z3++.h.

3214 {
3215 check_context(*this, t);
3216 Z3_ast r = Z3_solver_congruence_root(ctx(), m_solver, t);
3217 check_error();
3218 return expr(ctx(), r);
3219 }
Z3_ast Z3_API Z3_solver_congruence_root(Z3_context c, Z3_solver s, Z3_ast a)
retrieve the congruence closure root of an expression. The root is retrieved relative to the state wh...

◆ consequences()

check_result consequences ( expr_vector &  assumptions,
expr_vector &  vars,
expr_vector &  conseq 
)
inline

Definition at line 3192 of file z3++.h.

3192 {
3193 Z3_lbool r = Z3_solver_get_consequences(ctx(), m_solver, assumptions, vars, conseq);
3194 check_error();
3195 return to_check_result(r);
3196 }
Z3_lbool Z3_API Z3_solver_get_consequences(Z3_context c, Z3_solver s, Z3_ast_vector assumptions, Z3_ast_vector variables, Z3_ast_vector consequences)
retrieve consequences from solver that determine values of the supplied function symbols.

◆ cube()

expr_vector cube ( expr_vector &  vars,
unsigned  cutoff 
)
inline

Definition at line 3292 of file z3++.h.

3292 {
3293 Z3_ast_vector r = Z3_solver_cube(ctx(), m_solver, vars, cutoff);
3294 check_error();
3295 return expr_vector(ctx(), r);
3296 }
Z3_ast_vector Z3_API Z3_solver_cube(Z3_context c, Z3_solver s, Z3_ast_vector vars, unsigned backtrack_level)
extract a next cube for a solver. The last cube is the constant true or false. The number of (non-con...

◆ cubes() [1/2]

cube_generator cubes ( )
inline

Definition at line 3379 of file z3++.h.

3379{ return cube_generator(*this); }

◆ cubes() [2/2]

cube_generator cubes ( expr_vector &  vars)
inline

Definition at line 3380 of file z3++.h.

3380{ return cube_generator(*this, vars); }

◆ dimacs()

std::string dimacs ( bool  include_names = true) const
inline

Definition at line 3287 of file z3++.h.

3287{ return std::string(Z3_solver_to_dimacs_string(ctx(), m_solver, include_names)); }
Z3_string Z3_API Z3_solver_to_dimacs_string(Z3_context c, Z3_solver s, bool include_names)
Convert a solver into a DIMACS formatted string.

◆ from_file()

void from_file ( char const *  file)
inline

Definition at line 3166 of file z3++.h.

3166{ Z3_solver_from_file(ctx(), m_solver, file); ctx().check_parser_error(); }
void check_parser_error() const
Definition z3++.h:248
void Z3_API Z3_solver_from_file(Z3_context c, Z3_solver s, Z3_string file_name)
load solver assertions from a file.

◆ from_string()

void from_string ( char const *  s)
inline

Definition at line 3167 of file z3++.h.

3167{ Z3_solver_from_string(ctx(), m_solver, s); ctx().check_parser_error(); }
void Z3_API Z3_solver_from_string(Z3_context c, Z3_solver s, Z3_string str)
load solver assertions from a string.

◆ get_model()

model get_model ( ) const
inline

Definition at line 3191 of file z3++.h.

3191{ Z3_model m = Z3_solver_get_model(ctx(), m_solver); check_error(); return model(ctx(), m); }
Z3_model Z3_API Z3_solver_get_model(Z3_context c, Z3_solver s)
Retrieve the model for the last Z3_solver_check or Z3_solver_check_assumptions.
System.IntPtr Z3_model

◆ get_param_descrs()

param_descrs get_param_descrs ( )
inline

Definition at line 3289 of file z3++.h.

3289{ return param_descrs(ctx(), Z3_solver_get_param_descrs(ctx(), m_solver)); }
Z3_param_descrs Z3_API Z3_solver_get_param_descrs(Z3_context c, Z3_solver s)
Return the parameter description set for the given solver object.

◆ import_model_converter()

void import_model_converter ( solver const &  src)
inline

Definition at line 3258 of file z3++.h.

3258 {
3259 check_context(*this, src);
3260 Z3_solver_import_model_converter(ctx(), src.m_solver, m_solver);
3261 check_error();
3262 }
void Z3_API Z3_solver_import_model_converter(Z3_context ctx, Z3_solver src, Z3_solver dst)
Ad-hoc method for importing model conversion from solver.

◆ non_units()

expr_vector non_units ( ) const
inline

Definition at line 3201 of file z3++.h.

3201{ Z3_ast_vector r = Z3_solver_get_non_units(ctx(), m_solver); check_error(); return expr_vector(ctx(), r); }
Z3_ast_vector Z3_API Z3_solver_get_non_units(Z3_context c, Z3_solver s)
Return the set of non units in the solver state.

◆ operator Z3_solver()

operator Z3_solver ( ) const
inline

Definition at line 3125 of file z3++.h.

3125{ return m_solver; }

◆ operator=()

solver & operator= ( solver const &  s)
inline

Definition at line 3126 of file z3++.h.

3126 {
3127 Z3_solver_inc_ref(s.ctx(), s.m_solver);
3128 Z3_solver_dec_ref(ctx(), m_solver);
3129 object::operator=(s);
3130 m_solver = s.m_solver;
3131 return *this;
3132 }
void Z3_API Z3_solver_inc_ref(Z3_context c, Z3_solver s)
Increment the reference counter of the given solver.

◆ pop()

void pop ( unsigned  n = 1)
inline

Definition at line 3150 of file z3++.h.

3150{ Z3_solver_pop(ctx(), m_solver, n); check_error(); }
void Z3_API Z3_solver_pop(Z3_context c, Z3_solver s, unsigned n)
Backtrack n backtracking points.

Referenced by Solver::__exit__().

◆ proof()

expr proof ( ) const
inline

Definition at line 3264 of file z3++.h.

3264{ Z3_ast r = Z3_solver_get_proof(ctx(), m_solver); check_error(); return expr(ctx(), r); }
Z3_ast Z3_API Z3_solver_get_proof(Z3_context c, Z3_solver s)
Retrieve the proof for the last Z3_solver_check or Z3_solver_check_assumptions.

◆ push()

void push ( )
inline

Create a backtracking point.

The solver contains a stack of assertions.

See also
Z3_solver_get_num_scopes
Z3_solver_pop

def_API('Z3_solver_push', VOID, (_in(CONTEXT), _in(SOLVER)))

Definition at line 3149 of file z3++.h.

3149{ Z3_solver_push(ctx(), m_solver); check_error(); }
void Z3_API Z3_solver_push(Z3_context c, Z3_solver s)
Create a backtracking point.

Referenced by Solver::__enter__().

◆ reason_unknown()

std::string reason_unknown ( ) const
inline

Definition at line 3197 of file z3++.h.

3197{ Z3_string r = Z3_solver_get_reason_unknown(ctx(), m_solver); check_error(); return r; }
const char * Z3_string
Z3 string type. It is just an alias for const char *.
Definition z3_api.h:50
Z3_string Z3_API Z3_solver_get_reason_unknown(Z3_context c, Z3_solver s)
Return a brief justification for an "unknown" result (i.e., Z3_L_UNDEF) for the commands Z3_solver_ch...

◆ reset()

void reset ( )
inline

Definition at line 3151 of file z3++.h.

3151{ Z3_solver_reset(ctx(), m_solver); check_error(); }
void Z3_API Z3_solver_reset(Z3_context c, Z3_solver s)
Remove all assertions from the solver.

◆ set() [1/6]

void set ( char const *  k,
bool  v 
)
inline

Definition at line 3134 of file z3++.h.

3134{ params p(ctx()); p.set(k, v); set(p); }
void set(params const &p)
Definition z3++.h:3133

Referenced by solver::set().

◆ set() [2/6]

void set ( char const *  k,
char const *  v 
)
inline

Definition at line 3138 of file z3++.h.

3138{ params p(ctx()); p.set(k, v); set(p); }

Referenced by solver::set().

◆ set() [3/6]

void set ( char const *  k,
double  v 
)
inline

Definition at line 3136 of file z3++.h.

3136{ params p(ctx()); p.set(k, v); set(p); }

Referenced by solver::set().

◆ set() [4/6]

void set ( char const *  k,
symbol const &  v 
)
inline

Definition at line 3137 of file z3++.h.

3137{ params p(ctx()); p.set(k, v); set(p); }

Referenced by solver::set().

◆ set() [5/6]

void set ( char const *  k,
unsigned  v 
)
inline

Definition at line 3135 of file z3++.h.

3135{ params p(ctx()); p.set(k, v); set(p); }

Referenced by solver::set().

◆ set() [6/6]

void set ( params const &  p)
inline

Definition at line 3133 of file z3++.h.

3133{ Z3_solver_set_params(ctx(), m_solver, p); check_error(); }
void Z3_API Z3_solver_set_params(Z3_context c, Z3_solver s, Z3_params p)
Set the given solver using the given parameters.

◆ set_initial_value() [1/3]

void set_initial_value ( expr const &  var,
bool  b 
)
inline

Definition at line 3240 of file z3++.h.

3240 {
3241 set_initial_value(var, ctx().bool_val(b));
3242 }
void set_initial_value(expr const &var, expr const &value)
Definition z3++.h:3233

◆ set_initial_value() [2/3]

void set_initial_value ( expr const &  var,
expr const &  value 
)
inline

Definition at line 3233 of file z3++.h.

3233 {
3234 Z3_solver_set_initial_value(ctx(), m_solver, var, value);
3235 check_error();
3236 }
void Z3_API Z3_solver_set_initial_value(Z3_context c, Z3_solver s, Z3_ast v, Z3_ast val)
provide an initialization hint to the solver. The initialization hint is used to calibrate an initial...

Referenced by solver::set_initial_value(), and solver::set_initial_value().

◆ set_initial_value() [3/3]

void set_initial_value ( expr const &  var,
int  i 
)
inline

Definition at line 3237 of file z3++.h.

3237 {
3238 set_initial_value(var, ctx().num_val(i, var.get_sort()));
3239 }

◆ solve_for()

void solve_for ( expr_vector const &  vars,
expr_vector &  terms,
expr_vector &  guards 
)
inline

Definition at line 3244 of file z3++.h.

3244 {
3245 // Create a copy of vars since the C API modifies the variables vector
3246 expr_vector variables(ctx());
3247 for (unsigned i = 0; i < vars.size(); ++i) {
3248 check_context(*this, vars[i]);
3249 variables.push_back(vars[i]);
3250 }
3251 // Clear output vectors before calling C API
3252 terms = expr_vector(ctx());
3253 guards = expr_vector(ctx());
3254 Z3_solver_solve_for(ctx(), m_solver, variables, terms, guards);
3255 check_error();
3256 }
void Z3_API Z3_solver_solve_for(Z3_context c, Z3_solver s, Z3_ast_vector variables, Z3_ast_vector terms, Z3_ast_vector guards)
retrieve a 'solution' for variables as defined by equalities in maintained by solvers....

◆ statistics()

stats statistics ( ) const
inline

Definition at line 3198 of file z3++.h.

3198{ Z3_stats r = Z3_solver_get_statistics(ctx(), m_solver); check_error(); return stats(ctx(), r); }
Z3_stats Z3_API Z3_solver_get_statistics(Z3_context c, Z3_solver s)
Return statistics for the given solver.
System.IntPtr Z3_stats

◆ to_smt2()

std::string to_smt2 ( char const *  status = "unknown")
inline

Definition at line 3267 of file z3++.h.

3267 {
3268 array<Z3_ast> es(assertions());
3269 Z3_ast const* fmls = es.ptr();
3270 Z3_ast fml = 0;
3271 unsigned sz = es.size();
3272 if (sz > 0) {
3273 --sz;
3274 fml = fmls[sz];
3275 }
3276 else {
3277 fml = ctx().bool_val(true);
3278 }
3279 return std::string(Z3_benchmark_to_smtlib_string(
3280 ctx(),
3281 "", "", status, "",
3282 sz,
3283 fmls,
3284 fml));
3285 }
expr bool_val(bool b)
Definition z3++.h:4215
expr_vector assertions() const
Definition z3++.h:3200
Z3_string Z3_API Z3_benchmark_to_smtlib_string(Z3_context c, Z3_string name, Z3_string logic, Z3_string status, Z3_string attributes, unsigned num_assumptions, Z3_ast const assumptions[], Z3_ast formula)
Convert the given benchmark into SMT-LIB formatted string.

◆ trail() [1/2]

expr_vector trail ( ) const
inline

Definition at line 3203 of file z3++.h.

3203{ Z3_ast_vector r = Z3_solver_get_trail(ctx(), m_solver); check_error(); return expr_vector(ctx(), r); }
Z3_ast_vector Z3_API Z3_solver_get_trail(Z3_context c, Z3_solver s)
Return the trail modulo model conversion, in order of decision level The decision level can be retrie...

◆ trail() [2/2]

expr_vector trail ( array< unsigned > &  levels) const
inline

Definition at line 3204 of file z3++.h.

3204 {
3205 Z3_ast_vector r = Z3_solver_get_trail(ctx(), m_solver);
3206 check_error();
3207 expr_vector result(ctx(), r);
3208 unsigned sz = result.size();
3209 levels.resize(sz);
3210 Z3_solver_get_levels(ctx(), m_solver, r, sz, levels.ptr());
3211 check_error();
3212 return result;
3213 }
void Z3_API Z3_solver_get_levels(Z3_context c, Z3_solver s, Z3_ast_vector literals, unsigned sz, unsigned levels[])
retrieve the decision depth of Boolean literals (variables or their negations). Assumes a check-sat c...

◆ units()

expr_vector units ( ) const
inline

Definition at line 3202 of file z3++.h.

3202{ Z3_ast_vector r = Z3_solver_get_units(ctx(), m_solver); check_error(); return expr_vector(ctx(), r); }
Z3_ast_vector Z3_API Z3_solver_get_units(Z3_context c, Z3_solver s)
Return the set of units modulo model conversion.

◆ unsat_core()

expr_vector unsat_core ( ) const
inline

Definition at line 3199 of file z3++.h.

3199{ Z3_ast_vector r = Z3_solver_get_unsat_core(ctx(), m_solver); check_error(); return expr_vector(ctx(), r); }
Z3_ast_vector Z3_API Z3_solver_get_unsat_core(Z3_context c, Z3_solver s)
Retrieve the unsat core for the last Z3_solver_check_assumptions The unsat core is a subset of the as...

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  out,
solver const &  s 
)
friend

Definition at line 3383 of file z3++.h.

3383{ out << Z3_solver_to_string(s.ctx(), s); return out; }
Z3_string Z3_API Z3_solver_to_string(Z3_context c, Z3_solver s)
Convert a solver into a string.