Z3
Public Member Functions | Friends
context Class Reference

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

Public Member Functions

 context ()
 
 context (config &c)
 
 ~context ()
 
 operator Z3_context () const
 
Z3_error_code check_error () const
 Auxiliary method used to check for API usage errors. More...
 
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. More...
 
bool enable_exceptions () const
 
void set (char const *param, char const *value)
 Update global parameter param with string value. More...
 
void set (char const *param, bool value)
 Update global parameter param with Boolean value. More...
 
void set (char const *param, int value)
 Update global parameter param with Integer value. More...
 
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. More...
 
symbol str_symbol (char const *s)
 Create a Z3 symbol based on the given string. More...
 
symbol int_symbol (int n)
 Create a Z3 symbol based on the given integer. More...
 
sort bool_sort ()
 Return the Boolean sort. More...
 
sort int_sort ()
 Return the integer sort. More...
 
sort real_sort ()
 Return the Real sort. More...
 
sort bv_sort (unsigned sz)
 Return the Bit-vector sort of size sz. That is, the sort for bit-vectors of size sz. More...
 
sort string_sort ()
 Return the sort for ASCII strings. More...
 
sort seq_sort (sort &s)
 Return a sequence sort over base sort s. More...
 
sort re_sort (sort &seq_sort)
 Return a regular expression sort over sequences seq_sort. More...
 
sort array_sort (sort d, sort r)
 Return an array sort for arrays from d to r. More...
 
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,. More...
 
template<size_t precision>
sort fpa_sort ()
 Return a FloatingPoint sort with given precision bitwidth (16, 32, 64 or 128). More...
 
sort fpa_rounding_mode ()
 Return a RoundingMode sort. More...
 
void set_rounding_mode (rounding_mode rm)
 Sets RoundingMode of FloatingPoints. More...
 
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. More...
 
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. More...
 
sort uninterpreted_sort (char const *name)
 create an uninterpreted sort with the name given by the string or symbol. More...
 
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 (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, expr_vector const &args, expr const &body)
 
expr constant (symbol const &name, sort const &s)
 
expr constant (char const *name, sort const &s)
 
expr bool_const (char const *name)
 
expr int_const (char const *name)
 
expr real_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 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, int d)
 
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 (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 string_val (char const *s)
 
expr string_val (char const *s, unsigned n)
 
expr string_val (std::string const &s)
 
expr num_val (int n, sort const &s)
 
expr_vector parse_string (char const *s)
 parsing More...
 
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 scoped_context
 

Detailed Description

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

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

Constructor & Destructor Documentation

◆ context() [1/2]

context ( )
inline

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

179 { config c; init(c); }

◆ context() [2/2]

context ( config c)
inline

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

180 { init(c); }

◆ ~context()

~context ( )
inline

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

181 { 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 3029 of file z3++.h.

3029 { Z3_sort s = Z3_mk_array_sort(m_ctx, d, r); check_error(); return sort(*this, s); }
Z3_error_code check_error() const
Auxiliary method used to check for API usage errors.
Definition: z3++.h:187
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 3030 of file z3++.h.

3030  {
3031  array<Z3_sort> dom(d);
3032  Z3_sort s = Z3_mk_array_sort_n(m_ctx, dom.size(), dom.ptr(), r); check_error(); return sort(*this, s);
3033  }
Z3_error_code check_error() const
Auxiliary method used to check for API usage errors.
Definition: z3++.h:187
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

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

3174 { return constant(name, bool_sort()); }
sort bool_sort()
Return the Boolean sort.
Definition: z3++.h:2995
expr constant(symbol const &name, sort const &s)
Definition: z3++.h:3168

◆ bool_sort()

sort bool_sort ( )
inline

Return the Boolean sort.

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

2995 { Z3_sort s = Z3_mk_bool_sort(m_ctx); check_error(); return sort(*this, s); }
Z3_error_code check_error() const
Auxiliary method used to check for API usage errors.
Definition: z3++.h:187
Z3_sort Z3_API Z3_mk_bool_sort(Z3_context c)
Create the Boolean type.

◆ bool_val()

expr bool_val ( bool  b)
inline

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

Referenced by z3::implies(), z3::operator &&(), and z3::operator||().

3183 { 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.

◆ bv_const()

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

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

3177 { return constant(name, bv_sort(sz)); }
sort bv_sort(unsigned sz)
Return the Bit-vector sort of size sz. That is, the sort for bit-vectors of size sz.
Definition: z3++.h:2998
expr constant(symbol const &name, sort const &s)
Definition: z3++.h:3168

◆ 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 2998 of file z3++.h.

2998 { 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.
Z3_error_code check_error() const
Auxiliary method used to check for API usage errors.
Definition: z3++.h:187

◆ bv_val() [1/6]

expr bv_val ( int  n,
unsigned  sz 
)
inline

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

3198 { sort s = bv_sort(sz); Z3_ast r = Z3_mk_int(m_ctx, n, s); check_error(); return expr(*this, r); }
Z3_error_code check_error() const
Auxiliary method used to check for API usage errors.
Definition: z3++.h:187
sort bv_sort(unsigned sz)
Return the Bit-vector sort of size sz. That is, the sort for bit-vectors of size sz.
Definition: z3++.h:2998
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.

◆ bv_val() [2/6]

expr bv_val ( unsigned  n,
unsigned  sz 
)
inline

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

3199 { 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.
Z3_error_code check_error() const
Auxiliary method used to check for API usage errors.
Definition: z3++.h:187
sort bv_sort(unsigned sz)
Return the Bit-vector sort of size sz. That is, the sort for bit-vectors of size sz.
Definition: z3++.h:2998

◆ bv_val() [3/6]

expr bv_val ( int64_t  n,
unsigned  sz 
)
inline

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

3200 { sort s = bv_sort(sz); Z3_ast r = Z3_mk_int64(m_ctx, n, s); check_error(); return expr(*this, r); }
Z3_error_code check_error() const
Auxiliary method used to check for API usage errors.
Definition: z3++.h:187
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.
sort bv_sort(unsigned sz)
Return the Bit-vector sort of size sz. That is, the sort for bit-vectors of size sz.
Definition: z3++.h:2998

◆ bv_val() [4/6]

expr bv_val ( uint64_t  n,
unsigned  sz 
)
inline

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

3201 { sort s = bv_sort(sz); Z3_ast r = Z3_mk_unsigned_int64(m_ctx, n, s); check_error(); return expr(*this, r); }
Z3_error_code check_error() const
Auxiliary method used to check for API usage errors.
Definition: z3++.h:187
sort bv_sort(unsigned sz)
Return the Bit-vector sort of size sz. That is, the sort for bit-vectors of size sz.
Definition: z3++.h:2998
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 ( char const *  n,
unsigned  sz 
)
inline

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

3202 { sort s = bv_sort(sz); Z3_ast r = Z3_mk_numeral(m_ctx, n, s); check_error(); return expr(*this, r); }
Z3_error_code check_error() const
Auxiliary method used to check for API usage errors.
Definition: z3++.h:187
sort bv_sort(unsigned sz)
Return the Bit-vector sort of size sz. That is, the sort for bit-vectors of size sz.
Definition: z3++.h:2998
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() [6/6]

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

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

3203  {
3204  array<bool> _bits(n);
3205  for (unsigned i = 0; i < n; ++i) _bits[i] = bits[i] ? 1 : 0;
3206  Z3_ast r = Z3_mk_bv_numeral(m_ctx, n, _bits.ptr()); check_error(); return expr(*this, r);
3207  }
Z3_error_code check_error() const
Auxiliary method used to check for API usage errors.
Definition: z3++.h:187
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.

◆ check_error()

Z3_error_code check_error ( ) const
inline

Auxiliary method used to check for API usage errors.

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

Referenced by object::check_error(), z3::concat(), z3::to_expr(), z3::to_func_decl(), and z3::to_sort().

187  {
188  Z3_error_code e = Z3_get_error_code(m_ctx);
189  if (e != Z3_OK && enable_exceptions())
190  Z3_THROW(exception(Z3_get_error_msg(m_ctx, e)));
191  return e;
192  }
Z3_string Z3_API Z3_get_error_msg(Z3_context c, Z3_error_code err)
Return a string describing the given error code.
#define Z3_THROW(x)
Definition: z3++.h:99
Definition: z3_api.h:1365
Z3_error_code
Z3 error codes (See Z3_get_error_code).
Definition: z3_api.h:1363
bool enable_exceptions() const
Definition: z3++.h:207
Z3_error_code Z3_API Z3_get_error_code(Z3_context c)
Return the error code for the last API call.

◆ check_parser_error()

void check_parser_error ( ) const
inline

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

194  {
195  check_error();
196  }
Z3_error_code check_error() const
Auxiliary method used to check for API usage errors.
Definition: z3++.h:187

◆ constant() [1/2]

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

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

3168  {
3169  Z3_ast r = Z3_mk_const(m_ctx, name, s);
3170  check_error();
3171  return expr(*this, r);
3172  }
Z3_error_code check_error() const
Auxiliary method used to check for API usage errors.
Definition: z3++.h:187
Z3_ast Z3_API Z3_mk_const(Z3_context c, Z3_symbol s, Z3_sort ty)
Declare and create a constant.

◆ constant() [2/2]

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

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

3173 { return constant(str_symbol(name), s); }
symbol str_symbol(char const *s)
Create a Z3 symbol based on the given string.
Definition: z3++.h:2992
expr constant(symbol const &name, sort const &s)
Definition: z3++.h:3168

◆ enable_exceptions()

bool enable_exceptions ( ) const
inline

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

207 { return m_enable_exceptions; }

◆ 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 3034 of file z3++.h.

3034  {
3035  array<Z3_symbol> _enum_names(n);
3036  for (unsigned i = 0; i < n; i++) { _enum_names[i] = Z3_mk_string_symbol(*this, enum_names[i]); }
3037  array<Z3_func_decl> _cs(n);
3038  array<Z3_func_decl> _ts(n);
3039  Z3_symbol _name = Z3_mk_string_symbol(*this, name);
3040  sort s = to_sort(*this, Z3_mk_enumeration_sort(*this, _name, n, _enum_names.ptr(), _cs.ptr(), _ts.ptr()));
3041  check_error();
3042  for (unsigned i = 0; i < n; i++) { cs.push_back(func_decl(*this, _cs[i])); ts.push_back(func_decl(*this, _ts[i])); }
3043  return s;
3044  }
Z3_error_code check_error() const
Auxiliary method used to check for API usage errors.
Definition: z3++.h:187
Z3_symbol Z3_API Z3_mk_string_symbol(Z3_context c, Z3_string s)
Create a Z3 symbol using a C string.
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.
sort to_sort(context &c, Z3_sort s)
Definition: z3++.h:1793

◆ fpa_const() [1/2]

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

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

3178 { return constant(name, fpa_sort(ebits, sbits)); }
expr constant(symbol const &name, sort const &s)
Definition: z3++.h:3168
sort fpa_sort()
Return a FloatingPoint sort with given precision bitwidth (16, 32, 64 or 128).

◆ fpa_const() [2/2]

expr fpa_const ( char const *  name)
inline

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

3181 { return constant(name, fpa_sort<precision>()); }
expr constant(symbol const &name, sort const &s)
Definition: z3++.h:3168

◆ fpa_rounding_mode()

sort fpa_rounding_mode ( )
inline

Return a RoundingMode sort.

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

Referenced by z3::operator*(), z3::operator+(), z3::operator-(), and z3::operator/().

3016  {
3017  switch (m_rounding_mode) {
3018  case RNA: return sort(*this, Z3_mk_fpa_rna(m_ctx));
3019  case RNE: return sort(*this, Z3_mk_fpa_rne(m_ctx));
3020  case RTP: return sort(*this, Z3_mk_fpa_rtp(m_ctx));
3021  case RTN: return sort(*this, Z3_mk_fpa_rtn(m_ctx));
3022  case RTZ: return sort(*this, Z3_mk_fpa_rtz(m_ctx));
3023  default: return sort(*this);
3024  }
3025  }
Z3_ast Z3_API Z3_mk_fpa_rtz(Z3_context c)
Create a numeral of RoundingMode sort which represents the TowardZero rounding mode.
Definition: z3++.h:139
Z3_ast Z3_API Z3_mk_fpa_rne(Z3_context c)
Create a numeral of RoundingMode sort which represents the NearestTiesToEven 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...
Definition: z3++.h:136
Z3_ast Z3_API Z3_mk_fpa_rna(Z3_context c)
Create a numeral of RoundingMode sort which represents the NearestTiesToAway rounding mode...
Definition: z3++.h:140
Definition: z3++.h:138
Definition: z3++.h:137

◆ fpa_sort() [1/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 3002 of file z3++.h.

3002 { Z3_sort s = Z3_mk_fpa_sort(m_ctx, ebits, sbits); check_error(); return sort(*this, s); }
Z3_error_code check_error() const
Auxiliary method used to check for API usage errors.
Definition: z3++.h:187
Z3_sort Z3_API Z3_mk_fpa_sort(Z3_context c, unsigned ebits, unsigned sbits)
Create a FloatingPoint sort.

◆ fpa_sort() [2/6]

sort fpa_sort ( )

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

◆ fpa_sort() [3/6]

sort fpa_sort ( )
inline

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

Referenced by context::fpa_sort().

3005 { return fpa_sort(5, 11); }
sort fpa_sort()
Return a FloatingPoint sort with given precision bitwidth (16, 32, 64 or 128).

◆ fpa_sort() [4/6]

sort fpa_sort ( )
inline

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

Referenced by context::fpa_sort().

3008 { return fpa_sort(8, 24); }
sort fpa_sort()
Return a FloatingPoint sort with given precision bitwidth (16, 32, 64 or 128).

◆ fpa_sort() [5/6]

sort fpa_sort ( )
inline

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

Referenced by context::fpa_sort().

3011 { return fpa_sort(11, 53); }
sort fpa_sort()
Return a FloatingPoint sort with given precision bitwidth (16, 32, 64 or 128).

◆ fpa_sort() [6/6]

sort fpa_sort ( )
inline

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

Referenced by context::fpa_sort().

3014 { return fpa_sort(15, 113); }
sort fpa_sort()
Return a FloatingPoint sort with given precision bitwidth (16, 32, 64 or 128).

◆ fpa_val() [1/2]

expr fpa_val ( double  n)
inline

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

3209 { sort s = fpa_sort<64>(); Z3_ast r = Z3_mk_fpa_numeral_double(m_ctx, n, s); check_error(); return expr(*this, r); }
Z3_error_code check_error() const
Auxiliary method used to check for API usage errors.
Definition: z3++.h:187
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.

◆ fpa_val() [2/2]

expr fpa_val ( float  n)
inline

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

3210 { sort s = fpa_sort<32>(); Z3_ast r = Z3_mk_fpa_numeral_float(m_ctx, n, s); check_error(); return expr(*this, r); }
Z3_error_code check_error() const
Auxiliary method used to check for API usage errors.
Definition: z3++.h:187
Z3_ast Z3_API Z3_mk_fpa_numeral_float(Z3_context c, float v, Z3_sort ty)
Create a numeral of FloatingPoint sort from a float.

◆ function() [1/9]

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

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

Referenced by z3::function().

3066  {
3067  array<Z3_sort> args(arity);
3068  for (unsigned i = 0; i < arity; i++) {
3069  check_context(domain[i], range);
3070  args[i] = domain[i];
3071  }
3072  Z3_func_decl f = Z3_mk_func_decl(m_ctx, name, arity, args.ptr(), range);
3073  check_error();
3074  return func_decl(*this, f);
3075  }
Z3_error_code check_error() const
Auxiliary method used to check for API usage errors.
Definition: z3++.h:187
expr range(expr const &lo, expr const &hi)
Definition: z3++.h:3518
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:422

◆ function() [2/9]

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

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

3077  {
3078  return function(range.ctx().str_symbol(name), arity, domain, range);
3079  }
symbol str_symbol(char const *s)
Create a Z3 symbol based on the given string.
Definition: z3++.h:2992
expr range(expr const &lo, expr const &hi)
Definition: z3++.h:3518
context & ctx() const
Definition: z3++.h:418

◆ function() [3/9]

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

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

3081  {
3082  array<Z3_sort> args(domain.size());
3083  for (unsigned i = 0; i < domain.size(); i++) {
3084  check_context(domain[i], range);
3085  args[i] = domain[i];
3086  }
3087  Z3_func_decl f = Z3_mk_func_decl(m_ctx, name, domain.size(), args.ptr(), range);
3088  check_error();
3089  return func_decl(*this, f);
3090  }
Z3_error_code check_error() const
Auxiliary method used to check for API usage errors.
Definition: z3++.h:187
expr range(expr const &lo, expr const &hi)
Definition: z3++.h:3518
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:422

◆ function() [4/9]

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

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

3092  {
3093  return function(range.ctx().str_symbol(name), domain, range);
3094  }
symbol str_symbol(char const *s)
Create a Z3 symbol based on the given string.
Definition: z3++.h:2992
expr range(expr const &lo, expr const &hi)
Definition: z3++.h:3518
context & ctx() const
Definition: z3++.h:418

◆ function() [5/9]

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

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

3097  {
3098  check_context(domain, range);
3099  Z3_sort args[1] = { domain };
3100  Z3_func_decl f = Z3_mk_func_decl(m_ctx, str_symbol(name), 1, args, range);
3101  check_error();
3102  return func_decl(*this, f);
3103  }
Z3_error_code check_error() const
Auxiliary method used to check for API usage errors.
Definition: z3++.h:187
symbol str_symbol(char const *s)
Create a Z3 symbol based on the given string.
Definition: z3++.h:2992
expr range(expr const &lo, expr const &hi)
Definition: z3++.h:3518
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:422

◆ function() [6/9]

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

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

3105  {
3107  Z3_sort args[2] = { d1, d2 };
3108  Z3_func_decl f = Z3_mk_func_decl(m_ctx, str_symbol(name), 2, args, range);
3109  check_error();
3110  return func_decl(*this, f);
3111  }
Z3_error_code check_error() const
Auxiliary method used to check for API usage errors.
Definition: z3++.h:187
symbol str_symbol(char const *s)
Create a Z3 symbol based on the given string.
Definition: z3++.h:2992
expr range(expr const &lo, expr const &hi)
Definition: z3++.h:3518
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:422

◆ function() [7/9]

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

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

3113  {
3115  Z3_sort args[3] = { d1, d2, d3 };
3116  Z3_func_decl f = Z3_mk_func_decl(m_ctx, str_symbol(name), 3, args, range);
3117  check_error();
3118  return func_decl(*this, f);
3119  }
Z3_error_code check_error() const
Auxiliary method used to check for API usage errors.
Definition: z3++.h:187
symbol str_symbol(char const *s)
Create a Z3 symbol based on the given string.
Definition: z3++.h:2992
expr range(expr const &lo, expr const &hi)
Definition: z3++.h:3518
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:422

◆ function() [8/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 3121 of file z3++.h.

3121  {
3123  Z3_sort args[4] = { d1, d2, d3, d4 };
3124  Z3_func_decl f = Z3_mk_func_decl(m_ctx, str_symbol(name), 4, args, range);
3125  check_error();
3126  return func_decl(*this, f);
3127  }
Z3_error_code check_error() const
Auxiliary method used to check for API usage errors.
Definition: z3++.h:187
symbol str_symbol(char const *s)
Create a Z3 symbol based on the given string.
Definition: z3++.h:2992
expr range(expr const &lo, expr const &hi)
Definition: z3++.h:3518
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:422

◆ function() [9/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 3129 of file z3++.h.

3129  {
3131  Z3_sort args[5] = { d1, d2, d3, d4, d5 };
3132  Z3_func_decl f = Z3_mk_func_decl(m_ctx, str_symbol(name), 5, args, range);
3133  check_error();
3134  return func_decl(*this, f);
3135  }
Z3_error_code check_error() const
Auxiliary method used to check for API usage errors.
Definition: z3++.h:187
symbol str_symbol(char const *s)
Create a Z3 symbol based on the given string.
Definition: z3++.h:2992
expr range(expr const &lo, expr const &hi)
Definition: z3++.h:3518
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:422

◆ int_const()

expr int_const ( char const *  name)
inline

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

3175 { return constant(name, int_sort()); }
expr constant(symbol const &name, sort const &s)
Definition: z3++.h:3168
sort int_sort()
Return the integer sort.
Definition: z3++.h:2996

◆ int_sort()

sort int_sort ( )
inline

Return the integer sort.

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

2996 { Z3_sort s = Z3_mk_int_sort(m_ctx); check_error(); return sort(*this, s); }
Z3_error_code check_error() const
Auxiliary method used to check for API usage errors.
Definition: z3++.h:187
Z3_sort Z3_API Z3_mk_int_sort(Z3_context c)
Create the integer type.

◆ int_symbol()

symbol int_symbol ( int  n)
inline

Create a Z3 symbol based on the given integer.

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

2993 { Z3_symbol r = Z3_mk_int_symbol(m_ctx, n); check_error(); return symbol(*this, r); }
Z3_error_code check_error() const
Auxiliary method used to check for API usage errors.
Definition: z3++.h:187
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 ( int  n)
inline

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

Referenced by z3::abs().

3185 { Z3_ast r = Z3_mk_int(m_ctx, n, int_sort()); check_error(); return expr(*this, r); }
Z3_error_code check_error() const
Auxiliary method used to check for API usage errors.
Definition: z3++.h:187
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.
sort int_sort()
Return the integer sort.
Definition: z3++.h:2996

◆ int_val() [2/5]

expr int_val ( unsigned  n)
inline

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

3186 { Z3_ast r = Z3_mk_unsigned_int(m_ctx, n, int_sort()); 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.
Z3_error_code check_error() const
Auxiliary method used to check for API usage errors.
Definition: z3++.h:187
sort int_sort()
Return the integer sort.
Definition: z3++.h:2996

◆ int_val() [3/5]

expr int_val ( int64_t  n)
inline

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

3187 { Z3_ast r = Z3_mk_int64(m_ctx, n, int_sort()); check_error(); return expr(*this, r); }
Z3_error_code check_error() const
Auxiliary method used to check for API usage errors.
Definition: z3++.h:187
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.
sort int_sort()
Return the integer sort.
Definition: z3++.h:2996

◆ int_val() [4/5]

expr int_val ( uint64_t  n)
inline

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

3188 { Z3_ast r = Z3_mk_unsigned_int64(m_ctx, n, int_sort()); check_error(); return expr(*this, r); }
Z3_error_code check_error() const
Auxiliary method used to check for API usage errors.
Definition: z3++.h:187
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.
sort int_sort()
Return the integer sort.
Definition: z3++.h:2996

◆ int_val() [5/5]

expr int_val ( char const *  n)
inline

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

3189 { Z3_ast r = Z3_mk_numeral(m_ctx, n, int_sort()); check_error(); return expr(*this, r); }
Z3_error_code check_error() const
Auxiliary method used to check for API usage errors.
Definition: z3++.h:187
Z3_ast Z3_API Z3_mk_numeral(Z3_context c, Z3_string numeral, Z3_sort ty)
Create a numeral of a given sort.
sort int_sort()
Return the integer sort.
Definition: z3++.h:2996

◆ 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 229 of file z3++.h.

229 { 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_val()

expr num_val ( int  n,
sort const &  s 
)
inline

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

Referenced by z3::ashr(), z3::lshr(), z3::mod(), z3::operator &(), z3::operator!=(), z3::operator*(), z3::operator+(), z3::operator-(), z3::operator/(), z3::operator<(), z3::operator<=(), z3::operator==(), z3::operator>(), z3::operator>=(), z3::operator^(), z3::operator|(), z3::pw(), z3::rem(), z3::select(), z3::shl(), z3::sle(), z3::slt(), z3::smod(), z3::srem(), z3::store(), z3::udiv(), z3::uge(), z3::ugt(), z3::ule(), z3::ult(), and z3::urem().

3216 { Z3_ast r = Z3_mk_int(m_ctx, n, s); check_error(); return expr(*this, r); }
Z3_error_code check_error() const
Auxiliary method used to check for API usage errors.
Definition: z3++.h:187
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.

◆ operator Z3_context()

operator Z3_context ( ) const
inline

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

182 { return m_ctx; }

◆ parse_file() [1/2]

expr_vector parse_file ( char const *  file)
inline

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

3535  {
3536  Z3_ast_vector r = Z3_parse_smtlib2_file(*this, s, 0, 0, 0, 0, 0, 0);
3537  check_error();
3538  return expr_vector(*this, r);
3539  }
Z3_error_code check_error() const
Auxiliary method used to check for API usage errors.
Definition: z3++.h:187
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:72

◆ parse_file() [2/2]

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

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

3558  {
3559  array<Z3_symbol> sort_names(sorts.size());
3560  array<Z3_symbol> decl_names(decls.size());
3561  array<Z3_sort> sorts1(sorts);
3562  array<Z3_func_decl> decls1(decls);
3563  for (unsigned i = 0; i < sorts.size(); ++i) {
3564  sort_names[i] = sorts[i].name();
3565  }
3566  for (unsigned i = 0; i < decls.size(); ++i) {
3567  decl_names[i] = decls[i].name();
3568  }
3569  Z3_ast_vector r = Z3_parse_smtlib2_file(*this, s, sorts.size(), sort_names.ptr(), sorts1.ptr(), decls.size(), decl_names.ptr(), decls1.ptr());
3570  check_error();
3571  return expr_vector(*this, r);
3572  }
Z3_error_code check_error() const
Auxiliary method used to check for API usage errors.
Definition: z3++.h:187
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:72

◆ parse_string() [1/2]

expr_vector parse_string ( char const *  s)
inline

parsing

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

3529  {
3530  Z3_ast_vector r = Z3_parse_smtlib2_string(*this, s, 0, 0, 0, 0, 0, 0);
3531  check_error();
3532  return expr_vector(*this, r);
3533 
3534  }
Z3_error_code check_error() const
Auxiliary method used to check for API usage errors.
Definition: z3++.h:187
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.
ast_vector_tpl< expr > expr_vector
Definition: z3++.h:72

◆ parse_string() [2/2]

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

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

3541  {
3542  array<Z3_symbol> sort_names(sorts.size());
3543  array<Z3_symbol> decl_names(decls.size());
3544  array<Z3_sort> sorts1(sorts);
3545  array<Z3_func_decl> decls1(decls);
3546  for (unsigned i = 0; i < sorts.size(); ++i) {
3547  sort_names[i] = sorts[i].name();
3548  }
3549  for (unsigned i = 0; i < decls.size(); ++i) {
3550  decl_names[i] = decls[i].name();
3551  }
3552 
3553  Z3_ast_vector r = Z3_parse_smtlib2_string(*this, s, sorts.size(), sort_names.ptr(), sorts1.ptr(), decls.size(), decl_names.ptr(), decls1.ptr());
3554  check_error();
3555  return expr_vector(*this, r);
3556  }
Z3_error_code check_error() const
Auxiliary method used to check for API usage errors.
Definition: z3++.h:187
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.
ast_vector_tpl< expr > expr_vector
Definition: z3++.h:72

◆ re_sort()

sort re_sort ( sort seq_sort)
inline

Return a regular expression sort over sequences seq_sort.

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

3001 { Z3_sort r = Z3_mk_re_sort(m_ctx, s); check_error(); return sort(*this, r); }
Z3_error_code check_error() const
Auxiliary method used to check for API usage errors.
Definition: z3++.h:187
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 3176 of file z3++.h.

3176 { return constant(name, real_sort()); }
expr constant(symbol const &name, sort const &s)
Definition: z3++.h:3168
sort real_sort()
Return the Real sort.
Definition: z3++.h:2997

◆ real_sort()

sort real_sort ( )
inline

Return the Real sort.

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

2997 { Z3_sort s = Z3_mk_real_sort(m_ctx); check_error(); return sort(*this, s); }
Z3_error_code check_error() const
Auxiliary method used to check for API usage errors.
Definition: z3++.h:187
Z3_sort Z3_API Z3_mk_real_sort(Z3_context c)
Create the real type.

◆ real_val() [1/6]

expr real_val ( int  n,
int  d 
)
inline

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

Referenced by z3::abs().

3191 { Z3_ast r = Z3_mk_real(m_ctx, n, d); check_error(); return expr(*this, r); }
Z3_error_code check_error() const
Auxiliary method used to check for API usage errors.
Definition: z3++.h:187
Z3_ast Z3_API Z3_mk_real(Z3_context c, int num, int den)
Create a real from a fraction.

◆ real_val() [2/6]

expr real_val ( int  n)
inline

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

3192 { Z3_ast r = Z3_mk_int(m_ctx, n, real_sort()); check_error(); return expr(*this, r); }
Z3_error_code check_error() const
Auxiliary method used to check for API usage errors.
Definition: z3++.h:187
sort real_sort()
Return the Real sort.
Definition: z3++.h:2997
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.

◆ real_val() [3/6]

expr real_val ( unsigned  n)
inline

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

3193 { Z3_ast r = Z3_mk_unsigned_int(m_ctx, n, real_sort()); 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.
Z3_error_code check_error() const
Auxiliary method used to check for API usage errors.
Definition: z3++.h:187
sort real_sort()
Return the Real sort.
Definition: z3++.h:2997

◆ real_val() [4/6]

expr real_val ( int64_t  n)
inline

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

3194 { Z3_ast r = Z3_mk_int64(m_ctx, n, real_sort()); check_error(); return expr(*this, r); }
Z3_error_code check_error() const
Auxiliary method used to check for API usage errors.
Definition: z3++.h:187
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.
sort real_sort()
Return the Real sort.
Definition: z3++.h:2997

◆ real_val() [5/6]

expr real_val ( uint64_t  n)
inline

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

3195 { Z3_ast r = Z3_mk_unsigned_int64(m_ctx, n, real_sort()); check_error(); return expr(*this, r); }
Z3_error_code check_error() const
Auxiliary method used to check for API usage errors.
Definition: z3++.h:187
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.
sort real_sort()
Return the Real sort.
Definition: z3++.h:2997

◆ real_val() [6/6]

expr real_val ( char const *  n)
inline

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

3196 { Z3_ast r = Z3_mk_numeral(m_ctx, n, real_sort()); check_error(); return expr(*this, r); }
Z3_error_code check_error() const
Auxiliary method used to check for API usage errors.
Definition: z3++.h:187
sort real_sort()
Return the Real sort.
Definition: z3++.h:2997
Z3_ast Z3_API Z3_mk_numeral(Z3_context c, Z3_string numeral, Z3_sort ty)
Create a numeral of a given sort.

◆ recdef()

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

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

3162  {
3163  check_context(f, args); check_context(f, body);
3164  array<Z3_ast> vars(args);
3165  Z3_add_rec_def(f.ctx(), f, vars.size(), vars.ptr(), body);
3166  }
void check_context(object const &a, object const &b)
Definition: z3++.h:422
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.

◆ recfun() [1/4]

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

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

Referenced by z3::recfun().

3137  {
3138  array<Z3_sort> args(arity);
3139  for (unsigned i = 0; i < arity; i++) {
3140  check_context(domain[i], range);
3141  args[i] = domain[i];
3142  }
3143  Z3_func_decl f = Z3_mk_rec_func_decl(m_ctx, name, arity, args.ptr(), range);
3144  check_error();
3145  return func_decl(*this, f);
3146 
3147  }
Z3_error_code check_error() const
Auxiliary method used to check for API usage errors.
Definition: z3++.h:187
expr range(expr const &lo, expr const &hi)
Definition: z3++.h:3518
void check_context(object const &a, object const &b)
Definition: z3++.h:422
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() [2/4]

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

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

3149  {
3150  return recfun(str_symbol(name), arity, domain, range);
3151  }
symbol str_symbol(char const *s)
Create a Z3 symbol based on the given string.
Definition: z3++.h:2992
expr range(expr const &lo, expr const &hi)
Definition: z3++.h:3518
func_decl recfun(symbol const &name, unsigned arity, sort const *domain, sort const &range)
Definition: z3++.h:3137

◆ recfun() [3/4]

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

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

3153  {
3154  return recfun(str_symbol(name), 1, &d1, range);
3155  }
symbol str_symbol(char const *s)
Create a Z3 symbol based on the given string.
Definition: z3++.h:2992
expr range(expr const &lo, expr const &hi)
Definition: z3++.h:3518
func_decl recfun(symbol const &name, unsigned arity, sort const *domain, sort const &range)
Definition: z3++.h:3137

◆ recfun() [4/4]

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

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

3157  {
3158  sort dom[2] = { d1, d2 };
3159  return recfun(str_symbol(name), 2, dom, range);
3160  }
symbol str_symbol(char const *s)
Create a Z3 symbol based on the given string.
Definition: z3++.h:2992
expr range(expr const &lo, expr const &hi)
Definition: z3++.h:3518
func_decl recfun(symbol const &name, unsigned arity, sort const *domain, sort const &range)
Definition: z3++.h:3137

◆ seq_sort()

sort seq_sort ( sort s)
inline

Return a sequence sort over base sort s.

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

3000 { Z3_sort r = Z3_mk_seq_sort(m_ctx, s); check_error(); return sort(*this, r); }
Z3_error_code check_error() const
Auxiliary method used to check for API usage errors.
Definition: z3++.h:187
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,
char const *  value 
)
inline

Update global parameter param with string value.

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

212 { Z3_update_param_value(m_ctx, param, value); }
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,
bool  value 
)
inline

Update global parameter param with Boolean value.

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

216 { 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() [3/3]

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

Update global parameter param with Integer value.

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

220  {
221  auto str = std::to_string(value);
222  Z3_update_param_value(m_ctx, param, str.c_str());
223  }
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_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 205 of file z3++.h.

205 { m_enable_exceptions = f; }

◆ set_rounding_mode()

void set_rounding_mode ( rounding_mode  rm)
inline

Sets RoundingMode of FloatingPoints.

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

3027 { m_rounding_mode = rm; }

◆ str_symbol()

symbol str_symbol ( char const *  s)
inline

Create a Z3 symbol based on the given string.

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

Referenced by context::function(), and solver::solver().

2992 { Z3_symbol r = Z3_mk_string_symbol(m_ctx, s); check_error(); return symbol(*this, r); }
Z3_error_code check_error() const
Auxiliary method used to check for API usage errors.
Definition: z3++.h:187
Z3_symbol Z3_API Z3_mk_string_symbol(Z3_context c, Z3_string s)
Create a Z3 symbol using a C string.

◆ string_sort()

sort string_sort ( )
inline

Return the sort for ASCII strings.

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

2999 { Z3_sort s = Z3_mk_string_sort(m_ctx); check_error(); return sort(*this, s); }
Z3_error_code check_error() const
Auxiliary method used to check for API usage errors.
Definition: z3++.h:187
Z3_sort Z3_API Z3_mk_string_sort(Z3_context c)
Create a sort for 8 bit strings.

◆ string_val() [1/3]

expr string_val ( char const *  s)
inline

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

3213 { Z3_ast r = Z3_mk_string(m_ctx, s); check_error(); return expr(*this, r); }
Z3_error_code check_error() const
Auxiliary method used to check for API usage errors.
Definition: z3++.h:187
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.

◆ string_val() [2/3]

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

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

3212 { Z3_ast r = Z3_mk_lstring(m_ctx, n, s); check_error(); return expr(*this, r); }
Z3_error_code check_error() const
Auxiliary method used to check for API usage errors.
Definition: z3++.h:187
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/3]

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

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

3214 { Z3_ast r = Z3_mk_string(m_ctx, s.c_str()); check_error(); return expr(*this, r); }
Z3_error_code check_error() const
Auxiliary method used to check for API usage errors.
Definition: z3++.h:187
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.

◆ 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 3045 of file z3++.h.

3045  {
3046  array<Z3_symbol> _names(n);
3047  array<Z3_sort> _sorts(n);
3048  for (unsigned i = 0; i < n; i++) { _names[i] = Z3_mk_string_symbol(*this, names[i]); _sorts[i] = sorts[i]; }
3049  array<Z3_func_decl> _projs(n);
3050  Z3_symbol _name = Z3_mk_string_symbol(*this, name);
3051  Z3_func_decl tuple;
3052  sort _ignore_s = to_sort(*this, Z3_mk_tuple_sort(*this, _name, n, _names.ptr(), _sorts.ptr(), &tuple, _projs.ptr()));
3053  check_error();
3054  for (unsigned i = 0; i < n; i++) { projs.push_back(func_decl(*this, _projs[i])); }
3055  return func_decl(*this, tuple);
3056  }
Z3_error_code check_error() const
Auxiliary method used to check for API usage errors.
Definition: z3++.h:187
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.
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:1793

◆ 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 3058 of file z3++.h.

3058  {
3059  Z3_symbol _name = Z3_mk_string_symbol(*this, name);
3060  return to_sort(*this, Z3_mk_uninterpreted_sort(*this, _name));
3061  }
Z3_symbol Z3_API Z3_mk_string_symbol(Z3_context c, Z3_string s)
Create a Z3 symbol using a C string.
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 to_sort(context &c, Z3_sort s)
Definition: z3++.h:1793

◆ uninterpreted_sort() [2/2]

sort uninterpreted_sort ( symbol const &  name)
inline

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

3062  {
3063  return to_sort(*this, Z3_mk_uninterpreted_sort(*this, name));
3064  }
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 to_sort(context &c, Z3_sort s)
Definition: z3++.h:1793

Friends And Related Function Documentation

◆ scoped_context

friend class scoped_context
friend

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