84 char const *
msg()
const {
return m_msg.c_str(); }
108 void set(
char const * param,
bool value) {
Z3_set_param_value(m_cfg, param, value ?
"true" :
"false"); }
112 void set(
char const * param,
int value) {
113 std::ostringstream oss;
158 void set(
char const * param,
int value) {
159 std::ostringstream oss;
173 symbol str_symbol(
char const * s);
193 sort bv_sort(
unsigned sz);
205 sort enumeration_sort(
char const * name,
unsigned n,
char const *
const * enum_names, func_decl_vector & cs, func_decl_vector & ts);
209 sort uninterpreted_sort(
char const* name);
213 func_decl function(
char const * name,
unsigned arity,
sort const * domain,
sort const & range);
215 func_decl function(
char const * name, sort_vector
const& domain,
sort const& range);
223 expr constant(
char const * name,
sort const & s);
224 expr bool_const(
char const * name);
225 expr int_const(
char const * name);
226 expr real_const(
char const * name);
227 expr bv_const(
char const * name,
unsigned sz);
229 expr bool_val(
bool b);
232 expr int_val(
unsigned n);
235 expr int_val(
char const * n);
237 expr real_val(
int n,
int d);
238 expr real_val(
int n);
239 expr real_val(
unsigned n);
242 expr real_val(
char const * n);
244 expr bv_val(
int n,
unsigned sz);
245 expr bv_val(
unsigned n,
unsigned sz);
248 expr bv_val(
char const * n,
unsigned sz);
250 expr num_val(
int n,
sort const & s);
260 array(
unsigned sz):m_size(sz) { m_array =
new T[sz]; }
261 template<
typename T2>
264 unsigned size()
const {
return m_size; }
265 T &
operator[](
int i) { assert(0 <= i); assert(static_cast<unsigned>(i) < m_size);
return m_array[i]; }
266 T
const &
operator[](
int i)
const { assert(0 <= i); assert(static_cast<unsigned>(i) < m_size);
return m_array[i]; }
267 T
const *
ptr()
const {
return m_array; }
268 T *
ptr() {
return m_array; }
276 object(
object const & s):m_ctx(s.m_ctx) {}
279 friend void check_context(
object const & a,
object const & b);
289 operator Z3_symbol()
const {
return m_sym; }
295 out <<
"k!" << s.
to_int();
297 out << s.
str().c_str();
314 m_params = s.m_params;
318 void set(
char const * k,
unsigned n) {
Z3_params_set_uint(ctx(), m_params, ctx().str_symbol(k), n); }
334 operator Z3_ast()
const {
return m_ast; }
335 operator bool()
const {
return m_ast != 0; }
346 friend bool eq(
ast const & a,
ast const & b);
448 expr operator()()
const;
449 expr operator()(
unsigned n,
expr const * args)
const;
450 expr operator()(expr_vector
const& v)
const;
451 expr operator()(
expr const & a)
const;
452 expr operator()(
int a)
const;
453 expr operator()(
expr const & a1,
expr const & a2)
const;
454 expr operator()(
expr const & a1,
int a2)
const;
455 expr operator()(
int a1,
expr const & a2)
const;
480 bool is_bool()
const {
return get_sort().is_bool(); }
484 bool is_int()
const {
return get_sort().is_int(); }
488 bool is_real()
const {
return get_sort().is_real(); }
492 bool is_arith()
const {
return get_sort().is_arith(); }
496 bool is_bv()
const {
return get_sort().is_bv(); }
500 bool is_array()
const {
return get_sort().is_array(); }
599 Z3_ast args[2] = { a, b };
630 Z3_ast args[2] = { a, b };
676 Z3_ast args[2] = { a, b };
688 Z3_ast args[2] = { a, b };
708 Z3_ast args[2] = { a, b };
755 else if (a.
is_bv()) {
770 Z3_ast args[2] = { a, b };
1008 return sort(c, reinterpret_cast<Z3_sort>(a));
1016 return func_decl(c, reinterpret_cast<Z3_func_decl>(a));
1020 template<
typename T>
1034 T
back()
const {
return operator[](size() - 1); }
1035 void pop_back() { assert(size() > 0); resize(size() - 1); }
1036 bool empty()
const {
return size() == 0; }
1041 m_vector = s.m_vector;
1047 template<
typename T>
1048 template<
typename T2>
1050 m_array =
new T[v.
size()];
1052 for (
unsigned i = 0; i < m_size; i++) {
1110 assert(args.
size() > 0);
1115 return expr(ctx, r);
1140 m_entry = s.m_entry;
1163 m_interp = s.m_interp;
1186 m_model = s.m_model;
1196 throw exception(
"failed to evaluate expression");
1197 return expr(ctx(), r);
1204 unsigned size()
const {
return num_consts() + num_funcs(); }
1207 return static_cast<unsigned>(i) < num_consts() ? get_const_decl(i) : get_func_decl(i - num_consts());
1214 return expr(ctx(), r);
1242 m_stats = s.m_stats;
1259 if (r ==
unsat) out <<
"unsat";
1260 else if (r ==
sat) out <<
"sat";
1261 else out <<
"unknown";
1288 m_solver = s.m_solver;
1302 add(e, ctx().bool_const(p));
1307 for (
unsigned i = 0; i < n; i++) {
1309 _assumptions[i] = assumptions[i];
1316 unsigned n = assumptions.
size();
1318 for (
unsigned i = 0; i < n; i++) {
1320 _assumptions[i] = assumptions[i];
1334 std::string
to_smt2(
char const* status =
"unknown") {
1338 unsigned sz = es.
size();
1344 fml = ctx().bool_val(
true);
1385 unsigned n = size();
1387 return ctx().bool_val(
true);
1389 return operator[](0);
1392 for (
unsigned i = 0; i < n; i++)
1393 args[i] =
operator[](i);
1415 m_apply_result = s.m_apply_result;
1424 return model(ctx(), new_m);
1445 m_tactic = s.m_tactic;
1511 m_probe = s.m_probe;
1559 unsigned h()
const {
return m_h; }
1570 std::stringstream strm;
1596 return expr(ctx(), r);
1601 return expr(ctx(), r);
1623 return tactic(t1.ctx(), r);
1636 for (
unsigned i = 0; i < n; i++) { _enum_names[i] =
Z3_mk_string_symbol(*
this, enum_names[i]); }
1655 for (
unsigned i = 0; i < arity; i++) {
1657 args[i] = domain[i];
1665 return function(range.
ctx().
str_symbol(name), arity, domain, range);
1670 for (
unsigned i = 0; i < domain.
size(); i++) {
1672 args[i] = domain[i];
1680 return function(range.
ctx().
str_symbol(name), domain, range);
1702 Z3_sort args[3] = { d1, d2, d3 };
1710 Z3_sort args[4] = { d1, d2, d3, d4 };
1718 Z3_sort args[5] = { d1, d2, d3, d4, d5 };
1727 return expr(*
this, r);
1760 for (
unsigned i = 0; i < n; i++) {
1766 return expr(ctx(), r);
1771 for (
unsigned i = 0; i < args.
size(); i++) {
1777 return expr(ctx(), r);
1781 ctx().check_error();
1782 return expr(ctx(), r);
1788 ctx().check_error();
1789 return expr(ctx(), r);
1792 Z3_ast args[1] = { ctx().num_val(a, domain(0)) };
1794 ctx().check_error();
1795 return expr(ctx(), r);
1799 Z3_ast args[2] = { a1, a2 };
1801 ctx().check_error();
1802 return expr(ctx(), r);
1806 Z3_ast args[2] = { a1, ctx().num_val(a2, domain(1)) };
1808 ctx().check_error();
1809 return expr(ctx(), r);
1813 Z3_ast args[2] = { ctx().num_val(a1, domain(0)), a2 };
1815 ctx().check_error();
1816 return expr(ctx(), r);
1820 Z3_ast args[3] = { a1, a2, a3 };
1822 ctx().check_error();
1823 return expr(ctx(), r);
1827 Z3_ast args[4] = { a1, a2, a3, a4 };
1829 ctx().check_error();
1830 return expr(ctx(), r);
1834 Z3_ast args[5] = { a1, a2, a3, a4, a5 };
1836 ctx().check_error();
1837 return expr(ctx(), r);
1843 return range.
ctx().
function(name, arity, domain, range);
1845 inline func_decl function(
char const * name,
unsigned arity,
sort const * domain,
sort const & range) {
1846 return range.
ctx().
function(name, arity, domain, range);
1855 return range.
ctx().
function(name, d1, d2, d3, range);
1858 return range.
ctx().
function(name, d1, d2, d3, d4, range);
1861 return range.
ctx().
function(name, d1, d2, d3, d4, d5, range);
1893 for (
unsigned i = 0; i < src.
size(); ++i) {
1899 return expr(ctx(), r);
1904 for (
unsigned i = 0; i < dst.
size(); ++i) {
1909 return expr(ctx(), r);
Z3_probe Z3_API Z3_probe_and(Z3_context x, Z3_probe p1, Z3_probe p2)
Return a probe that evaluates to "true" when p1 and p2 evaluates to true.
ast_vector_tpl(context &c)
void Z3_API Z3_solver_push(Z3_context c, Z3_solver s)
Create a backtracking point.
expr distinct(expr_vector const &args)
Z3_ast Z3_API Z3_mk_unsigned_int(Z3_context c, unsigned v, Z3_sort ty)
Create a numeral of a int, bit-vector, or finite-domain sort.
System.IntPtr Z3_optimize
void Z3_API Z3_stats_inc_ref(Z3_context c, Z3_stats s)
Increment the reference counter of the given statistics object.
Z3_ast Z3_API Z3_mk_true(Z3_context c)
Create an AST node representing true.
Z3_ast Z3_API Z3_mk_distinct(Z3_context c, unsigned num_args, Z3_ast const args[])
Create an AST node representing distinct(args[0], ..., args[num_args-1]).The distinct construct is us...
Z3_probe Z3_API Z3_probe_le(Z3_context x, Z3_probe p1, Z3_probe p2)
Return a probe that evaluates to "true" when the value returned by p1 is less than or equal to the va...
Z3_sort_kind
The different kinds of Z3 types (See Z3_get_sort_kind).
Z3_sort Z3_API Z3_mk_bv_sort(Z3_context c, unsigned sz)
Create a bit-vector type of the given size.
friend expr operator|(expr const &a, expr const &b)
void Z3_API Z3_global_param_set(Z3_string param_id, Z3_string param_value)
Set a global (or module) parameter. This setting is shared by all Z3 contexts.
std::string reason_unknown() const
sort bool_sort()
Return the Boolean sort.
void Z3_API Z3_solver_set_params(Z3_context c, Z3_solver s, Z3_params p)
Set the given solver using the given parameters.
friend expr operator+(expr const &a, expr const &b)
Z3_string Z3_API Z3_apply_result_to_string(Z3_context c, Z3_apply_result r)
Convert the Z3_apply_result object returned by Z3_tactic_apply into a string.
Z3_bool Z3_API Z3_goal_inconsistent(Z3_context c, Z3_goal g)
Return true if the given goal contains the formula false.
friend expr operator>=(expr const &a, int b)
bool is_int() const
Return true if this sort is the Integer sort.
Z3_ast Z3_API Z3_mk_false(Z3_context c)
Create an AST node representing false.
Z3_ast_vector Z3_API Z3_solver_get_assertions(Z3_context c, Z3_solver s)
Return the set of asserted formulas as a goal object.
Z3_probe Z3_API Z3_probe_ge(Z3_context x, Z3_probe p1, Z3_probe p2)
Return a probe that evaluates to "true" when the value returned by p1 is greater than or equal to the...
tactic & operator=(tactic const &s)
probe(context &c, Z3_probe s)
void Z3_API Z3_goal_reset(Z3_context c, Z3_goal g)
Erase all formulas from the given goal.
probe & operator=(probe const &s)
Z3_tactic Z3_API Z3_tactic_when(Z3_context c, Z3_probe p, Z3_tactic t)
Return a tactic that applies t to a given goal is the probe p evaluates to true. If p evaluates to fa...
func_decl get_const_decl(unsigned i) const
Z3_ast Z3_API Z3_mk_mul(Z3_context c, unsigned num_args, Z3_ast const args[])
Create an AST node representing args[0] * ... * args[num_args-1].The array args must have num_args el...
void Z3_API Z3_tactic_inc_ref(Z3_context c, Z3_tactic t)
Increment the reference counter of the given tactic.
friend expr operator>=(expr const &a, expr const &b)
bool is_array() const
Return true if this is a Array expression.
void Z3_API Z3_solver_pop(Z3_context c, Z3_solver s, unsigned n)
Backtrack n backtracking points.
Z3_symbol Z3_API Z3_get_decl_name(Z3_context c, Z3_func_decl d)
Return the constant declaration name as a symbol.
friend probe operator<(probe const &p1, double p2)
symbol str_symbol(char const *s)
Create a Z3 symbol based on the given string.
void Z3_API Z3_func_interp_inc_ref(Z3_context c, Z3_func_interp f)
Increment the reference counter of the given Z3_func_interp object.
friend expr operator<=(expr const &a, int b)
Z3_params Z3_API Z3_mk_params(Z3_context c)
Create a Z3 (empty) parameter set. Starting at Z3 4.0, parameter sets are used to configure many comp...
Z3_tactic Z3_API Z3_tactic_and_then(Z3_context c, Z3_tactic t1, Z3_tactic t2)
Return a tactic that applies t1 to a given goal and t2 to every subgoal produced by t1...
Z3_symbol_kind Z3_API Z3_get_symbol_kind(Z3_context c, Z3_symbol s)
Return Z3_INT_SYMBOL if the symbol was constructed using Z3_mk_int_symbol, and Z3_STRING_SYMBOL if th...
void Z3_API Z3_ast_vector_inc_ref(Z3_context c, Z3_ast_vector v)
Increment the reference counter of the given AST vector.
Z3_string Z3_API Z3_ast_to_string(Z3_context c, Z3_ast a)
Convert the given AST node into a string.
Z3_symbol Z3_API Z3_mk_string_symbol(Z3_context c, Z3_string s)
Create a Z3 symbol using a C string.
tactic cond(probe const &p, tactic const &t1, tactic const &t2)
Z3_ast Z3_API Z3_mk_unary_minus(Z3_context c, Z3_ast arg)
Create an AST node representing -arg.The arguments must have int or real type.
void Z3_API Z3_params_set_uint(Z3_context c, Z3_params p, Z3_symbol k, unsigned v)
Add a unsigned parameter k with value v to the parameter set p.
expr bv_val(int n, unsigned sz)
Z3_ast Z3_API Z3_mk_bvsgt(Z3_context c, Z3_ast t1, Z3_ast t2)
Two's complement signed greater than.
Z3_model Z3_API Z3_apply_result_convert_model(Z3_context c, Z3_apply_result r, unsigned i, Z3_model m)
Convert a model for the subgoal Z3_apply_result_get_subgoal(c, r, i) into a model for the original go...
Z3_lbool Z3_API Z3_optimize_check(Z3_context c, Z3_optimize o)
Check consistency and produce optimal values.
Z3_func_decl Z3_API Z3_model_get_func_decl(Z3_context c, Z3_model m, unsigned i)
Return the declaration of the i-th function in the given model.
Z3_sort Z3_API Z3_mk_int_sort(Z3_context c)
Create the integer type.
bool is_real() const
Return true if this is a real expression.
func_interp & operator=(func_interp const &s)
friend expr operator!=(expr const &a, expr const &b)
Z3_probe Z3_API Z3_probe_gt(Z3_context x, Z3_probe p1, Z3_probe p2)
Return a probe that evaluates to "true" when the value returned by p1 is greater than the value retur...
probe(context &c, double val)
expr select(expr const &a, expr const &i)
Z3_ast Z3_API Z3_mk_store(Z3_context c, Z3_ast a, Z3_ast i, Z3_ast v)
Array update.
func_entry & operator=(func_entry const &s)
Z3_ast Z3_API Z3_mk_const(Z3_context c, Z3_symbol s, Z3_sort ty)
Declare and create a constant.
Z3_ast Z3_API Z3_ast_vector_get(Z3_context c, Z3_ast_vector v, unsigned i)
Return the AST at position i in the AST vector v.
Z3_tactic Z3_API Z3_mk_tactic(Z3_context c, Z3_string name)
Return a tactic associated with the given name. The complete list of tactics may be obtained using th...
tactic when(probe const &p, tactic const &t)
Z3_probe Z3_API Z3_probe_const(Z3_context x, double val)
Return a probe that always evaluates to val.
friend std::ostream & operator<<(std::ostream &out, params const &p)
void Z3_API Z3_stats_dec_ref(Z3_context c, Z3_stats s)
Decrement the reference counter of the given statistics object.
Z3_sort Z3_API Z3_get_array_sort_range(Z3_context c, Z3_sort t)
Return the range of the given array sort.
expr lower(handle const &h)
friend expr operator/(expr const &a, expr const &b)
Z3_probe Z3_API Z3_probe_eq(Z3_context x, Z3_probe p1, Z3_probe p2)
Return a probe that evaluates to "true" when the value returned by p1 is equal to the value returned ...
Z3_ast Z3_API Z3_mk_concat(Z3_context c, Z3_ast t1, Z3_ast t2)
Concatenate the given bit-vectors.
Z3_ast Z3_API Z3_mk_int64(Z3_context c, __int64 v, Z3_sort ty)
Create a numeral of a int, bit-vector, or finite-domain sort.
Z3_solver Z3_API Z3_mk_solver(Z3_context c)
Create a new (incremental) solver. This solver also uses a set of builtin tactics for handling the fi...
A Z3 sort (aka type). Every expression (i.e., formula or term) in Z3 has a sort.
Z3_ast Z3_API Z3_substitute(Z3_context c, Z3_ast a, unsigned num_exprs, Z3_ast const from[], Z3_ast const to[])
Substitute every occurrence of from[i] in a with to[i], for i smaller than num_exprs. The result is the new AST. The arrays from and to must have size num_exprs. For every i smaller than num_exprs, we must have that sort of from[i] must be equal to sort of to[i].
expr simplify() const
Return a simplified version of this expression.
unsigned bv_size() const
Return the size of this Bit-vector sort.
bool is_bv() const
Return true if this sort is a Bit-vector sort.
Z3_ast Z3_API Z3_mk_bvuge(Z3_context c, Z3_ast t1, Z3_ast t2)
Unsigned greater than or equal to.
Z3_ast Z3_API Z3_mk_bvugt(Z3_context c, Z3_ast t1, Z3_ast t2)
Unsigned greater than.
Z3_optimize Z3_API Z3_mk_optimize(Z3_context c)
Create a new optimize context.
void Z3_API Z3_optimize_assert(Z3_context c, Z3_optimize o, Z3_ast a)
Assert hard constraint to the optimization context.
friend expr operator^(expr const &a, expr const &b)
void Z3_API Z3_del_context(Z3_context c)
Delete the given logical context.
Z3_ast Z3_API Z3_mk_app(Z3_context c, Z3_func_decl d, unsigned num_args, Z3_ast const args[])
Create a constant or function application.
friend std::ostream & operator<<(std::ostream &out, ast const &n)
Z3_goal Z3_API Z3_mk_goal(Z3_context c, Z3_bool models, Z3_bool unsat_cores, Z3_bool proofs)
Create a goal (aka problem). A goal is essentially a set of formulas, that can be solved and/or trans...
sort bv_sort(unsigned sz)
Return the Bit-vector sort of size sz. That is, the sort for bit-vectors of size sz.
Z3_func_decl Z3_API Z3_model_get_const_decl(Z3_context c, Z3_model m, unsigned i)
Return the i-th constant in the given model.
void interrupt()
Interrupt the current procedure being executed by any object managed by this context. This is a soft interruption: there is no guarantee the object will actualy stop.
bool is_double(unsigned i) const
expr udiv(expr const &a, expr const &b)
unsigned division operator for bitvectors.
apply_result operator()(goal const &g) const
Z3_ast Z3_API Z3_mk_le(Z3_context c, Z3_ast t1, Z3_ast t2)
Create less than or equal to.
expr upper(handle const &h)
Z3_goal_prec
A Goal is essentially a set of formulas. Z3 provide APIs for building strategies/tactics for solving ...
Z3_error_code
Z3 error codes (See Z3_get_error_code).
goal(context &c, Z3_goal s)
Z3_ast Z3_API Z3_mk_or(Z3_context c, unsigned num_args, Z3_ast const args[])
Create an AST node representing args[0] or ... or args[num_args-1].The array args must have num_args ...
expr eval(expr const &n, bool model_completion=false) const
model(context &c, Z3_model m)
sort array_sort(sort d, sort r)
Return an array sort for arrays from d to r.
expr constant(symbol const &name, sort const &s)
friend probe operator>(double p1, probe const &p2)
Z3_ast Z3_API Z3_func_entry_get_arg(Z3_context c, Z3_func_entry e, unsigned i)
Return an argument of a Z3_func_entry object.
int Z3_bool
Z3 Boolean type. It is just an alias for int.
unsigned Z3_API Z3_get_decl_num_parameters(Z3_context c, Z3_func_decl d)
Return the number of parameters associated with a declaration.
func_decl operator[](int i) const
Z3_bool Z3_API Z3_is_eq_ast(Z3_context c, Z3_ast t1, Z3_ast t2)
compare terms.
System.IntPtr Z3_func_entry
friend probe operator>=(probe const &p1, double p2)
Z3_ast Z3_API Z3_mk_bvule(Z3_context c, Z3_ast t1, Z3_ast t2)
Unsigned less than or equal to.
friend expr operator/(expr const &a, int b)
Z3_probe Z3_API Z3_mk_probe(Z3_context c, Z3_string name)
Return a probe associated with the given name. The complete list of probes may be obtained using the ...
friend expr operator||(bool a, expr const &b)
Return an expression representing a or b. The C++ Boolean value a is automatically converted into a Z...
Z3_string Z3_API Z3_ast_vector_to_string(Z3_context c, Z3_ast_vector v)
Convert AST vector into a string.
friend expr operator||(expr const &a, expr const &b)
Return an expression representing a or b.
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...
bool is_datatype() const
Return true if this is a Datatype expression.
Z3_decl_kind Z3_API Z3_get_decl_kind(Z3_context c, Z3_func_decl d)
Return declaration kind corresponding to declaration.
sort operator()(context &c, Z3_ast a)
friend probe operator||(probe const &p1, probe const &p2)
void Z3_API Z3_optimize_inc_ref(Z3_context c, Z3_optimize d)
Increment the reference counter of the given optimize context.
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.
friend expr operator*(int a, expr const &b)
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...
friend std::ostream & operator<<(std::ostream &out, optimize const &s)
Z3_ast Z3_API Z3_mk_const_array(Z3_context c, Z3_sort domain, Z3_ast v)
Create the constant array.
Z3_ast Z3_API Z3_mk_add(Z3_context c, unsigned num_args, Z3_ast const args[])
Create an AST node representing args[0] + ... + args[num_args-1].The array args must have num_args el...
Exception used to sign API usage errors.
Z3_ast Z3_API Z3_simplify_ex(Z3_context c, Z3_ast a, Z3_params p)
Interface to simplifier.
unsigned uint_value(unsigned i) const
Z3_context Z3_API Z3_mk_context_rc(Z3_config c)
Create a context using the given configuration. This function is similar to Z3_mk_context. However, in the context returned by this function, the user is responsible for managing Z3_ast reference counters. Managing reference counters is a burden and error-prone, but allows the user to use the memory more efficiently. The user must invoke Z3_inc_ref for any Z3_ast returned by Z3, and Z3_dec_ref whenever the Z3_ast is not needed anymore. This idiom is similar to the one used in BDD (binary decision diagrams) packages such as CUDD.
Z3_apply_result Z3_API Z3_tactic_apply(Z3_context c, Z3_tactic t, Z3_goal g)
Apply tactic t to the goal g.
ast_vector_tpl(context &c, Z3_ast_vector v)
A Z3 expression is used to represent formulas and terms. For Z3, a formula is any expression of sort ...
void Z3_API Z3_update_param_value(Z3_context c, Z3_string param_id, Z3_string param_value)
Set a value of a context parameter.
expr & operator=(expr const &n)
void Z3_API Z3_solver_reset(Z3_context c, Z3_solver s)
Remove all assertions from the solver.
unsigned num_exprs() const
bool is_uint(unsigned i) const
expr ule(expr const &a, expr const &b)
unsigned less than or equal to operator for bitvectors.
void Z3_API Z3_ast_vector_resize(Z3_context c, Z3_ast_vector v, unsigned n)
Resize the AST vector v.
expr_vector unsat_core() const
Z3_string Z3_API Z3_stats_get_key(Z3_context c, Z3_stats s, unsigned idx)
Return the key (a string) for a particular statistical data.
Z3_ast Z3_API Z3_get_app_arg(Z3_context c, Z3_app a, unsigned i)
Return the i-th argument of the given application.
unsigned num_entries() const
bool is_finite_domain() const
Return true if this sort is a Finite domain sort.
friend probe operator>(probe const &p1, double p2)
func_decl operator()(context &c, Z3_ast a)
void Z3_API Z3_func_interp_dec_ref(Z3_context c, Z3_func_interp f)
Decrement the reference counter of the given Z3_func_interp object.
ast_vector_tpl< func_decl > func_decl_vector
Z3_stats Z3_API Z3_solver_get_statistics(Z3_context c, Z3_solver s)
Return statistics for the given solver.
void Z3_API Z3_ast_vector_dec_ref(Z3_context c, Z3_ast_vector v)
Decrement the reference counter of the given AST vector.
expr pw(expr const &a, expr const &b)
Z3_func_decl Z3_API Z3_get_app_decl(Z3_context c, Z3_app a)
Return the declaration of a constant or function application.
friend std::ostream & operator<<(std::ostream &out, goal const &g)
friend probe operator>=(probe const &p1, probe const &p2)
expr(context &c, Z3_ast n)
unsigned Z3_API Z3_ast_vector_size(Z3_context c, Z3_ast_vector v)
Return the size of the given AST vector.
friend expr operator^(expr const &a, int b)
expr operator[](int i) const
friend expr operator-(expr const &a, expr const &b)
friend expr operator-(expr const &a)
Z3_error_code Z3_API Z3_get_error_code(Z3_context c)
Return the error code for the last API call.
check_result check(unsigned n, expr *const assumptions)
check_result check(expr_vector assumptions)
friend expr operator*(expr const &a, int b)
friend expr operator&(expr const &a, int b)
friend expr operator*(expr const &a, expr const &b)
probe(context &c, char const *name)
friend std::ostream & operator<<(std::ostream &out, solver const &s)
Z3_ast Z3_API Z3_mk_bvslt(Z3_context c, Z3_ast t1, Z3_ast t2)
Two's complement signed less than.
void Z3_API Z3_optimize_set_params(Z3_context c, Z3_optimize o, Z3_params p)
Set parameters on optimization context.
void Z3_API Z3_solver_assert(Z3_context c, Z3_solver s, Z3_ast a)
Assert a constraint into the solver.
friend expr operator<=(expr const &a, expr const &b)
Z3_tactic Z3_API Z3_tactic_or_else(Z3_context c, Z3_tactic t1, Z3_tactic t2)
Return a tactic that first applies t1 to a given goal, if it fails then returns the result of t2 appl...
expr get_const_interp(func_decl c) const
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.
Z3_ast Z3_API Z3_optimize_get_upper(Z3_context c, Z3_optimize o, unsigned idx)
Retrieve upper bound value or approximation for the i'th optimization objective.
A Context manages all other Z3 objects, global configuration options, etc.
Z3_ast_kind Z3_API Z3_get_ast_kind(Z3_context c, Z3_ast a)
Return the kind of the given AST.
void Z3_API Z3_set_ast_print_mode(Z3_context c, Z3_ast_print_mode mode)
Select mode for the format used for pretty-printing AST nodes.
void Z3_API Z3_solver_inc_ref(Z3_context c, Z3_solver s)
Increment the reference counter of the given solver.
friend tactic operator|(tactic const &t1, tactic const &t2)
Z3_ast Z3_API Z3_mk_bvsdiv(Z3_context c, Z3_ast t1, Z3_ast t2)
Two's complement signed division.
expr simplify(params const &p) const
Return a simplified version of this expression. The parameter p is a set of parameters for the Z3 sim...
Z3_probe Z3_API Z3_probe_not(Z3_context x, Z3_probe p)
Return a probe that evaluates to "true" when p does not evaluate to true.
friend expr operator&(int a, expr const &b)
solver(context &c, Z3_solver s)
Z3_func_decl Z3_API Z3_mk_func_decl(Z3_context c, Z3_symbol s, unsigned domain_size, Z3_sort const domain[], Z3_sort range)
Declare a constant or function.
Z3 global configuration object.
solver & operator=(solver const &s)
expr substitute(expr_vector const &src, expr_vector const &dst)
Apply substitution. Replace src expressions by dst.
ast(context &c, Z3_ast n)
ast_vector_tpl & operator=(ast_vector_tpl const &s)
handle add(expr const &e, char const *weight)
friend std::ostream & operator<<(std::ostream &out, apply_result const &r)
bool is_finite_domain() const
Return true if this is a Finite-domain expression.
expr bv_const(char const *name, unsigned sz)
Z3_ast Z3_API Z3_func_interp_get_else(Z3_context c, Z3_func_interp f)
Return the 'else' value of the given function interpretation.
tactic(context &c, char const *name)
Z3_ast Z3_API Z3_mk_div(Z3_context c, Z3_ast arg1, Z3_ast arg2)
Create an AST node representing arg1 div arg2.The arguments must either both have int type or both ha...
Z3_ast Z3_API Z3_mk_unsigned_int64(Z3_context c, unsigned __int64 v, Z3_sort ty)
Create a numeral of a int, bit-vector, or finite-domain sort.
void Z3_API Z3_probe_inc_ref(Z3_context c, Z3_probe p)
Increment the reference counter of the given probe.
tactic with(tactic const &t, params const &p)
Z3_ast_vector Z3_API Z3_mk_ast_vector(Z3_context c)
Return an empty AST vector.
System.IntPtr Z3_func_decl
Z3_bool Z3_API Z3_goal_is_decided_sat(Z3_context c, Z3_goal g)
Return true if the goal is empty, and it is precise or the product of a under approximation.
friend expr operator<=(int a, expr const &b)
Z3_ast Z3_API Z3_mk_int2real(Z3_context c, Z3_ast t1)
Coerce an integer to a real.
Z3_sort Z3_API Z3_mk_uninterpreted_sort(Z3_context c, Z3_symbol s)
Create a free (uninterpreted) type using the given name (symbol).
sort array_domain() const
Return the domain of this Array sort.
Z3_ast Z3_API Z3_mk_lt(Z3_context c, Z3_ast t1, Z3_ast t2)
Create less than.
Z3_ast_kind
The different kinds of Z3 AST (abstract syntax trees). That is, terms, formulas and types...
unsigned Z3_API Z3_goal_depth(Z3_context c, Z3_goal g)
Return the depth of the given goal. It tracks how many transformations were applied to it...
void Z3_API Z3_apply_result_inc_ref(Z3_context c, Z3_apply_result r)
Increment the reference counter of the given Z3_apply_result object.
void Z3_API Z3_func_entry_inc_ref(Z3_context c, Z3_func_entry e)
Increment the reference counter of the given Z3_func_entry object.
void Z3_API Z3_dec_ref(Z3_context c, Z3_ast a)
Decrement the reference counter of the given AST. The context c should have been created using Z3_mk_...
func_entry(context &c, Z3_func_entry e)
void Z3_API Z3_del_config(Z3_config c)
Delete the given configuration object.
bool is_var() const
Return true if this expression is a variable.
expr extract(unsigned hi, unsigned lo) const
void add(expr const &e, char const *p)
func_decl to_func_decl(context &c, Z3_func_decl f)
BEGIN_MLAPI_EXCLUDE Z3_string Z3_API Z3_get_error_msg_ex(Z3_context c, Z3_error_code err)
Return a string describing the given error code.
sort array_range() const
Return the range of this Array sort.
void Z3_API Z3_optimize_push(Z3_context c, Z3_optimize d)
Create a backtracking point.
Z3_ast Z3_API Z3_mk_not(Z3_context c, Z3_ast a)
Create an AST node representing not(a).
Z3_ast Z3_API Z3_mk_and(Z3_context c, unsigned num_args, Z3_ast const args[])
Create an AST node representing args[0] and ... and args[num_args-1].The array args must have num_arg...
Z3_ast Z3_API Z3_substitute_vars(Z3_context c, Z3_ast a, unsigned num_exprs, Z3_ast const to[])
Substitute the free variables in a with the expressions in to. For every i smaller than num_exprs...
Z3_ast Z3_API Z3_mk_ge(Z3_context c, Z3_ast t1, Z3_ast t2)
Create greater than or equal to.
unsigned Z3_API Z3_get_bv_sort_size(Z3_context c, Z3_sort t)
Return the size of the given bit-vector sort.
Z3_ast Z3_API Z3_optimize_get_lower(Z3_context c, Z3_optimize o, unsigned idx)
Retrieve lower bound value or approximation for the i'th optimization objective.
Z3_sort Z3_API Z3_mk_array_sort(Z3_context c, Z3_sort domain, Z3_sort range)
Create an array type.
unsigned Z3_API Z3_stats_size(Z3_context c, Z3_stats s)
Return the number of statistical data in s.
std::string to_smt2(char const *status="unknown")
Z3_goal_prec Z3_API Z3_goal_precision(Z3_context c, Z3_goal g)
Return the "precision" of the given goal. Goals can be transformed using over and under approximation...
func_decl get_func_decl(unsigned i) const
func_decl function(symbol const &name, unsigned arity, sort const *domain, sort const &range)
expr operator()(context &c, Z3_ast a)
Z3_ast Z3_API Z3_mk_bvsge(Z3_context c, Z3_ast t1, Z3_ast t2)
Two's complement signed greater than or equal to.
friend probe operator!(probe const &p)
bool is_numeral() const
Return true if this expression is a numeral.
Z3_ast Z3_API Z3_mk_real(Z3_context c, int num, int den)
Create a real from a fraction.
unsigned Z3_API Z3_get_ast_hash(Z3_context c, Z3_ast a)
Return a hash code for the given AST. The hash code is structural. You can use Z3_get_ast_id intercha...
Z3_string Z3_API Z3_params_to_string(Z3_context c, Z3_params p)
Convert a parameter set into a string. This function is mainly used for printing the contents of a pa...
Z3_ast Z3_API Z3_mk_bvsle(Z3_context c, Z3_ast t1, Z3_ast t2)
Two's complement signed less than or equal to.
Z3_string Z3_API Z3_optimize_to_string(Z3_context c, Z3_optimize o)
Print the current context as a string.
Z3_ast Z3_API Z3_mk_exists_const(Z3_context c, unsigned weight, unsigned num_bound, Z3_app const bound[], unsigned num_patterns, Z3_pattern const patterns[], Z3_ast body)
Similar to Z3_mk_forall_const.
exception(char const *msg)
Z3_lbool
Lifted Boolean type: false, undefined, true.
unsigned Z3_API Z3_get_app_num_args(Z3_context c, Z3_app a)
Return the number of argument of an application. If t is an constant, then the number of arguments is...
friend expr operator!=(expr const &a, int b)
void Z3_API Z3_goal_dec_ref(Z3_context c, Z3_goal g)
Decrement the reference counter of the given goal.
expr real_val(int n, int d)
ast_vector_tpl< sort > sort_vector
void Z3_API Z3_set_error_handler(Z3_context c, Z3_error_handler h)
Register a Z3 error handler.
func_interp(func_interp const &s)
Z3_decl_kind decl_kind() const
Z3_func_interp Z3_API Z3_model_get_func_interp(Z3_context c, Z3_model m, Z3_func_decl f)
Return the interpretation of the function f in the model m. Return NULL, if the model does not assign...
model & operator=(model const &s)
friend expr operator-(int a, expr const &b)
void Z3_API Z3_model_dec_ref(Z3_context c, Z3_model m)
Decrement the reference counter of the given model.
friend expr operator==(expr const &a, expr const &b)
unsigned Z3_API Z3_model_get_num_consts(Z3_context c, Z3_model m)
Return the number of constants assigned by the given model.
func_entry entry(unsigned i) const
Z3_ast Z3_API Z3_model_get_const_interp(Z3_context c, Z3_model m, Z3_func_decl a)
Return the interpretation (i.e., assignment) of constant a in the model m. Return NULL...
bool is_relation() const
Return true if this is a Relation expression.
unsigned Z3_API Z3_goal_size(Z3_context c, Z3_goal g)
Return the number of formulas in the given goal.
bool is_bool() const
Return true if this sort is the Boolean sort.
expr ugt(expr const &a, expr const &b)
unsigned greater than operator for bitvectors.
goal & operator=(goal const &s)
Z3_sort Z3_API Z3_get_array_sort_domain(Z3_context c, Z3_sort t)
Return the domain of the given array sort.
expr const_array(sort const &d, expr const &v)
Z3_bool Z3_API Z3_stats_is_uint(Z3_context c, Z3_stats s, unsigned idx)
Return Z3_TRUE if the given statistical data is a unsigned integer.
friend std::ostream & operator<<(std::ostream &out, model const &m)
int Z3_API Z3_get_symbol_int(Z3_context c, Z3_symbol s)
Return the symbol int value.
void Z3_API Z3_params_dec_ref(Z3_context c, Z3_params p)
Decrement the reference counter of the given parameter set.
void Z3_API Z3_optimize_dec_ref(Z3_context c, Z3_optimize d)
Decrement the reference counter of the given optimize context.
sort uninterpreted_sort(char const *name)
create an uninterpreted sort with the name given by the string or symbol.
double Z3_API Z3_probe_apply(Z3_context c, Z3_probe p, Z3_goal g)
Execute the probe over the goal. The probe always produce a double value. "Boolean" probes return 0...
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...
goal operator[](int i) const
friend expr operator<(expr const &a, int b)
friend probe operator==(probe const &p1, double p2)
friend expr operator<(int a, expr const &b)
Z3_ast Z3_API Z3_func_entry_get_value(Z3_context c, Z3_func_entry e)
Return the value of this point.
unsigned Z3_API Z3_stats_get_uint_value(Z3_context c, Z3_stats s, unsigned idx)
Return the unsigned value of the given statistical data.
void set_param(char const *param, char const *value)
unsigned Z3_API Z3_optimize_assert_soft(Z3_context c, Z3_optimize o, Z3_ast a, Z3_string weight, Z3_symbol id)
Assert soft constraint to the optimization context.
Z3_ast Z3_API Z3_mk_bvult(Z3_context c, Z3_ast t1, Z3_ast t2)
Unsigned less than.
Z3_string Z3_API Z3_goal_to_string(Z3_context c, Z3_goal g)
Convert a goal into a string.
handle maximize(expr const &e)
unsigned Z3_API Z3_model_get_num_funcs(Z3_context c, Z3_model m)
Return the number of function interpretations in the given model.
func_decl decl() const
Return the declaration associated with this application. This method assumes the expression is an app...
friend probe operator<=(probe const &p1, probe const &p2)
friend expr operator&&(expr const &a, expr const &b)
Return an expression representing a and b.
expr int_const(char const *name)
friend expr operator&(expr const &a, expr const &b)
friend std::ostream & operator<<(std::ostream &out, exception const &e)
expr arg(unsigned i) const
Z3_bool Z3_API Z3_model_eval(Z3_context c, Z3_model m, Z3_ast t, Z3_bool model_completion, Z3_ast *v)
Evaluate the AST node t in the given model. Return Z3_TRUE if succeeded, and store the result in v...
unsigned Z3_API Z3_func_entry_get_num_args(Z3_context c, Z3_func_entry e)
Return the number of arguments in a Z3_func_entry object.
unsigned num_args() const
Return the number of arguments in this application. This method assumes the expression is an applicat...
Z3_symbol_kind
The different kinds of symbol. In Z3, a symbol can be represented using integers and strings (See Z3_...
Z3_ast Z3_API Z3_simplify(Z3_context c, Z3_ast a)
Interface to simplifier.
friend expr operator&&(expr const &a, bool b)
Return an expression representing a and b. The C++ Boolean value b is automatically converted into a ...
Z3_model Z3_API Z3_optimize_get_model(Z3_context c, Z3_optimize o)
Retrieve the model for the last Z3_optimize_check.
goal(context &c, bool models=true, bool unsat_cores=false, bool proofs=false)
System.IntPtr Z3_apply_result
void Z3_API Z3_interrupt(Z3_context c)
Interrupt the execution of a Z3 procedure. This procedure can be used to interrupt: solvers...
bool is_app() const
Return true if this expression is an application.
friend tactic operator&(tactic const &t1, tactic const &t2)
friend expr operator>(expr const &a, expr const &b)
handle add(expr const &e, unsigned weight)
Z3_symbol_kind kind() const
Z3_ast Z3_API Z3_mk_bvor(Z3_context c, Z3_ast t1, Z3_ast t2)
Bitwise or.
friend expr operator!=(int a, expr const &b)
expr real_const(char const *name)
friend probe operator<=(double p1, probe const &p2)
friend expr operator/(int a, expr const &b)
friend expr operator>(int a, expr const &b)
func_interp get_func_interp(func_decl f) const
friend probe operator==(probe const &p1, probe const &p2)
friend probe operator>=(double p1, probe const &p2)
Z3_tactic Z3_API Z3_tactic_using_params(Z3_context c, Z3_tactic t, Z3_params p)
Return a tactic that applies t using the given set of parameters.
Z3_string Z3_API Z3_solver_to_string(Z3_context c, Z3_solver s)
Convert a solver into a string.
Z3_sort_kind sort_kind() const
Return the internal sort kind.
bool is_arith() const
Return true if this sort is the Integer or Real sort.
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_sort Z3_API Z3_get_domain(Z3_context c, Z3_func_decl d, unsigned i)
Return the sort of the i-th parameter of the given function declaration.
void Z3_API Z3_optimize_pop(Z3_context c, Z3_optimize d)
Backtrack one level.
Z3_sort Z3_API Z3_mk_real_sort(Z3_context c)
Create the real type.
model convert_model(model const &m, unsigned i=0) const
bool is_well_sorted() const
Return true if this expression is well sorted (aka type correct).
Z3_config Z3_API Z3_mk_config(void)
Create a configuration object for the Z3 context object.
symbol & operator=(symbol const &s)
sort real_sort()
Return the Real sort.
unsigned Z3_API Z3_goal_num_exprs(Z3_context c, Z3_goal g)
Return the number of formulas, subformulas and terms in the given goal.
friend std::ostream & operator<<(std::ostream &out, ast_vector_tpl const &v)
Z3_sort Z3_API Z3_get_range(Z3_context c, Z3_func_decl d)
Return the range of the given declaration.
bool inconsistent() const
bool is_const() const
Return true if this expression is a constant (i.e., an application with 0 arguments).
expr arg(unsigned i) const
Return the i-th argument of this application. This method assumes the expression is an application...
ast_vector_tpl(ast_vector_tpl const &s)
expr num_val(int n, sort const &s)
bool eq(ast const &a, ast const &b)
Z3_string Z3_API Z3_stats_to_string(Z3_context c, Z3_stats s)
Convert a statistics into a string.
symbol int_symbol(int n)
Create a Z3 symbol based on the given integer.
unsigned num_consts() const
Z3_tactic Z3_API Z3_tactic_repeat(Z3_context c, Z3_tactic t, unsigned max)
Return a tactic that keeps applying t until the goal is not modified anymore or the maximum number of...
Z3_stats Z3_API Z3_optimize_get_statistics(Z3_context c, Z3_optimize d)
Retrieve statistics information from the last call to Z3_optimize_check.
Z3_ast Z3_API Z3_mk_gt(Z3_context c, Z3_ast t1, Z3_ast t2)
Create greater than.
friend probe operator>(probe const &p1, probe const &p2)
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...
friend probe operator<(double p1, probe const &p2)
unsigned num_funcs() const
friend probe operator==(double p1, probe const &p2)
Z3_tactic Z3_API Z3_tactic_cond(Z3_context c, Z3_probe p, Z3_tactic t1, Z3_tactic t2)
Return a tactic that applies t1 to a given goal if the probe p evaluates to true, and t2 if p evaluat...
Z3_ast Z3_API Z3_mk_sub(Z3_context c, unsigned num_args, Z3_ast const args[])
Create an AST node representing args[0] - ... - args[num_args - 1].The array args must have num_args ...
check_result to_check_result(Z3_lbool l)
friend expr operator~(expr const &a)
Z3_ast Z3_API Z3_mk_power(Z3_context c, Z3_ast arg1, Z3_ast arg2)
Create an AST node representing arg1^arg2.
Z3_ast Z3_API Z3_mk_implies(Z3_context c, Z3_ast t1, Z3_ast t2)
Create an AST node representing t1 implies t2.
Z3_tactic Z3_API Z3_tactic_try_for(Z3_context c, Z3_tactic t, unsigned ms)
Return a tactic that applies t to a given goal for ms milliseconds. If t does not terminate in ms mil...
void Z3_API Z3_set_param_value(Z3_config c, Z3_string param_id, Z3_string param_value)
Set a configuration parameter.
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...
T operator[](int i) const
Z3_ast Z3_API Z3_mk_bvnot(Z3_context c, Z3_ast t1)
Bitwise negation.
tactic(context &c, Z3_tactic s)
void check_context(object const &a, object const &b)
Z3_probe Z3_API Z3_probe_lt(Z3_context x, Z3_probe p1, Z3_probe p2)
Return a probe that evaluates to "true" when the value returned by p1 is less than the value returned...
expr bool_const(char const *name)
void Z3_API Z3_params_set_double(Z3_context c, Z3_params p, Z3_symbol k, double v)
Add a double parameter k with value v to the parameter set p.
void Z3_API Z3_goal_assert(Z3_context c, Z3_goal g, Z3_ast a)
Add a new formula a to the given goal.
Z3_tactic Z3_API Z3_tactic_fail_if(Z3_context c, Z3_probe p)
Return a tactic that fails if the probe p evaluates to false.
double apply(goal const &g) const
Z3_string Z3_API Z3_optimize_get_help(Z3_context c, Z3_optimize t)
Return a string containing a description of parameters accepted by optimize.
Z3_string Z3_API Z3_get_symbol_string(Z3_context c, Z3_symbol s)
Return the symbol name.
Z3_goal Z3_API Z3_apply_result_get_subgoal(Z3_context c, Z3_apply_result r, unsigned i)
Return one of the subgoals in the Z3_apply_result object returned by Z3_tactic_apply.
params & operator=(params const &s)
friend std::ostream & operator<<(std::ostream &out, symbol const &s)
Z3_sort_kind Z3_API Z3_get_sort_kind(Z3_context c, Z3_sort t)
Return the sort kind (e.g., array, tuple, int, bool, etc).
friend expr operator>(expr const &a, int b)
friend expr operator<(expr const &a, expr const &b)
friend expr operator!(expr const &a)
Return an expression representing not(a).
Z3_goal_prec precision() const
void Z3_API Z3_apply_result_dec_ref(Z3_context c, Z3_apply_result r)
Decrement the reference counter of the given Z3_apply_result object.
Z3_ast Z3_API Z3_mk_bvsub(Z3_context c, Z3_ast t1, Z3_ast t2)
Standard two's complement subtraction.
func_decl(context &c, Z3_func_decl n)
Z3_ast Z3_API Z3_mk_bvand(Z3_context c, Z3_ast t1, Z3_ast t2)
Bitwise and.
ast_vector_tpl< ast > ast_vector
bool is_decided_unsat() const
Z3_ast Z3_API Z3_mk_int(Z3_context c, int v, Z3_sort ty)
Create a numeral of an int, bit-vector, or finite-domain sort.
handle minimize(expr const &e)
friend probe operator<(probe const &p1, probe const &p2)
friend expr operator==(expr const &a, int b)
expr_vector assertions() const
void Z3_API Z3_goal_inc_ref(Z3_context c, Z3_goal g)
Increment the reference counter of the given goal.
sort get_sort() const
Return the sort of this expression.
friend probe operator&&(probe const &p1, probe const &p2)
void add(expr const &e, expr const &p)
Z3_bool Z3_API Z3_goal_is_decided_unsat(Z3_context c, Z3_goal g)
Return true if the goal contains false, and it is precise or the product of an over approximation...
Z3_ast Z3_API Z3_get_quantifier_body(Z3_context c, Z3_ast a)
Return body of quantifier.
expr store(expr const &a, expr const &i, expr const &v)
Z3_sort Z3_API Z3_mk_bool_sort(Z3_context c)
Create the Boolean type.
void check_error() const
Auxiliary method used to check for API usage errors.
std::string key(unsigned i) const
bool is_relation() const
Return true if this sort is a Relation sort.
Z3_ast Z3_API Z3_mk_bvudiv(Z3_context c, Z3_ast t1, Z3_ast t2)
Unsigned division.
tactic repeat(tactic const &t, unsigned max=UINT_MAX)
expr ult(expr const &a, expr const &b)
unsigned less than operator for bitvectors.
friend expr operator&&(bool a, expr const &b)
Return an expression representing a and b. The C++ Boolean value a is automatically converted into a ...
void Z3_API Z3_params_inc_ref(Z3_context c, Z3_params p)
Increment the reference counter of the given parameter set.
Z3_ast Z3_API Z3_mk_forall_const(Z3_context c, unsigned weight, unsigned num_bound, Z3_app const bound[], unsigned num_patterns, Z3_pattern const patterns[], Z3_ast body)
Create a universal quantifier using a list of constants that will form the set of bound variables...
Z3_string Z3_API Z3_tactic_get_help(Z3_context c, Z3_tactic t)
Return a string containing a description of parameters accepted by the given tactic.
void Z3_API Z3_params_set_symbol(Z3_context c, Z3_params p, Z3_symbol k, Z3_symbol v)
Add a symbol parameter k with value v to the parameter set p.
bool is_int() const
Return true if this is an integer expression.
apply_result apply(goal const &g) const
bool is_arith() const
Return true if this is an integer or real expression.
void Z3_API Z3_global_param_reset_all(void)
Restore the value of all global (and module) parameters. This command will not affect already created...
void Z3_API Z3_model_inc_ref(Z3_context c, Z3_model m)
Increment the reference counter of the given model.
unsigned Z3_API Z3_optimize_minimize(Z3_context c, Z3_optimize o, Z3_ast t)
Add a minimization constraint.
func_decl(func_decl const &s)
Z3_ast Z3_API Z3_mk_eq(Z3_context c, Z3_ast l, Z3_ast r)
Create an AST node representing l = r.
friend expr operator||(expr const &a, bool b)
Return an expression representing a or b. The C++ Boolean value b is automatically converted into a Z...
tactic fail_if(probe const &p)
stats(context &c, Z3_stats e)
expr exists(expr const &x, expr const &b)
ast operator()(context &c, Z3_ast a)
Z3_symbol Z3_API Z3_mk_int_symbol(Z3_context c, int i)
Create a Z3 symbol using an integer.
Z3_ast Z3_API Z3_mk_bvmul(Z3_context c, Z3_ast t1, Z3_ast t2)
Standard two's complement multiplication.
bool is_array() const
Return true if this sort is a Array sort.
unsigned Z3_API Z3_func_interp_get_num_entries(Z3_context c, Z3_func_interp f)
Return the number of entries in the given function interpretation.
friend expr operator-(expr const &a, int b)
expr ite(expr const &c, expr const &t, expr const &e)
Create the if-then-else expression ite(c, t, e)
T const & operator[](int i) const
func_entry(func_entry const &s)
Z3_ast Z3_API Z3_mk_extract(Z3_context c, unsigned high, unsigned low, Z3_ast t1)
Extract the bits high down to low from a bitvector of size m to yield a new bitvector of size n...
double double_value(unsigned i) const
Z3_ast Z3_API Z3_mk_bvneg(Z3_context c, Z3_ast t1)
Standard two's complement unary minus.
expr body() const
Return the 'body' of this quantifier.
#define Z3_FALSE
False value. It is just an alias for 0.
double Z3_API Z3_stats_get_double_value(Z3_context c, Z3_stats s, unsigned idx)
Return the double value of the given statistical data.
ast & operator=(ast const &s)
bool is_bv() const
Return true if this is a Bit-vector expression.
expr forall(expr const &x, expr const &b)
sort domain(unsigned i) const
bool is_bool() const
Return true if this is a Boolean expression.
sort(context &c, Z3_sort s)
double operator()(goal const &g) const
Z3_ast Z3_API Z3_mk_bvxor(Z3_context c, Z3_ast t1, Z3_ast t2)
Bitwise exclusive-or.
Z3_ast Z3_API Z3_mk_ite(Z3_context c, Z3_ast t1, Z3_ast t2, Z3_ast t3)
Create an AST node representing an if-then-else: ite(t1, t2, t3).
bool is_datatype() const
Return true if this sort is a Datatype sort.
Z3_solver Z3_API Z3_mk_solver_from_tactic(Z3_context c, Z3_tactic t)
Create a new solver that is implemented using the given tactic. The solver supports the commands Z3_s...
Z3_func_entry Z3_API Z3_func_interp_get_entry(Z3_context c, Z3_func_interp f, unsigned i)
Return a "point" of the given function intepretation. It represents the value of f in a particular po...
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.
expr to_expr(context &c, Z3_ast a)
Wraps a Z3_ast as an expr object. It also checks for errors. This function allows the user to use the...
friend expr operator+(int a, expr const &b)
expr concat(expr const &a, expr const &b)
symbol(context &c, Z3_symbol s)
int Z3_API Z3_get_decl_int_parameter(Z3_context c, Z3_func_decl d, unsigned idx)
Return the integer value associated with an integer parameter.
solver(context &c, char const *logic)
tactic try_for(tactic const &t, unsigned ms)
func_interp(context &c, Z3_func_interp e)
unsigned Z3_API Z3_get_arity(Z3_context c, Z3_func_decl d)
Alias for Z3_get_domain_size.
Z3_sort Z3_API Z3_get_sort(Z3_context c, Z3_ast a)
Return the sort of an AST node.
void push_back(T const &e)
System.IntPtr Z3_ast_vector
ast_vector_tpl< expr > expr_vector
void Z3_API Z3_params_set_bool(Z3_context c, Z3_params p, Z3_symbol k, Z3_bool v)
Add a Boolean parameter k with value v to the parameter set p.
void Z3_API Z3_probe_dec_ref(Z3_context c, Z3_probe p)
Decrement the reference counter of the given probe.
expr uge(expr const &a, expr const &b)
unsigned greater than or equal to operator for bitvectors.
expr implies(expr const &a, bool b)
friend expr operator+(expr const &a, int b)
Z3_ast Z3_API Z3_goal_formula(Z3_context c, Z3_goal g, unsigned idx)
Return a formula from the given goal.
sort & operator=(sort const &s)
Return true if this sort and s are equal.
bool is_quantifier() const
Return true if this expression is a quantifier.
friend probe operator<=(probe const &p1, double p2)
friend expr operator|(expr const &a, int b)
friend std::ostream & operator<<(std::ostream &out, stats const &s)
expr to_real(expr const &a)
friend expr operator>=(int a, expr const &b)
Z3_ast Z3_API Z3_mk_bvadd(Z3_context c, Z3_ast t1, Z3_ast t2)
Standard two's complement addition.
friend expr implies(expr const &a, expr const &b)
Z3_bool Z3_API Z3_is_well_sorted(Z3_context c, Z3_ast t)
Return true if the given expression t is well sorted.
void Z3_API Z3_solver_dec_ref(Z3_context c, Z3_solver s)
Decrement the reference counter of the given solver.
void Z3_API Z3_inc_ref(Z3_context c, Z3_ast a)
Increment the reference counter of the given AST. The context c should have been created using Z3_mk_...
sort enumeration_sort(char const *name, unsigned n, char const *const *enum_names, func_decl_vector &cs, func_decl_vector &ts)
Return an enumeration sort: enum_names[0], ..., enum_names[n-1]. cs and ts are output parameters...
Z3_ast Z3_API Z3_mk_numeral(Z3_context c, Z3_string numeral, Z3_sort ty)
Create a numeral of a given sort.
friend expr operator==(int a, expr const &b)
friend expr operator|(int a, expr const &b)
void Z3_API Z3_func_entry_dec_ref(Z3_context c, Z3_func_entry e)
Decrement the reference counter of the given Z3_func_entry object.
Z3_bool Z3_API Z3_stats_is_double(Z3_context c, Z3_stats s, unsigned idx)
Return Z3_TRUE if the given statistical data is a double.
Z3_decl_kind
The different kinds of interpreted function kinds.
unsigned Z3_API Z3_optimize_maximize(Z3_context c, Z3_optimize o, Z3_ast t)
Add a maximization constraint.
Z3_ast Z3_API Z3_mk_select(Z3_context c, Z3_ast a, Z3_ast i)
Array read. The argument a is the array and i is the index of the array that gets read...
apply_result(context &c, Z3_apply_result s)
unsigned Z3_API Z3_apply_result_get_num_subgoals(Z3_context c, Z3_apply_result r)
Return the number of subgoals in the Z3_apply_result object returned by Z3_tactic_apply.
friend expr operator^(int a, expr const &b)
Function declaration (aka function definition). It is the signature of interpreted and uninterpreted ...
Z3_probe Z3_API Z3_probe_or(Z3_context x, Z3_probe p1, Z3_probe p2)
Return a probe that evaluates to "true" when p1 or p2 evaluates to true.
sort int_sort()
Return the integer sort.
void Z3_API Z3_tactic_dec_ref(Z3_context c, Z3_tactic g)
Decrement the reference counter of the given tactic.
stats & operator=(stats const &s)
Z3_sort Z3_API Z3_mk_enumeration_sort(Z3_context c, Z3_symbol name, unsigned n, Z3_symbol const enum_names[], Z3_func_decl enum_consts[], Z3_func_decl enum_testers[])
Create a enumeration sort.
unsigned num_args() const
func_decl & operator=(func_decl const &s)
apply_result & operator=(apply_result const &s)
void Z3_API Z3_ast_vector_push(Z3_context c, Z3_ast_vector v, Z3_ast a)
Add the AST a in the end of the AST vector v. The size of v is increased by one.
System.IntPtr Z3_func_interp
bool is_real() const
Return true if this sort is the Real sort.
sort to_sort(context &c, Z3_sort s)
bool is_decided_sat() const
Z3_string Z3_API Z3_model_to_string(Z3_context c, Z3_model m)
Convert the given model into a string.
const char * Z3_string
Z3 string type. It is just an alias for const char *.
apply_result(apply_result const &s)