Z3
Loading...
Searching...
No Matches
z3 Namespace Reference

Z3 C++ namespace. More...

Data Structures

class  cast_ast
class  ast_vector_tpl
class  exception
 Exception used to sign API usage errors. More...
class  config
 Z3 global configuration object. More...
class  context
 A Context manages all other Z3 objects, global configuration options, etc. More...
class  array
class  object
class  symbol
class  param_descrs
class  params
class  ast
class  ast_map
 A map from ASTs to ASTs. More...
class  sort
 A Z3 sort (aka type). Every expression (i.e., formula or term) in Z3 has a sort. More...
class  func_decl
 Function declaration (aka function definition). It is the signature of interpreted and uninterpreted functions in Z3. The basic building block in Z3 is the function application. More...
class  parser_context
class  expr
 A Z3 expression is used to represent formulas and terms. For Z3, a formula is any expression of sort Boolean. Every expression has a sort. More...
class  cast_ast< ast >
class  cast_ast< expr >
class  cast_ast< sort >
class  cast_ast< func_decl >
class  func_entry
class  func_interp
class  model
class  stats
class  parameter
 class for auxiliary parameters associated with func_decl The class is initialized with a func_decl or application expression and an index The accessor get_expr, get_sort, ... is available depending on the value of kind(). The caller is responsible to check that the kind of the parameter aligns with the call (get_expr etc). More...
class  solver
class  goal
class  apply_result
class  tactic
class  simplifier
class  probe
class  optimize
class  fixedpoint
class  constructor_list
class  constructors
class  on_clause
class  user_propagator_base
class  rcf_num
 Wrapper for Z3 Real Closed Field (RCF) numerals. More...

Typedefs

typedef ast_vector_tpl< ast > ast_vector
typedef ast_vector_tpl< expr > expr_vector
typedef ast_vector_tpl< sort > sort_vector
typedef ast_vector_tpl< func_decl > func_decl_vector
typedef std::function< void(expr const &proof, std::vector< unsigned > const &deps, expr_vector const &clause)> on_clause_eh_t

Enumerations

enum  check_result { unsat , sat , unknown }
enum  rounding_mode {
  RNA , RNE , RTP , RTN ,
  RTZ
}

Functions

void set_param (char const *param, char const *value)
void set_param (char const *param, bool value)
void set_param (char const *param, int value)
void reset_params ()
void get_version (unsigned &major, unsigned &minor, unsigned &build_number, unsigned &revision_number)
 Return Z3 version number information.
std::string get_full_version ()
 Return a string that fully describes the version of Z3 in use.
void enable_trace (char const *tag)
 Enable tracing messages tagged as tag when Z3 is compiled in debug mode. It is a NOOP otherwise.
void disable_trace (char const *tag)
 Disable tracing messages tagged as tag when Z3 is compiled in debug mode. It is a NOOP otherwise.
std::ostream & operator<< (std::ostream &out, exception const &e)
check_result to_check_result (Z3_lbool l)
void check_context (object const &a, object const &b)
std::ostream & operator<< (std::ostream &out, symbol const &s)
std::ostream & operator<< (std::ostream &out, param_descrs const &d)
std::ostream & operator<< (std::ostream &out, params const &p)
std::ostream & operator<< (std::ostream &out, ast const &n)
bool eq (ast const &a, ast const &b)
expr select (expr const &a, expr const &i)
 forward declarations
expr select (expr const &a, expr_vector const &i)
expr implies (expr const &a, expr const &b)
expr implies (expr const &a, bool b)
expr implies (bool a, expr const &b)
expr pw (expr const &a, expr const &b)
expr pw (expr const &a, int b)
expr pw (int a, expr const &b)
expr mod (expr const &a, expr const &b)
expr mod (expr const &a, int b)
expr mod (int a, expr const &b)
expr operator% (expr const &a, expr const &b)
expr operator% (expr const &a, int b)
expr operator% (int a, expr const &b)
expr rem (expr const &a, expr const &b)
expr rem (expr const &a, int b)
expr rem (int a, expr const &b)
expr complex (expr const &re, expr const &im)
 Construct a Complex expression from Int or Real components.
expr real_part (expr const &z)
expr imag_part (expr const &z)
expr operator! (expr const &a)
expr is_int (expr const &e)
expr operator&& (expr const &a, expr const &b)
expr operator&& (expr const &a, bool b)
expr operator&& (bool a, expr const &b)
expr operator|| (expr const &a, expr const &b)
expr operator|| (expr const &a, bool b)
expr operator|| (bool a, expr const &b)
expr operator== (expr const &a, expr const &b)
expr operator== (expr const &a, int b)
expr operator== (int a, expr const &b)
expr operator== (expr const &a, double b)
expr operator== (double a, expr const &b)
expr operator!= (expr const &a, expr const &b)
expr operator!= (expr const &a, int b)
expr operator!= (int a, expr const &b)
expr operator!= (expr const &a, double b)
expr operator!= (double a, expr const &b)
expr operator+ (expr const &a, expr const &b)
expr operator+ (expr const &a, int b)
expr operator+ (int a, expr const &b)
expr operator* (expr const &a, expr const &b)
expr operator* (expr const &a, int b)
expr operator* (int a, expr const &b)
expr operator>= (expr const &a, expr const &b)
expr operator/ (expr const &a, expr const &b)
expr operator/ (expr const &a, int b)
expr operator/ (int a, expr const &b)
expr operator- (expr const &a)
expr operator- (expr const &a, expr const &b)
expr operator- (expr const &a, int b)
expr operator- (int a, expr const &b)
expr operator<= (expr const &a, expr const &b)
expr operator<= (expr const &a, int b)
expr operator<= (int a, expr const &b)
expr operator>= (expr const &a, int b)
expr operator>= (int a, expr const &b)
expr operator< (expr const &a, expr const &b)
expr operator< (expr const &a, int b)
expr operator< (int a, expr const &b)
expr operator> (expr const &a, expr const &b)
expr operator> (expr const &a, int b)
expr operator> (int a, expr const &b)
expr operator& (expr const &a, expr const &b)
expr operator& (expr const &a, int b)
expr operator& (int a, expr const &b)
expr operator^ (expr const &a, expr const &b)
expr operator^ (expr const &a, int b)
expr operator^ (int a, expr const &b)
expr operator| (expr const &a, expr const &b)
expr operator| (expr const &a, int b)
expr operator| (int a, expr const &b)
expr nand (expr const &a, expr const &b)
expr nor (expr const &a, expr const &b)
expr xnor (expr const &a, expr const &b)
expr min (expr const &a, expr const &b)
expr max (expr const &a, expr const &b)
expr bvredor (expr const &a)
expr bvredand (expr const &a)
expr abs (expr const &a)
expr sqrt (expr const &a, expr const &rm)
expr fp_eq (expr const &a, expr const &b)
expr operator~ (expr const &a)
expr fma (expr const &a, expr const &b, expr const &c, expr const &rm)
expr fpa_fp (expr const &sgn, expr const &exp, expr const &sig)
expr fpa_to_sbv (expr const &t, unsigned sz)
expr fpa_to_ubv (expr const &t, unsigned sz)
expr sbv_to_fpa (expr const &t, sort s)
expr ubv_to_fpa (expr const &t, sort s)
expr fpa_to_fpa (expr const &t, sort s)
expr round_fpa_to_closest_integer (expr const &t)
expr ite (expr const &c, expr const &t, expr const &e)
 Create the if-then-else expression ite(c, t, e).
expr to_expr (context &c, Z3_ast a)
 Wraps a Z3_ast as an expr object. It also checks for errors. This function allows the user to use the whole C API with the C++ layer defined in this file.
sort to_sort (context &c, Z3_sort s)
func_decl to_func_decl (context &c, Z3_func_decl f)
expr sle (expr const &a, expr const &b)
 signed less than or equal to operator for bitvectors.
expr sle (expr const &a, int b)
expr sle (int a, expr const &b)
expr slt (expr const &a, expr const &b)
 signed less than operator for bitvectors.
expr slt (expr const &a, int b)
expr slt (int a, expr const &b)
expr sge (expr const &a, expr const &b)
 signed greater than or equal to operator for bitvectors.
expr sge (expr const &a, int b)
expr sge (int a, expr const &b)
expr sgt (expr const &a, expr const &b)
 signed greater than operator for bitvectors.
expr sgt (expr const &a, int b)
expr sgt (int a, expr const &b)
expr ule (expr const &a, expr const &b)
 unsigned less than or equal to operator for bitvectors.
expr ule (expr const &a, int b)
expr ule (int a, expr const &b)
expr ult (expr const &a, expr const &b)
 unsigned less than operator for bitvectors.
expr ult (expr const &a, int b)
expr ult (int a, expr const &b)
expr uge (expr const &a, expr const &b)
 unsigned greater than or equal to operator for bitvectors.
expr uge (expr const &a, int b)
expr uge (int a, expr const &b)
expr ugt (expr const &a, expr const &b)
 unsigned greater than operator for bitvectors.
expr ugt (expr const &a, int b)
expr ugt (int a, expr const &b)
expr sdiv (expr const &a, expr const &b)
 signed division operator for bitvectors.
expr sdiv (expr const &a, int b)
expr sdiv (int a, expr const &b)
expr udiv (expr const &a, expr const &b)
 unsigned division operator for bitvectors.
expr udiv (expr const &a, int b)
expr udiv (int a, expr const &b)
expr srem (expr const &a, expr const &b)
 signed remainder operator for bitvectors
expr srem (expr const &a, int b)
expr srem (int a, expr const &b)
expr smod (expr const &a, expr const &b)
 signed modulus operator for bitvectors
expr smod (expr const &a, int b)
expr smod (int a, expr const &b)
expr urem (expr const &a, expr const &b)
 unsigned reminder operator for bitvectors
expr urem (expr const &a, int b)
expr urem (int a, expr const &b)
expr shl (expr const &a, expr const &b)
 shift left operator for bitvectors
expr shl (expr const &a, int b)
expr shl (int a, expr const &b)
expr lshr (expr const &a, expr const &b)
 logic shift right operator for bitvectors
expr lshr (expr const &a, int b)
expr lshr (int a, expr const &b)
expr ashr (expr const &a, expr const &b)
 arithmetic shift right operator for bitvectors
expr ashr (expr const &a, int b)
expr ashr (int a, expr const &b)
expr zext (expr const &a, unsigned i)
 Extend the given bit-vector with zeros to the (unsigned) equivalent bitvector of size m+i, where m is the size of the given bit-vector.
expr bv2int (expr const &a, bool is_signed)
 bit-vector and integer conversions.
expr int2bv (unsigned n, expr const &a)
expr bvadd_no_overflow (expr const &a, expr const &b, bool is_signed)
 bit-vector overflow/underflow checks
expr bvadd_no_underflow (expr const &a, expr const &b)
expr bvsub_no_overflow (expr const &a, expr const &b)
expr bvsub_no_underflow (expr const &a, expr const &b, bool is_signed)
expr bvsdiv_no_overflow (expr const &a, expr const &b)
expr bvneg_no_overflow (expr const &a)
expr bvmul_no_overflow (expr const &a, expr const &b, bool is_signed)
expr bvmul_no_underflow (expr const &a, expr const &b)
expr sext (expr const &a, unsigned i)
 Sign-extend of the given bit-vector to the (signed) equivalent bitvector of size m+i, where m is the size of the given bit-vector.
func_decl linear_order (sort const &a, unsigned index)
func_decl partial_order (sort const &a, unsigned index)
func_decl piecewise_linear_order (sort const &a, unsigned index)
func_decl tree_order (sort const &a, unsigned index)
expr_vector polynomial_subresultants (expr const &p, expr const &q, expr const &x)
 Return the nonzero subresultants of p and q with respect to the "variable" x.
expr forall (expr const &x, expr const &b)
expr forall (expr const &x1, expr const &x2, expr const &b)
expr forall (expr const &x1, expr const &x2, expr const &x3, expr const &b)
expr forall (expr const &x1, expr const &x2, expr const &x3, expr const &x4, expr const &b)
expr forall (expr_vector const &xs, expr const &b)
expr exists (expr const &x, expr const &b)
expr exists (expr const &x1, expr const &x2, expr const &b)
expr exists (expr const &x1, expr const &x2, expr const &x3, expr const &b)
expr exists (expr const &x1, expr const &x2, expr const &x3, expr const &x4, expr const &b)
expr exists (expr_vector const &xs, expr const &b)
expr lambda (expr const &x, expr const &b)
expr lambda (expr const &x1, expr const &x2, expr const &b)
expr lambda (expr const &x1, expr const &x2, expr const &x3, expr const &b)
expr lambda (expr const &x1, expr const &x2, expr const &x3, expr const &x4, expr const &b)
expr lambda (expr_vector const &xs, expr const &b)
expr pble (expr_vector const &es, int const *coeffs, int bound)
expr pbge (expr_vector const &es, int const *coeffs, int bound)
expr pbeq (expr_vector const &es, int const *coeffs, int bound)
expr atmost (expr_vector const &es, unsigned bound)
expr atleast (expr_vector const &es, unsigned bound)
expr sum (expr_vector const &args)
expr distinct (expr_vector const &args)
expr concat (expr const &a, expr const &b)
expr concat (expr_vector const &args)
expr map (expr const &f, expr const &list)
expr mapi (expr const &f, expr const &i, expr const &list)
expr foldl (expr const &f, expr const &a, expr const &list)
expr foldli (expr const &f, expr const &i, expr const &a, expr const &list)
expr mk_or (expr_vector const &args)
expr mk_and (expr_vector const &args)
expr mk_xor (expr_vector const &args)
expr qe_lite (expr_vector const &vars, expr const &body)
std::vector< Z3_app > to_apps (expr_vector const &bounds)
expr qe_model_project (model const &m, expr_vector const &bounds, expr const &body)
expr qe_model_project_skolem (model const &m, expr_vector const &bounds, expr const &body, ast_map &map)
 Project variables and write the introduced Skolem terms to map.
expr qe_model_project_with_witness (model const &m, expr_vector const &bounds, expr const &body, ast_map &map)
 Project variables and write the introduced witnesses to map.
std::ostream & operator<< (std::ostream &out, model const &m)
std::ostream & operator<< (std::ostream &out, stats const &s)
std::ostream & operator<< (std::ostream &out, check_result r)
std::ostream & operator<< (std::ostream &out, solver const &s)
std::ostream & operator<< (std::ostream &out, goal const &g)
std::ostream & operator<< (std::ostream &out, apply_result const &r)
tactic operator& (tactic const &t1, tactic const &t2)
tactic operator| (tactic const &t1, tactic const &t2)
tactic repeat (tactic const &t, unsigned max=UINT_MAX)
tactic with (tactic const &t, params const &p)
tactic try_for (tactic const &t, unsigned ms)
tactic par_or (unsigned n, tactic const *tactics)
tactic par_and_then (tactic const &t1, tactic const &t2)
simplifier operator& (simplifier const &t1, simplifier const &t2)
simplifier with (simplifier const &t, params const &p)
probe operator<= (probe const &p1, probe const &p2)
probe operator<= (probe const &p1, double p2)
probe operator<= (double p1, probe const &p2)
probe operator>= (probe const &p1, probe const &p2)
probe operator>= (probe const &p1, double p2)
probe operator>= (double p1, probe const &p2)
probe operator< (probe const &p1, probe const &p2)
probe operator< (probe const &p1, double p2)
probe operator< (double p1, probe const &p2)
probe operator> (probe const &p1, probe const &p2)
probe operator> (probe const &p1, double p2)
probe operator> (double p1, probe const &p2)
probe operator== (probe const &p1, probe const &p2)
probe operator== (probe const &p1, double p2)
probe operator== (double p1, probe const &p2)
probe operator&& (probe const &p1, probe const &p2)
probe operator|| (probe const &p1, probe const &p2)
probe operator! (probe const &p)
std::ostream & operator<< (std::ostream &out, optimize const &s)
std::ostream & operator<< (std::ostream &out, fixedpoint const &f)
tactic fail_if (probe const &p)
tactic when (probe const &p, tactic const &t)
tactic cond (probe const &p, tactic const &t1, tactic const &t2)
expr to_real (expr const &a)
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 (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 function (char const *name, sort_vector const &domain, sort const &range)
func_decl function (std::string const &name, sort_vector const &domain, 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 &d1, sort const &range)
func_decl recfun (char const *name, sort const &d1, sort const &d2, sort const &range)
expr select (expr const &a, int i)
expr store (expr const &a, expr const &i, expr const &v)
expr store (expr const &a, int i, expr const &v)
expr store (expr const &a, expr i, int v)
expr store (expr const &a, int i, int v)
expr store (expr const &a, expr_vector const &i, expr const &v)
expr as_array (func_decl &f)
expr array_default (expr const &a)
expr array_ext (expr const &a, expr const &b)
expr const_array (sort const &d, expr const &v)
expr empty_set (sort const &s)
expr full_set (sort const &s)
expr set_add (expr const &s, expr const &e)
expr set_del (expr const &s, expr const &e)
expr set_union (expr const &a, expr const &b)
expr set_intersect (expr const &a, expr const &b)
expr set_difference (expr const &a, expr const &b)
expr set_complement (expr const &a)
expr set_member (expr const &s, expr const &e)
expr set_subset (expr const &a, expr const &b)
expr finite_set_empty (sort const &s)
expr finite_set_singleton (expr const &e)
expr finite_set_union (expr const &a, expr const &b)
expr finite_set_intersect (expr const &a, expr const &b)
expr finite_set_difference (expr const &a, expr const &b)
expr finite_set_member (expr const &e, expr const &s)
expr finite_set_size (expr const &s)
expr finite_set_subset (expr const &a, expr const &b)
expr finite_set_map (expr const &f, expr const &s)
expr finite_set_filter (expr const &f, expr const &s)
expr finite_set_range (expr const &low, expr const &high)
expr empty (sort const &s)
expr suffixof (expr const &a, expr const &b)
expr prefixof (expr const &a, expr const &b)
expr indexof (expr const &s, expr const &substr, expr const &offset)
expr last_indexof (expr const &s, expr const &substr)
expr to_re (expr const &s)
expr in_re (expr const &s, expr const &re)
expr plus (expr const &re)
expr option (expr const &re)
expr star (expr const &re)
expr re_empty (sort const &s)
expr re_full (sort const &s)
expr re_intersect (expr_vector const &args)
expr re_diff (expr const &a, expr const &b)
expr re_complement (expr const &a)
expr range (expr const &lo, expr const &hi)
rcf_num rcf_pi (context &c)
 Create an RCF numeral representing pi.
rcf_num rcf_e (context &c)
 Create an RCF numeral representing e (Euler's constant).
rcf_num rcf_infinitesimal (context &c)
 Create an RCF numeral representing an infinitesimal.
std::vector< rcf_num > rcf_roots (context &c, std::vector< rcf_num > const &coeffs)
 Find roots of a polynomial with given coefficients.

Detailed Description

Z3 C++ namespace.

Typedef Documentation

◆ ast_vector

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

◆ expr_vector

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

◆ func_decl_vector

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

◆ on_clause_eh_t

typedef std::function<void(expr const& proof, std::vector<unsigned> const& deps, expr_vector const& clause)> on_clause_eh_t

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

◆ sort_vector

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

Enumeration Type Documentation

◆ check_result

Enumerator
unsat 
sat 
unknown 

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

166 {
168 };
@ unknown
Definition z3++.h:167
@ sat
Definition z3++.h:167
@ unsat
Definition z3++.h:167

◆ rounding_mode

Enumerator
RNA 
RNE 
RTP 
RTN 
RTZ 

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

170 {
171 RNA,
172 RNE,
173 RTP,
174 RTN,
175 RTZ
176 };
@ 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

Function Documentation

◆ abs()

expr abs ( expr const & a)
inline

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

2249 {
2250 Z3_ast r;
2251 if (a.is_int()) {
2252 expr zero = a.ctx().int_val(0);
2253 expr ge = a >= zero;
2254 expr na = -a;
2255 r = Z3_mk_ite(a.ctx(), ge, a, na);
2256 }
2257 else if (a.is_real()) {
2258 expr zero = a.ctx().real_val(0);
2259 expr ge = a >= zero;
2260 expr na = -a;
2261 r = Z3_mk_ite(a.ctx(), ge, a, na);
2262 }
2263 else {
2264 r = Z3_mk_fpa_abs(a.ctx(), a);
2265 }
2266 a.check_error();
2267 return expr(a.ctx(), r);
2268 }
expr int_val(int n)
Definition z3++.h:4217
expr real_val(int n)
Definition z3++.h:4224
A Z3 expression is used to represent formulas and terms. For Z3, a formula is any expression of sort ...
Definition z3++.h:1003
expr(context &c)
Definition z3++.h:1005
context & ctx() const
Definition z3++.h:567
Z3_ast Z3_API Z3_mk_ite(Z3_context c, Z3_ast t1, Z3_ast t2, Z3_ast t3)
Create an AST node representing an if-then-else: ite(t1, t2, t3).
Z3_ast Z3_API Z3_mk_fpa_abs(Z3_context c, Z3_ast t)
Floating-point absolute value.

◆ array_default()

expr array_default ( expr const & a)
inline

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

4431 {
4432 Z3_ast r = Z3_mk_array_default(a.ctx(), a);
4433 a.check_error();
4434 return expr(a.ctx(), r);
4435 }
Z3_ast Z3_API Z3_mk_array_default(Z3_context c, Z3_ast array)
Access the array default value. Produces the default range value, for arrays that can be represented ...

Referenced by array_default().

◆ array_ext()

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

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

4437 {
4438 check_context(a, b);
4439 Z3_ast r = Z3_mk_array_ext(a.ctx(), a, b);
4440 a.check_error();
4441 return expr(a.ctx(), r);
4442 }
Z3_ast Z3_API Z3_mk_array_ext(Z3_context c, Z3_ast arg1, Z3_ast arg2)
Create array extensionality index given two arrays with the same sort. The meaning is given by the ax...
void check_context(object const &a, object const &b)
Definition z3++.h:571

Referenced by array_ext().

◆ as_array()

expr as_array ( func_decl & f)
inline

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

4425 {
4426 Z3_ast r = Z3_mk_as_array(f.ctx(), f);
4427 f.check_error();
4428 return expr(f.ctx(), r);
4429 }
Z3_error_code check_error() const
Definition z3++.h:568
Z3_ast Z3_API Z3_mk_as_array(Z3_context c, Z3_func_decl f)
Create array with the same interpretation as a function. The array satisfies the property (f x) = (se...

Referenced by as_array().

◆ ashr() [1/3]

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

arithmetic shift right operator for bitvectors

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

2483{ return to_expr(a.ctx(), Z3_mk_bvashr(a.ctx(), a, b)); }
Z3_ast Z3_API Z3_mk_bvashr(Z3_context c, Z3_ast t1, Z3_ast t2)
Arithmetic shift right.
expr to_expr(context &c, Z3_ast a)
Wraps a Z3_ast as an expr object. It also checks for errors. This function allows the user to use the...
Definition z3++.h:2361

Referenced by ashr(), ashr(), and ashr().

◆ ashr() [2/3]

expr ashr ( expr const & a,
int b )
inline

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

2484{ return ashr(a, a.ctx().num_val(b, a.get_sort())); }
expr ashr(expr const &a, expr const &b)
arithmetic shift right operator for bitvectors
Definition z3++.h:2483

◆ ashr() [3/3]

expr ashr ( int a,
expr const & b )
inline

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

2485{ return ashr(b.ctx().num_val(a, b.get_sort()), b); }

◆ atleast()

expr atleast ( expr_vector const & es,
unsigned bound )
inline

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

2705 {
2706 assert(es.size() > 0);
2707 context& ctx = es[0u].ctx();
2708 array<Z3_ast> _es(es);
2709 Z3_ast r = Z3_mk_atleast(ctx, _es.size(), _es.ptr(), bound);
2710 ctx.check_error();
2711 return expr(ctx, r);
2712 }
A Context manages all other Z3 objects, global configuration options, etc.
Definition z3++.h:191
Z3_error_code check_error() const
Auxiliary method used to check for API usage errors.
Definition z3++.h:241
Z3_ast Z3_API Z3_mk_atleast(Z3_context c, unsigned num_args, Z3_ast const args[], unsigned k)
Pseudo-Boolean relations.

◆ atmost()

expr atmost ( expr_vector const & es,
unsigned bound )
inline

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

2697 {
2698 assert(es.size() > 0);
2699 context& ctx = es[0u].ctx();
2700 array<Z3_ast> _es(es);
2701 Z3_ast r = Z3_mk_atmost(ctx, _es.size(), _es.ptr(), bound);
2702 ctx.check_error();
2703 return expr(ctx, r);
2704 }
Z3_ast Z3_API Z3_mk_atmost(Z3_context c, unsigned num_args, Z3_ast const args[], unsigned k)
Pseudo-Boolean relations.

◆ bv2int()

expr bv2int ( expr const & a,
bool is_signed )
inline

bit-vector and integer conversions.

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

2495{ Z3_ast r = Z3_mk_bv2int(a.ctx(), a, is_signed); a.check_error(); return expr(a.ctx(), r); }
Z3_ast Z3_API Z3_mk_bv2int(Z3_context c, Z3_ast t1, bool is_signed)
Create an integer from the bit-vector argument t1. If is_signed is false, then the bit-vector t1 is t...

◆ bvadd_no_overflow()

expr bvadd_no_overflow ( expr const & a,
expr const & b,
bool is_signed )
inline

bit-vector overflow/underflow checks

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

2501 {
2502 check_context(a, b); Z3_ast r = Z3_mk_bvadd_no_overflow(a.ctx(), a, b, is_signed); a.check_error(); return expr(a.ctx(), r);
2503 }
Z3_ast Z3_API Z3_mk_bvadd_no_overflow(Z3_context c, Z3_ast t1, Z3_ast t2, bool is_signed)
Create a predicate that checks that the bit-wise addition of t1 and t2 does not overflow.

◆ bvadd_no_underflow()

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

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

2504 {
2505 check_context(a, b); Z3_ast r = Z3_mk_bvadd_no_underflow(a.ctx(), a, b); a.check_error(); return expr(a.ctx(), r);
2506 }
Z3_ast Z3_API Z3_mk_bvadd_no_underflow(Z3_context c, Z3_ast t1, Z3_ast t2)
Create a predicate that checks that the bit-wise signed addition of t1 and t2 does not underflow.

◆ bvmul_no_overflow()

expr bvmul_no_overflow ( expr const & a,
expr const & b,
bool is_signed )
inline

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

2519 {
2520 check_context(a, b); Z3_ast r = Z3_mk_bvmul_no_overflow(a.ctx(), a, b, is_signed); a.check_error(); return expr(a.ctx(), r);
2521 }
Z3_ast Z3_API Z3_mk_bvmul_no_overflow(Z3_context c, Z3_ast t1, Z3_ast t2, bool is_signed)
Create a predicate that checks that the bit-wise multiplication of t1 and t2 does not overflow.

◆ bvmul_no_underflow()

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

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

2522 {
2523 check_context(a, b); Z3_ast r = Z3_mk_bvmul_no_underflow(a.ctx(), a, b); a.check_error(); return expr(a.ctx(), r);
2524 }
Z3_ast Z3_API Z3_mk_bvmul_no_underflow(Z3_context c, Z3_ast t1, Z3_ast t2)
Create a predicate that checks that the bit-wise signed multiplication of t1 and t2 does not underflo...

◆ bvneg_no_overflow()

expr bvneg_no_overflow ( expr const & a)
inline

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

2516 {
2517 Z3_ast r = Z3_mk_bvneg_no_overflow(a.ctx(), a); a.check_error(); return expr(a.ctx(), r);
2518 }
Z3_ast Z3_API Z3_mk_bvneg_no_overflow(Z3_context c, Z3_ast t1)
Check that bit-wise negation does not overflow when t1 is interpreted as a signed bit-vector.

◆ bvredand()

expr bvredand ( expr const & a)
inline

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

2243 {
2244 assert(a.is_bv());
2245 Z3_ast r = Z3_mk_bvredand(a.ctx(), a);
2246 a.check_error();
2247 return expr(a.ctx(), r);
2248 }
Z3_ast Z3_API Z3_mk_bvredand(Z3_context c, Z3_ast t1)
Take conjunction of bits in vector, return vector of length 1.

◆ bvredor()

expr bvredor ( expr const & a)
inline

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

2237 {
2238 assert(a.is_bv());
2239 Z3_ast r = Z3_mk_bvredor(a.ctx(), a);
2240 a.check_error();
2241 return expr(a.ctx(), r);
2242 }
Z3_ast Z3_API Z3_mk_bvredor(Z3_context c, Z3_ast t1)
Take disjunction of bits in vector, return vector of length 1.

◆ bvsdiv_no_overflow()

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

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

2513 {
2514 check_context(a, b); Z3_ast r = Z3_mk_bvsdiv_no_overflow(a.ctx(), a, b); a.check_error(); return expr(a.ctx(), r);
2515 }
Z3_ast Z3_API Z3_mk_bvsdiv_no_overflow(Z3_context c, Z3_ast t1, Z3_ast t2)
Create a predicate that checks that the bit-wise signed division of t1 and t2 does not overflow.

◆ bvsub_no_overflow()

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

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

2507 {
2508 check_context(a, b); Z3_ast r = Z3_mk_bvsub_no_overflow(a.ctx(), a, b); a.check_error(); return expr(a.ctx(), r);
2509 }
Z3_ast Z3_API Z3_mk_bvsub_no_overflow(Z3_context c, Z3_ast t1, Z3_ast t2)
Create a predicate that checks that the bit-wise signed subtraction of t1 and t2 does not overflow.

◆ bvsub_no_underflow()

expr bvsub_no_underflow ( expr const & a,
expr const & b,
bool is_signed )
inline

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

2510 {
2511 check_context(a, b); Z3_ast r = Z3_mk_bvsub_no_underflow(a.ctx(), a, b, is_signed); a.check_error(); return expr(a.ctx(), r);
2512 }
Z3_ast Z3_API Z3_mk_bvsub_no_underflow(Z3_context c, Z3_ast t1, Z3_ast t2, bool is_signed)
Create a predicate that checks that the bit-wise subtraction of t1 and t2 does not underflow.

◆ check_context()

◆ complex()

expr complex ( expr const & re,
expr const & im )
inline

Construct a Complex expression from Int or Real components.

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

1900 {
1901 check_context(re, im);
1902 Z3_ast r = Z3_mk_complex(re.ctx(), re, im);
1903 re.check_error();
1904 return expr(re.ctx(), r);
1905 }
Z3_ast Z3_API Z3_mk_complex(Z3_context c, Z3_ast re, Z3_ast im)
Create a complex number with the given real and imaginary components. Integer components are coerced ...

Referenced by complex(), context::complex_val(), and context::complex_val().

◆ concat() [1/2]

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

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

2731 {
2732 check_context(a, b);
2733 Z3_ast r;
2734 if (Z3_is_seq_sort(a.ctx(), a.get_sort())) {
2735 Z3_ast _args[2] = { a, b };
2736 r = Z3_mk_seq_concat(a.ctx(), 2, _args);
2737 }
2738 else if (Z3_is_re_sort(a.ctx(), a.get_sort())) {
2739 Z3_ast _args[2] = { a, b };
2740 r = Z3_mk_re_concat(a.ctx(), 2, _args);
2741 }
2742 else {
2743 r = Z3_mk_concat(a.ctx(), a, b);
2744 }
2745 a.ctx().check_error();
2746 return expr(a.ctx(), r);
2747 }
bool Z3_API Z3_is_seq_sort(Z3_context c, Z3_sort s)
Check if s is a sequence sort.
Z3_ast Z3_API Z3_mk_seq_concat(Z3_context c, unsigned n, Z3_ast const args[])
Concatenate sequences.
Z3_ast Z3_API Z3_mk_re_concat(Z3_context c, unsigned n, Z3_ast const args[])
Create the concatenation of the regular languages.
Z3_ast Z3_API Z3_mk_concat(Z3_context c, Z3_ast t1, Z3_ast t2)
Concatenate the given bit-vectors.
bool Z3_API Z3_is_re_sort(Z3_context c, Z3_sort s)
Check if s is a regular expression sort.

◆ concat() [2/2]

expr concat ( expr_vector const & args)
inline

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

2749 {
2750 Z3_ast r;
2751 assert(args.size() > 0);
2752 if (args.size() == 1) {
2753 return args[0u];
2754 }
2755 context& ctx = args[0u].ctx();
2756 array<Z3_ast> _args(args);
2757 if (Z3_is_seq_sort(ctx, args[0u].get_sort())) {
2758 r = Z3_mk_seq_concat(ctx, _args.size(), _args.ptr());
2759 }
2760 else if (Z3_is_re_sort(ctx, args[0u].get_sort())) {
2761 r = Z3_mk_re_concat(ctx, _args.size(), _args.ptr());
2762 }
2763 else {
2764 r = _args[args.size()-1];
2765 for (unsigned i = args.size()-1; i > 0; ) {
2766 --i;
2767 r = Z3_mk_concat(ctx, _args[i], r);
2768 ctx.check_error();
2769 }
2770 }
2771 ctx.check_error();
2772 return expr(ctx, r);
2773 }

◆ cond()

tactic cond ( probe const & p,
tactic const & t1,
tactic const & t2 )
inline

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

3873 {
3874 check_context(p, t1); check_context(p, t2);
3875 Z3_tactic r = Z3_tactic_cond(t1.ctx(), p, t1, t2);
3876 t1.check_error();
3877 return tactic(t1.ctx(), r);
3878 }
tactic(context &c, char const *name)
Definition z3++.h:3475
Z3_tactic Z3_API Z3_tactic_cond(Z3_context c, Z3_probe p, Z3_tactic t1, Z3_tactic t2)
Return a tactic that applies t1 to a given goal if the probe p evaluates to true, and t2 if p evaluat...

Referenced by cond().

◆ const_array()

expr const_array ( sort const & d,
expr const & v )
inline

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

4455 {
4457 }
Z3_ast Z3_API Z3_mk_const_array(Z3_context c, Z3_sort domain, Z3_ast v)
Create the constant array.
#define MK_EXPR2(_fn, _arg1, _arg2)
Definition z3++.h:4449

Referenced by const_array().

◆ disable_trace()

void disable_trace ( char const * tag)
inline

Disable tracing messages tagged as tag when Z3 is compiled in debug mode. It is a NOOP otherwise.

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

112 {
113 Z3_disable_trace(tag);
114 }
void Z3_API Z3_disable_trace(Z3_string tag)
Disable tracing messages tagged as tag when Z3 is compiled in debug mode. It is a NOOP otherwise.

Referenced by disable_trace().

◆ distinct()

expr distinct ( expr_vector const & args)
inline

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

2722 {
2723 assert(args.size() > 0);
2724 context& ctx = args[0u].ctx();
2725 array<Z3_ast> _args(args);
2726 Z3_ast r = Z3_mk_distinct(ctx, _args.size(), _args.ptr());
2727 ctx.check_error();
2728 return expr(ctx, r);
2729 }
Z3_ast Z3_API Z3_mk_distinct(Z3_context c, unsigned num_args, Z3_ast const args[])
Create an AST node representing distinct(args[0], ..., args[num_args-1]).

◆ empty()

expr empty ( sort const & s)
inline

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

4559 {
4560 Z3_ast r = Z3_mk_seq_empty(s.ctx(), s);
4561 s.check_error();
4562 return expr(s.ctx(), r);
4563 }
Z3_ast Z3_API Z3_mk_seq_empty(Z3_context c, Z3_sort seq)
Create an empty sequence of the sequence sort seq.

Referenced by empty().

◆ empty_set()

expr empty_set ( sort const & s)
inline

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

4459 {
4461 }
Z3_ast Z3_API Z3_mk_empty_set(Z3_context c, Z3_sort domain)
Create the empty set.
#define MK_EXPR1(_fn, _arg)
Definition z3++.h:4444

Referenced by empty_set().

◆ enable_trace()

void enable_trace ( char const * tag)
inline

Enable tracing messages tagged as tag when Z3 is compiled in debug mode. It is a NOOP otherwise.

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

104 {
105 Z3_enable_trace(tag);
106 }
void Z3_API Z3_enable_trace(Z3_string tag)
Enable tracing messages tagged as tag when Z3 is compiled in debug mode. It is a NOOP otherwise.

Referenced by enable_trace().

◆ eq()

bool eq ( ast const & a,
ast const & b )
inline

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

677{ return Z3_is_eq_ast(a.ctx(), a, b); }
bool Z3_API Z3_is_eq_ast(Z3_context c, Z3_ast t1, Z3_ast t2)
Compare terms.

◆ exists() [1/5]

expr exists ( expr const & x,
expr const & b )
inline

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

2624 {
2625 check_context(x, b);
2626 Z3_app vars[] = {(Z3_app) x};
2627 Z3_ast r = Z3_mk_exists_const(b.ctx(), 0, 1, vars, 0, 0, b); b.check_error(); return expr(b.ctx(), r);
2628 }
Z3_ast Z3_API Z3_mk_exists_const(Z3_context c, unsigned weight, unsigned num_bound, Z3_app const bound[], unsigned num_patterns, Z3_pattern const patterns[], Z3_ast body)
Similar to Z3_mk_forall_const.

Referenced by exists(), exists(), exists(), exists(), and exists().

◆ exists() [2/5]

expr exists ( expr const & x1,
expr const & x2,
expr const & b )
inline

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

2629 {
2630 check_context(x1, b); check_context(x2, b);
2631 Z3_app vars[] = {(Z3_app) x1, (Z3_app) x2};
2632 Z3_ast r = Z3_mk_exists_const(b.ctx(), 0, 2, vars, 0, 0, b); b.check_error(); return expr(b.ctx(), r);
2633 }

◆ exists() [3/5]

expr exists ( expr const & x1,
expr const & x2,
expr const & x3,
expr const & b )
inline

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

2634 {
2635 check_context(x1, b); check_context(x2, b); check_context(x3, b);
2636 Z3_app vars[] = {(Z3_app) x1, (Z3_app) x2, (Z3_app) x3 };
2637 Z3_ast r = Z3_mk_exists_const(b.ctx(), 0, 3, vars, 0, 0, b); b.check_error(); return expr(b.ctx(), r);
2638 }

◆ exists() [4/5]

expr exists ( expr const & x1,
expr const & x2,
expr const & x3,
expr const & x4,
expr const & b )
inline

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

2639 {
2640 check_context(x1, b); check_context(x2, b); check_context(x3, b); check_context(x4, b);
2641 Z3_app vars[] = {(Z3_app) x1, (Z3_app) x2, (Z3_app) x3, (Z3_app) x4 };
2642 Z3_ast r = Z3_mk_exists_const(b.ctx(), 0, 4, vars, 0, 0, b); b.check_error(); return expr(b.ctx(), r);
2643 }

◆ exists() [5/5]

expr exists ( expr_vector const & xs,
expr const & b )
inline

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

2644 {
2645 array<Z3_app> vars(xs);
2646 Z3_ast r = Z3_mk_exists_const(b.ctx(), 0, vars.size(), vars.ptr(), 0, 0, b); b.check_error(); return expr(b.ctx(), r);
2647 }

◆ fail_if()

tactic fail_if ( probe const & p)
inline

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

3862 {
3863 Z3_tactic r = Z3_tactic_fail_if(p.ctx(), p);
3864 p.check_error();
3865 return tactic(p.ctx(), r);
3866 }
Z3_tactic Z3_API Z3_tactic_fail_if(Z3_context c, Z3_probe p)
Return a tactic that fails if the probe p evaluates to false.

Referenced by fail_if().

◆ finite_set_difference()

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

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

4527 {
4529 }
Z3_ast Z3_API Z3_mk_finite_set_difference(Z3_context c, Z3_ast s1, Z3_ast s2)
Create the set difference of two finite sets.

Referenced by finite_set_difference().

◆ finite_set_empty()

expr finite_set_empty ( sort const & s)
inline

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

4509 {
4510 Z3_ast r = Z3_mk_finite_set_empty(s.ctx(), s);
4511 s.check_error();
4512 return expr(s.ctx(), r);
4513 }
Z3_ast Z3_API Z3_mk_finite_set_empty(Z3_context c, Z3_sort set_sort)
Create an empty finite set of the given sort.

Referenced by finite_set_empty().

◆ finite_set_filter()

expr finite_set_filter ( expr const & f,
expr const & s )
inline

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

4547 {
4549 }
Z3_ast Z3_API Z3_mk_finite_set_filter(Z3_context c, Z3_ast f, Z3_ast set)
Filter a finite set using a predicate.

Referenced by finite_set_filter().

◆ finite_set_intersect()

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

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

4523 {
4525 }
Z3_ast Z3_API Z3_mk_finite_set_intersect(Z3_context c, Z3_ast s1, Z3_ast s2)
Create the intersection of two finite sets.

Referenced by finite_set_intersect().

◆ finite_set_map()

expr finite_set_map ( expr const & f,
expr const & s )
inline

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

4543 {
4545 }
Z3_ast Z3_API Z3_mk_finite_set_map(Z3_context c, Z3_ast f, Z3_ast set)
Apply a function to all elements of a finite set.

Referenced by finite_set_map().

◆ finite_set_member()

expr finite_set_member ( expr const & e,
expr const & s )
inline

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

4531 {
4533 }
Z3_ast Z3_API Z3_mk_finite_set_member(Z3_context c, Z3_ast elem, Z3_ast set)
Check if an element is a member of a finite set.

Referenced by finite_set_member().

◆ finite_set_range()

expr finite_set_range ( expr const & low,
expr const & high )
inline

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

4551 {
4552 MK_EXPR2(Z3_mk_finite_set_range, low, high);
4553 }
Z3_ast Z3_API Z3_mk_finite_set_range(Z3_context c, Z3_ast low, Z3_ast high)
Create a finite set of integers in the range [low, high].

Referenced by finite_set_range().

◆ finite_set_singleton()

expr finite_set_singleton ( expr const & e)
inline

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

4515 {
4517 }
Z3_ast Z3_API Z3_mk_finite_set_singleton(Z3_context c, Z3_ast elem)
Create a singleton finite set.

Referenced by finite_set_singleton().

◆ finite_set_size()

expr finite_set_size ( expr const & s)
inline

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

4535 {
4537 }
Z3_ast Z3_API Z3_mk_finite_set_size(Z3_context c, Z3_ast set)
Get the size (cardinality) of a finite set.

Referenced by finite_set_size().

◆ finite_set_subset()

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

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

4539 {
4541 }
Z3_ast Z3_API Z3_mk_finite_set_subset(Z3_context c, Z3_ast s1, Z3_ast s2)
Check if one finite set is a subset of another.

Referenced by finite_set_subset().

◆ finite_set_union()

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

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

4519 {
4521 }
Z3_ast Z3_API Z3_mk_finite_set_union(Z3_context c, Z3_ast s1, Z3_ast s2)
Create the union of two finite sets.

Referenced by finite_set_union().

◆ fma()

expr fma ( expr const & a,
expr const & b,
expr const & c,
expr const & rm )
inline

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

2285 {
2286 check_context(a, b); check_context(a, c); check_context(a, rm);
2287 assert(a.is_fpa() && b.is_fpa() && c.is_fpa());
2288 Z3_ast r = Z3_mk_fpa_fma(a.ctx(), rm, a, b, c);
2289 a.check_error();
2290 return expr(a.ctx(), r);
2291 }
Z3_ast Z3_API Z3_mk_fpa_fma(Z3_context c, Z3_ast rm, Z3_ast t1, Z3_ast t2, Z3_ast t3)
Floating-point fused multiply-add.

◆ foldl()

expr foldl ( expr const & f,
expr const & a,
expr const & list )
inline

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

2789 {
2790 context& ctx = f.ctx();
2791 Z3_ast r = Z3_mk_seq_foldl(ctx, f, a, list);
2792 ctx.check_error();
2793 return expr(ctx, r);
2794 }
Z3_ast Z3_API Z3_mk_seq_foldl(Z3_context c, Z3_ast f, Z3_ast a, Z3_ast s)
Create a fold of the function f over the sequence s with accumulator a.

Referenced by foldl().

◆ foldli()

expr foldli ( expr const & f,
expr const & i,
expr const & a,
expr const & list )
inline

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

2796 {
2797 context& ctx = f.ctx();
2798 Z3_ast r = Z3_mk_seq_foldli(ctx, f, i, a, list);
2799 ctx.check_error();
2800 return expr(ctx, r);
2801 }
Z3_ast Z3_API Z3_mk_seq_foldli(Z3_context c, Z3_ast f, Z3_ast i, Z3_ast a, Z3_ast s)
Create a fold with index tracking of the function f over the sequence s with accumulator a starting a...

Referenced by foldli().

◆ forall() [1/5]

expr forall ( expr const & x,
expr const & b )
inline

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

2600 {
2601 check_context(x, b);
2602 Z3_app vars[] = {(Z3_app) x};
2603 Z3_ast r = Z3_mk_forall_const(b.ctx(), 0, 1, vars, 0, 0, b); b.check_error(); return expr(b.ctx(), r);
2604 }
Z3_ast Z3_API Z3_mk_forall_const(Z3_context c, unsigned weight, unsigned num_bound, Z3_app const bound[], unsigned num_patterns, Z3_pattern const patterns[], Z3_ast body)
Create a universal quantifier using a list of constants that will form the set of bound variables.

Referenced by forall(), forall(), forall(), forall(), and forall().

◆ forall() [2/5]

expr forall ( expr const & x1,
expr const & x2,
expr const & b )
inline

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

2605 {
2606 check_context(x1, b); check_context(x2, b);
2607 Z3_app vars[] = {(Z3_app) x1, (Z3_app) x2};
2608 Z3_ast r = Z3_mk_forall_const(b.ctx(), 0, 2, vars, 0, 0, b); b.check_error(); return expr(b.ctx(), r);
2609 }

◆ forall() [3/5]

expr forall ( expr const & x1,
expr const & x2,
expr const & x3,
expr const & b )
inline

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

2610 {
2611 check_context(x1, b); check_context(x2, b); check_context(x3, b);
2612 Z3_app vars[] = {(Z3_app) x1, (Z3_app) x2, (Z3_app) x3 };
2613 Z3_ast r = Z3_mk_forall_const(b.ctx(), 0, 3, vars, 0, 0, b); b.check_error(); return expr(b.ctx(), r);
2614 }

◆ forall() [4/5]

expr forall ( expr const & x1,
expr const & x2,
expr const & x3,
expr const & x4,
expr const & b )
inline

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

2615 {
2616 check_context(x1, b); check_context(x2, b); check_context(x3, b); check_context(x4, b);
2617 Z3_app vars[] = {(Z3_app) x1, (Z3_app) x2, (Z3_app) x3, (Z3_app) x4 };
2618 Z3_ast r = Z3_mk_forall_const(b.ctx(), 0, 4, vars, 0, 0, b); b.check_error(); return expr(b.ctx(), r);
2619 }

◆ forall() [5/5]

expr forall ( expr_vector const & xs,
expr const & b )
inline

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

2620 {
2621 array<Z3_app> vars(xs);
2622 Z3_ast r = Z3_mk_forall_const(b.ctx(), 0, vars.size(), vars.ptr(), 0, 0, b); b.check_error(); return expr(b.ctx(), r);
2623 }

◆ fp_eq()

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

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

2276 {
2277 check_context(a, b);
2278 assert(a.is_fpa());
2279 Z3_ast r = Z3_mk_fpa_eq(a.ctx(), a, b);
2280 a.check_error();
2281 return expr(a.ctx(), r);
2282 }
Z3_ast Z3_API Z3_mk_fpa_eq(Z3_context c, Z3_ast t1, Z3_ast t2)
Floating-point equality.

◆ fpa_fp()

expr fpa_fp ( expr const & sgn,
expr const & exp,
expr const & sig )
inline

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

2293 {
2294 check_context(sgn, exp); check_context(exp, sig);
2295 assert(sgn.is_bv() && exp.is_bv() && sig.is_bv());
2296 Z3_ast r = Z3_mk_fpa_fp(sgn.ctx(), sgn, exp, sig);
2297 sgn.check_error();
2298 return expr(sgn.ctx(), r);
2299 }

◆ fpa_to_fpa()

expr fpa_to_fpa ( expr const & t,
sort s )
inline

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

2329 {
2330 assert(t.is_fpa());
2331 Z3_ast r = Z3_mk_fpa_to_fp_float(t.ctx(), t.ctx().fpa_rounding_mode(), t, s);
2332 t.check_error();
2333 return expr(t.ctx(), r);
2334 }
Z3_ast Z3_API Z3_mk_fpa_to_fp_float(Z3_context c, Z3_ast rm, Z3_ast t, Z3_sort s)
Conversion of a FloatingPoint term into another term of different FloatingPoint sort.

◆ fpa_to_sbv()

expr fpa_to_sbv ( expr const & t,
unsigned sz )
inline

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

2301 {
2302 assert(t.is_fpa());
2303 Z3_ast r = Z3_mk_fpa_to_sbv(t.ctx(), t.ctx().fpa_rounding_mode(), t, sz);
2304 t.check_error();
2305 return expr(t.ctx(), r);
2306 }
Z3_ast Z3_API Z3_mk_fpa_to_sbv(Z3_context c, Z3_ast rm, Z3_ast t, unsigned sz)
Conversion of a floating-point term into a signed bit-vector.

◆ fpa_to_ubv()

expr fpa_to_ubv ( expr const & t,
unsigned sz )
inline

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

2308 {
2309 assert(t.is_fpa());
2310 Z3_ast r = Z3_mk_fpa_to_ubv(t.ctx(), t.ctx().fpa_rounding_mode(), t, sz);
2311 t.check_error();
2312 return expr(t.ctx(), r);
2313 }
Z3_ast Z3_API Z3_mk_fpa_to_ubv(Z3_context c, Z3_ast rm, Z3_ast t, unsigned sz)
Conversion of a floating-point term into an unsigned bit-vector.

◆ full_set()

expr full_set ( sort const & s)
inline

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

4463 {
4465 }
Z3_ast Z3_API Z3_mk_full_set(Z3_context c, Z3_sort domain)
Create the full set.

Referenced by full_set().

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

4365 {
4366 return range.ctx().function(name, d1, d2, d3, d4, d5, range);
4367 }
func_decl function(symbol const &name, unsigned arity, sort const *domain, sort const &range)
Definition z3++.h:4056
expr range(expr const &lo, expr const &hi)
Definition z3++.h:4631

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

4362 {
4363 return range.ctx().function(name, d1, d2, d3, d4, range);
4364 }

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

4359 {
4360 return range.ctx().function(name, d1, d2, d3, range);
4361 }

◆ function() [4/9]

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

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

4356 {
4357 return range.ctx().function(name, d1, d2, range);
4358 }

◆ function() [5/9]

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

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

4353 {
4354 return range.ctx().function(name, domain, range);
4355 }

◆ function() [6/9]

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

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

4368 {
4369 return range.ctx().function(name, domain, range);
4370 }

◆ function() [7/9]

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

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

4350 {
4351 return range.ctx().function(name, arity, domain, range);
4352 }

◆ function() [8/9]

func_decl function ( std::string const & name,
sort_vector const & domain,
sort const & range )
inline

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

4371 {
4372 return range.ctx().function(name.c_str(), domain, range);
4373 }

◆ function() [9/9]

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

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

4347 {
4348 return range.ctx().function(name, arity, domain, range);
4349 }

Referenced by function(), function(), function(), function(), function(), function(), function(), function(), and function().

◆ get_full_version()

std::string get_full_version ( )
inline

Return a string that fully describes the version of Z3 in use.

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

96 {
97 return std::string(Z3_get_full_version());
98 }
Z3_string Z3_API Z3_get_full_version(void)
Return a string that fully describes the version of Z3 in use.

Referenced by get_full_version().

◆ get_version()

void get_version ( unsigned & major,
unsigned & minor,
unsigned & build_number,
unsigned & revision_number )
inline

Return Z3 version number information.

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

89 {
90 Z3_get_version(&major, &minor, &build_number, &revision_number);
91 }
void Z3_API Z3_get_version(unsigned *major, unsigned *minor, unsigned *build_number, unsigned *revision_number)
Return Z3 version number information.

Referenced by get_version().

◆ imag_part()

expr imag_part ( expr const & z)
inline

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

1913 {
1914 Z3_ast r = Z3_mk_imag_part(z.ctx(), z);
1915 z.check_error();
1916 return expr(z.ctx(), r);
1917 }
Z3_ast Z3_API Z3_mk_imag_part(Z3_context c, Z3_ast z)
Return the imaginary component of a Complex expression.

Referenced by imag_part().

◆ implies() [1/3]

expr implies ( bool a,
expr const & b )
inline

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

1858{ return implies(b.ctx().bool_val(a), b); }
expr implies(expr const &a, expr const &b)
Definition z3++.h:1853

◆ implies() [2/3]

expr implies ( expr const & a,
bool b )
inline

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

1857{ return implies(a, a.ctx().bool_val(b)); }

◆ implies() [3/3]

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

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

1853 {
1854 assert(a.is_bool() && b.is_bool());
1856 }
Z3_ast Z3_API Z3_mk_implies(Z3_context c, Z3_ast t1, Z3_ast t2)
Create an AST node representing t1 implies t2.
#define _Z3_MK_BIN_(a, b, binop)
Definition z3++.h:1846

◆ in_re()

expr in_re ( expr const & s,
expr const & re )
inline

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

4591 {
4592 MK_EXPR2(Z3_mk_seq_in_re, s, re);
4593 }
Z3_ast Z3_API Z3_mk_seq_in_re(Z3_context c, Z3_ast seq, Z3_ast re)
Check if seq is in the language generated by the regular expression re.

Referenced by in_re().

◆ indexof()

expr indexof ( expr const & s,
expr const & substr,
expr const & offset )
inline

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

4576 {
4577 check_context(s, substr); check_context(s, offset);
4578 Z3_ast r = Z3_mk_seq_index(s.ctx(), s, substr, offset);
4579 s.check_error();
4580 return expr(s.ctx(), r);
4581 }
Z3_ast Z3_API Z3_mk_seq_index(Z3_context c, Z3_ast s, Z3_ast substr, Z3_ast offset)
Return index of the first occurrence of substr in s starting from offset offset. If s does not contai...

Referenced by indexof().

◆ int2bv()

expr int2bv ( unsigned n,
expr const & a )
inline

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

2496{ Z3_ast r = Z3_mk_int2bv(a.ctx(), n, a); a.check_error(); return expr(a.ctx(), r); }
Z3_ast Z3_API Z3_mk_int2bv(Z3_context c, unsigned n, Z3_ast t1)
Create an n bit bit-vector from the integer argument t1.

◆ is_int()

expr is_int ( expr const & e)
inline

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

1921{ _Z3_MK_UN_(e, Z3_mk_is_int); }
Z3_ast Z3_API Z3_mk_is_int(Z3_context c, Z3_ast t1)
Check if a real number is an integer.
#define _Z3_MK_UN_(a, mkun)
Definition z3++.h:1893

◆ ite()

expr ite ( expr const & c,
expr const & t,
expr const & e )
inline

Create the if-then-else expression ite(c, t, e).

Precondition
c.is_bool()

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

2348 {
2349 check_context(c, t); check_context(c, e);
2350 assert(c.is_bool());
2351 Z3_ast r = Z3_mk_ite(c.ctx(), c, t, e);
2352 c.check_error();
2353 return expr(c.ctx(), r);
2354 }

◆ lambda() [1/5]

expr lambda ( expr const & x,
expr const & b )
inline

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

2648 {
2649 check_context(x, b);
2650 Z3_app vars[] = {(Z3_app) x};
2651 Z3_ast r = Z3_mk_lambda_const(b.ctx(), 1, vars, b); b.check_error(); return expr(b.ctx(), r);
2652 }
Z3_ast Z3_API Z3_mk_lambda_const(Z3_context c, unsigned num_bound, Z3_app const bound[], Z3_ast body)
Create a lambda expression using a list of constants that form the set of bound variables.

Referenced by lambda(), lambda(), lambda(), lambda(), and lambda().

◆ lambda() [2/5]

expr lambda ( expr const & x1,
expr const & x2,
expr const & b )
inline

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

2653 {
2654 check_context(x1, b); check_context(x2, b);
2655 Z3_app vars[] = {(Z3_app) x1, (Z3_app) x2};
2656 Z3_ast r = Z3_mk_lambda_const(b.ctx(), 2, vars, b); b.check_error(); return expr(b.ctx(), r);
2657 }

◆ lambda() [3/5]

expr lambda ( expr const & x1,
expr const & x2,
expr const & x3,
expr const & b )
inline

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

2658 {
2659 check_context(x1, b); check_context(x2, b); check_context(x3, b);
2660 Z3_app vars[] = {(Z3_app) x1, (Z3_app) x2, (Z3_app) x3 };
2661 Z3_ast r = Z3_mk_lambda_const(b.ctx(), 3, vars, b); b.check_error(); return expr(b.ctx(), r);
2662 }

◆ lambda() [4/5]

expr lambda ( expr const & x1,
expr const & x2,
expr const & x3,
expr const & x4,
expr const & b )
inline

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

2663 {
2664 check_context(x1, b); check_context(x2, b); check_context(x3, b); check_context(x4, b);
2665 Z3_app vars[] = {(Z3_app) x1, (Z3_app) x2, (Z3_app) x3, (Z3_app) x4 };
2666 Z3_ast r = Z3_mk_lambda_const(b.ctx(), 4, vars, b); b.check_error(); return expr(b.ctx(), r);
2667 }

◆ lambda() [5/5]

expr lambda ( expr_vector const & xs,
expr const & b )
inline

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

2668 {
2669 array<Z3_app> vars(xs);
2670 Z3_ast r = Z3_mk_lambda_const(b.ctx(), vars.size(), vars.ptr(), b); b.check_error(); return expr(b.ctx(), r);
2671 }

◆ last_indexof()

expr last_indexof ( expr const & s,
expr const & substr )
inline

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

4582 {
4583 check_context(s, substr);
4584 Z3_ast r = Z3_mk_seq_last_index(s.ctx(), s, substr);
4585 s.check_error();
4586 return expr(s.ctx(), r);
4587 }
Z3_ast Z3_API Z3_mk_seq_last_index(Z3_context c, Z3_ast s, Z3_ast substr)
Return index of the last occurrence of substr in s. If s does not contain substr, then the value is -...

Referenced by last_indexof().

◆ linear_order()

func_decl linear_order ( sort const & a,
unsigned index )
inline

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

2532 {
2533 return to_func_decl(a.ctx(), Z3_mk_linear_order(a.ctx(), a, index));
2534 }
Z3_func_decl Z3_API Z3_mk_linear_order(Z3_context c, Z3_sort a, unsigned id)
create a linear ordering relation over signature a. The relation is identified by the index id.
func_decl to_func_decl(context &c, Z3_func_decl f)
Definition z3++.h:2375

Referenced by linear_order().

◆ lshr() [1/3]

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

logic shift right operator for bitvectors

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

2476{ return to_expr(a.ctx(), Z3_mk_bvlshr(a.ctx(), a, b)); }
Z3_ast Z3_API Z3_mk_bvlshr(Z3_context c, Z3_ast t1, Z3_ast t2)
Logical shift right.

Referenced by lshr(), lshr(), and lshr().

◆ lshr() [2/3]

expr lshr ( expr const & a,
int b )
inline

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

2477{ return lshr(a, a.ctx().num_val(b, a.get_sort())); }
expr lshr(expr const &a, expr const &b)
logic shift right operator for bitvectors
Definition z3++.h:2476

◆ lshr() [3/3]

expr lshr ( int a,
expr const & b )
inline

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

2478{ return lshr(b.ctx().num_val(a, b.get_sort()), b); }

◆ map()

expr map ( expr const & f,
expr const & list )
inline

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

2775 {
2776 context& ctx = f.ctx();
2777 Z3_ast r = Z3_mk_seq_map(ctx, f, list);
2778 ctx.check_error();
2779 return expr(ctx, r);
2780 }
Z3_ast Z3_API Z3_mk_seq_map(Z3_context c, Z3_ast f, Z3_ast s)
Create a map of the function f over the sequence s.

Referenced by map(), qe_model_project_skolem(), and qe_model_project_with_witness().

◆ mapi()

expr mapi ( expr const & f,
expr const & i,
expr const & list )
inline

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

2782 {
2783 context& ctx = f.ctx();
2784 Z3_ast r = Z3_mk_seq_mapi(ctx, f, i, list);
2785 ctx.check_error();
2786 return expr(ctx, r);
2787 }
Z3_ast Z3_API Z3_mk_seq_mapi(Z3_context c, Z3_ast f, Z3_ast i, Z3_ast s)
Create a map of the function f over the sequence s starting at index i.

Referenced by mapi().

◆ max()

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

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

2221 {
2222 check_context(a, b);
2223 Z3_ast r;
2224 if (a.is_arith()) {
2225 r = Z3_mk_ite(a.ctx(), Z3_mk_ge(a.ctx(), a, b), a, b);
2226 }
2227 else if (a.is_bv()) {
2228 r = Z3_mk_ite(a.ctx(), Z3_mk_bvuge(a.ctx(), a, b), a, b);
2229 }
2230 else {
2231 assert(a.is_fpa());
2232 r = Z3_mk_fpa_max(a.ctx(), a, b);
2233 }
2234 a.check_error();
2235 return expr(a.ctx(), r);
2236 }
Z3_ast Z3_API Z3_mk_ge(Z3_context c, Z3_ast t1, Z3_ast t2)
Create greater than or equal to.
Z3_ast Z3_API Z3_mk_fpa_max(Z3_context c, Z3_ast t1, Z3_ast t2)
Maximum of floating-point numbers.
Z3_ast Z3_API Z3_mk_bvuge(Z3_context c, Z3_ast t1, Z3_ast t2)
Unsigned greater than or equal to.

Referenced by tactic::repeat.

◆ min()

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

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

2205 {
2206 check_context(a, b);
2207 Z3_ast r;
2208 if (a.is_arith()) {
2209 r = Z3_mk_ite(a.ctx(), Z3_mk_ge(a.ctx(), a, b), b, a);
2210 }
2211 else if (a.is_bv()) {
2212 r = Z3_mk_ite(a.ctx(), Z3_mk_bvuge(a.ctx(), a, b), b, a);
2213 }
2214 else {
2215 assert(a.is_fpa());
2216 r = Z3_mk_fpa_min(a.ctx(), a, b);
2217 }
2218 a.check_error();
2219 return expr(a.ctx(), r);
2220 }
Z3_ast Z3_API Z3_mk_fpa_min(Z3_context c, Z3_ast t1, Z3_ast t2)
Minimum of floating-point numbers.

◆ mk_and()

expr mk_and ( expr_vector const & args)
inline

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

2809 {
2810 array<Z3_ast> _args(args);
2811 Z3_ast r = Z3_mk_and(args.ctx(), _args.size(), _args.ptr());
2812 args.check_error();
2813 return expr(args.ctx(), r);
2814 }
Z3_ast Z3_API Z3_mk_and(Z3_context c, unsigned num_args, Z3_ast const args[])
Create an AST node representing args[0] and ... and args[num_args-1].

◆ mk_or()

expr mk_or ( expr_vector const & args)
inline

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

2803 {
2804 array<Z3_ast> _args(args);
2805 Z3_ast r = Z3_mk_or(args.ctx(), _args.size(), _args.ptr());
2806 args.check_error();
2807 return expr(args.ctx(), r);
2808 }
Z3_ast Z3_API Z3_mk_or(Z3_context c, unsigned num_args, Z3_ast const args[])
Create an AST node representing args[0] or ... or args[num_args-1].

◆ mk_xor()

expr mk_xor ( expr_vector const & args)
inline

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

2815 {
2816 if (args.empty())
2817 return args.ctx().bool_val(false);
2818 expr r = args[0u];
2819 for (unsigned i = 1; i < args.size(); ++i)
2820 r = r ^ args[i];
2821 return r;
2822 }

◆ mod() [1/3]

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

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

1865 {
1866 if (a.is_bv()) {
1867 _Z3_MK_BIN_(a, b, Z3_mk_bvsmod);
1868 }
1869 else {
1870 _Z3_MK_BIN_(a, b, Z3_mk_mod);
1871 }
1872 }
Z3_ast Z3_API Z3_mk_mod(Z3_context c, Z3_ast arg1, Z3_ast arg2)
Create an AST node representing arg1 mod arg2.
Z3_ast Z3_API Z3_mk_bvsmod(Z3_context c, Z3_ast t1, Z3_ast t2)
Two's complement signed remainder (sign follows divisor).

Referenced by operator%(), operator%(), and operator%().

◆ mod() [2/3]

expr mod ( expr const & a,
int b )
inline

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

1873{ return mod(a, a.ctx().num_val(b, a.get_sort())); }
expr mod(expr const &a, expr const &b)
Definition z3++.h:1865

◆ mod() [3/3]

expr mod ( int a,
expr const & b )
inline

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

1874{ return mod(b.ctx().num_val(a, b.get_sort()), b); }

◆ nand()

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

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

2202{ if (a.is_bool()) return !(a && b); check_context(a, b); Z3_ast r = Z3_mk_bvnand(a.ctx(), a, b); a.check_error(); return expr(a.ctx(), r); }
Z3_ast Z3_API Z3_mk_bvnand(Z3_context c, Z3_ast t1, Z3_ast t2)
Bitwise nand.

◆ nor()

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

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

2203{ if (a.is_bool()) return !(a || b); check_context(a, b); Z3_ast r = Z3_mk_bvnor(a.ctx(), a, b); a.check_error(); return expr(a.ctx(), r); }
Z3_ast Z3_API Z3_mk_bvnor(Z3_context c, Z3_ast t1, Z3_ast t2)
Bitwise nor.

◆ operator!() [1/2]

expr operator! ( expr const & a)
inline
Precondition
a.is_bool()

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

1919{ assert(a.is_bool()); _Z3_MK_UN_(a, Z3_mk_not); }
Z3_ast Z3_API Z3_mk_not(Z3_context c, Z3_ast a)
Create an AST node representing not(a).

◆ operator!() [2/2]

probe operator! ( probe const & p)
inline

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

3668 {
3669 Z3_probe r = Z3_probe_not(p.ctx(), p); p.check_error(); return probe(p.ctx(), r);
3670 }
probe(context &c, char const *name)
Definition z3++.h:3602
Z3_probe Z3_API Z3_probe_not(Z3_context x, Z3_probe p)
Return a probe that evaluates to "true" when p does not evaluate to true.

◆ operator!=() [1/5]

expr operator!= ( double a,
expr const & b )
inline

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

1971{ assert(b.is_fpa()); return b.ctx().fpa_val(a) != b; }

◆ operator!=() [2/5]

expr operator!= ( expr const & a,
double b )
inline

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

1970{ assert(a.is_fpa()); return a != a.ctx().fpa_val(b); }

◆ operator!=() [3/5]

expr operator!= ( expr const & a,
expr const & b )
inline

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

1961 {
1962 check_context(a, b);
1963 Z3_ast args[2] = { a, b };
1964 Z3_ast r = Z3_mk_distinct(a.ctx(), 2, args);
1965 a.check_error();
1966 return expr(a.ctx(), r);
1967 }

Referenced by operator!=(), and operator!=().

◆ operator!=() [4/5]

expr operator!= ( expr const & a,
int b )
inline

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

1968{ assert(a.is_arith() || a.is_bv() || a.is_fpa() || a.is_finite_field()); return a != a.ctx().num_val(b, a.get_sort()); }

◆ operator!=() [5/5]

expr operator!= ( int a,
expr const & b )
inline

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

1969{ assert(b.is_arith() || b.is_bv() || b.is_fpa() || b.is_finite_field()); return b.ctx().num_val(a, b.get_sort()) != b; }

◆ operator%() [1/3]

expr operator% ( expr const & a,
expr const & b )
inline

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

1876{ return mod(a, b); }

Referenced by operator%(), operator%(), and operator%().

◆ operator%() [2/3]

expr operator% ( expr const & a,
int b )
inline

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

1877{ return mod(a, b); }

◆ operator%() [3/3]

expr operator% ( int a,
expr const & b )
inline

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

1878{ return mod(a, b); }

◆ operator&() [1/5]

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

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

2190{ if (a.is_bool()) return a && b; check_context(a, b); Z3_ast r = Z3_mk_bvand(a.ctx(), a, b); a.check_error(); return expr(a.ctx(), r); }
Z3_ast Z3_API Z3_mk_bvand(Z3_context c, Z3_ast t1, Z3_ast t2)
Bitwise and.

◆ operator&() [2/5]

expr operator& ( expr const & a,
int b )
inline

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

2191{ return a & a.ctx().num_val(b, a.get_sort()); }

◆ operator&() [3/5]

expr operator& ( int a,
expr const & b )
inline

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

2192{ return b.ctx().num_val(a, b.get_sort()) & b; }

◆ operator&() [4/5]

simplifier operator& ( simplifier const & t1,
simplifier const & t2 )
inline

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

3582 {
3583 check_context(t1, t2);
3584 Z3_simplifier r = Z3_simplifier_and_then(t1.ctx(), t1, t2);
3585 t1.check_error();
3586 return simplifier(t1.ctx(), r);
3587 }
simplifier(context &c, char const *name)
Definition z3++.h:3561
Z3_simplifier Z3_API Z3_simplifier_and_then(Z3_context c, Z3_simplifier t1, Z3_simplifier t2)
Return a simplifier that applies t1 to a given goal and t2 to every subgoal produced by t1.

◆ operator&() [5/5]

tactic operator& ( tactic const & t1,
tactic const & t2 )
inline

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

3508 {
3509 check_context(t1, t2);
3510 Z3_tactic r = Z3_tactic_and_then(t1.ctx(), t1, t2);
3511 t1.check_error();
3512 return tactic(t1.ctx(), r);
3513 }
Z3_tactic Z3_API Z3_tactic_and_then(Z3_context c, Z3_tactic t1, Z3_tactic t2)
Return a tactic that applies t1 to a given goal and t2 to every subgoal produced by t1.

◆ operator&&() [1/4]

expr operator&& ( bool a,
expr const & b )
inline
Precondition
b.is_bool()

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

1935{ return b.ctx().bool_val(a) && b; }

◆ operator&&() [2/4]

expr operator&& ( expr const & a,
bool b )
inline
Precondition
a.is_bool()

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

1934{ return a && a.ctx().bool_val(b); }

◆ operator&&() [3/4]

expr operator&& ( expr const & a,
expr const & b )
inline
Precondition
a.is_bool()
b.is_bool()

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

1925 {
1926 check_context(a, b);
1927 assert(a.is_bool() && b.is_bool());
1928 Z3_ast args[2] = { a, b };
1929 Z3_ast r = Z3_mk_and(a.ctx(), 2, args);
1930 a.check_error();
1931 return expr(a.ctx(), r);
1932 }

◆ operator&&() [4/4]

probe operator&& ( probe const & p1,
probe const & p2 )
inline

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

3662 {
3663 check_context(p1, p2); Z3_probe r = Z3_probe_and(p1.ctx(), p1, p2); p1.check_error(); return probe(p1.ctx(), r);
3664 }
Z3_probe Z3_API Z3_probe_and(Z3_context x, Z3_probe p1, Z3_probe p2)
Return a probe that evaluates to "true" when p1 and p2 evaluates to true.

◆ operator*() [1/3]

expr operator* ( expr const & a,
expr const & b )
inline

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

2007 {
2008 check_context(a, b);
2009 Z3_ast r = 0;
2010 if (a.is_arith() && b.is_arith()) {
2011 Z3_ast args[2] = { a, b };
2012 r = Z3_mk_mul(a.ctx(), 2, args);
2013 }
2014 else if (a.is_finite_field() && b.is_finite_field()) {
2015 Z3_ast args[2] = { a, b };
2016 r = Z3_mk_ff_mul(a.ctx(), 2, args);
2017 }
2018 else if (a.is_bv() && b.is_bv()) {
2019 r = Z3_mk_bvmul(a.ctx(), a, b);
2020 }
2021 else if (a.is_fpa() && b.is_fpa()) {
2022 r = Z3_mk_fpa_mul(a.ctx(), a.ctx().fpa_rounding_mode(), a, b);
2023 }
2024 else {
2025 // operator is not supported by given arguments.
2026 assert(false);
2027 }
2028 a.check_error();
2029 return expr(a.ctx(), r);
2030 }
Z3_ast Z3_API Z3_mk_mul(Z3_context c, unsigned num_args, Z3_ast const args[])
Create an AST node representing args[0] * ... * args[num_args-1].
Z3_ast Z3_API Z3_mk_bvmul(Z3_context c, Z3_ast t1, Z3_ast t2)
Standard two's complement multiplication.
Z3_ast Z3_API Z3_mk_ff_mul(Z3_context c, unsigned n, Z3_ast const args[])
Multiply at least two elements of the same prime field.
Z3_ast Z3_API Z3_mk_fpa_mul(Z3_context c, Z3_ast rm, Z3_ast t1, Z3_ast t2)
Floating-point multiplication.

◆ operator*() [2/3]

expr operator* ( expr const & a,
int b )
inline

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

2031{ return a * a.ctx().num_val(b, a.get_sort()); }

◆ operator*() [3/3]

expr operator* ( int a,
expr const & b )
inline

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

2032{ return b.ctx().num_val(a, b.get_sort()) * b; }

◆ operator+() [1/3]

expr operator+ ( expr const & a,
expr const & b )
inline

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

1973 {
1974 check_context(a, b);
1975 Z3_ast r = 0;
1976 if (a.is_arith() && b.is_arith()) {
1977 Z3_ast args[2] = { a, b };
1978 r = Z3_mk_add(a.ctx(), 2, args);
1979 }
1980 else if (a.is_finite_field() && b.is_finite_field()) {
1981 Z3_ast args[2] = { a, b };
1982 r = Z3_mk_ff_add(a.ctx(), 2, args);
1983 }
1984 else if (a.is_bv() && b.is_bv()) {
1985 r = Z3_mk_bvadd(a.ctx(), a, b);
1986 }
1987 else if (a.is_seq() && b.is_seq()) {
1988 return concat(a, b);
1989 }
1990 else if (a.is_re() && b.is_re()) {
1991 Z3_ast _args[2] = { a, b };
1992 r = Z3_mk_re_union(a.ctx(), 2, _args);
1993 }
1994 else if (a.is_fpa() && b.is_fpa()) {
1995 r = Z3_mk_fpa_add(a.ctx(), a.ctx().fpa_rounding_mode(), a, b);
1996 }
1997 else {
1998 // operator is not supported by given arguments.
1999 assert(false);
2000 }
2001 a.check_error();
2002 return expr(a.ctx(), r);
2003 }
Z3_ast Z3_API Z3_mk_re_union(Z3_context c, unsigned n, Z3_ast const args[])
Create the union of the regular languages.
Z3_ast Z3_API Z3_mk_bvadd(Z3_context c, Z3_ast t1, Z3_ast t2)
Standard two's complement addition.
Z3_ast Z3_API Z3_mk_ff_add(Z3_context c, unsigned n, Z3_ast const args[])
Sum at least two elements of the same prime field.
Z3_ast Z3_API Z3_mk_fpa_add(Z3_context c, Z3_ast rm, Z3_ast t1, Z3_ast t2)
Floating-point addition.
Z3_ast Z3_API Z3_mk_add(Z3_context c, unsigned num_args, Z3_ast const args[])
Create an AST node representing args[0] + ... + args[num_args-1].
expr concat(expr const &a, expr const &b)
Definition z3++.h:2731

◆ operator+() [2/3]

expr operator+ ( expr const & a,
int b )
inline

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

2004{ return a + a.ctx().num_val(b, a.get_sort()); }

◆ operator+() [3/3]

expr operator+ ( int a,
expr const & b )
inline

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

2005{ return b.ctx().num_val(a, b.get_sort()) + b; }

◆ operator-() [1/4]

expr operator- ( expr const & a)
inline

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

2077 {
2078 Z3_ast r = 0;
2079 if (a.is_arith()) {
2080 r = Z3_mk_unary_minus(a.ctx(), a);
2081 }
2082 else if (a.is_finite_field()) { r = Z3_mk_ff_neg(a.ctx(), a); }
2083 else if (a.is_bv()) {
2084 r = Z3_mk_bvneg(a.ctx(), a);
2085 }
2086 else if (a.is_fpa()) {
2087 r = Z3_mk_fpa_neg(a.ctx(), a);
2088 }
2089 else {
2090 // operator is not supported by given arguments.
2091 assert(false);
2092 }
2093 a.check_error();
2094 return expr(a.ctx(), r);
2095 }
Z3_ast Z3_API Z3_mk_ff_neg(Z3_context c, Z3_ast a)
Additive inverse in a prime field.
Z3_ast Z3_API Z3_mk_unary_minus(Z3_context c, Z3_ast arg)
Create an AST node representing - arg.
Z3_ast Z3_API Z3_mk_fpa_neg(Z3_context c, Z3_ast t)
Floating-point negation.
Z3_ast Z3_API Z3_mk_bvneg(Z3_context c, Z3_ast t1)
Standard two's complement unary minus.

◆ operator-() [2/4]

expr operator- ( expr const & a,
expr const & b )
inline

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

2097 {
2098 check_context(a, b);
2099 if (a.is_finite_field() && b.is_finite_field()) return a + -b;
2100 Z3_ast r = 0;
2101 if (a.is_arith() && b.is_arith()) {
2102 Z3_ast args[2] = { a, b };
2103 r = Z3_mk_sub(a.ctx(), 2, args);
2104 }
2105 else if (a.is_bv() && b.is_bv()) {
2106 r = Z3_mk_bvsub(a.ctx(), a, b);
2107 }
2108 else if (a.is_fpa() && b.is_fpa()) {
2109 r = Z3_mk_fpa_sub(a.ctx(), a.ctx().fpa_rounding_mode(), a, b);
2110 }
2111 else {
2112 // operator is not supported by given arguments.
2113 assert(false);
2114 }
2115 a.check_error();
2116 return expr(a.ctx(), r);
2117 }
Z3_ast Z3_API Z3_mk_fpa_sub(Z3_context c, Z3_ast rm, Z3_ast t1, Z3_ast t2)
Floating-point subtraction.
Z3_ast Z3_API Z3_mk_bvsub(Z3_context c, Z3_ast t1, Z3_ast t2)
Standard two's complement subtraction.
Z3_ast Z3_API Z3_mk_sub(Z3_context c, unsigned num_args, Z3_ast const args[])
Create an AST node representing args[0] - ... - args[num_args - 1].

◆ operator-() [3/4]

expr operator- ( expr const & a,
int b )
inline

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

2118{ return a - a.ctx().num_val(b, a.get_sort()); }

◆ operator-() [4/4]

expr operator- ( int a,
expr const & b )
inline

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

2119{ return b.ctx().num_val(a, b.get_sort()) - b; }

◆ operator/() [1/3]

expr operator/ ( expr const & a,
expr const & b )
inline

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

2055 {
2056 check_context(a, b);
2057 Z3_ast r = 0;
2058 if (a.is_arith() && b.is_arith()) {
2059 r = Z3_mk_div(a.ctx(), a, b);
2060 }
2061 else if (a.is_bv() && b.is_bv()) {
2062 r = Z3_mk_bvsdiv(a.ctx(), a, b);
2063 }
2064 else if (a.is_fpa() && b.is_fpa()) {
2065 r = Z3_mk_fpa_div(a.ctx(), a.ctx().fpa_rounding_mode(), a, b);
2066 }
2067 else {
2068 // operator is not supported by given arguments.
2069 assert(false);
2070 }
2071 a.check_error();
2072 return expr(a.ctx(), r);
2073 }
Z3_ast Z3_API Z3_mk_div(Z3_context c, Z3_ast arg1, Z3_ast arg2)
Create an AST node representing arg1 div arg2.
Z3_ast Z3_API Z3_mk_bvsdiv(Z3_context c, Z3_ast t1, Z3_ast t2)
Two's complement signed division.
Z3_ast Z3_API Z3_mk_fpa_div(Z3_context c, Z3_ast rm, Z3_ast t1, Z3_ast t2)
Floating-point division.

◆ operator/() [2/3]

expr operator/ ( expr const & a,
int b )
inline

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

2074{ return a / a.ctx().num_val(b, a.get_sort()); }

◆ operator/() [3/3]

expr operator/ ( int a,
expr const & b )
inline

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

2075{ return b.ctx().num_val(a, b.get_sort()) / b; }

◆ operator<() [1/6]

probe operator< ( double p1,
probe const & p2 )
inline

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

3651{ return probe(p2.ctx(), p1) < p2; }

◆ operator<() [2/6]

expr operator< ( expr const & a,
expr const & b )
inline

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

2146 {
2147 check_context(a, b);
2148 Z3_ast r = 0;
2149 if (a.is_arith() && b.is_arith()) {
2150 r = Z3_mk_lt(a.ctx(), a, b);
2151 }
2152 else if (a.is_bv() && b.is_bv()) {
2153 r = Z3_mk_bvslt(a.ctx(), a, b);
2154 }
2155 else if (a.is_fpa() && b.is_fpa()) {
2156 r = Z3_mk_fpa_lt(a.ctx(), a, b);
2157 }
2158 else {
2159 // operator is not supported by given arguments.
2160 assert(false);
2161 }
2162 a.check_error();
2163 return expr(a.ctx(), r);
2164 }
Z3_ast Z3_API Z3_mk_bvslt(Z3_context c, Z3_ast t1, Z3_ast t2)
Two's complement signed less than.
Z3_ast Z3_API Z3_mk_lt(Z3_context c, Z3_ast t1, Z3_ast t2)
Create less than.
Z3_ast Z3_API Z3_mk_fpa_lt(Z3_context c, Z3_ast t1, Z3_ast t2)
Floating-point less than.

◆ operator<() [3/6]

expr operator< ( expr const & a,
int b )
inline

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

2165{ return a < a.ctx().num_val(b, a.get_sort()); }

◆ operator<() [4/6]

expr operator< ( int a,
expr const & b )
inline

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

2166{ return b.ctx().num_val(a, b.get_sort()) < b; }

◆ operator<() [5/6]

probe operator< ( probe const & p1,
double p2 )
inline

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

3650{ return p1 < probe(p1.ctx(), p2); }

◆ operator<() [6/6]

probe operator< ( probe const & p1,
probe const & p2 )
inline

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

3647 {
3648 check_context(p1, p2); Z3_probe r = Z3_probe_lt(p1.ctx(), p1, p2); p1.check_error(); return probe(p1.ctx(), r);
3649 }
Z3_probe Z3_API Z3_probe_lt(Z3_context x, Z3_probe p1, Z3_probe p2)
Return a probe that evaluates to "true" when the value returned by p1 is less than the value returned...

◆ operator<<() [1/13]

std::ostream & operator<< ( std::ostream & out,
apply_result const & r )
inline

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

3466{ out << Z3_apply_result_to_string(r.ctx(), r); return out; }
Z3_string Z3_API Z3_apply_result_to_string(Z3_context c, Z3_apply_result r)
Convert the Z3_apply_result object returned by Z3_tactic_apply into a string.

◆ operator<<() [2/13]

std::ostream & operator<< ( std::ostream & out,
ast const & n )
inline

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

673 {
674 out << Z3_ast_to_string(n.ctx(), n.m_ast); return out;
675 }
Z3_string Z3_API Z3_ast_to_string(Z3_context c, Z3_ast a)
Convert the given AST node into a string.

◆ operator<<() [3/13]

std::ostream & operator<< ( std::ostream & out,
check_result r )
inline

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

3062 {
3063 if (r == unsat) out << "unsat";
3064 else if (r == sat) out << "sat";
3065 else out << "unknown";
3066 return out;
3067 }

◆ operator<<() [4/13]

std::ostream & operator<< ( std::ostream & out,
exception const & e )
inline

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

128{ out << e.msg(); return out; }

Referenced by operator<<(), operator<<(), and operator<<().

◆ operator<<() [5/13]

std::ostream & operator<< ( std::ostream & out,
fixedpoint const & f )
inline

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

3860{ return out << Z3_fixedpoint_to_string(f.ctx(), f, 0, 0); }
Z3_string Z3_API Z3_fixedpoint_to_string(Z3_context c, Z3_fixedpoint f, unsigned num_queries, Z3_ast queries[])
Print the current rules and background axioms as a string.

◆ operator<<() [6/13]

std::ostream & operator<< ( std::ostream & out,
goal const & g )
inline

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

3442{ out << Z3_goal_to_string(g.ctx(), g); return out; }
Z3_string Z3_API Z3_goal_to_string(Z3_context c, Z3_goal g)
Convert a goal into a string.

◆ operator<<() [7/13]

std::ostream & operator<< ( std::ostream & out,
model const & m )
inline

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

3030{ return out << m.to_string(); }

◆ operator<<() [8/13]

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

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

3802{ out << Z3_optimize_to_string(s.ctx(), s.m_opt); return out; }
Z3_string Z3_API Z3_optimize_to_string(Z3_context c, Z3_optimize o)
Print the current context as a string.

◆ operator<<() [9/13]

std::ostream & operator<< ( std::ostream & out,
param_descrs const & d )
inline

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

616{ return out << d.to_string(); }

◆ operator<<() [10/13]

std::ostream & operator<< ( std::ostream & out,
params const & p )
inline

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

640 {
641 out << Z3_params_to_string(p.ctx(), p); return out;
642 }
Z3_string Z3_API Z3_params_to_string(Z3_context c, Z3_params p)
Convert a parameter set into a string. This function is mainly used for printing the contents of a pa...

◆ operator<<() [11/13]

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

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

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

◆ operator<<() [12/13]

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

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

3059{ out << Z3_stats_to_string(s.ctx(), s); return out; }
Z3_string Z3_API Z3_stats_to_string(Z3_context c, Z3_stats s)
Convert a statistics into a string.

◆ operator<<() [13/13]

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

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

584 {
585 if (s.kind() == Z3_INT_SYMBOL)
586 out << "k!" << s.to_int();
587 else
588 out << s.str();
589 return out;
590 }
@ Z3_INT_SYMBOL
Definition z3_api.h:73

◆ operator<=() [1/6]

probe operator<= ( double p1,
probe const & p2 )
inline

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

3641{ return probe(p2.ctx(), p1) <= p2; }

◆ operator<=() [2/6]

expr operator<= ( expr const & a,
expr const & b )
inline

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

2121 {
2122 check_context(a, b);
2123 Z3_ast r = 0;
2124 if (a.is_arith() && b.is_arith()) {
2125 r = Z3_mk_le(a.ctx(), a, b);
2126 }
2127 else if (a.is_bv() && b.is_bv()) {
2128 r = Z3_mk_bvsle(a.ctx(), a, b);
2129 }
2130 else if (a.is_fpa() && b.is_fpa()) {
2131 r = Z3_mk_fpa_leq(a.ctx(), a, b);
2132 }
2133 else {
2134 // operator is not supported by given arguments.
2135 assert(false);
2136 }
2137 a.check_error();
2138 return expr(a.ctx(), r);
2139 }
Z3_ast Z3_API Z3_mk_bvsle(Z3_context c, Z3_ast t1, Z3_ast t2)
Two's complement signed less than or equal to.
Z3_ast Z3_API Z3_mk_le(Z3_context c, Z3_ast t1, Z3_ast t2)
Create less than or equal to.
Z3_ast Z3_API Z3_mk_fpa_leq(Z3_context c, Z3_ast t1, Z3_ast t2)
Floating-point less than or equal.

◆ operator<=() [3/6]

expr operator<= ( expr const & a,
int b )
inline

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

2140{ return a <= a.ctx().num_val(b, a.get_sort()); }

◆ operator<=() [4/6]

expr operator<= ( int a,
expr const & b )
inline

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

2141{ return b.ctx().num_val(a, b.get_sort()) <= b; }

◆ operator<=() [5/6]

probe operator<= ( probe const & p1,
double p2 )
inline

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

3640{ return p1 <= probe(p1.ctx(), p2); }

◆ operator<=() [6/6]

probe operator<= ( probe const & p1,
probe const & p2 )
inline

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

3637 {
3638 check_context(p1, p2); Z3_probe r = Z3_probe_le(p1.ctx(), p1, p2); p1.check_error(); return probe(p1.ctx(), r);
3639 }
Z3_probe Z3_API Z3_probe_le(Z3_context x, Z3_probe p1, Z3_probe p2)
Return a probe that evaluates to "true" when the value returned by p1 is less than or equal to the va...

◆ operator==() [1/8]

expr operator== ( double a,
expr const & b )
inline

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

1959{ assert(b.is_fpa()); return b.ctx().fpa_val(a) == b; }

◆ operator==() [2/8]

probe operator== ( double p1,
probe const & p2 )
inline

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

3661{ return probe(p2.ctx(), p1) == p2; }

◆ operator==() [3/8]

expr operator== ( expr const & a,
double b )
inline

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

1958{ assert(a.is_fpa()); return a == a.ctx().fpa_val(b); }

◆ operator==() [4/8]

expr operator== ( expr const & a,
expr const & b )
inline

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

1950 {
1951 check_context(a, b);
1952 Z3_ast r = Z3_mk_eq(a.ctx(), a, b);
1953 a.check_error();
1954 return expr(a.ctx(), r);
1955 }
Z3_ast Z3_API Z3_mk_eq(Z3_context c, Z3_ast l, Z3_ast r)
Create an AST node representing l = r.

Referenced by operator==(), and operator==().

◆ operator==() [5/8]

expr operator== ( expr const & a,
int b )
inline

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

1956{ assert(a.is_arith() || a.is_bv() || a.is_fpa() || a.is_finite_field()); return a == a.ctx().num_val(b, a.get_sort()); }

◆ operator==() [6/8]

expr operator== ( int a,
expr const & b )
inline

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

1957{ assert(b.is_arith() || b.is_bv() || b.is_fpa() || b.is_finite_field()); return b.ctx().num_val(a, b.get_sort()) == b; }

◆ operator==() [7/8]

probe operator== ( probe const & p1,
double p2 )
inline

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

3660{ return p1 == probe(p1.ctx(), p2); }

◆ operator==() [8/8]

probe operator== ( probe const & p1,
probe const & p2 )
inline

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

3657 {
3658 check_context(p1, p2); Z3_probe r = Z3_probe_eq(p1.ctx(), p1, p2); p1.check_error(); return probe(p1.ctx(), r);
3659 }
Z3_probe Z3_API Z3_probe_eq(Z3_context x, Z3_probe p1, Z3_probe p2)
Return a probe that evaluates to "true" when the value returned by p1 is equal to the value returned ...

◆ operator>() [1/6]

probe operator> ( double p1,
probe const & p2 )
inline

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

3656{ return probe(p2.ctx(), p1) > p2; }

◆ operator>() [2/6]

expr operator> ( expr const & a,
expr const & b )
inline

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

2168 {
2169 check_context(a, b);
2170 Z3_ast r = 0;
2171 if (a.is_arith() && b.is_arith()) {
2172 r = Z3_mk_gt(a.ctx(), a, b);
2173 }
2174 else if (a.is_bv() && b.is_bv()) {
2175 r = Z3_mk_bvsgt(a.ctx(), a, b);
2176 }
2177 else if (a.is_fpa() && b.is_fpa()) {
2178 r = Z3_mk_fpa_gt(a.ctx(), a, b);
2179 }
2180 else {
2181 // operator is not supported by given arguments.
2182 assert(false);
2183 }
2184 a.check_error();
2185 return expr(a.ctx(), r);
2186 }
Z3_ast Z3_API Z3_mk_bvsgt(Z3_context c, Z3_ast t1, Z3_ast t2)
Two's complement signed greater than.
Z3_ast Z3_API Z3_mk_fpa_gt(Z3_context c, Z3_ast t1, Z3_ast t2)
Floating-point greater than.
Z3_ast Z3_API Z3_mk_gt(Z3_context c, Z3_ast t1, Z3_ast t2)
Create greater than.

◆ operator>() [3/6]

expr operator> ( expr const & a,
int b )
inline

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

2187{ return a > a.ctx().num_val(b, a.get_sort()); }

◆ operator>() [4/6]

expr operator> ( int a,
expr const & b )
inline

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

2188{ return b.ctx().num_val(a, b.get_sort()) > b; }

◆ operator>() [5/6]

probe operator> ( probe const & p1,
double p2 )
inline

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

3655{ return p1 > probe(p1.ctx(), p2); }

◆ operator>() [6/6]

probe operator> ( probe const & p1,
probe const & p2 )
inline

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

3652 {
3653 check_context(p1, p2); Z3_probe r = Z3_probe_gt(p1.ctx(), p1, p2); p1.check_error(); return probe(p1.ctx(), r);
3654 }
Z3_probe Z3_API Z3_probe_gt(Z3_context x, Z3_probe p1, Z3_probe p2)
Return a probe that evaluates to "true" when the value returned by p1 is greater than the value retur...

◆ operator>=() [1/6]

probe operator>= ( double p1,
probe const & p2 )
inline

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

3646{ return probe(p2.ctx(), p1) >= p2; }

◆ operator>=() [2/6]

expr operator>= ( expr const & a,
expr const & b )
inline

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

2035 {
2036 check_context(a, b);
2037 Z3_ast r = 0;
2038 if (a.is_arith() && b.is_arith()) {
2039 r = Z3_mk_ge(a.ctx(), a, b);
2040 }
2041 else if (a.is_bv() && b.is_bv()) {
2042 r = Z3_mk_bvsge(a.ctx(), a, b);
2043 }
2044 else if (a.is_fpa() && b.is_fpa()) {
2045 r = Z3_mk_fpa_geq(a.ctx(), a, b);
2046 }
2047 else {
2048 // operator is not supported by given arguments.
2049 assert(false);
2050 }
2051 a.check_error();
2052 return expr(a.ctx(), r);
2053 }
Z3_ast Z3_API Z3_mk_bvsge(Z3_context c, Z3_ast t1, Z3_ast t2)
Two's complement signed greater than or equal to.
Z3_ast Z3_API Z3_mk_fpa_geq(Z3_context c, Z3_ast t1, Z3_ast t2)
Floating-point greater than or equal.

◆ operator>=() [3/6]

expr operator>= ( expr const & a,
int b )
inline

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

2143{ return a >= a.ctx().num_val(b, a.get_sort()); }

◆ operator>=() [4/6]

expr operator>= ( int a,
expr const & b )
inline

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

2144{ return b.ctx().num_val(a, b.get_sort()) >= b; }

◆ operator>=() [5/6]

probe operator>= ( probe const & p1,
double p2 )
inline

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

3645{ return p1 >= probe(p1.ctx(), p2); }

◆ operator>=() [6/6]

probe operator>= ( probe const & p1,
probe const & p2 )
inline

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

3642 {
3643 check_context(p1, p2); Z3_probe r = Z3_probe_ge(p1.ctx(), p1, p2); p1.check_error(); return probe(p1.ctx(), r);
3644 }
Z3_probe Z3_API Z3_probe_ge(Z3_context x, Z3_probe p1, Z3_probe p2)
Return a probe that evaluates to "true" when the value returned by p1 is greater than or equal to the...

◆ operator^() [1/3]

expr operator^ ( expr const & a,
expr const & b )
inline

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

2194{ check_context(a, b); Z3_ast r = a.is_bool() ? Z3_mk_xor(a.ctx(), a, b) : Z3_mk_bvxor(a.ctx(), a, b); a.check_error(); return expr(a.ctx(), r); }
Z3_ast Z3_API Z3_mk_bvxor(Z3_context c, Z3_ast t1, Z3_ast t2)
Bitwise exclusive-or.
Z3_ast Z3_API Z3_mk_xor(Z3_context c, Z3_ast t1, Z3_ast t2)
Create an AST node representing t1 xor t2.

◆ operator^() [2/3]

expr operator^ ( expr const & a,
int b )
inline

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

2195{ return a ^ a.ctx().num_val(b, a.get_sort()); }

◆ operator^() [3/3]

expr operator^ ( int a,
expr const & b )
inline

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

2196{ return b.ctx().num_val(a, b.get_sort()) ^ b; }

◆ operator|() [1/4]

expr operator| ( expr const & a,
expr const & b )
inline

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

2198{ if (a.is_bool()) return a || b; check_context(a, b); Z3_ast r = Z3_mk_bvor(a.ctx(), a, b); a.check_error(); return expr(a.ctx(), r); }
Z3_ast Z3_API Z3_mk_bvor(Z3_context c, Z3_ast t1, Z3_ast t2)
Bitwise or.

◆ operator|() [2/4]

expr operator| ( expr const & a,
int b )
inline

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

2199{ return a | a.ctx().num_val(b, a.get_sort()); }

◆ operator|() [3/4]

expr operator| ( int a,
expr const & b )
inline

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

2200{ return b.ctx().num_val(a, b.get_sort()) | b; }

◆ operator|() [4/4]

tactic operator| ( tactic const & t1,
tactic const & t2 )
inline

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

3515 {
3516 check_context(t1, t2);
3517 Z3_tactic r = Z3_tactic_or_else(t1.ctx(), t1, t2);
3518 t1.check_error();
3519 return tactic(t1.ctx(), r);
3520 }
Z3_tactic Z3_API Z3_tactic_or_else(Z3_context c, Z3_tactic t1, Z3_tactic t2)
Return a tactic that first applies t1 to a given goal, if it fails then returns the result of t2 appl...

◆ operator||() [1/4]

expr operator|| ( bool a,
expr const & b )
inline
Precondition
b.is_bool()

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

1948{ return b.ctx().bool_val(a) || b; }

◆ operator||() [2/4]

expr operator|| ( expr const & a,
bool b )
inline
Precondition
a.is_bool()

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

1946{ return a || a.ctx().bool_val(b); }

◆ operator||() [3/4]

expr operator|| ( expr const & a,
expr const & b )
inline
Precondition
a.is_bool()
b.is_bool()

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

1937 {
1938 check_context(a, b);
1939 assert(a.is_bool() && b.is_bool());
1940 Z3_ast args[2] = { a, b };
1941 Z3_ast r = Z3_mk_or(a.ctx(), 2, args);
1942 a.check_error();
1943 return expr(a.ctx(), r);
1944 }

◆ operator||() [4/4]

probe operator|| ( probe const & p1,
probe const & p2 )
inline

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

3665 {
3666 check_context(p1, p2); Z3_probe r = Z3_probe_or(p1.ctx(), p1, p2); p1.check_error(); return probe(p1.ctx(), r);
3667 }
Z3_probe Z3_API Z3_probe_or(Z3_context x, Z3_probe p1, Z3_probe p2)
Return a probe that evaluates to "true" when p1 or p2 evaluates to true.

◆ operator~()

expr operator~ ( expr const & a)
inline

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

2283{ Z3_ast r = Z3_mk_bvnot(a.ctx(), a); return expr(a.ctx(), r); }
Z3_ast Z3_API Z3_mk_bvnot(Z3_context c, Z3_ast t1)
Bitwise negation.

◆ option()

expr option ( expr const & re)
inline

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

4597 {
4599 }
Z3_ast Z3_API Z3_mk_re_option(Z3_context c, Z3_ast re)
Create the regular language [re].

Referenced by option().

◆ par_and_then()

tactic par_and_then ( tactic const & t1,
tactic const & t2 )
inline

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

3547 {
3548 check_context(t1, t2);
3549 Z3_tactic r = Z3_tactic_par_and_then(t1.ctx(), t1, t2);
3550 t1.check_error();
3551 return tactic(t1.ctx(), r);
3552 }
Z3_tactic Z3_API Z3_tactic_par_and_then(Z3_context c, Z3_tactic t1, Z3_tactic t2)
Return a tactic that applies t1 to a given goal and then t2 to every subgoal produced by t1....

◆ par_or()

tactic par_or ( unsigned n,
tactic const * tactics )
inline

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

3538 {
3539 if (n == 0) {
3540 Z3_THROW(exception("a non-zero number of tactics need to be passed to par_or"));
3541 }
3542 array<Z3_tactic> buffer(n);
3543 for (unsigned i = 0; i < n; ++i) buffer[i] = tactics[i];
3544 return tactic(tactics[0u].ctx(), Z3_tactic_par_or(tactics[0u].ctx(), n, buffer.ptr()));
3545 }
exception(char const *msg)
Definition z3++.h:123
Z3_tactic Z3_API Z3_tactic_par_or(Z3_context c, unsigned num, Z3_tactic const ts[])
Return a tactic that applies the given tactics in parallel.
#define Z3_THROW(x)
Definition z3++.h:134

◆ partial_order()

func_decl partial_order ( sort const & a,
unsigned index )
inline

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

2535 {
2536 return to_func_decl(a.ctx(), Z3_mk_partial_order(a.ctx(), a, index));
2537 }
Z3_func_decl Z3_API Z3_mk_partial_order(Z3_context c, Z3_sort a, unsigned id)
create a partial ordering relation over signature a and index id.

Referenced by partial_order().

◆ pbeq()

expr pbeq ( expr_vector const & es,
int const * coeffs,
int bound )
inline

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

2689 {
2690 assert(es.size() > 0);
2691 context& ctx = es[0u].ctx();
2692 array<Z3_ast> _es(es);
2693 Z3_ast r = Z3_mk_pbeq(ctx, _es.size(), _es.ptr(), coeffs, bound);
2694 ctx.check_error();
2695 return expr(ctx, r);
2696 }
Z3_ast Z3_API Z3_mk_pbeq(Z3_context c, unsigned num_args, Z3_ast const args[], int const coeffs[], int k)
Pseudo-Boolean relations.

◆ pbge()

expr pbge ( expr_vector const & es,
int const * coeffs,
int bound )
inline

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

2681 {
2682 assert(es.size() > 0);
2683 context& ctx = es[0u].ctx();
2684 array<Z3_ast> _es(es);
2685 Z3_ast r = Z3_mk_pbge(ctx, _es.size(), _es.ptr(), coeffs, bound);
2686 ctx.check_error();
2687 return expr(ctx, r);
2688 }
Z3_ast Z3_API Z3_mk_pbge(Z3_context c, unsigned num_args, Z3_ast const args[], int const coeffs[], int k)
Pseudo-Boolean relations.

◆ pble()

expr pble ( expr_vector const & es,
int const * coeffs,
int bound )
inline

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

2673 {
2674 assert(es.size() > 0);
2675 context& ctx = es[0u].ctx();
2676 array<Z3_ast> _es(es);
2677 Z3_ast r = Z3_mk_pble(ctx, _es.size(), _es.ptr(), coeffs, bound);
2678 ctx.check_error();
2679 return expr(ctx, r);
2680 }
Z3_ast Z3_API Z3_mk_pble(Z3_context c, unsigned num_args, Z3_ast const args[], int const coeffs[], int k)
Pseudo-Boolean relations.

◆ piecewise_linear_order()

func_decl piecewise_linear_order ( sort const & a,
unsigned index )
inline

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

2538 {
2539 return to_func_decl(a.ctx(), Z3_mk_piecewise_linear_order(a.ctx(), a, index));
2540 }
Z3_func_decl Z3_API Z3_mk_piecewise_linear_order(Z3_context c, Z3_sort a, unsigned id)
create a piecewise linear ordering relation over signature a and index id.

Referenced by piecewise_linear_order().

◆ plus()

expr plus ( expr const & re)
inline

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

4594 {
4596 }
Z3_ast Z3_API Z3_mk_re_plus(Z3_context c, Z3_ast re)
Create the regular language re+.

Referenced by plus().

◆ polynomial_subresultants()

expr_vector polynomial_subresultants ( expr const & p,
expr const & q,
expr const & x )
inline

Return the nonzero subresultants of p and q with respect to the "variable" x.

Precondition
p, q and x are Z3 expressions where p and q are arithmetic terms. Note that, any subterm that cannot be viewed as a polynomial is assumed to be a variable.

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

2551 {
2552 check_context(p, q); check_context(p, x);
2553 Z3_ast_vector r = Z3_polynomial_subresultants(p.ctx(), p, q, x);
2554 p.check_error();
2555 return expr_vector(p.ctx(), r);
2556 }
Z3_ast_vector Z3_API Z3_polynomial_subresultants(Z3_context c, Z3_ast p, Z3_ast q, Z3_ast x)
Return the nonzero subresultants of p and q with respect to the "variable" x.
ast_vector_tpl< expr > expr_vector
Definition z3++.h:77

Referenced by polynomial_subresultants().

◆ prefixof()

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

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

4570 {
4571 check_context(a, b);
4572 Z3_ast r = Z3_mk_seq_prefix(a.ctx(), a, b);
4573 a.check_error();
4574 return expr(a.ctx(), r);
4575 }
Z3_ast Z3_API Z3_mk_seq_prefix(Z3_context c, Z3_ast prefix, Z3_ast s)
Check if prefix is a prefix of s.

Referenced by prefixof().

◆ pw() [1/3]

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

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

1861{ _Z3_MK_BIN_(a, b, Z3_mk_power); }
Z3_ast Z3_API Z3_mk_power(Z3_context c, Z3_ast arg1, Z3_ast arg2)
Create an AST node representing arg1 ^ arg2.

◆ pw() [2/3]

expr pw ( expr const & a,
int b )
inline

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

1862{ return pw(a, a.ctx().num_val(b, a.get_sort())); }
expr pw(expr const &a, expr const &b)
Definition z3++.h:1861

◆ pw() [3/3]

expr pw ( int a,
expr const & b )
inline

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

1863{ return pw(b.ctx().num_val(a, b.get_sort()), b); }

◆ qe_lite()

expr qe_lite ( expr_vector const & vars,
expr const & body )
inline

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

2983 {
2984 check_context(vars, body);
2985 Z3_ast r = Z3_qe_lite(body.ctx(), vars, body);
2986 body.check_error();
2987 return expr(body.ctx(), r);
2988 }

Referenced by qe_lite().

◆ qe_model_project()

expr qe_model_project ( model const & m,
expr_vector const & bounds,
expr const & body )
inline

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

3000 {
3001 check_context(m, bounds); check_context(m, body);
3002 std::vector<Z3_app> apps = to_apps(bounds);
3003 Z3_ast r = Z3_qe_model_project(m.ctx(), m, bounds.size(), apps.data(), body);
3004 m.check_error();
3005 return expr(m.ctx(), r);
3006 }
std::vector< Z3_app > to_apps(expr_vector const &bounds)
Definition z3++.h:2990

Referenced by qe_model_project().

◆ qe_model_project_skolem()

expr qe_model_project_skolem ( model const & m,
expr_vector const & bounds,
expr const & body,
ast_map & map )
inline

Project variables and write the introduced Skolem terms to map.

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

3011 {
3012 check_context(m, bounds); check_context(m, body); check_context(m, map);
3013 std::vector<Z3_app> apps = to_apps(bounds);
3014 Z3_ast r = Z3_qe_model_project_skolem(m.ctx(), m, bounds.size(), apps.data(), body, map);
3015 m.check_error();
3016 return expr(m.ctx(), r);
3017 }
expr map(expr const &f, expr const &list)
Definition z3++.h:2775

Referenced by qe_model_project_skolem().

◆ qe_model_project_with_witness()

expr qe_model_project_with_witness ( model const & m,
expr_vector const & bounds,
expr const & body,
ast_map & map )
inline

Project variables and write the introduced witnesses to map.

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

3022 {
3023 check_context(m, bounds); check_context(m, body); check_context(m, map);
3024 std::vector<Z3_app> apps = to_apps(bounds);
3025 Z3_ast r = Z3_qe_model_project_with_witness(m.ctx(), m, bounds.size(), apps.data(), body, map);
3026 m.check_error();
3027 return expr(m.ctx(), r);
3028 }

Referenced by qe_model_project_with_witness().

◆ range()

expr range ( expr const & lo,
expr const & hi )
inline

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

4631 {
4632 check_context(lo, hi);
4633 Z3_ast r = Z3_mk_re_range(lo.ctx(), lo, hi);
4634 lo.check_error();
4635 return expr(lo.ctx(), r);
4636 }
Z3_ast Z3_API Z3_mk_re_range(Z3_context c, Z3_ast lo, Z3_ast hi)
Create the range regular expression over two sequences of length 1.

Referenced by context::fpa_sort(), context::function(), context::function(), context::function(), context::function(), context::function(), context::function(), context::function(), context::function(), context::function(), function(), function(), function(), function(), function(), function(), function(), function(), function(), context::recfun(), context::recfun(), context::recfun(), context::recfun(), context::recfun(), context::recfun(), recfun(), recfun(), recfun(), recfun(), and context::user_propagate_function().

◆ rcf_e()

rcf_num rcf_e ( context & c)
inline

Create an RCF numeral representing e (Euler's constant).

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

5284 {
5285 return rcf_num(c, Z3_rcf_mk_e(c));
5286 }
rcf_num(context &c, Z3_rcf_num n)
Definition z3++.h:5128
Z3_rcf_num Z3_API Z3_rcf_mk_e(Z3_context c)
Return e (Euler's constant).

Referenced by rcf_e().

◆ rcf_infinitesimal()

rcf_num rcf_infinitesimal ( context & c)
inline

Create an RCF numeral representing an infinitesimal.

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

5291 {
5292 return rcf_num(c, Z3_rcf_mk_infinitesimal(c));
5293 }
Z3_rcf_num Z3_API Z3_rcf_mk_infinitesimal(Z3_context c)
Return a new infinitesimal that is smaller than all elements in the Z3 field.

Referenced by rcf_infinitesimal().

◆ rcf_pi()

rcf_num rcf_pi ( context & c)
inline

Create an RCF numeral representing pi.

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

5277 {
5278 return rcf_num(c, Z3_rcf_mk_pi(c));
5279 }
Z3_rcf_num Z3_API Z3_rcf_mk_pi(Z3_context c)
Return Pi.

Referenced by rcf_pi().

◆ rcf_roots()

std::vector< rcf_num > rcf_roots ( context & c,
std::vector< rcf_num > const & coeffs )
inline

Find roots of a polynomial with given coefficients.

The polynomial is a[n-1]*x^(n-1) + ... + a[1]*x + a[0]. Returns a vector of RCF numerals representing the roots.

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

5301 {
5302 if (coeffs.empty()) {
5303 Z3_THROW(exception("polynomial coefficients cannot be empty"));
5304 }
5305
5306 unsigned n = static_cast<unsigned>(coeffs.size());
5307 std::vector<Z3_rcf_num> a(n);
5308 std::vector<Z3_rcf_num> roots(n);
5309
5310 for (unsigned i = 0; i < n; ++i) {
5311 a[i] = coeffs[i];
5312 }
5313
5314 unsigned num_roots = Z3_rcf_mk_roots(c, n, a.data(), roots.data());
5315
5316 std::vector<rcf_num> result;
5317 result.reserve(num_roots);
5318 for (unsigned i = 0; i < num_roots; ++i) {
5319 result.push_back(rcf_num(c, roots[i]));
5320 }
5321
5322 return result;
5323 }
unsigned Z3_API Z3_rcf_mk_roots(Z3_context c, unsigned n, Z3_rcf_num const a[], Z3_rcf_num roots[])
Store in roots the roots of the polynomial a[n-1]*x^{n-1} + ... + a[0]. The output vector roots must ...

Referenced by rcf_roots().

◆ re_complement()

expr re_complement ( expr const & a)
inline

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

4628 {
4630 }
Z3_ast Z3_API Z3_mk_re_complement(Z3_context c, Z3_ast re)
Create the complement of the regular language re.

Referenced by re_complement().

◆ re_diff()

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

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

4621 {
4622 check_context(a, b);
4623 context& ctx = a.ctx();
4624 Z3_ast r = Z3_mk_re_diff(ctx, a, b);
4625 ctx.check_error();
4626 return expr(ctx, r);
4627 }
Z3_ast Z3_API Z3_mk_re_diff(Z3_context c, Z3_ast re1, Z3_ast re2)
Create the difference of regular expressions.

Referenced by re_diff().

◆ re_empty()

expr re_empty ( sort const & s)
inline

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

4603 {
4604 Z3_ast r = Z3_mk_re_empty(s.ctx(), s);
4605 s.check_error();
4606 return expr(s.ctx(), r);
4607 }
Z3_ast Z3_API Z3_mk_re_empty(Z3_context c, Z3_sort re)
Create an empty regular expression of sort re.

Referenced by re_empty().

◆ re_full()

expr re_full ( sort const & s)
inline

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

4608 {
4609 Z3_ast r = Z3_mk_re_full(s.ctx(), s);
4610 s.check_error();
4611 return expr(s.ctx(), r);
4612 }
Z3_ast Z3_API Z3_mk_re_full(Z3_context c, Z3_sort re)
Create an universal regular expression of sort re.

Referenced by re_full().

◆ re_intersect()

expr re_intersect ( expr_vector const & args)
inline

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

4613 {
4614 assert(args.size() > 0);
4615 context& ctx = args[0u].ctx();
4616 array<Z3_ast> _args(args);
4617 Z3_ast r = Z3_mk_re_intersect(ctx, _args.size(), _args.ptr());
4618 ctx.check_error();
4619 return expr(ctx, r);
4620 }
Z3_ast Z3_API Z3_mk_re_intersect(Z3_context c, unsigned n, Z3_ast const args[])
Create the intersection of the regular languages.

Referenced by re_intersect().

◆ real_part()

expr real_part ( expr const & z)
inline

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

1907 {
1908 Z3_ast r = Z3_mk_real_part(z.ctx(), z);
1909 z.check_error();
1910 return expr(z.ctx(), r);
1911 }
Z3_ast Z3_API Z3_mk_real_part(Z3_context c, Z3_ast z)
Return the real component of a Complex expression.

Referenced by real_part().

◆ recfun() [1/4]

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

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

4384 {
4385 return range.ctx().recfun(name, d1, d2, range);
4386 }
func_decl recfun(symbol const &name, unsigned arity, sort const *domain, sort const &range)
Definition z3++.h:4127

◆ recfun() [2/4]

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

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

4381 {
4382 return range.ctx().recfun(name, d1, range);
4383 }

◆ recfun() [3/4]

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

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

4378 {
4379 return range.ctx().recfun(name, arity, domain, range);
4380 }

◆ recfun() [4/4]

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

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

4375 {
4376 return range.ctx().recfun(name, arity, domain, range);
4377 }

Referenced by recfun(), recfun(), recfun(), and recfun().

◆ rem() [1/3]

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

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

1881 {
1882 if (a.is_fpa() && b.is_fpa()) {
1884 } else {
1885 _Z3_MK_BIN_(a, b, Z3_mk_rem);
1886 }
1887 }
Z3_ast Z3_API Z3_mk_fpa_rem(Z3_context c, Z3_ast t1, Z3_ast t2)
Floating-point remainder.
Z3_ast Z3_API Z3_mk_rem(Z3_context c, Z3_ast arg1, Z3_ast arg2)
Create an AST node representing arg1 rem arg2.

◆ rem() [2/3]

expr rem ( expr const & a,
int b )
inline

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

1888{ return rem(a, a.ctx().num_val(b, a.get_sort())); }
expr rem(expr const &a, expr const &b)
Definition z3++.h:1881

◆ rem() [3/3]

expr rem ( int a,
expr const & b )
inline

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

1889{ return rem(b.ctx().num_val(a, b.get_sort()), b); }

◆ repeat()

tactic repeat ( tactic const & t,
unsigned max = UINT_MAX )
inline

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

3522 {
3523 Z3_tactic r = Z3_tactic_repeat(t.ctx(), t, max);
3524 t.check_error();
3525 return tactic(t.ctx(), r);
3526 }
Z3_tactic Z3_API Z3_tactic_repeat(Z3_context c, Z3_tactic t, unsigned max)
Return a tactic that keeps applying t until the goal is not modified anymore or the maximum number of...
expr max(expr const &a, expr const &b)
Definition z3++.h:2221

◆ reset_params()

void reset_params ( )
inline

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

void Z3_API Z3_global_param_reset_all(void)
Restore the value of all global (and module) parameters. This command will not affect already created...

Referenced by reset_params().

◆ round_fpa_to_closest_integer()

expr round_fpa_to_closest_integer ( expr const & t)
inline

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

2336 {
2337 assert(t.is_fpa());
2338 Z3_ast r = Z3_mk_fpa_round_to_integral(t.ctx(), t.ctx().fpa_rounding_mode(), t);
2339 t.check_error();
2340 return expr(t.ctx(), r);
2341 }
Z3_ast Z3_API Z3_mk_fpa_round_to_integral(Z3_context c, Z3_ast rm, Z3_ast t)
Floating-point roundToIntegral. Rounds a floating-point number to the closest integer,...

◆ sbv_to_fpa()

expr sbv_to_fpa ( expr const & t,
sort s )
inline

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

2315 {
2316 assert(t.is_bv());
2317 Z3_ast r = Z3_mk_fpa_to_fp_signed(t.ctx(), t.ctx().fpa_rounding_mode(), t, s);
2318 t.check_error();
2319 return expr(t.ctx(), r);
2320 }
Z3_ast Z3_API Z3_mk_fpa_to_fp_signed(Z3_context c, Z3_ast rm, Z3_ast t, Z3_sort s)
Conversion of a 2's complement signed bit-vector term into a term of FloatingPoint sort.

◆ sdiv() [1/3]

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

signed division operator for bitvectors.

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

2434{ return to_expr(a.ctx(), Z3_mk_bvsdiv(a.ctx(), a, b)); }

Referenced by sdiv(), sdiv(), and sdiv().

◆ sdiv() [2/3]

expr sdiv ( expr const & a,
int b )
inline

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

2435{ return sdiv(a, a.ctx().num_val(b, a.get_sort())); }
expr sdiv(expr const &a, expr const &b)
signed division operator for bitvectors.
Definition z3++.h:2434

◆ sdiv() [3/3]

expr sdiv ( int a,
expr const & b )
inline

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

2436{ return sdiv(b.ctx().num_val(a, b.get_sort()), b); }

◆ select() [1/3]

expr select ( expr const & a,
expr const & i )
inline

forward declarations

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

4388 {
4389 check_context(a, i);
4390 Z3_ast r = Z3_mk_select(a.ctx(), a, i);
4391 a.check_error();
4392 return expr(a.ctx(), r);
4393 }
Z3_ast Z3_API Z3_mk_select(Z3_context c, Z3_ast a, Z3_ast i)
Array read. The argument a is the array and i is the index of the array that gets read.

Referenced by expr::operator[](), expr::operator[](), select(), select(), and select().

◆ select() [2/3]

expr select ( expr const & a,
expr_vector const & i )
inline

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

4397 {
4398 check_context(a, i);
4399 array<Z3_ast> idxs(i);
4400 Z3_ast r = Z3_mk_select_n(a.ctx(), a, idxs.size(), idxs.ptr());
4401 a.check_error();
4402 return expr(a.ctx(), r);
4403 }
Z3_ast Z3_API Z3_mk_select_n(Z3_context c, Z3_ast a, unsigned n, Z3_ast const *idxs)
n-ary Array read. The argument a is the array and idxs are the indices of the array that gets read.

◆ select() [3/3]

expr select ( expr const & a,
int i )
inline

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

4394 {
4395 return select(a, a.ctx().num_val(i, a.get_sort().array_domain()));
4396 }
expr select(expr const &a, expr const &i)
forward declarations
Definition z3++.h:4388

◆ set_add()

expr set_add ( expr const & s,
expr const & e )
inline

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

4467 {
4468 MK_EXPR2(Z3_mk_set_add, s, e);
4469 }
Z3_ast Z3_API Z3_mk_set_add(Z3_context c, Z3_ast set, Z3_ast elem)
Add an element to a set.

Referenced by set_add().

◆ set_complement()

expr set_complement ( expr const & a)
inline

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

4495 {
4497 }
Z3_ast Z3_API Z3_mk_set_complement(Z3_context c, Z3_ast arg)
Take the complement of a set.

Referenced by set_complement().

◆ set_del()

expr set_del ( expr const & s,
expr const & e )
inline

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

4471 {
4472 MK_EXPR2(Z3_mk_set_del, s, e);
4473 }
Z3_ast Z3_API Z3_mk_set_del(Z3_context c, Z3_ast set, Z3_ast elem)
Remove an element to a set.

Referenced by set_del().

◆ set_difference()

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

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

4491 {
4493 }
Z3_ast Z3_API Z3_mk_set_difference(Z3_context c, Z3_ast arg1, Z3_ast arg2)
Take the set difference between two sets.

Referenced by set_difference().

◆ set_intersect()

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

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

4483 {
4484 check_context(a, b);
4485 Z3_ast es[2] = { a, b };
4486 Z3_ast r = Z3_mk_set_intersect(a.ctx(), 2, es);
4487 a.check_error();
4488 return expr(a.ctx(), r);
4489 }
Z3_ast Z3_API Z3_mk_set_intersect(Z3_context c, unsigned num_args, Z3_ast const args[])
Take the intersection of a list of sets.

Referenced by set_intersect().

◆ set_member()

expr set_member ( expr const & s,
expr const & e )
inline

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

4499 {
4501 }
Z3_ast Z3_API Z3_mk_set_member(Z3_context c, Z3_ast elem, Z3_ast set)
Check for set membership.

Referenced by set_member().

◆ set_param() [1/3]

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

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

82{ Z3_global_param_set(param, value ? "true" : "false"); }
void Z3_API Z3_global_param_set(Z3_string param_id, Z3_string param_value)
Set a global (or module) parameter. This setting is shared by all Z3 contexts.

◆ set_param() [2/3]

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

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

81{ Z3_global_param_set(param, value); }

Referenced by set_param(), set_param(), and set_param().

◆ set_param() [3/3]

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

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

83{ auto str = std::to_string(value); Z3_global_param_set(param, str.c_str()); }

◆ set_subset()

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

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

4503 {
4505 }
Z3_ast Z3_API Z3_mk_set_subset(Z3_context c, Z3_ast arg1, Z3_ast arg2)
Check for subsetness of sets.

Referenced by set_subset().

◆ set_union()

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

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

4475 {
4476 check_context(a, b);
4477 Z3_ast es[2] = { a, b };
4478 Z3_ast r = Z3_mk_set_union(a.ctx(), 2, es);
4479 a.check_error();
4480 return expr(a.ctx(), r);
4481 }
Z3_ast Z3_API Z3_mk_set_union(Z3_context c, unsigned num_args, Z3_ast const args[])
Take the union of a list of sets.

Referenced by set_union().

◆ sext()

expr sext ( expr const & a,
unsigned i )
inline

Sign-extend of the given bit-vector to the (signed) equivalent bitvector of size m+i, where m is the size of the given bit-vector.

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

2530{ return to_expr(a.ctx(), Z3_mk_sign_ext(a.ctx(), i, a)); }
Z3_ast Z3_API Z3_mk_sign_ext(Z3_context c, unsigned i, Z3_ast t1)
Sign-extend of the given bit-vector to the (signed) equivalent bit-vector of size m+i,...

Referenced by sext().

◆ sge() [1/3]

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

signed greater than or equal to operator for bitvectors.

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

2395{ return to_expr(a.ctx(), Z3_mk_bvsge(a.ctx(), a, b)); }

Referenced by sge(), sge(), and sge().

◆ sge() [2/3]

expr sge ( expr const & a,
int b )
inline

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

2396{ return sge(a, a.ctx().num_val(b, a.get_sort())); }
expr sge(expr const &a, expr const &b)
signed greater than or equal to operator for bitvectors.
Definition z3++.h:2395

◆ sge() [3/3]

expr sge ( int a,
expr const & b )
inline

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

2397{ return sge(b.ctx().num_val(a, b.get_sort()), b); }

◆ sgt() [1/3]

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

signed greater than operator for bitvectors.

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

2401{ return to_expr(a.ctx(), Z3_mk_bvsgt(a.ctx(), a, b)); }

Referenced by sgt(), sgt(), and sgt().

◆ sgt() [2/3]

expr sgt ( expr const & a,
int b )
inline

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

2402{ return sgt(a, a.ctx().num_val(b, a.get_sort())); }
expr sgt(expr const &a, expr const &b)
signed greater than operator for bitvectors.
Definition z3++.h:2401

◆ sgt() [3/3]

expr sgt ( int a,
expr const & b )
inline

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

2403{ return sgt(b.ctx().num_val(a, b.get_sort()), b); }

◆ shl() [1/3]

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

shift left operator for bitvectors

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

2469{ return to_expr(a.ctx(), Z3_mk_bvshl(a.ctx(), a, b)); }
Z3_ast Z3_API Z3_mk_bvshl(Z3_context c, Z3_ast t1, Z3_ast t2)
Shift left.

Referenced by shl(), shl(), and shl().

◆ shl() [2/3]

expr shl ( expr const & a,
int b )
inline

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

2470{ return shl(a, a.ctx().num_val(b, a.get_sort())); }
expr shl(expr const &a, expr const &b)
shift left operator for bitvectors
Definition z3++.h:2469

◆ shl() [3/3]

expr shl ( int a,
expr const & b )
inline

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

2471{ return shl(b.ctx().num_val(a, b.get_sort()), b); }

◆ sle() [1/3]

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

signed less than or equal to operator for bitvectors.

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

2383{ return to_expr(a.ctx(), Z3_mk_bvsle(a.ctx(), a, b)); }

Referenced by sle(), sle(), and sle().

◆ sle() [2/3]

expr sle ( expr const & a,
int b )
inline

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

2384{ return sle(a, a.ctx().num_val(b, a.get_sort())); }
expr sle(expr const &a, expr const &b)
signed less than or equal to operator for bitvectors.
Definition z3++.h:2383

◆ sle() [3/3]

expr sle ( int a,
expr const & b )
inline

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

2385{ return sle(b.ctx().num_val(a, b.get_sort()), b); }

◆ slt() [1/3]

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

signed less than operator for bitvectors.

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

2389{ return to_expr(a.ctx(), Z3_mk_bvslt(a.ctx(), a, b)); }

Referenced by slt(), slt(), and slt().

◆ slt() [2/3]

expr slt ( expr const & a,
int b )
inline

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

2390{ return slt(a, a.ctx().num_val(b, a.get_sort())); }
expr slt(expr const &a, expr const &b)
signed less than operator for bitvectors.
Definition z3++.h:2389

◆ slt() [3/3]

expr slt ( int a,
expr const & b )
inline

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

2391{ return slt(b.ctx().num_val(a, b.get_sort()), b); }

◆ smod() [1/3]

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

signed modulus operator for bitvectors

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

2455{ return to_expr(a.ctx(), Z3_mk_bvsmod(a.ctx(), a, b)); }

Referenced by smod(), smod(), and smod().

◆ smod() [2/3]

expr smod ( expr const & a,
int b )
inline

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

2456{ return smod(a, a.ctx().num_val(b, a.get_sort())); }
expr smod(expr const &a, expr const &b)
signed modulus operator for bitvectors
Definition z3++.h:2455

◆ smod() [3/3]

expr smod ( int a,
expr const & b )
inline

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

2457{ return smod(b.ctx().num_val(a, b.get_sort()), b); }

◆ sqrt()

expr sqrt ( expr const & a,
expr const & rm )
inline

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

2269 {
2270 check_context(a, rm);
2271 assert(a.is_fpa());
2272 Z3_ast r = Z3_mk_fpa_sqrt(a.ctx(), rm, a);
2273 a.check_error();
2274 return expr(a.ctx(), r);
2275 }
Z3_ast Z3_API Z3_mk_fpa_sqrt(Z3_context c, Z3_ast rm, Z3_ast t)
Floating-point square root.

◆ srem() [1/3]

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

signed remainder operator for bitvectors

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

2448{ return to_expr(a.ctx(), Z3_mk_bvsrem(a.ctx(), a, b)); }
Z3_ast Z3_API Z3_mk_bvsrem(Z3_context c, Z3_ast t1, Z3_ast t2)
Two's complement signed remainder (sign follows dividend).

Referenced by srem(), srem(), and srem().

◆ srem() [2/3]

expr srem ( expr const & a,
int b )
inline

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

2449{ return srem(a, a.ctx().num_val(b, a.get_sort())); }
expr srem(expr const &a, expr const &b)
signed remainder operator for bitvectors
Definition z3++.h:2448

◆ srem() [3/3]

expr srem ( int a,
expr const & b )
inline

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

2450{ return srem(b.ctx().num_val(a, b.get_sort()), b); }

◆ star()

expr star ( expr const & re)
inline

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

4600 {
4602 }
Z3_ast Z3_API Z3_mk_re_star(Z3_context c, Z3_ast re)
Create the regular language re*.

Referenced by star().

◆ store() [1/5]

expr store ( expr const & a,
expr const & i,
expr const & v )
inline

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

4405 {
4406 check_context(a, i); check_context(a, v);
4407 Z3_ast r = Z3_mk_store(a.ctx(), a, i, v);
4408 a.check_error();
4409 return expr(a.ctx(), r);
4410 }
Z3_ast Z3_API Z3_mk_store(Z3_context c, Z3_ast a, Z3_ast i, Z3_ast v)
Array update.

Referenced by store(), store(), store(), store(), and store().

◆ store() [2/5]

expr store ( expr const & a,
expr i,
int v )
inline

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

4413{ return store(a, i, a.ctx().num_val(v, a.get_sort().array_range())); }
expr store(expr const &a, expr const &i, expr const &v)
Definition z3++.h:4405

◆ store() [3/5]

expr store ( expr const & a,
expr_vector const & i,
expr const & v )
inline

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

4417 {
4418 check_context(a, i); check_context(a, v);
4419 array<Z3_ast> idxs(i);
4420 Z3_ast r = Z3_mk_store_n(a.ctx(), a, idxs.size(), idxs.ptr(), v);
4421 a.check_error();
4422 return expr(a.ctx(), r);
4423 }
Z3_ast Z3_API Z3_mk_store_n(Z3_context c, Z3_ast a, unsigned n, Z3_ast const *idxs, Z3_ast v)
n-ary Array update.

◆ store() [4/5]

expr store ( expr const & a,
int i,
expr const & v )
inline

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

4412{ return store(a, a.ctx().num_val(i, a.get_sort().array_domain()), v); }

◆ store() [5/5]

expr store ( expr const & a,
int i,
int v )
inline

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

4414 {
4415 return store(a, a.ctx().num_val(i, a.get_sort().array_domain()), a.ctx().num_val(v, a.get_sort().array_range()));
4416 }

◆ suffixof()

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

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

4564 {
4565 check_context(a, b);
4566 Z3_ast r = Z3_mk_seq_suffix(a.ctx(), a, b);
4567 a.check_error();
4568 return expr(a.ctx(), r);
4569 }
Z3_ast Z3_API Z3_mk_seq_suffix(Z3_context c, Z3_ast suffix, Z3_ast s)
Check if suffix is a suffix of s.

Referenced by suffixof().

◆ sum()

expr sum ( expr_vector const & args)
inline

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

2713 {
2714 assert(args.size() > 0);
2715 context& ctx = args[0u].ctx();
2716 array<Z3_ast> _args(args);
2717 Z3_ast r = Z3_mk_add(ctx, _args.size(), _args.ptr());
2718 ctx.check_error();
2719 return expr(ctx, r);
2720 }

◆ to_apps()

std::vector< Z3_app > to_apps ( expr_vector const & bounds)
inline

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

2990 {
2991 std::vector<Z3_app> apps;
2992 for (unsigned i = 0; i < bounds.size(); ++i) {
2993 if (!Z3_is_app(bounds.ctx(), bounds[i]))
2994 Z3_THROW(exception("model projection bounds must be applications"));
2995 apps.push_back(Z3_to_app(bounds.ctx(), bounds[i]));
2996 }
2997 return apps;
2998 }
Z3_app Z3_API Z3_to_app(Z3_context c, Z3_ast a)
Convert an ast into an APP_AST. This is just type casting.
bool Z3_API Z3_is_app(Z3_context c, Z3_ast a)

Referenced by qe_model_project(), qe_model_project_skolem(), qe_model_project_with_witness(), and to_apps().

◆ to_check_result()

check_result to_check_result ( Z3_lbool l)
inline

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

178 {
179 if (l == Z3_L_TRUE) return sat;
180 else if (l == Z3_L_FALSE) return unsat;
181 return unknown;
182 }
@ Z3_L_TRUE
Definition z3_api.h:61
@ Z3_L_FALSE
Definition z3_api.h:59

Referenced by optimize::check(), optimize::check(), solver::check(), solver::check(), solver::check(), solver::consequences(), fixedpoint::query(), fixedpoint::query(), and to_check_result().

◆ to_expr()

expr to_expr ( context & c,
Z3_ast a )
inline

Wraps a Z3_ast as an expr object. It also checks for errors. This function allows the user to use the whole C API with the C++ layer defined in this file.

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

2361 {
2362 c.check_error();
2363 assert(Z3_get_ast_kind(c, a) == Z3_APP_AST ||
2365 Z3_get_ast_kind(c, a) == Z3_VAR_AST ||
2367 return expr(c, a);
2368 }
Z3_ast_kind Z3_API Z3_get_ast_kind(Z3_context c, Z3_ast a)
Return the kind of the given AST.
@ Z3_APP_AST
Definition z3_api.h:146
@ Z3_VAR_AST
Definition z3_api.h:147
@ Z3_NUMERAL_AST
Definition z3_api.h:145
@ Z3_QUANTIFIER_AST
Definition z3_api.h:148

Referenced by ashr(), lshr(), sdiv(), sext(), sge(), sgt(), shl(), sle(), slt(), smod(), srem(), to_expr(), udiv(), uge(), ugt(), ule(), ult(), urem(), and zext().

◆ to_func_decl()

func_decl to_func_decl ( context & c,
Z3_func_decl f )
inline

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

2375 {
2376 c.check_error();
2377 return func_decl(c, f);
2378 }
func_decl(context &c)
Definition z3++.h:916

Referenced by linear_order(), partial_order(), piecewise_linear_order(), to_func_decl(), and tree_order().

◆ to_re()

expr to_re ( expr const & s)
inline

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

4588 {
4590 }
Z3_ast Z3_API Z3_mk_seq_to_re(Z3_context c, Z3_ast seq)
Create a regular expression that accepts the sequence seq.

Referenced by to_re().

◆ to_real()

expr to_real ( expr const & a)
inline

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

4345{ Z3_ast r = Z3_mk_int2real(a.ctx(), a); a.check_error(); return expr(a.ctx(), r); }
Z3_ast Z3_API Z3_mk_int2real(Z3_context c, Z3_ast t1)
Coerce an integer to a real.

Referenced by to_real().

◆ to_sort()

sort to_sort ( context & c,
Z3_sort s )
inline

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

2370 {
2371 c.check_error();
2372 return sort(c, s);
2373 }
sort(context &c)
Definition z3++.h:810

Referenced by context::enumeration_sort(), to_sort(), context::tuple_sort(), context::uninterpreted_sort(), and context::uninterpreted_sort().

◆ tree_order()

func_decl tree_order ( sort const & a,
unsigned index )
inline

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

2541 {
2542 return to_func_decl(a.ctx(), Z3_mk_tree_order(a.ctx(), a, index));
2543 }
Z3_func_decl Z3_API Z3_mk_tree_order(Z3_context c, Z3_sort a, unsigned id)
create a tree ordering relation over signature a identified using index id.

Referenced by tree_order().

◆ try_for()

tactic try_for ( tactic const & t,
unsigned ms )
inline

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

3533 {
3534 Z3_tactic r = Z3_tactic_try_for(t.ctx(), t, ms);
3535 t.check_error();
3536 return tactic(t.ctx(), r);
3537 }
Z3_tactic Z3_API Z3_tactic_try_for(Z3_context c, Z3_tactic t, unsigned ms)
Return a tactic that applies t to a given goal for ms milliseconds. If t does not terminate in ms mil...

◆ ubv_to_fpa()

expr ubv_to_fpa ( expr const & t,
sort s )
inline

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

2322 {
2323 assert(t.is_bv());
2324 Z3_ast r = Z3_mk_fpa_to_fp_unsigned(t.ctx(), t.ctx().fpa_rounding_mode(), t, s);
2325 t.check_error();
2326 return expr(t.ctx(), r);
2327 }
Z3_ast Z3_API Z3_mk_fpa_to_fp_unsigned(Z3_context c, Z3_ast rm, Z3_ast t, Z3_sort s)
Conversion of a 2's complement unsigned bit-vector term into a term of FloatingPoint sort.

◆ udiv() [1/3]

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

unsigned division operator for bitvectors.

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

2441{ return to_expr(a.ctx(), Z3_mk_bvudiv(a.ctx(), a, b)); }
Z3_ast Z3_API Z3_mk_bvudiv(Z3_context c, Z3_ast t1, Z3_ast t2)
Unsigned division.

Referenced by udiv(), udiv(), and udiv().

◆ udiv() [2/3]

expr udiv ( expr const & a,
int b )
inline

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

2442{ return udiv(a, a.ctx().num_val(b, a.get_sort())); }
expr udiv(expr const &a, expr const &b)
unsigned division operator for bitvectors.
Definition z3++.h:2441

◆ udiv() [3/3]

expr udiv ( int a,
expr const & b )
inline

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

2443{ return udiv(b.ctx().num_val(a, b.get_sort()), b); }

◆ uge() [1/3]

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

unsigned greater than or equal to operator for bitvectors.

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

2421{ return to_expr(a.ctx(), Z3_mk_bvuge(a.ctx(), a, b)); }

Referenced by uge(), uge(), and uge().

◆ uge() [2/3]

expr uge ( expr const & a,
int b )
inline

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

2422{ return uge(a, a.ctx().num_val(b, a.get_sort())); }
expr uge(expr const &a, expr const &b)
unsigned greater than or equal to operator for bitvectors.
Definition z3++.h:2421

◆ uge() [3/3]

expr uge ( int a,
expr const & b )
inline

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

2423{ return uge(b.ctx().num_val(a, b.get_sort()), b); }

◆ ugt() [1/3]

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

unsigned greater than operator for bitvectors.

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

2427{ return to_expr(a.ctx(), Z3_mk_bvugt(a.ctx(), a, b)); }
Z3_ast Z3_API Z3_mk_bvugt(Z3_context c, Z3_ast t1, Z3_ast t2)
Unsigned greater than.

Referenced by ugt(), ugt(), and ugt().

◆ ugt() [2/3]

expr ugt ( expr const & a,
int b )
inline

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

2428{ return ugt(a, a.ctx().num_val(b, a.get_sort())); }
expr ugt(expr const &a, expr const &b)
unsigned greater than operator for bitvectors.
Definition z3++.h:2427

◆ ugt() [3/3]

expr ugt ( int a,
expr const & b )
inline

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

2429{ return ugt(b.ctx().num_val(a, b.get_sort()), b); }

◆ ule() [1/3]

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

unsigned less than or equal to operator for bitvectors.

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

2409{ return to_expr(a.ctx(), Z3_mk_bvule(a.ctx(), a, b)); }
Z3_ast Z3_API Z3_mk_bvule(Z3_context c, Z3_ast t1, Z3_ast t2)
Unsigned less than or equal to.

Referenced by ule(), ule(), and ule().

◆ ule() [2/3]

expr ule ( expr const & a,
int b )
inline

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

2410{ return ule(a, a.ctx().num_val(b, a.get_sort())); }
expr ule(expr const &a, expr const &b)
unsigned less than or equal to operator for bitvectors.
Definition z3++.h:2409

◆ ule() [3/3]

expr ule ( int a,
expr const & b )
inline

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

2411{ return ule(b.ctx().num_val(a, b.get_sort()), b); }

◆ ult() [1/3]

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

unsigned less than operator for bitvectors.

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

2415{ return to_expr(a.ctx(), Z3_mk_bvult(a.ctx(), a, b)); }
Z3_ast Z3_API Z3_mk_bvult(Z3_context c, Z3_ast t1, Z3_ast t2)
Unsigned less than.

Referenced by ult(), ult(), and ult().

◆ ult() [2/3]

expr ult ( expr const & a,
int b )
inline

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

2416{ return ult(a, a.ctx().num_val(b, a.get_sort())); }
expr ult(expr const &a, expr const &b)
unsigned less than operator for bitvectors.
Definition z3++.h:2415

◆ ult() [3/3]

expr ult ( int a,
expr const & b )
inline

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

2417{ return ult(b.ctx().num_val(a, b.get_sort()), b); }

◆ urem() [1/3]

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

unsigned reminder operator for bitvectors

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

2462{ return to_expr(a.ctx(), Z3_mk_bvurem(a.ctx(), a, b)); }
Z3_ast Z3_API Z3_mk_bvurem(Z3_context c, Z3_ast t1, Z3_ast t2)
Unsigned remainder.

Referenced by urem(), urem(), and urem().

◆ urem() [2/3]

expr urem ( expr const & a,
int b )
inline

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

2463{ return urem(a, a.ctx().num_val(b, a.get_sort())); }
expr urem(expr const &a, expr const &b)
unsigned reminder operator for bitvectors
Definition z3++.h:2462

◆ urem() [3/3]

expr urem ( int a,
expr const & b )
inline

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

2464{ return urem(b.ctx().num_val(a, b.get_sort()), b); }

◆ when()

tactic when ( probe const & p,
tactic const & t )
inline

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

3867 {
3868 check_context(p, t);
3869 Z3_tactic r = Z3_tactic_when(t.ctx(), p, t);
3870 t.check_error();
3871 return tactic(t.ctx(), r);
3872 }
Z3_tactic Z3_API Z3_tactic_when(Z3_context c, Z3_probe p, Z3_tactic t)
Return a tactic that applies t to a given goal is the probe p evaluates to true. If p evaluates to fa...

Referenced by when().

◆ with() [1/2]

simplifier with ( simplifier const & t,
params const & p )
inline

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

3589 {
3590 Z3_simplifier r = Z3_simplifier_using_params(t.ctx(), t, p);
3591 t.check_error();
3592 return simplifier(t.ctx(), r);
3593 }
Z3_simplifier Z3_API Z3_simplifier_using_params(Z3_context c, Z3_simplifier t, Z3_params p)
Return a simplifier that applies t using the given set of parameters.

◆ with() [2/2]

tactic with ( tactic const & t,
params const & p )
inline

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

3528 {
3529 Z3_tactic r = Z3_tactic_using_params(t.ctx(), t, p);
3530 t.check_error();
3531 return tactic(t.ctx(), r);
3532 }
Z3_tactic Z3_API Z3_tactic_using_params(Z3_context c, Z3_tactic t, Z3_params p)
Return a tactic that applies t using the given set of parameters.

◆ xnor()

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

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

2204{ if (a.is_bool()) return !(a ^ b); check_context(a, b); Z3_ast r = Z3_mk_bvxnor(a.ctx(), a, b); a.check_error(); return expr(a.ctx(), r); }
Z3_ast Z3_API Z3_mk_bvxnor(Z3_context c, Z3_ast t1, Z3_ast t2)
Bitwise xnor.

◆ zext()

expr zext ( expr const & a,
unsigned i )
inline

Extend the given bit-vector with zeros to the (unsigned) equivalent bitvector of size m+i, where m is the size of the given bit-vector.

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

2490{ return to_expr(a.ctx(), Z3_mk_zero_ext(a.ctx(), i, a)); }
Z3_ast Z3_API Z3_mk_zero_ext(Z3_context c, unsigned i, Z3_ast t1)
Extend the given bit-vector with zeros to the (unsigned) equivalent bit-vector of size m+i,...

Referenced by zext().