Z3
Loading...
Searching...
No Matches
context Class Reference

A Context manages all other Z3 objects, global configuration options, etc. More...

#include <z3++.h>

Public Member Functions

 context ()
 context (config &c)
 context (context &&other) noexcept
context & operator= (context &&other) noexcept
 ~context ()
 operator Z3_context () const
Z3_error_code check_error () const
 Auxiliary method used to check for API usage errors.
void check_parser_error () const
void set_enable_exceptions (bool f)
 The C++ API uses by defaults exceptions on errors. For applications that don't work well with exceptions (there should be only few) you have the ability to turn off exceptions. The tradeoffs are that applications have to be very careful about using check_error() after calls that may result in an erroneous state.
bool enable_exceptions () const
void set (char const *param, char const *value)
 Update global parameter param with string value.
void set (char const *param, bool value)
 Update global parameter param with Boolean value.
unsigned num_simplifiers () const
std::string simplifier_name (unsigned i) const
std::string simplifier_description (char const *name) const
void set (char const *param, int value)
 Update global parameter param with Integer value.
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 actually stop.
symbol str_symbol (char const *s)
 Create a Z3 symbol based on the given string.
symbol int_symbol (int n)
 Create a Z3 symbol based on the given integer.
sort bool_sort ()
 Return the Boolean sort.
sort int_sort ()
 Return the integer sort.
sort real_sort ()
 Return the Real sort.
sort finite_field_sort (char const *prime)
 Return the prime finite-field sort with the given decimal modulus.
sort bv_sort (unsigned sz)
 Return the Bit-vector sort of size sz. That is, the sort for bit-vectors of size sz.
sort char_sort ()
 Return the sort for Unicode characters.
sort string_sort ()
 Return the sort for Unicode strings.
sort seq_sort (sort &s)
 Return a sequence sort over base sort s.
sort re_sort (sort &seq_sort)
 Return a regular expression sort over sequences seq_sort.
sort finite_set_sort (sort &s)
 Return a finite set sort over element sort s.
sort array_sort (sort d, sort r)
 Return an array sort for arrays from d to r.
sort array_sort (sort_vector const &d, sort r)
sort fpa_sort (unsigned ebits, unsigned sbits)
 Return a floating point sort. ebits is a number of exponent bits, sbits is a number of significand bits,.
template<size_t precision>
sort fpa_sort ()
 Return a FloatingPoint sort with given precision bitwidth (16, 32, 64 or 128).
sort fpa_rounding_mode_sort ()
 Return a RoundingMode sort.
void set_rounding_mode (rounding_mode rm)
 Sets RoundingMode of FloatingPoints.
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. The method stores in cs the constants corresponding to the enumerated elements, and in ts the predicates for testing if terms of the enumeration sort correspond to an enumeration.
func_decl tuple_sort (char const *name, unsigned n, char const *const *names, sort const *sorts, func_decl_vector &projs)
 Return a tuple constructor. name is the name of the returned constructor, n are the number of arguments, names and sorts are their projected sorts. projs is an output parameter. It contains the set of projection functions.
sort datatype (symbol const &name, constructors const &cs)
 Create a recursive datatype over a single sort. name is the name of the recursive datatype n - the number of constructors of the datatype cs - the n constructors used to define the datatype.
sort datatype (symbol const &name, sort_vector const &params, constructors const &cs)
 Create a parametric recursive datatype. name is the name of the recursive datatype params - the sort parameters of the datatype cs - the n constructors used to define the datatype References to the datatype and mutually recursive datatypes can be created using datatype_sort.
sort_vector datatypes (unsigned n, symbol const *names, constructor_list *const *cons)
 Create a set of mutually recursive datatypes. n - number of recursive datatypes names - array of names of length n cons - array of constructor lists of length n.
sort datatype_sort (symbol const &name)
 a reference to a recursively defined datatype. Expect that it gets defined as a datatype.
sort datatype_sort (symbol const &name, sort_vector const &params)
 a reference to a recursively defined parametric datatype. Expect that it gets defined as a datatype.
sort uninterpreted_sort (char const *name)
 create an uninterpreted sort with the name given by the string or symbol.
sort uninterpreted_sort (symbol const &name)
func_decl function (symbol const &name, unsigned arity, sort const *domain, sort const &range)
func_decl function (char const *name, unsigned arity, sort const *domain, sort const &range)
func_decl function (symbol const &name, sort_vector const &domain, sort const &range)
func_decl function (char const *name, sort_vector const &domain, sort const &range)
func_decl function (char const *name, sort const &domain, sort const &range)
func_decl function (char const *name, sort const &d1, sort const &d2, sort const &range)
func_decl function (char const *name, sort const &d1, sort const &d2, sort const &d3, sort const &range)
func_decl function (char const *name, sort const &d1, sort const &d2, sort const &d3, sort const &d4, sort const &range)
func_decl function (char const *name, sort const &d1, sort const &d2, sort const &d3, sort const &d4, sort const &d5, sort const &range)
func_decl recfun (symbol const &name, unsigned arity, sort const *domain, sort const &range)
func_decl recfun (symbol const &name, const sort_vector &domain, sort const &range)
func_decl recfun (char const *name, sort_vector const &domain, sort const &range)
func_decl recfun (char const *name, unsigned arity, sort const *domain, sort const &range)
func_decl recfun (char const *name, sort const &domain, sort const &range)
func_decl recfun (char const *name, sort const &d1, sort const &d2, sort const &range)
void recdef (func_decl decl, expr_vector const &args, expr const &body)
 add function definition body to declaration decl. decl needs to be declared using context::recfun.
func_decl user_propagate_function (symbol const &name, sort_vector const &domain, sort const &range)
expr constant (symbol const &name, sort const &s)
 create an uninterpreted constant.
expr constant (char const *name, sort const &s)
expr bool_const (char const *name)
 create uninterpreted constants of a given sort.
expr int_const (char const *name)
expr real_const (char const *name)
expr string_const (char const *name)
expr bv_const (char const *name, unsigned sz)
expr fpa_const (char const *name, unsigned ebits, unsigned sbits)
template<size_t precision>
expr fpa_const (char const *name)
expr variable (unsigned index, sort const &s)
 create a de-Bruijn variable.
expr fpa_rounding_mode ()
expr bool_val (bool b)
expr int_val (int n)
expr int_val (unsigned n)
expr int_val (int64_t n)
expr int_val (uint64_t n)
expr int_val (char const *n)
expr real_val (int n)
expr real_val (unsigned n)
expr real_val (int64_t n)
expr real_val (uint64_t n)
expr real_val (int64_t n, int64_t d)
expr real_val (char const *n)
expr bv_val (int n, unsigned sz)
expr bv_val (unsigned n, unsigned sz)
expr bv_val (int64_t n, unsigned sz)
expr bv_val (uint64_t n, unsigned sz)
expr bv_val (char const *n, unsigned sz)
expr bv_val (unsigned n, bool const *bits)
expr fpa_val (double n)
expr fpa_val (float n)
expr fpa_nan (sort const &s)
expr fpa_inf (sort const &s, bool sgn)
expr string_val (char const *s)
expr string_val (char const *s, unsigned n)
expr string_val (std::string const &s)
expr string_val (std::u32string const &s)
expr num_val (int n, sort const &s)
expr_vector parse_string (char const *s)
 parsing
expr_vector parse_file (char const *file)
expr_vector parse_string (char const *s, sort_vector const &sorts, func_decl_vector const &decls)
expr_vector parse_file (char const *s, sort_vector const &sorts, func_decl_vector const &decls)
template<>
sort fpa_sort ()
template<>
sort fpa_sort ()
template<>
sort fpa_sort ()
template<>
sort fpa_sort ()

Friends

class user_propagator_base

Detailed Description

A Context manages all other Z3 objects, global configuration options, etc.

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

Constructor & Destructor Documentation

◆ context() [1/3]

context ( )
inline

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

215{ config c; init(c); }

◆ context() [2/3]

context ( config & c)
inline

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

216{ init(c); }

◆ context() [3/3]

context ( context && other)
inlinenoexcept

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

219 : m_enable_exceptions(other.m_enable_exceptions),
220 m_rounding_mode(other.m_rounding_mode),
221 m_ctx(other.m_ctx) {
222 other.m_ctx = nullptr;
223 }

◆ ~context()

~context ( )
inline

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

235{ if (m_ctx) Z3_del_context(m_ctx); }
void Z3_API Z3_del_context(Z3_context c)
Delete the given logical context.

Member Function Documentation

◆ array_sort() [1/2]

sort array_sort ( sort d,
sort r )
inline

Return an array sort for arrays from d to r.

Example: Given a context c, c.array_sort(c.int_sort(), c.bool_sort()) is an array sort from integer to Boolean.

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

3880{ Z3_sort s = Z3_mk_array_sort(m_ctx, d, r); check_error(); return sort(*this, s); }
Z3_sort Z3_API Z3_mk_array_sort(Z3_context c, Z3_sort domain, Z3_sort range)
Create an array type.

◆ array_sort() [2/2]

sort array_sort ( sort_vector const & d,
sort r )
inline

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

3881 {
3882 array<Z3_sort> dom(d);
3883 Z3_sort s = Z3_mk_array_sort_n(m_ctx, dom.size(), dom.ptr(), r); check_error(); return sort(*this, s);
3884 }
Z3_sort Z3_API Z3_mk_array_sort_n(Z3_context c, unsigned n, Z3_sort const *domain, Z3_sort range)
Create an array type with N arguments.

◆ bool_const()

expr bool_const ( char const * name)
inline

create uninterpreted constants of a given sort.

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

4160{ return constant(name, bool_sort()); }

Referenced by fpa_sort().

◆ bool_sort()

sort bool_sort ( )
inline

Return the Boolean sort.

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

3854{ Z3_sort s = Z3_mk_bool_sort(m_ctx); check_error(); return sort(*this, s); }
Z3_sort Z3_API Z3_mk_bool_sort(Z3_context c)
Create the Boolean type.

Referenced by bool_const().

◆ bool_val()

expr bool_val ( bool b)
inline

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

4184{ return b ? expr(*this, Z3_mk_true(m_ctx)) : expr(*this, Z3_mk_false(m_ctx)); }
Z3_ast Z3_API Z3_mk_true(Z3_context c)
Create an AST node representing true.
Z3_ast Z3_API Z3_mk_false(Z3_context c)
Create an AST node representing false.

Referenced by goal::as_expr(), fpa_sort(), expr::implies, expr::implies, expr::mk_xor, expr::operator&&, expr::operator&&, expr::operator||, expr::operator||, and solver::to_smt2().

◆ bv_const()

expr bv_const ( char const * name,
unsigned sz )
inline

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

4164{ return constant(name, bv_sort(sz)); }

Referenced by fpa_sort().

◆ bv_sort()

sort bv_sort ( unsigned sz)
inline

Return the Bit-vector sort of size sz. That is, the sort for bit-vectors of size sz.

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

3858{ Z3_sort s = Z3_mk_bv_sort(m_ctx, sz); check_error(); return sort(*this, s); }
Z3_sort Z3_API Z3_mk_bv_sort(Z3_context c, unsigned sz)
Create a bit-vector type of the given size.

Referenced by bv_const(), bv_val(), bv_val(), bv_val(), bv_val(), and bv_val().

◆ bv_val() [1/6]

expr bv_val ( char const * n,
unsigned sz )
inline

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

4203{ sort s = bv_sort(sz); Z3_ast r = Z3_mk_numeral(m_ctx, n, s); check_error(); return expr(*this, r); }
Z3_ast Z3_API Z3_mk_numeral(Z3_context c, Z3_string numeral, Z3_sort ty)
Create a numeral of a given sort.

◆ bv_val() [2/6]

expr bv_val ( int n,
unsigned sz )
inline

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

4199{ sort s = bv_sort(sz); Z3_ast r = Z3_mk_int(m_ctx, n, s); check_error(); return expr(*this, r); }
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.

Referenced by fpa_sort().

◆ bv_val() [3/6]

expr bv_val ( int64_t n,
unsigned sz )
inline

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

4201{ sort s = bv_sort(sz); Z3_ast r = Z3_mk_int64(m_ctx, n, s); check_error(); return expr(*this, r); }
Z3_ast Z3_API Z3_mk_int64(Z3_context c, int64_t v, Z3_sort ty)
Create a numeral of a int, bit-vector, or finite-domain sort.

◆ bv_val() [4/6]

expr bv_val ( uint64_t n,
unsigned sz )
inline

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

4202{ sort s = bv_sort(sz); Z3_ast r = Z3_mk_unsigned_int64(m_ctx, n, s); check_error(); return expr(*this, r); }
Z3_ast Z3_API Z3_mk_unsigned_int64(Z3_context c, uint64_t v, Z3_sort ty)
Create a numeral of a int, bit-vector, or finite-domain sort.

◆ bv_val() [5/6]

expr bv_val ( unsigned n,
bool const * bits )
inline

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

4204 {
4205 array<bool> _bits(n);
4206 for (unsigned i = 0; i < n; ++i) _bits[i] = bits[i] ? 1 : 0;
4207 Z3_ast r = Z3_mk_bv_numeral(m_ctx, n, _bits.ptr()); check_error(); return expr(*this, r);
4208 }
Z3_ast Z3_API Z3_mk_bv_numeral(Z3_context c, unsigned sz, bool const *bits)
create a bit-vector numeral from a vector of Booleans.

◆ bv_val() [6/6]

expr bv_val ( unsigned n,
unsigned sz )
inline

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

4200{ sort s = bv_sort(sz); Z3_ast r = Z3_mk_unsigned_int(m_ctx, n, s); check_error(); return expr(*this, r); }
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.

◆ char_sort()

sort char_sort ( )
inline

Return the sort for Unicode characters.

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

3860{ Z3_sort s = Z3_mk_char_sort(m_ctx); check_error(); return sort(*this, s); }
Z3_sort Z3_API Z3_mk_char_sort(Z3_context c)
Create a sort for unicode characters.

◆ check_error()

Z3_error_code check_error ( ) const
inline

Auxiliary method used to check for API usage errors.

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

241 {
243 if (e != Z3_OK && enable_exceptions())
244 Z3_THROW(exception(Z3_get_error_msg(m_ctx, e)));
245 return e;
246 }
Z3_string Z3_API Z3_get_error_msg(Z3_context c, Z3_error_code err)
Return a string describing the given error code.
Z3_error_code
Z3 error codes (See Z3_get_error_code).
Definition z3_api.h:1396
Z3_error_code Z3_API Z3_get_error_code(Z3_context c)
Return the error code for the last API call.
@ Z3_OK
Definition z3_api.h:1397
#define Z3_THROW(x)
Definition z3++.h:134

Referenced by array_sort(), array_sort(), expr::atleast, expr::atmost, expr::bit2bool(), bool_sort(), bv_sort(), bv_val(), bv_val(), bv_val(), bv_val(), bv_val(), bv_val(), char_sort(), object::check_error(), check_parser_error(), expr::concat, expr::concat, constant(), datatype(), datatype(), datatype_sort(), datatype_sort(), expr::distinct, enumeration_sort(), expr::ext_rotate_left(), expr::ext_rotate_right(), expr::extract(), finite_field_sort(), finite_set_sort(), z3::foldl(), z3::foldli(), fpa_inf(), fpa_nan(), fpa_rounding_mode_sort(), fpa_sort(), fpa_val(), fpa_val(), function(), function(), function(), function(), function(), function(), function(), int_sort(), int_symbol(), int_val(), int_val(), int_val(), int_val(), int_val(), z3::map(), z3::mapi(), num_simplifiers(), num_val(), func_decl::operator()(), func_decl::operator()(), func_decl::operator()(), func_decl::operator()(), func_decl::operator()(), func_decl::operator()(), func_decl::operator()(), func_decl::operator()(), func_decl::operator()(), parse_file(), parse_file(), parse_string(), parse_string(), expr::pbeq, expr::pbge, expr::pble, z3::re_diff(), z3::re_intersect(), re_sort(), real_sort(), real_val(), real_val(), real_val(), real_val(), real_val(), real_val(), recfun(), recfun(), expr::repeat(), expr::rotate_left(), expr::rotate_right(), seq_sort(), simplifier_description(), simplifier_name(), str_symbol(), string_sort(), string_val(), string_val(), string_val(), string_val(), expr::sum, z3::to_expr(), z3::to_func_decl(), z3::to_sort(), tuple_sort(), user_propagate_function(), and variable().

◆ check_parser_error()

void check_parser_error ( ) const
inline

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

248 {
249 check_error();
250 }

Referenced by solver::from_file(), and solver::from_string().

◆ constant() [1/2]

expr constant ( char const * name,
sort const & s )
inline

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

4154{ return constant(str_symbol(name), s); }

◆ constant() [2/2]

expr constant ( symbol const & name,
sort const & s )
inline

create an uninterpreted constant.

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

4149 {
4150 Z3_ast r = Z3_mk_const(m_ctx, name, s);
4151 check_error();
4152 return expr(*this, r);
4153 }
Z3_ast Z3_API Z3_mk_const(Z3_context c, Z3_symbol s, Z3_sort ty)
Declare and create a constant.

Referenced by bool_const(), bv_const(), constant(), fpa_const(), fpa_const(), fpa_sort(), int_const(), real_const(), and string_const().

◆ datatype() [1/2]

sort datatype ( symbol const & name,
constructors const & cs )
inline

Create a recursive datatype over a single sort. name is the name of the recursive datatype n - the number of constructors of the datatype cs - the n constructors used to define the datatype.

References to the datatype can be created using datatype_sort.

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

3970 {
3971 array<Z3_constructor> _cs(cs.size());
3972 for (unsigned i = 0; i < cs.size(); ++i) _cs[i] = cs[i];
3973 Z3_sort s = Z3_mk_datatype(*this, name, cs.size(), _cs.ptr());
3974 check_error();
3975 return sort(*this, s);
3976 }
Z3_sort Z3_API Z3_mk_datatype(Z3_context c, Z3_symbol name, unsigned num_constructors, Z3_constructor constructors[])
Create datatype, such as lists, trees, records, enumerations or unions of records....

Referenced by fpa_sort().

◆ datatype() [2/2]

sort datatype ( symbol const & name,
sort_vector const & params,
constructors const & cs )
inline

Create a parametric recursive datatype. name is the name of the recursive datatype params - the sort parameters of the datatype cs - the n constructors used to define the datatype References to the datatype and mutually recursive datatypes can be created using datatype_sort.

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

3978 {
3979 array<Z3_sort> _params(params);
3980 array<Z3_constructor> _cs(cs.size());
3981 for (unsigned i = 0; i < cs.size(); ++i)
3982 _cs[i] = cs[i];
3983 Z3_sort s = Z3_mk_polymorphic_datatype(*this, name, _params.size(), _params.ptr(), cs.size(), _cs.ptr());
3984 check_error();
3985 return sort(*this, s);
3986 }
Z3_sort Z3_API Z3_mk_polymorphic_datatype(Z3_context c, Z3_symbol name, unsigned num_parameters, Z3_sort parameters[], unsigned num_constructors, Z3_constructor constructors[])
Create a parametric datatype with explicit type parameters.

◆ datatype_sort() [1/2]

sort datatype_sort ( symbol const & name)
inline

a reference to a recursively defined datatype. Expect that it gets defined as a datatype.

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

4004 {
4005 Z3_sort s = Z3_mk_datatype_sort(*this, name, 0, nullptr);
4006 check_error();
4007 return sort(*this, s);
4008 }
Z3_sort Z3_API Z3_mk_datatype_sort(Z3_context c, Z3_symbol name, unsigned num_params, Z3_sort const params[])
create a forward reference to a recursive datatype being declared. The forward reference can be used ...

Referenced by fpa_sort().

◆ datatype_sort() [2/2]

sort datatype_sort ( symbol const & name,
sort_vector const & params )
inline

a reference to a recursively defined parametric datatype. Expect that it gets defined as a datatype.

Parameters
namename of the datatype
paramssort parameters

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

4010 {
4011 array<Z3_sort> _params(params);
4012 Z3_sort s = Z3_mk_datatype_sort(*this, name, _params.size(), _params.ptr());
4013 check_error();
4014 return sort(*this, s);
4015 }

◆ datatypes()

sort_vector datatypes ( unsigned n,
symbol const * names,
constructor_list *const * cons )
inline

Create a set of mutually recursive datatypes. n - number of recursive datatypes names - array of names of length n cons - array of constructor lists of length n.

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

3990 {
3991 sort_vector result(*this);
3992 array<Z3_symbol> _names(n);
3993 array<Z3_sort> _sorts(n);
3994 array<Z3_constructor_list> _cons(n);
3995 for (unsigned i = 0; i < n; ++i)
3996 _names[i] = names[i], _cons[i] = *cons[i];
3997 Z3_mk_datatypes(*this, n, _names.ptr(), _sorts.ptr(), _cons.ptr());
3998 for (unsigned i = 0; i < n; ++i)
3999 result.push_back(sort(*this, _sorts[i]));
4000 return result;
4001 }
void Z3_API Z3_mk_datatypes(Z3_context c, unsigned num_sorts, Z3_symbol const sort_names[], Z3_sort sorts[], Z3_constructor_list constructor_lists[])
Create mutually recursive datatypes.
ast_vector_tpl< sort > sort_vector
Definition z3++.h:78

Referenced by fpa_sort().

◆ enable_exceptions()

bool enable_exceptions ( ) const
inline

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

261{ return m_enable_exceptions; }

Referenced by check_error().

◆ enumeration_sort()

sort enumeration_sort ( char const * name,
unsigned n,
char const *const * enum_names,
func_decl_vector & cs,
func_decl_vector & ts )
inline

Return an enumeration sort: enum_names[0], ..., enum_names[n-1]. cs and ts are output parameters. The method stores in cs the constants corresponding to the enumerated elements, and in ts the predicates for testing if terms of the enumeration sort correspond to an enumeration.

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

3885 {
3886 array<Z3_symbol> _enum_names(n);
3887 for (unsigned i = 0; i < n; ++i) { _enum_names[i] = Z3_mk_string_symbol(*this, enum_names[i]); }
3888 array<Z3_func_decl> _cs(n);
3889 array<Z3_func_decl> _ts(n);
3890 Z3_symbol _name = Z3_mk_string_symbol(*this, name);
3891 sort s = to_sort(*this, Z3_mk_enumeration_sort(*this, _name, n, _enum_names.ptr(), _cs.ptr(), _ts.ptr()));
3892 check_error();
3893 for (unsigned i = 0; i < n; ++i) { cs.push_back(func_decl(*this, _cs[i])); ts.push_back(func_decl(*this, _ts[i])); }
3894 return s;
3895 }
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.
Z3_symbol Z3_API Z3_mk_string_symbol(Z3_context c, Z3_string s)
Create a Z3 symbol using a C string.
sort to_sort(context &c, Z3_sort s)
Definition z3++.h:2341

Referenced by fpa_sort().

◆ finite_field_sort()

sort finite_field_sort ( char const * prime)
inline

Return the prime finite-field sort with the given decimal modulus.

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

3857{ Z3_sort s = Z3_mk_finite_field_sort(m_ctx, prime); check_error(); return sort(*this, s); }
Z3_sort Z3_API Z3_mk_finite_field_sort(Z3_context c, Z3_string prime)
Create a prime-field sort. Large moduli undergo probable-prime screening.

◆ finite_set_sort()

sort finite_set_sort ( sort & s)
inline

Return a finite set sort over element sort s.

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

3863{ Z3_sort r = Z3_mk_finite_set_sort(m_ctx, s); check_error(); return sort(*this, r); }
Z3_sort Z3_API Z3_mk_finite_set_sort(Z3_context c, Z3_sort elem_sort)
Create a finite set sort.

◆ fpa_const() [1/2]

template<size_t precision>
expr fpa_const ( char const * name)
inline

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

4168{ return constant(name, fpa_sort<precision>()); }

◆ fpa_const() [2/2]

expr fpa_const ( char const * name,
unsigned ebits,
unsigned sbits )
inline

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

4165{ return constant(name, fpa_sort(ebits, sbits)); }

Referenced by fpa_sort().

◆ fpa_inf()

expr fpa_inf ( sort const & s,
bool sgn )
inline

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

4213{ Z3_ast r = Z3_mk_fpa_inf(m_ctx, s, sgn); check_error(); return expr(*this, r); }
Z3_ast Z3_API Z3_mk_fpa_inf(Z3_context c, Z3_sort s, bool negative)
Create a floating-point infinity of sort s.

Referenced by fpa_sort().

◆ fpa_nan()

expr fpa_nan ( sort const & s)
inline

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

4212{ Z3_ast r = Z3_mk_fpa_nan(m_ctx, s); check_error(); return expr(*this, r); }
Z3_ast Z3_API Z3_mk_fpa_nan(Z3_context c, Z3_sort s)
Create a floating-point NaN of sort s.

Referenced by fpa_sort().

◆ fpa_rounding_mode()

expr fpa_rounding_mode ( )
inline

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

4172 {
4173 switch (m_rounding_mode) {
4174 case RNA: return expr(*this, Z3_mk_fpa_rna(m_ctx));
4175 case RNE: return expr(*this, Z3_mk_fpa_rne(m_ctx));
4176 case RTP: return expr(*this, Z3_mk_fpa_rtp(m_ctx));
4177 case RTN: return expr(*this, Z3_mk_fpa_rtn(m_ctx));
4178 case RTZ: return expr(*this, Z3_mk_fpa_rtz(m_ctx));
4179 }
4180 assert(false);
4181 return expr(*this, Z3_mk_fpa_rne(m_ctx));
4182 }
Z3_ast Z3_API Z3_mk_fpa_rna(Z3_context c)
Create a numeral of RoundingMode sort which represents the NearestTiesToAway rounding mode.
Z3_ast Z3_API Z3_mk_fpa_rtn(Z3_context c)
Create a numeral of RoundingMode sort which represents the TowardNegative rounding mode.
Z3_ast Z3_API Z3_mk_fpa_rtp(Z3_context c)
Create a numeral of RoundingMode sort which represents the TowardPositive rounding mode.
Z3_ast Z3_API Z3_mk_fpa_rtz(Z3_context c)
Create a numeral of RoundingMode sort which represents the TowardZero rounding mode.
Z3_ast Z3_API Z3_mk_fpa_rne(Z3_context c)
Create a numeral of RoundingMode sort which represents the NearestTiesToEven rounding mode.
@ RNE
Definition z3++.h:172
@ RNA
Definition z3++.h:171
@ RTZ
Definition z3++.h:175
@ RTN
Definition z3++.h:174
@ RTP
Definition z3++.h:173

Referenced by fpa_sort(), expr::fpa_to_fpa, expr::fpa_to_sbv, expr::fpa_to_ubv, expr::operator*, expr::operator+, expr::operator-, expr::operator/, expr::round_fpa_to_closest_integer, expr::sbv_to_fpa, and expr::ubv_to_fpa.

◆ fpa_rounding_mode_sort()

sort fpa_rounding_mode_sort ( )
inline

Return a RoundingMode sort.

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

3878{ Z3_sort r = Z3_mk_fpa_rounding_mode_sort(m_ctx); check_error(); return sort(*this, r); }
Z3_sort Z3_API Z3_mk_fpa_rounding_mode_sort(Z3_context c)
Create the RoundingMode sort.

Referenced by fpa_sort().

◆ fpa_sort() [1/6]

template<>
sort fpa_sort ( )
inline

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

3876{ return fpa_sort(15, 113); }

Referenced by fpa_sort().

◆ fpa_sort() [2/6]

template<>
sort fpa_sort ( )
inline

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

3873{ return fpa_sort(11, 53); }

Referenced by fpa_sort().

◆ fpa_sort() [3/6]

template<>
sort fpa_sort ( )
inline

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

3870{ return fpa_sort(8, 24); }

Referenced by fpa_sort().

◆ fpa_sort() [4/6]

template<>
sort fpa_sort ( )
inline

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

3867{ return fpa_sort(5, 11); }

Referenced by fpa_sort().

◆ fpa_sort() [5/6]

template<size_t precision>
sort fpa_sort ( )

Return a FloatingPoint sort with given precision bitwidth (16, 32, 64 or 128).

◆ fpa_sort() [6/6]

sort fpa_sort ( unsigned ebits,
unsigned sbits )
inline

Return a floating point sort. ebits is a number of exponent bits, sbits is a number of significand bits,.

Precondition
where ebits must be larger than 1 and sbits must be larger than 2.

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

3864{ Z3_sort s = Z3_mk_fpa_sort(m_ctx, ebits, sbits); check_error(); return sort(*this, s); }
Z3_sort Z3_API Z3_mk_fpa_sort(Z3_context c, unsigned ebits, unsigned sbits)
Create a FloatingPoint sort.

Referenced by fpa_const(), fpa_const(), fpa_val(), and fpa_val().

◆ fpa_val() [1/2]

expr fpa_val ( double n)
inline

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

4210{ sort s = fpa_sort<64>(); Z3_ast r = Z3_mk_fpa_numeral_double(m_ctx, n, s); check_error(); return expr(*this, r); }
Z3_ast Z3_API Z3_mk_fpa_numeral_double(Z3_context c, double v, Z3_sort ty)
Create a numeral of FloatingPoint sort from a double.

Referenced by fpa_sort(), z3::operator!=(), z3::operator!=(), z3::operator==(), and z3::operator==().

◆ fpa_val() [2/2]

expr fpa_val ( float n)
inline

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

4211{ sort s = fpa_sort<32>(); Z3_ast r = Z3_mk_fpa_numeral_float(m_ctx, n, s); check_error(); return expr(*this, r); }
Z3_ast Z3_API Z3_mk_fpa_numeral_float(Z3_context c, float v, Z3_sort ty)
Create an expression of FloatingPoint sort from three bit-vector expressions.

◆ function() [1/9]

func_decl function ( char const * name,
sort const & d1,
sort const & d2,
sort const & d3,
sort const & d4,
sort const & d5,
sort const & range )
inline

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

4089 {
4090 check_context(d1, range); check_context(d2, range); check_context(d3, range); check_context(d4, range); check_context(d5, range);
4091 Z3_sort args[5] = { d1, d2, d3, d4, d5 };
4092 Z3_func_decl f = Z3_mk_func_decl(m_ctx, str_symbol(name), 5, args, range);
4093 check_error();
4094 return func_decl(*this, f);
4095 }
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.
void check_context(object const &a, object const &b)
Definition z3++.h:566

◆ function() [2/9]

func_decl function ( char const * name,
sort const & d1,
sort const & d2,
sort const & d3,
sort const & d4,
sort const & range )
inline

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

4081 {
4082 check_context(d1, range); check_context(d2, range); check_context(d3, range); check_context(d4, range);
4083 Z3_sort args[4] = { d1, d2, d3, d4 };
4084 Z3_func_decl f = Z3_mk_func_decl(m_ctx, str_symbol(name), 4, args, range);
4085 check_error();
4086 return func_decl(*this, f);
4087 }

◆ function() [3/9]

func_decl function ( char const * name,
sort const & d1,
sort const & d2,
sort const & d3,
sort const & range )
inline

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

4073 {
4074 check_context(d1, range); check_context(d2, range); check_context(d3, range);
4075 Z3_sort args[3] = { d1, d2, d3 };
4076 Z3_func_decl f = Z3_mk_func_decl(m_ctx, str_symbol(name), 3, args, range);
4077 check_error();
4078 return func_decl(*this, f);
4079 }

◆ function() [4/9]

func_decl function ( char const * name,
sort const & d1,
sort const & d2,
sort const & range )
inline

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

4065 {
4066 check_context(d1, range); check_context(d2, range);
4067 Z3_sort args[2] = { d1, d2 };
4068 Z3_func_decl f = Z3_mk_func_decl(m_ctx, str_symbol(name), 2, args, range);
4069 check_error();
4070 return func_decl(*this, f);
4071 }

◆ function() [5/9]

func_decl function ( char const * name,
sort const & domain,
sort const & range )
inline

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

4057 {
4058 check_context(domain, range);
4059 Z3_sort args[1] = { domain };
4060 Z3_func_decl f = Z3_mk_func_decl(m_ctx, str_symbol(name), 1, args, range);
4061 check_error();
4062 return func_decl(*this, f);
4063 }

◆ function() [6/9]

func_decl function ( char const * name,
sort_vector const & domain,
sort const & range )
inline

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

4052 {
4053 return function(range.ctx().str_symbol(name), domain, range);
4054 }
symbol str_symbol(char const *s)
Create a Z3 symbol based on the given string.
Definition z3++.h:3851
context & ctx() const
Definition z3++.h:562
func_decl function(symbol const &name, unsigned arity, sort const *domain, sort const &range)
Definition z3++.h:4306
expr range(expr const &lo, expr const &hi)
Definition z3++.h:4590

◆ function() [7/9]

func_decl function ( char const * name,
unsigned arity,
sort const * domain,
sort const & range )
inline

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

4037 {
4038 return function(range.ctx().str_symbol(name), arity, domain, range);
4039 }

◆ function() [8/9]

func_decl function ( symbol const & name,
sort_vector const & domain,
sort const & range )
inline

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

4041 {
4042 array<Z3_sort> args(domain.size());
4043 for (unsigned i = 0; i < domain.size(); ++i) {
4044 check_context(domain[i], range);
4045 args[i] = domain[i];
4046 }
4047 Z3_func_decl f = Z3_mk_func_decl(m_ctx, name, domain.size(), args.ptr(), range);
4048 check_error();
4049 return func_decl(*this, f);
4050 }

◆ function() [9/9]

func_decl function ( symbol const & name,
unsigned arity,
sort const * domain,
sort const & range )
inline

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

4026 {
4027 array<Z3_sort> args(arity);
4028 for (unsigned i = 0; i < arity; ++i) {
4029 check_context(domain[i], range);
4030 args[i] = domain[i];
4031 }
4032 Z3_func_decl f = Z3_mk_func_decl(m_ctx, name, arity, args.ptr(), range);
4033 check_error();
4034 return func_decl(*this, f);
4035 }

Referenced by fpa_sort(), function(), function(), z3::function(), z3::function(), z3::function(), z3::function(), z3::function(), z3::function(), z3::function(), z3::function(), and z3::function().

◆ int_const()

expr int_const ( char const * name)
inline

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

4161{ return constant(name, int_sort()); }

Referenced by fpa_sort().

◆ int_sort()

sort int_sort ( )
inline

Return the integer sort.

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

3855{ Z3_sort s = Z3_mk_int_sort(m_ctx); check_error(); return sort(*this, s); }
Z3_sort Z3_API Z3_mk_int_sort(Z3_context c)
Create the integer type.

Referenced by int_const(), int_val(), int_val(), int_val(), int_val(), and int_val().

◆ int_symbol()

symbol int_symbol ( int n)
inline

Create a Z3 symbol based on the given integer.

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

3852{ Z3_symbol r = Z3_mk_int_symbol(m_ctx, n); check_error(); return symbol(*this, r); }
Z3_symbol Z3_API Z3_mk_int_symbol(Z3_context c, int i)
Create a Z3 symbol using an integer.

◆ int_val() [1/5]

expr int_val ( char const * n)
inline

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

4190{ Z3_ast r = Z3_mk_numeral(m_ctx, n, int_sort()); check_error(); return expr(*this, r); }

◆ int_val() [2/5]

expr int_val ( int n)
inline

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

4186{ Z3_ast r = Z3_mk_int(m_ctx, n, int_sort()); check_error(); return expr(*this, r); }

Referenced by expr::abs, and fpa_sort().

◆ int_val() [3/5]

expr int_val ( int64_t n)
inline

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

4188{ Z3_ast r = Z3_mk_int64(m_ctx, n, int_sort()); check_error(); return expr(*this, r); }

◆ int_val() [4/5]

expr int_val ( uint64_t n)
inline

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

4189{ Z3_ast r = Z3_mk_unsigned_int64(m_ctx, n, int_sort()); check_error(); return expr(*this, r); }

◆ int_val() [5/5]

expr int_val ( unsigned n)
inline

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

4187{ Z3_ast r = Z3_mk_unsigned_int(m_ctx, n, int_sort()); check_error(); return expr(*this, r); }

◆ interrupt()

void interrupt ( )
inline

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 actually stop.

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

299{ Z3_interrupt(m_ctx); }
void Z3_API Z3_interrupt(Z3_context c)
Interrupt the execution of a Z3 procedure. This procedure can be used to interrupt: solvers,...

◆ num_simplifiers()

unsigned num_simplifiers ( ) const
inline

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

272 {
273 unsigned r = Z3_get_num_simplifiers(m_ctx);
274 check_error();
275 return r;
276 }
unsigned Z3_API Z3_get_num_simplifiers(Z3_context c)
Return the number of builtin simplifiers available in Z3.

◆ num_val()

◆ operator Z3_context()

operator Z3_context ( ) const
inline

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

236{ return m_ctx; }

◆ operator=()

context & operator= ( context && other)
inlinenoexcept

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

225 {
226 if (this != &other) {
227 if (m_ctx) Z3_del_context(m_ctx);
228 m_enable_exceptions = other.m_enable_exceptions;
229 m_rounding_mode = other.m_rounding_mode;
230 m_ctx = other.m_ctx;
231 other.m_ctx = nullptr;
232 }
233 return *this;
234 }

◆ parse_file() [1/2]

expr_vector parse_file ( char const * file)
inline

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

4607 {
4608 Z3_ast_vector r = Z3_parse_smtlib2_file(*this, s, 0, 0, 0, 0, 0, 0);
4609 check_error();
4610 return expr_vector(*this, r);
4611 }
Z3_ast_vector Z3_API Z3_parse_smtlib2_file(Z3_context c, Z3_string file_name, unsigned num_sorts, Z3_symbol const sort_names[], Z3_sort const sorts[], unsigned num_decls, Z3_symbol const decl_names[], Z3_func_decl const decls[])
Similar to Z3_parse_smtlib2_string, but reads the benchmark from a file.
ast_vector_tpl< expr > expr_vector
Definition z3++.h:77

Referenced by fpa_sort().

◆ parse_file() [2/2]

expr_vector parse_file ( char const * s,
sort_vector const & sorts,
func_decl_vector const & decls )
inline

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

4630 {
4631 array<Z3_symbol> sort_names(sorts.size());
4632 array<Z3_symbol> decl_names(decls.size());
4633 array<Z3_sort> sorts1(sorts);
4634 array<Z3_func_decl> decls1(decls);
4635 for (unsigned i = 0; i < sorts.size(); ++i) {
4636 sort_names[i] = sorts[i].name();
4637 }
4638 for (unsigned i = 0; i < decls.size(); ++i) {
4639 decl_names[i] = decls[i].name();
4640 }
4641 Z3_ast_vector r = Z3_parse_smtlib2_file(*this, s, sorts.size(), sort_names.ptr(), sorts1.ptr(), decls.size(), decl_names.ptr(), decls1.ptr());
4642 check_error();
4643 return expr_vector(*this, r);
4644 }

◆ parse_string() [1/2]

expr_vector parse_string ( char const * s)
inline

parsing

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

4601 {
4602 Z3_ast_vector r = Z3_parse_smtlib2_string(*this, s, 0, 0, 0, 0, 0, 0);
4603 check_error();
4604 return expr_vector(*this, r);
4605
4606 }
Z3_ast_vector Z3_API Z3_parse_smtlib2_string(Z3_context c, Z3_string str, unsigned num_sorts, Z3_symbol const sort_names[], Z3_sort const sorts[], unsigned num_decls, Z3_symbol const decl_names[], Z3_func_decl const decls[])
Parse the given string using the SMT-LIB2 parser.

Referenced by fpa_sort().

◆ parse_string() [2/2]

expr_vector parse_string ( char const * s,
sort_vector const & sorts,
func_decl_vector const & decls )
inline

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

4613 {
4614 array<Z3_symbol> sort_names(sorts.size());
4615 array<Z3_symbol> decl_names(decls.size());
4616 array<Z3_sort> sorts1(sorts);
4617 array<Z3_func_decl> decls1(decls);
4618 for (unsigned i = 0; i < sorts.size(); ++i) {
4619 sort_names[i] = sorts[i].name();
4620 }
4621 for (unsigned i = 0; i < decls.size(); ++i) {
4622 decl_names[i] = decls[i].name();
4623 }
4624
4625 Z3_ast_vector r = Z3_parse_smtlib2_string(*this, s, sorts.size(), sort_names.ptr(), sorts1.ptr(), decls.size(), decl_names.ptr(), decls1.ptr());
4626 check_error();
4627 return expr_vector(*this, r);
4628 }

◆ re_sort()

sort re_sort ( sort & seq_sort)
inline

Return a regular expression sort over sequences seq_sort.

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

3862{ Z3_sort r = Z3_mk_re_sort(m_ctx, s); check_error(); return sort(*this, r); }
Z3_sort Z3_API Z3_mk_re_sort(Z3_context c, Z3_sort seq)
Create a regular expression sort out of a sequence sort.

◆ real_const()

expr real_const ( char const * name)
inline

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

4162{ return constant(name, real_sort()); }

Referenced by fpa_sort().

◆ real_sort()

sort real_sort ( )
inline

Return the Real sort.

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

3856{ Z3_sort s = Z3_mk_real_sort(m_ctx); check_error(); return sort(*this, s); }
Z3_sort Z3_API Z3_mk_real_sort(Z3_context c)
Create the real type.

Referenced by real_const(), real_val(), real_val(), real_val(), real_val(), and real_val().

◆ real_val() [1/6]

expr real_val ( char const * n)
inline

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

4197{ Z3_ast r = Z3_mk_numeral(m_ctx, n, real_sort()); check_error(); return expr(*this, r); }

◆ real_val() [2/6]

expr real_val ( int n)
inline

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

4193{ Z3_ast r = Z3_mk_int(m_ctx, n, real_sort()); check_error(); return expr(*this, r); }

Referenced by expr::abs, and fpa_sort().

◆ real_val() [3/6]

expr real_val ( int64_t n)
inline

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

4195{ Z3_ast r = Z3_mk_int64(m_ctx, n, real_sort()); check_error(); return expr(*this, r); }

◆ real_val() [4/6]

expr real_val ( int64_t n,
int64_t d )
inline

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

4192{ Z3_ast r = Z3_mk_real_int64(m_ctx, n, d); check_error(); return expr(*this, r); }
Z3_ast Z3_API Z3_mk_real_int64(Z3_context c, int64_t num, int64_t den)
Create a real from a fraction of int64.

◆ real_val() [5/6]

expr real_val ( uint64_t n)
inline

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

4196{ Z3_ast r = Z3_mk_unsigned_int64(m_ctx, n, real_sort()); check_error(); return expr(*this, r); }

◆ real_val() [6/6]

expr real_val ( unsigned n)
inline

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

4194{ Z3_ast r = Z3_mk_unsigned_int(m_ctx, n, real_sort()); check_error(); return expr(*this, r); }

◆ recdef()

void recdef ( func_decl decl,
expr_vector const & args,
expr const & body )
inline

add function definition body to declaration decl. decl needs to be declared using context::recfun.

Parameters
decl
args
body

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

4135 {
4136 check_context(f, args); check_context(f, body);
4137 array<Z3_ast> vars(args);
4138 Z3_add_rec_def(f.ctx(), f, vars.size(), vars.ptr(), body);
4139 }
void Z3_API Z3_add_rec_def(Z3_context c, Z3_func_decl f, unsigned n, Z3_ast args[], Z3_ast body)
Define the body of a recursive function.

Referenced by fpa_sort().

◆ recfun() [1/6]

func_decl recfun ( char const * name,
sort const & d1,
sort const & d2,
sort const & range )
inline

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

4130 {
4131 sort dom[2] = { d1, d2 };
4132 return recfun(str_symbol(name), 2, dom, range);
4133 }
func_decl recfun(symbol const &name, unsigned arity, sort const *domain, sort const &range)
Definition z3++.h:4334

◆ recfun() [2/6]

func_decl recfun ( char const * name,
sort const & domain,
sort const & range )
inline

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

4126 {
4127 return recfun(str_symbol(name), 1, &d1, range);
4128 }

◆ recfun() [3/6]

func_decl recfun ( char const * name,
sort_vector const & domain,
sort const & range )
inline

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

4117 {
4118 return recfun(str_symbol(name), domain, range);
4119
4120 }

◆ recfun() [4/6]

func_decl recfun ( char const * name,
unsigned arity,
sort const * domain,
sort const & range )
inline

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

4122 {
4123 return recfun(str_symbol(name), arity, domain, range);
4124 }

◆ recfun() [5/6]

func_decl recfun ( symbol const & name,
const sort_vector & domain,
sort const & range )
inline

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

4109 {
4110 check_context(domain, range);
4111 array<Z3_sort> domain1(domain);
4112 Z3_func_decl f = Z3_mk_rec_func_decl(m_ctx, name, domain1.size(), domain1.ptr(), range);
4113 check_error();
4114 return func_decl(*this, f);
4115 }
Z3_func_decl Z3_API Z3_mk_rec_func_decl(Z3_context c, Z3_symbol s, unsigned domain_size, Z3_sort const domain[], Z3_sort range)
Declare a recursive function.

◆ recfun() [6/6]

func_decl recfun ( symbol const & name,
unsigned arity,
sort const * domain,
sort const & range )
inline

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

4097 {
4098 array<Z3_sort> args(arity);
4099 for (unsigned i = 0; i < arity; ++i) {
4100 check_context(domain[i], range);
4101 args[i] = domain[i];
4102 }
4103 Z3_func_decl f = Z3_mk_rec_func_decl(m_ctx, name, arity, args.ptr(), range);
4104 check_error();
4105 return func_decl(*this, f);
4106
4107 }

Referenced by fpa_sort(), recfun(), recfun(), recfun(), recfun(), z3::recfun(), z3::recfun(), z3::recfun(), and z3::recfun().

◆ seq_sort()

sort seq_sort ( sort & s)
inline

Return a sequence sort over base sort s.

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

3861{ Z3_sort r = Z3_mk_seq_sort(m_ctx, s); check_error(); return sort(*this, r); }
Z3_sort Z3_API Z3_mk_seq_sort(Z3_context c, Z3_sort s)
Create a sequence sort out of the sort for the elements.

◆ set() [1/3]

void set ( char const * param,
bool value )
inline

Update global parameter param with Boolean value.

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

270{ Z3_update_param_value(m_ctx, param, value ? "true" : "false"); }
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.

◆ set() [2/3]

void set ( char const * param,
char const * value )
inline

Update global parameter param with string value.

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

266{ Z3_update_param_value(m_ctx, param, value); }

◆ set() [3/3]

void set ( char const * param,
int value )
inline

Update global parameter param with Integer value.

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

290 {
291 auto str = std::to_string(value);
292 Z3_update_param_value(m_ctx, param, str.c_str());
293 }

◆ set_enable_exceptions()

void set_enable_exceptions ( bool f)
inline

The C++ API uses by defaults exceptions on errors. For applications that don't work well with exceptions (there should be only few) you have the ability to turn off exceptions. The tradeoffs are that applications have to be very careful about using check_error() after calls that may result in an erroneous state.

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

259{ m_enable_exceptions = f; }

◆ set_rounding_mode()

void set_rounding_mode ( rounding_mode rm)
inline

Sets RoundingMode of FloatingPoints.

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

4170{ m_rounding_mode = rm; }

Referenced by fpa_sort().

◆ simplifier_description()

std::string simplifier_description ( char const * name) const
inline

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

282 {
283 char const* r = Z3_simplifier_get_descr(m_ctx, name);
284 check_error();
285 return r;
286 }
Z3_string Z3_API Z3_simplifier_get_descr(Z3_context c, Z3_string name)
Return a string containing a description of the simplifier with the given name.

◆ simplifier_name()

std::string simplifier_name ( unsigned i) const
inline

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

277 {
278 char const* r = Z3_get_simplifier_name(m_ctx, i);
279 check_error();
280 return r;
281 }
Z3_string Z3_API Z3_get_simplifier_name(Z3_context c, unsigned i)
Return the name of the idx simplifier.

◆ str_symbol()

symbol str_symbol ( char const * s)
inline

Create a Z3 symbol based on the given string.

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

3851{ Z3_symbol r = Z3_mk_string_symbol(m_ctx, s); check_error(); return symbol(*this, r); }

Referenced by constant(), function(), function(), function(), function(), function(), function(), function(), recfun(), recfun(), recfun(), recfun(), and solver::solver().

◆ string_const()

expr string_const ( char const * name)
inline

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

4163{ return constant(name, string_sort()); }

Referenced by fpa_sort().

◆ string_sort()

sort string_sort ( )
inline

Return the sort for Unicode strings.

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

3859{ Z3_sort s = Z3_mk_string_sort(m_ctx); check_error(); return sort(*this, s); }
Z3_sort Z3_API Z3_mk_string_sort(Z3_context c)
Create a sort for unicode strings.

Referenced by string_const().

◆ string_val() [1/4]

expr string_val ( char const * s)
inline

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

4216{ Z3_ast r = Z3_mk_string(m_ctx, s); check_error(); return expr(*this, r); }
Z3_ast Z3_API Z3_mk_string(Z3_context c, Z3_string s)
Create a string constant out of the string that is passed in The string may contain escape encoding f...

Referenced by fpa_sort().

◆ string_val() [2/4]

expr string_val ( char const * s,
unsigned n )
inline

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

4215{ Z3_ast r = Z3_mk_lstring(m_ctx, n, s); check_error(); return expr(*this, r); }
Z3_ast Z3_API Z3_mk_lstring(Z3_context c, unsigned len, Z3_string s)
Create a string constant out of the string that is passed in It takes the length of the string as wel...

◆ string_val() [3/4]

expr string_val ( std::string const & s)
inline

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

4217{ Z3_ast r = Z3_mk_string(m_ctx, s.c_str()); check_error(); return expr(*this, r); }

◆ string_val() [4/4]

expr string_val ( std::u32string const & s)
inline

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

4218{ Z3_ast r = Z3_mk_u32string(m_ctx, (unsigned)s.size(), (unsigned const*)s.c_str()); check_error(); return expr(*this, r); }
Z3_ast Z3_API Z3_mk_u32string(Z3_context c, unsigned len, unsigned const chars[])
Create a string constant out of the string that is passed in It takes the length of the string as wel...

◆ tuple_sort()

func_decl tuple_sort ( char const * name,
unsigned n,
char const *const * names,
sort const * sorts,
func_decl_vector & projs )
inline

Return a tuple constructor. name is the name of the returned constructor, n are the number of arguments, names and sorts are their projected sorts. projs is an output parameter. It contains the set of projection functions.

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

3896 {
3897 array<Z3_symbol> _names(n);
3898 array<Z3_sort> _sorts(n);
3899 for (unsigned i = 0; i < n; ++i) { _names[i] = Z3_mk_string_symbol(*this, names[i]); _sorts[i] = sorts[i]; }
3900 array<Z3_func_decl> _projs(n);
3901 Z3_symbol _name = Z3_mk_string_symbol(*this, name);
3902 Z3_func_decl tuple;
3903 sort _ignore_s = to_sort(*this, Z3_mk_tuple_sort(*this, _name, n, _names.ptr(), _sorts.ptr(), &tuple, _projs.ptr()));
3904 check_error();
3905 for (unsigned i = 0; i < n; ++i) { projs.push_back(func_decl(*this, _projs[i])); }
3906 return func_decl(*this, tuple);
3907 }
Z3_sort Z3_API Z3_mk_tuple_sort(Z3_context c, Z3_symbol mk_tuple_name, unsigned num_fields, Z3_symbol const field_names[], Z3_sort const field_sorts[], Z3_func_decl *mk_tuple_decl, Z3_func_decl proj_decl[])
Create a tuple type.

Referenced by fpa_sort().

◆ uninterpreted_sort() [1/2]

sort uninterpreted_sort ( char const * name)
inline

create an uninterpreted sort with the name given by the string or symbol.

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

4018 {
4019 Z3_symbol _name = Z3_mk_string_symbol(*this, name);
4020 return to_sort(*this, Z3_mk_uninterpreted_sort(*this, _name));
4021 }
Z3_sort Z3_API Z3_mk_uninterpreted_sort(Z3_context c, Z3_symbol s)
Create a free (uninterpreted) type using the given name (symbol).

Referenced by fpa_sort().

◆ uninterpreted_sort() [2/2]

sort uninterpreted_sort ( symbol const & name)
inline

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

4022 {
4023 return to_sort(*this, Z3_mk_uninterpreted_sort(*this, name));
4024 }

◆ user_propagate_function()

func_decl user_propagate_function ( symbol const & name,
sort_vector const & domain,
sort const & range )
inline

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

4141 {
4142 check_context(domain, range);
4143 array<Z3_sort> domain1(domain);
4144 Z3_func_decl f = Z3_solver_propagate_declare(range.ctx(), name, domain1.size(), domain1.ptr(), range);
4145 check_error();
4146 return func_decl(*this, f);
4147 }
Z3_func_decl Z3_API Z3_solver_propagate_declare(Z3_context c, Z3_symbol name, unsigned n, Z3_sort *domain, Z3_sort range)

Referenced by fpa_sort().

◆ variable()

expr variable ( unsigned index,
sort const & s )
inline

create a de-Bruijn variable.

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

4155 {
4156 Z3_ast r = Z3_mk_bound(m_ctx, idx, s);
4157 check_error();
4158 return expr(*this, r);
4159 }
Z3_ast Z3_API Z3_mk_bound(Z3_context c, unsigned index, Z3_sort ty)
Create a variable.

Referenced by fpa_sort().

◆ user_propagator_base

friend class user_propagator_base
friend

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

Referenced by user_propagator_base.