Z3
 
Loading...
Searching...
No Matches
Data Structures | Typedefs | Enumerations | Functions
z3 Namespace Reference

Z3 C++ namespace. More...

Data Structures

class  apply_result
 
class  array
 
class  ast
 
class  ast_vector_tpl
 
class  cast_ast
 
class  cast_ast< ast >
 
class  cast_ast< expr >
 
class  cast_ast< func_decl >
 
class  cast_ast< sort >
 
class  config
 Z3 global configuration object. More...
 
class  constructor_list
 
class  constructors
 
class  context
 A Context manages all other Z3 objects, global configuration options, etc. More...
 
class  exception
 Exception used to sign API usage errors. More...
 
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  fixedpoint
 
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  func_entry
 
class  func_interp
 
class  goal
 
class  model
 
class  object
 
class  on_clause
 
class  optimize
 
class  param_descrs
 
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  params
 
class  probe
 
class  simplifier
 
class  solver
 
class  sort
 A Z3 sort (aka type). Every expression (i.e., formula or term) in Z3 has a sort. More...
 
class  stats
 
class  symbol
 
class  tactic
 
class  user_propagator_base
 

Typedefs

typedef ast_vector_tpl< astast_vector
 
typedef ast_vector_tpl< exprexpr_vector
 
typedef ast_vector_tpl< sortsort_vector
 
typedef ast_vector_tpl< func_declfunc_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 ()
 
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 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 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)
 
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 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 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)
 

Detailed Description

Z3 C++ namespace.

Typedef Documentation

◆ ast_vector

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

◆ expr_vector

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

◆ func_decl_vector

Definition at line 78 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 4317 of file z3++.h.

◆ sort_vector

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

Enumeration Type Documentation

◆ check_result

Enumerator
unsat 
sat 
unknown 

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

135 {
136 unsat, sat, unknown
137 };

◆ rounding_mode

Enumerator
RNA 
RNE 
RTP 
RTN 
RTZ 

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

139 {
140 RNA,
141 RNE,
142 RTP,
143 RTN,
144 RTZ
145 };
@ RNE
Definition z3++.h:141
@ RNA
Definition z3++.h:140
@ RTZ
Definition z3++.h:144
@ RTN
Definition z3++.h:143
@ RTP
Definition z3++.h:142

Function Documentation

◆ abs()

expr abs ( expr const a)
inline

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

2012 {
2013 Z3_ast r;
2014 if (a.is_int()) {
2015 expr zero = a.ctx().int_val(0);
2016 expr ge = a >= zero;
2017 expr na = -a;
2018 r = Z3_mk_ite(a.ctx(), ge, a, na);
2019 }
2020 else if (a.is_real()) {
2021 expr zero = a.ctx().real_val(0);
2022 expr ge = a >= zero;
2023 expr na = -a;
2024 r = Z3_mk_ite(a.ctx(), ge, a, na);
2025 }
2026 else {
2027 r = Z3_mk_fpa_abs(a.ctx(), a);
2028 }
2029 a.check_error();
2030 return expr(a.ctx(), r);
2031 }
A Z3 expression is used to represent formulas and terms. For Z3, a formula is any expression of sort ...
Definition z3++.h:828
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.

◆ as_array()

expr as_array ( func_decl f)
inline

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

4040 {
4041 Z3_ast r = Z3_mk_as_array(f.ctx(), f);
4042 f.check_error();
4043 return expr(f.ctx(), r);
4044 }
Z3_error_code check_error() const
Definition z3++.h:492
context & ctx() const
Definition z3++.h:491
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...

◆ ashr() [1/3]

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

arithmetic shift right operator for bitvectors

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

2246{ 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:2124

Referenced by ashr(), and ashr().

◆ ashr() [2/3]

expr ashr ( expr const a,
int  b 
)
inline

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

2247{ 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:2246

◆ ashr() [3/3]

expr ashr ( int  a,
expr const b 
)
inline

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

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

◆ atleast()

expr atleast ( expr_vector const es,
unsigned  bound 
)
inline

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

2455 {
2456 assert(es.size() > 0);
2457 context& ctx = es[0u].ctx();
2459 Z3_ast r = Z3_mk_atleast(ctx, _es.size(), _es.ptr(), bound);
2460 ctx.check_error();
2461 return expr(ctx, r);
2462 }
A Context manages all other Z3 objects, global configuration options, etc.
Definition z3++.h:160
Z3_error_code check_error() const
Auxiliary method used to check for API usage errors.
Definition z3++.h:192
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 2447 of file z3++.h.

2447 {
2448 assert(es.size() > 0);
2449 context& ctx = es[0u].ctx();
2451 Z3_ast r = Z3_mk_atmost(ctx, _es.size(), _es.ptr(), bound);
2452 ctx.check_error();
2453 return expr(ctx, r);
2454 }
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 2258 of file z3++.h.

2258{ 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 2264 of file z3++.h.

2264 {
2265 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);
2266 }
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.
void check_context(object const &a, object const &b)
Definition z3++.h:495

◆ bvadd_no_underflow()

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

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

2267 {
2268 check_context(a, b); Z3_ast r = Z3_mk_bvadd_no_underflow(a.ctx(), a, b); a.check_error(); return expr(a.ctx(), r);
2269 }
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 2282 of file z3++.h.

2282 {
2283 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);
2284 }
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 2285 of file z3++.h.

2285 {
2286 check_context(a, b); Z3_ast r = Z3_mk_bvmul_no_underflow(a.ctx(), a, b); a.check_error(); return expr(a.ctx(), r);
2287 }
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 2279 of file z3++.h.

2279 {
2280 Z3_ast r = Z3_mk_bvneg_no_overflow(a.ctx(), a); a.check_error(); return expr(a.ctx(), r);
2281 }
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 2006 of file z3++.h.

2006 {
2007 assert(a.is_bv());
2008 Z3_ast r = Z3_mk_bvredand(a.ctx(), a);
2009 a.check_error();
2010 return expr(a.ctx(), r);
2011 }
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 2000 of file z3++.h.

2000 {
2001 assert(a.is_bv());
2002 Z3_ast r = Z3_mk_bvredor(a.ctx(), a);
2003 a.check_error();
2004 return expr(a.ctx(), r);
2005 }
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 2276 of file z3++.h.

2276 {
2277 check_context(a, b); Z3_ast r = Z3_mk_bvsdiv_no_overflow(a.ctx(), a, b); a.check_error(); return expr(a.ctx(), r);
2278 }
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 2270 of file z3++.h.

2270 {
2271 check_context(a, b); Z3_ast r = Z3_mk_bvsub_no_overflow(a.ctx(), a, b); a.check_error(); return expr(a.ctx(), r);
2272 }
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 2273 of file z3++.h.

2273 {
2274 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);
2275 }
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()

void check_context ( object const a,
object const b 
)
inline

◆ concat() [1/2]

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

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

2481 {
2482 check_context(a, b);
2483 Z3_ast r;
2484 if (Z3_is_seq_sort(a.ctx(), a.get_sort())) {
2485 Z3_ast _args[2] = { a, b };
2486 r = Z3_mk_seq_concat(a.ctx(), 2, _args);
2487 }
2488 else if (Z3_is_re_sort(a.ctx(), a.get_sort())) {
2489 Z3_ast _args[2] = { a, b };
2490 r = Z3_mk_re_concat(a.ctx(), 2, _args);
2491 }
2492 else {
2493 r = Z3_mk_concat(a.ctx(), a, b);
2494 }
2495 a.ctx().check_error();
2496 return expr(a.ctx(), r);
2497 }
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.
System.IntPtr Z3_ast

◆ concat() [2/2]

expr concat ( expr_vector const args)
inline

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

2499 {
2500 Z3_ast r;
2501 assert(args.size() > 0);
2502 if (args.size() == 1) {
2503 return args[0u];
2504 }
2505 context& ctx = args[0u].ctx();
2506 array<Z3_ast> _args(args);
2507 if (Z3_is_seq_sort(ctx, args[0u].get_sort())) {
2508 r = Z3_mk_seq_concat(ctx, _args.size(), _args.ptr());
2509 }
2510 else if (Z3_is_re_sort(ctx, args[0u].get_sort())) {
2511 r = Z3_mk_re_concat(ctx, _args.size(), _args.ptr());
2512 }
2513 else {
2514 r = _args[args.size()-1];
2515 for (unsigned i = args.size()-1; i > 0; ) {
2516 --i;
2517 r = Z3_mk_concat(ctx, _args[i], r);
2518 ctx.check_error();
2519 }
2520 }
2521 ctx.check_error();
2522 return expr(ctx, r);
2523 }

◆ cond()

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

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

3503 {
3505 Z3_tactic r = Z3_tactic_cond(t1.ctx(), p, t1, t2);
3506 t1.check_error();
3507 return tactic(t1.ctx(), r);
3508 }
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...

◆ const_array()

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

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

4057 {
4059 }
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:4051

◆ distinct()

expr distinct ( expr_vector const args)
inline

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

2472 {
2473 assert(args.size() > 0);
2474 context& ctx = args[0u].ctx();
2475 array<Z3_ast> _args(args);
2476 Z3_ast r = Z3_mk_distinct(ctx, _args.size(), _args.ptr());
2477 ctx.check_error();
2478 return expr(ctx, r);
2479 }
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 4113 of file z3++.h.

4113 {
4114 Z3_ast r = Z3_mk_seq_empty(s.ctx(), s);
4115 s.check_error();
4116 return expr(s.ctx(), r);
4117 }
Z3_ast Z3_API Z3_mk_seq_empty(Z3_context c, Z3_sort seq)
Create an empty sequence of the sequence sort seq.

◆ empty_set()

expr empty_set ( sort const s)
inline

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

4061 {
4063 }
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:4046

◆ eq()

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

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

601{ 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 2374 of file z3++.h.

2374 {
2375 check_context(x, b);
2376 Z3_app vars[] = {(Z3_app) x};
2377 Z3_ast r = Z3_mk_exists_const(b.ctx(), 0, 1, vars, 0, 0, b); b.check_error(); return expr(b.ctx(), r);
2378 }
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.

◆ exists() [2/5]

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

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

2379 {
2381 Z3_app vars[] = {(Z3_app) x1, (Z3_app) x2};
2382 Z3_ast r = Z3_mk_exists_const(b.ctx(), 0, 2, vars, 0, 0, b); b.check_error(); return expr(b.ctx(), r);
2383 }

◆ exists() [3/5]

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

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

2384 {
2386 Z3_app vars[] = {(Z3_app) x1, (Z3_app) x2, (Z3_app) x3 };
2387 Z3_ast r = Z3_mk_exists_const(b.ctx(), 0, 3, vars, 0, 0, b); b.check_error(); return expr(b.ctx(), r);
2388 }

◆ exists() [4/5]

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

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

2389 {
2391 Z3_app vars[] = {(Z3_app) x1, (Z3_app) x2, (Z3_app) x3, (Z3_app) x4 };
2392 Z3_ast r = Z3_mk_exists_const(b.ctx(), 0, 4, vars, 0, 0, b); b.check_error(); return expr(b.ctx(), r);
2393 }

◆ exists() [5/5]

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

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

2394 {
2395 array<Z3_app> vars(xs);
2396 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);
2397 }

◆ fail_if()

tactic fail_if ( probe const p)
inline

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

3492 {
3493 Z3_tactic r = Z3_tactic_fail_if(p.ctx(), p);
3494 p.check_error();
3495 return tactic(p.ctx(), r);
3496 }
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.

◆ fma()

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

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

2048 {
2050 assert(a.is_fpa() && b.is_fpa() && c.is_fpa());
2051 Z3_ast r = Z3_mk_fpa_fma(a.ctx(), rm, a, b, c);
2052 a.check_error();
2053 return expr(a.ctx(), r);
2054 }
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 2539 of file z3++.h.

2539 {
2540 context& ctx = f.ctx();
2541 Z3_ast r = Z3_mk_seq_foldl(ctx, f, a, list);
2542 ctx.check_error();
2543 return expr(ctx, r);
2544 }
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.

◆ foldli()

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

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

2546 {
2547 context& ctx = f.ctx();
2548 Z3_ast r = Z3_mk_seq_foldli(ctx, f, i, a, list);
2549 ctx.check_error();
2550 return expr(ctx, r);
2551 }
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...

◆ forall() [1/5]

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

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

2350 {
2351 check_context(x, b);
2352 Z3_app vars[] = {(Z3_app) x};
2353 Z3_ast r = Z3_mk_forall_const(b.ctx(), 0, 1, vars, 0, 0, b); b.check_error(); return expr(b.ctx(), r);
2354 }
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.

◆ forall() [2/5]

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

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

2355 {
2357 Z3_app vars[] = {(Z3_app) x1, (Z3_app) x2};
2358 Z3_ast r = Z3_mk_forall_const(b.ctx(), 0, 2, vars, 0, 0, b); b.check_error(); return expr(b.ctx(), r);
2359 }

◆ forall() [3/5]

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

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

2360 {
2362 Z3_app vars[] = {(Z3_app) x1, (Z3_app) x2, (Z3_app) x3 };
2363 Z3_ast r = Z3_mk_forall_const(b.ctx(), 0, 3, vars, 0, 0, b); b.check_error(); return expr(b.ctx(), r);
2364 }

◆ forall() [4/5]

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

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

2365 {
2367 Z3_app vars[] = {(Z3_app) x1, (Z3_app) x2, (Z3_app) x3, (Z3_app) x4 };
2368 Z3_ast r = Z3_mk_forall_const(b.ctx(), 0, 4, vars, 0, 0, b); b.check_error(); return expr(b.ctx(), r);
2369 }

◆ forall() [5/5]

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

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

2370 {
2371 array<Z3_app> vars(xs);
2372 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);
2373 }

◆ fp_eq()

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

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

2039 {
2040 check_context(a, b);
2041 assert(a.is_fpa());
2042 Z3_ast r = Z3_mk_fpa_eq(a.ctx(), a, b);
2043 a.check_error();
2044 return expr(a.ctx(), r);
2045 }
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 2056 of file z3++.h.

2056 {
2058 assert(sgn.is_bv() && exp.is_bv() && sig.is_bv());
2059 Z3_ast r = Z3_mk_fpa_fp(sgn.ctx(), sgn, exp, sig);
2060 sgn.check_error();
2061 return expr(sgn.ctx(), r);
2062 }
Z3_ast Z3_API Z3_mk_fpa_fp(Z3_context c, Z3_ast sgn, Z3_ast exp, Z3_ast sig)
Create an expression of FloatingPoint sort from three bit-vector expressions.

◆ fpa_to_fpa()

expr fpa_to_fpa ( expr const t,
sort  s 
)
inline

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

2092 {
2093 assert(t.is_fpa());
2094 Z3_ast r = Z3_mk_fpa_to_fp_float(t.ctx(), t.ctx().fpa_rounding_mode(), t, s);
2095 t.check_error();
2096 return expr(t.ctx(), r);
2097 }
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 2064 of file z3++.h.

2064 {
2065 assert(t.is_fpa());
2066 Z3_ast r = Z3_mk_fpa_to_sbv(t.ctx(), t.ctx().fpa_rounding_mode(), t, sz);
2067 t.check_error();
2068 return expr(t.ctx(), r);
2069 }
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 2071 of file z3++.h.

2071 {
2072 assert(t.is_fpa());
2073 Z3_ast r = Z3_mk_fpa_to_ubv(t.ctx(), t.ctx().fpa_rounding_mode(), t, sz);
2074 t.check_error();
2075 return expr(t.ctx(), r);
2076 }
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 4065 of file z3++.h.

4065 {
4067 }
Z3_ast Z3_API Z3_mk_full_set(Z3_context c, Z3_sort domain)
Create the 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 3980 of file z3++.h.

3980 {
3981 return range.ctx().function(name, d1, d2, d3, d4, d5, range);
3982 }
func_decl function(symbol const &name, unsigned arity, sort const *domain, sort const &range)
Definition z3++.h:3683
expr range(expr const &lo, expr const &hi)
Definition z3++.h:4185

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

3977 {
3978 return range.ctx().function(name, d1, d2, d3, d4, range);
3979 }

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

3974 {
3975 return range.ctx().function(name, d1, d2, d3, range);
3976 }

◆ function() [4/9]

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

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

3971 {
3972 return range.ctx().function(name, d1, d2, range);
3973 }

◆ function() [5/9]

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

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

3968 {
3969 return range.ctx().function(name, domain, range);
3970 }

◆ function() [6/9]

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

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

3983 {
3984 return range.ctx().function(name, domain, range);
3985 }

◆ function() [7/9]

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

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

3965 {
3966 return range.ctx().function(name, arity, domain, range);
3967 }

◆ function() [8/9]

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

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

3986 {
3987 return range.ctx().function(name.c_str(), domain, range);
3988 }

◆ function() [9/9]

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

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

3962 {
3963 return range.ctx().function(name, arity, domain, range);
3964 }

◆ implies() [1/3]

expr implies ( bool  a,
expr const b 
)
inline

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

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

◆ implies() [2/3]

expr implies ( expr const a,
bool  b 
)
inline

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

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

◆ implies() [3/3]

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

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

1646 {
1647 assert(a.is_bool() && b.is_bool());
1649 }
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:1639

◆ in_re()

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

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

4145 {
4147 }
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.

◆ indexof()

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

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

4130 {
4132 Z3_ast r = Z3_mk_seq_index(s.ctx(), s, substr, offset);
4133 s.check_error();
4134 return expr(s.ctx(), r);
4135 }
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...

◆ int2bv()

expr int2bv ( unsigned  n,
expr const a 
)
inline

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

2259{ 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 1694 of file z3++.h.

1694{ _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:1686

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

2111 {
2112 check_context(c, t); check_context(c, e);
2113 assert(c.is_bool());
2114 Z3_ast r = Z3_mk_ite(c.ctx(), c, t, e);
2115 c.check_error();
2116 return expr(c.ctx(), r);
2117 }

◆ lambda() [1/5]

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

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

2398 {
2399 check_context(x, b);
2400 Z3_app vars[] = {(Z3_app) x};
2401 Z3_ast r = Z3_mk_lambda_const(b.ctx(), 1, vars, b); b.check_error(); return expr(b.ctx(), r);
2402 }
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.

◆ lambda() [2/5]

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

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

2403 {
2405 Z3_app vars[] = {(Z3_app) x1, (Z3_app) x2};
2406 Z3_ast r = Z3_mk_lambda_const(b.ctx(), 2, vars, b); b.check_error(); return expr(b.ctx(), r);
2407 }

◆ lambda() [3/5]

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

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

2408 {
2410 Z3_app vars[] = {(Z3_app) x1, (Z3_app) x2, (Z3_app) x3 };
2411 Z3_ast r = Z3_mk_lambda_const(b.ctx(), 3, vars, b); b.check_error(); return expr(b.ctx(), r);
2412 }

◆ lambda() [4/5]

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

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

2413 {
2415 Z3_app vars[] = {(Z3_app) x1, (Z3_app) x2, (Z3_app) x3, (Z3_app) x4 };
2416 Z3_ast r = Z3_mk_lambda_const(b.ctx(), 4, vars, b); b.check_error(); return expr(b.ctx(), r);
2417 }

◆ lambda() [5/5]

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

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

2418 {
2419 array<Z3_app> vars(xs);
2420 Z3_ast r = Z3_mk_lambda_const(b.ctx(), vars.size(), vars.ptr(), b); b.check_error(); return expr(b.ctx(), r);
2421 }

◆ last_indexof()

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

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

4136 {
4137 check_context(s, substr);
4138 Z3_ast r = Z3_mk_seq_last_index(s.ctx(), s, substr);
4139 s.check_error();
4140 return expr(s.ctx(), r);
4141 }
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 -...

◆ linear_order()

func_decl linear_order ( sort const a,
unsigned  index 
)
inline

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

2295 {
2296 return to_func_decl(a.ctx(), Z3_mk_linear_order(a.ctx(), a, index));
2297 }
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:2138

◆ lshr() [1/3]

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

logic shift right operator for bitvectors

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

2239{ 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(), and lshr().

◆ lshr() [2/3]

expr lshr ( expr const a,
int  b 
)
inline

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

2240{ 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:2239

◆ lshr() [3/3]

expr lshr ( int  a,
expr const b 
)
inline

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

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

◆ map()

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

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

2525 {
2526 context& ctx = f.ctx();
2527 Z3_ast r = Z3_mk_seq_map(ctx, f, list);
2528 ctx.check_error();
2529 return expr(ctx, r);
2530 }
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.

◆ mapi()

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

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

2532 {
2533 context& ctx = f.ctx();
2534 Z3_ast r = Z3_mk_seq_mapi(ctx, f, i, list);
2535 ctx.check_error();
2536 return expr(ctx, r);
2537 }
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.

◆ max()

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

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

1984 {
1985 check_context(a, b);
1986 Z3_ast r;
1987 if (a.is_arith()) {
1988 r = Z3_mk_ite(a.ctx(), Z3_mk_ge(a.ctx(), a, b), a, b);
1989 }
1990 else if (a.is_bv()) {
1991 r = Z3_mk_ite(a.ctx(), Z3_mk_bvuge(a.ctx(), a, b), a, b);
1992 }
1993 else {
1994 assert(a.is_fpa());
1995 r = Z3_mk_fpa_max(a.ctx(), a, b);
1996 }
1997 a.check_error();
1998 return expr(a.ctx(), r);
1999 }
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.

◆ min()

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

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

1968 {
1969 check_context(a, b);
1970 Z3_ast r;
1971 if (a.is_arith()) {
1972 r = Z3_mk_ite(a.ctx(), Z3_mk_ge(a.ctx(), a, b), b, a);
1973 }
1974 else if (a.is_bv()) {
1975 r = Z3_mk_ite(a.ctx(), Z3_mk_bvuge(a.ctx(), a, b), b, a);
1976 }
1977 else {
1978 assert(a.is_fpa());
1979 r = Z3_mk_fpa_min(a.ctx(), a, b);
1980 }
1981 a.check_error();
1982 return expr(a.ctx(), r);
1983 }
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 2559 of file z3++.h.

2559 {
2560 array<Z3_ast> _args(args);
2561 Z3_ast r = Z3_mk_and(args.ctx(), _args.size(), _args.ptr());
2562 args.check_error();
2563 return expr(args.ctx(), r);
2564 }
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 2553 of file z3++.h.

2553 {
2554 array<Z3_ast> _args(args);
2555 Z3_ast r = Z3_mk_or(args.ctx(), _args.size(), _args.ptr());
2556 args.check_error();
2557 return expr(args.ctx(), r);
2558 }
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 2565 of file z3++.h.

2565 {
2566 if (args.empty())
2567 return args.ctx().bool_val(false);
2568 expr r = args[0u];
2569 for (unsigned i = 1; i < args.size(); ++i)
2570 r = r ^ args[i];
2571 return r;
2572 }

◆ mod() [1/3]

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

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

1658 {
1659 if (a.is_bv()) {
1661 }
1662 else {
1663 _Z3_MK_BIN_(a, b, Z3_mk_mod);
1664 }
1665 }
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 1666 of file z3++.h.

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

◆ mod() [3/3]

expr mod ( int  a,
expr const b 
)
inline

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

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

◆ nand()

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

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

1965{ 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 1966 of file z3++.h.

1966{ 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 1692 of file z3++.h.

1692{ 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 3308 of file z3++.h.

3308 {
3309 Z3_probe r = Z3_probe_not(p.ctx(), p); p.check_error(); return probe(p.ctx(), r);
3310 }
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 1744 of file z3++.h.

1744{ 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 1743 of file z3++.h.

1743{ 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 1734 of file z3++.h.

1734 {
1735 check_context(a, b);
1736 Z3_ast args[2] = { a, b };
1737 Z3_ast r = Z3_mk_distinct(a.ctx(), 2, args);
1738 a.check_error();
1739 return expr(a.ctx(), r);
1740 }

◆ operator!=() [4/5]

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

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

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

◆ operator!=() [5/5]

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

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

1742{ assert(b.is_arith() || b.is_bv() || b.is_fpa()); 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 1669 of file z3++.h.

1669{ return mod(a, b); }

◆ operator%() [2/3]

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

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

1670{ return mod(a, b); }

◆ operator%() [3/3]

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

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

1671{ return mod(a, b); }

◆ operator&() [1/5]

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

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

1953{ 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 1954 of file z3++.h.

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

◆ operator&() [3/5]

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

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

1955{ 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 3222 of file z3++.h.

3222 {
3224 Z3_simplifier r = Z3_simplifier_and_then(t1.ctx(), t1, t2);
3225 t1.check_error();
3226 return simplifier(t1.ctx(), r);
3227 }
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 3148 of file z3++.h.

3148 {
3150 Z3_tactic r = Z3_tactic_and_then(t1.ctx(), t1, t2);
3151 t1.check_error();
3152 return tactic(t1.ctx(), r);
3153 }
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 1708 of file z3++.h.

1708{ 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 1707 of file z3++.h.

1707{ 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 1698 of file z3++.h.

1698 {
1699 check_context(a, b);
1700 assert(a.is_bool() && b.is_bool());
1701 Z3_ast args[2] = { a, b };
1702 Z3_ast r = Z3_mk_and(a.ctx(), 2, args);
1703 a.check_error();
1704 return expr(a.ctx(), r);
1705 }

◆ operator&&() [4/4]

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

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

3302 {
3303 check_context(p1, p2); Z3_probe r = Z3_probe_and(p1.ctx(), p1, p2); p1.check_error(); return probe(p1.ctx(), r);
3304 }
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 1776 of file z3++.h.

1776 {
1777 check_context(a, b);
1778 Z3_ast r = 0;
1779 if (a.is_arith() && b.is_arith()) {
1780 Z3_ast args[2] = { a, b };
1781 r = Z3_mk_mul(a.ctx(), 2, args);
1782 }
1783 else if (a.is_bv() && b.is_bv()) {
1784 r = Z3_mk_bvmul(a.ctx(), a, b);
1785 }
1786 else if (a.is_fpa() && b.is_fpa()) {
1787 r = Z3_mk_fpa_mul(a.ctx(), a.ctx().fpa_rounding_mode(), a, b);
1788 }
1789 else {
1790 // operator is not supported by given arguments.
1791 assert(false);
1792 }
1793 a.check_error();
1794 return expr(a.ctx(), r);
1795 }
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_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 1796 of file z3++.h.

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

◆ operator*() [3/3]

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

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

1797{ 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 1746 of file z3++.h.

1746 {
1747 check_context(a, b);
1748 Z3_ast r = 0;
1749 if (a.is_arith() && b.is_arith()) {
1750 Z3_ast args[2] = { a, b };
1751 r = Z3_mk_add(a.ctx(), 2, args);
1752 }
1753 else if (a.is_bv() && b.is_bv()) {
1754 r = Z3_mk_bvadd(a.ctx(), a, b);
1755 }
1756 else if (a.is_seq() && b.is_seq()) {
1757 return concat(a, b);
1758 }
1759 else if (a.is_re() && b.is_re()) {
1760 Z3_ast _args[2] = { a, b };
1761 r = Z3_mk_re_union(a.ctx(), 2, _args);
1762 }
1763 else if (a.is_fpa() && b.is_fpa()) {
1764 r = Z3_mk_fpa_add(a.ctx(), a.ctx().fpa_rounding_mode(), a, b);
1765 }
1766 else {
1767 // operator is not supported by given arguments.
1768 assert(false);
1769 }
1770 a.check_error();
1771 return expr(a.ctx(), r);
1772 }
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_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:2481

◆ operator+() [2/3]

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

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

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

◆ operator+() [3/3]

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

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

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

◆ operator-() [1/4]

expr operator- ( expr const a)
inline

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

1842 {
1843 Z3_ast r = 0;
1844 if (a.is_arith()) {
1845 r = Z3_mk_unary_minus(a.ctx(), a);
1846 }
1847 else if (a.is_bv()) {
1848 r = Z3_mk_bvneg(a.ctx(), a);
1849 }
1850 else if (a.is_fpa()) {
1851 r = Z3_mk_fpa_neg(a.ctx(), a);
1852 }
1853 else {
1854 // operator is not supported by given arguments.
1855 assert(false);
1856 }
1857 a.check_error();
1858 return expr(a.ctx(), r);
1859 }
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 1861 of file z3++.h.

1861 {
1862 check_context(a, b);
1863 Z3_ast r = 0;
1864 if (a.is_arith() && b.is_arith()) {
1865 Z3_ast args[2] = { a, b };
1866 r = Z3_mk_sub(a.ctx(), 2, args);
1867 }
1868 else if (a.is_bv() && b.is_bv()) {
1869 r = Z3_mk_bvsub(a.ctx(), a, b);
1870 }
1871 else if (a.is_fpa() && b.is_fpa()) {
1872 r = Z3_mk_fpa_sub(a.ctx(), a.ctx().fpa_rounding_mode(), a, b);
1873 }
1874 else {
1875 // operator is not supported by given arguments.
1876 assert(false);
1877 }
1878 a.check_error();
1879 return expr(a.ctx(), r);
1880 }
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 1881 of file z3++.h.

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

◆ operator-() [4/4]

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

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

1882{ 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 1820 of file z3++.h.

1820 {
1821 check_context(a, b);
1822 Z3_ast r = 0;
1823 if (a.is_arith() && b.is_arith()) {
1824 r = Z3_mk_div(a.ctx(), a, b);
1825 }
1826 else if (a.is_bv() && b.is_bv()) {
1827 r = Z3_mk_bvsdiv(a.ctx(), a, b);
1828 }
1829 else if (a.is_fpa() && b.is_fpa()) {
1830 r = Z3_mk_fpa_div(a.ctx(), a.ctx().fpa_rounding_mode(), a, b);
1831 }
1832 else {
1833 // operator is not supported by given arguments.
1834 assert(false);
1835 }
1836 a.check_error();
1837 return expr(a.ctx(), r);
1838 }
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 1839 of file z3++.h.

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

◆ operator/() [3/3]

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

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

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

◆ operator<() [1/6]

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

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

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

◆ operator<() [2/6]

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

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

1909 {
1910 check_context(a, b);
1911 Z3_ast r = 0;
1912 if (a.is_arith() && b.is_arith()) {
1913 r = Z3_mk_lt(a.ctx(), a, b);
1914 }
1915 else if (a.is_bv() && b.is_bv()) {
1916 r = Z3_mk_bvslt(a.ctx(), a, b);
1917 }
1918 else if (a.is_fpa() && b.is_fpa()) {
1919 r = Z3_mk_fpa_lt(a.ctx(), a, b);
1920 }
1921 else {
1922 // operator is not supported by given arguments.
1923 assert(false);
1924 }
1925 a.check_error();
1926 return expr(a.ctx(), r);
1927 }
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 1928 of file z3++.h.

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

◆ operator<() [4/6]

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

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

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

◆ operator<() [5/6]

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

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

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

◆ operator<() [6/6]

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

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

3287 {
3288 check_context(p1, p2); Z3_probe r = Z3_probe_lt(p1.ctx(), p1, p2); p1.check_error(); return probe(p1.ctx(), r);
3289 }
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 3106 of file z3++.h.

3106{ 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 597 of file z3++.h.

597 {
598 out << Z3_ast_to_string(n.ctx(), n.m_ast); return out;
599 }
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 2741 of file z3++.h.

2741 {
2742 if (r == unsat) out << "unsat";
2743 else if (r == sat) out << "sat";
2744 else out << "unknown";
2745 return out;
2746 }

◆ operator<<() [4/13]

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

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

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

◆ operator<<() [5/13]

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

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

3490{ 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 3082 of file z3++.h.

3082{ 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 2709 of file z3++.h.

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

◆ operator<<() [8/13]

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

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

3432{ 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 540 of file z3++.h.

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

◆ operator<<() [10/13]

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

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

564 {
565 out << Z3_params_to_string(p.ctx(), p); return out;
566 }
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 3023 of file z3++.h.

3023{ 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 2738 of file z3++.h.

2738{ 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 508 of file z3++.h.

508 {
509 if (s.kind() == Z3_INT_SYMBOL)
510 out << "k!" << s.to_int();
511 else
512 out << s.str();
513 return out;
514 }
@ Z3_INT_SYMBOL
Definition z3_api.h:73

◆ operator<=() [1/6]

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

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

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

◆ operator<=() [2/6]

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

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

1884 {
1885 check_context(a, b);
1886 Z3_ast r = 0;
1887 if (a.is_arith() && b.is_arith()) {
1888 r = Z3_mk_le(a.ctx(), a, b);
1889 }
1890 else if (a.is_bv() && b.is_bv()) {
1891 r = Z3_mk_bvsle(a.ctx(), a, b);
1892 }
1893 else if (a.is_fpa() && b.is_fpa()) {
1894 r = Z3_mk_fpa_leq(a.ctx(), a, b);
1895 }
1896 else {
1897 // operator is not supported by given arguments.
1898 assert(false);
1899 }
1900 a.check_error();
1901 return expr(a.ctx(), r);
1902 }
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 1903 of file z3++.h.

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

◆ operator<=() [4/6]

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

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

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

◆ operator<=() [5/6]

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

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

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

◆ operator<=() [6/6]

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

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

3277 {
3278 check_context(p1, p2); Z3_probe r = Z3_probe_le(p1.ctx(), p1, p2); p1.check_error(); return probe(p1.ctx(), r);
3279 }
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 1732 of file z3++.h.

1732{ 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 3301 of file z3++.h.

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

◆ operator==() [3/8]

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

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

1731{ 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 1723 of file z3++.h.

1723 {
1724 check_context(a, b);
1725 Z3_ast r = Z3_mk_eq(a.ctx(), a, b);
1726 a.check_error();
1727 return expr(a.ctx(), r);
1728 }
Z3_ast Z3_API Z3_mk_eq(Z3_context c, Z3_ast l, Z3_ast r)
Create an AST node representing l = r.

◆ operator==() [5/8]

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

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

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

◆ operator==() [6/8]

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

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

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

◆ operator==() [7/8]

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

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

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

◆ operator==() [8/8]

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

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

3297 {
3298 check_context(p1, p2); Z3_probe r = Z3_probe_eq(p1.ctx(), p1, p2); p1.check_error(); return probe(p1.ctx(), r);
3299 }
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 3296 of file z3++.h.

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

◆ operator>() [2/6]

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

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

1931 {
1932 check_context(a, b);
1933 Z3_ast r = 0;
1934 if (a.is_arith() && b.is_arith()) {
1935 r = Z3_mk_gt(a.ctx(), a, b);
1936 }
1937 else if (a.is_bv() && b.is_bv()) {
1938 r = Z3_mk_bvsgt(a.ctx(), a, b);
1939 }
1940 else if (a.is_fpa() && b.is_fpa()) {
1941 r = Z3_mk_fpa_gt(a.ctx(), a, b);
1942 }
1943 else {
1944 // operator is not supported by given arguments.
1945 assert(false);
1946 }
1947 a.check_error();
1948 return expr(a.ctx(), r);
1949 }
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 1950 of file z3++.h.

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

◆ operator>() [4/6]

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

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

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

◆ operator>() [5/6]

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

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

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

◆ operator>() [6/6]

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

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

3292 {
3293 check_context(p1, p2); Z3_probe r = Z3_probe_gt(p1.ctx(), p1, p2); p1.check_error(); return probe(p1.ctx(), r);
3294 }
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 3286 of file z3++.h.

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

◆ operator>=() [2/6]

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

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

1800 {
1801 check_context(a, b);
1802 Z3_ast r = 0;
1803 if (a.is_arith() && b.is_arith()) {
1804 r = Z3_mk_ge(a.ctx(), a, b);
1805 }
1806 else if (a.is_bv() && b.is_bv()) {
1807 r = Z3_mk_bvsge(a.ctx(), a, b);
1808 }
1809 else if (a.is_fpa() && b.is_fpa()) {
1810 r = Z3_mk_fpa_geq(a.ctx(), a, b);
1811 }
1812 else {
1813 // operator is not supported by given arguments.
1814 assert(false);
1815 }
1816 a.check_error();
1817 return expr(a.ctx(), r);
1818 }
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 1906 of file z3++.h.

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

◆ operator>=() [4/6]

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

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

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

◆ operator>=() [5/6]

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

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

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

◆ operator>=() [6/6]

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

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

3282 {
3283 check_context(p1, p2); Z3_probe r = Z3_probe_ge(p1.ctx(), p1, p2); p1.check_error(); return probe(p1.ctx(), r);
3284 }
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 1957 of file z3++.h.

1957{ 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 1958 of file z3++.h.

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

◆ operator^() [3/3]

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

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

1959{ 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 1961 of file z3++.h.

1961{ 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 1962 of file z3++.h.

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

◆ operator|() [3/4]

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

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

1963{ 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 3155 of file z3++.h.

3155 {
3157 Z3_tactic r = Z3_tactic_or_else(t1.ctx(), t1, t2);
3158 t1.check_error();
3159 return tactic(t1.ctx(), r);
3160 }
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 1721 of file z3++.h.

1721{ 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 1719 of file z3++.h.

1719{ 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 1710 of file z3++.h.

1710 {
1711 check_context(a, b);
1712 assert(a.is_bool() && b.is_bool());
1713 Z3_ast args[2] = { a, b };
1714 Z3_ast r = Z3_mk_or(a.ctx(), 2, args);
1715 a.check_error();
1716 return expr(a.ctx(), r);
1717 }

◆ operator||() [4/4]

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

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

3305 {
3306 check_context(p1, p2); Z3_probe r = Z3_probe_or(p1.ctx(), p1, p2); p1.check_error(); return probe(p1.ctx(), r);
3307 }
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 2046 of file z3++.h.

2046{ 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 4151 of file z3++.h.

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

◆ par_and_then()

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

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

3187 {
3189 Z3_tactic r = Z3_tactic_par_and_then(t1.ctx(), t1, t2);
3190 t1.check_error();
3191 return tactic(t1.ctx(), r);
3192 }
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 3178 of file z3++.h.

3178 {
3179 if (n == 0) {
3180 Z3_THROW(exception("a non-zero number of tactics need to be passed to par_or"));
3181 }
3182 array<Z3_tactic> buffer(n);
3183 for (unsigned i = 0; i < n; ++i) buffer[i] = tactics[i];
3184 return tactic(tactics[0u].ctx(), Z3_tactic_par_or(tactics[0u].ctx(), n, buffer.ptr()));
3185 }
Exception used to sign API usage errors.
Definition z3++.h:88
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:103

◆ partial_order()

func_decl partial_order ( sort const a,
unsigned  index 
)
inline

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

2298 {
2299 return to_func_decl(a.ctx(), Z3_mk_partial_order(a.ctx(), a, index));
2300 }
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.

◆ pbeq()

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

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

2439 {
2440 assert(es.size() > 0);
2441 context& ctx = es[0u].ctx();
2443 Z3_ast r = Z3_mk_pbeq(ctx, _es.size(), _es.ptr(), coeffs, bound);
2444 ctx.check_error();
2445 return expr(ctx, r);
2446 }
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 2431 of file z3++.h.

2431 {
2432 assert(es.size() > 0);
2433 context& ctx = es[0u].ctx();
2435 Z3_ast r = Z3_mk_pbge(ctx, _es.size(), _es.ptr(), coeffs, bound);
2436 ctx.check_error();
2437 return expr(ctx, r);
2438 }
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 2423 of file z3++.h.

2423 {
2424 assert(es.size() > 0);
2425 context& ctx = es[0u].ctx();
2427 Z3_ast r = Z3_mk_pble(ctx, _es.size(), _es.ptr(), coeffs, bound);
2428 ctx.check_error();
2429 return expr(ctx, r);
2430 }
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 2301 of file z3++.h.

2301 {
2302 return to_func_decl(a.ctx(), Z3_mk_piecewise_linear_order(a.ctx(), a, index));
2303 }
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.

◆ plus()

expr plus ( expr const re)
inline

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

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

◆ prefixof()

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

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

4124 {
4125 check_context(a, b);
4126 Z3_ast r = Z3_mk_seq_prefix(a.ctx(), a, b);
4127 a.check_error();
4128 return expr(a.ctx(), r);
4129 }
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.

◆ pw() [1/3]

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

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

1654{ _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 1655 of file z3++.h.

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

◆ pw() [3/3]

expr pw ( int  a,
expr const b 
)
inline

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

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

◆ range()

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

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

4185 {
4186 check_context(lo, hi);
4187 Z3_ast r = Z3_mk_re_range(lo.ctx(), lo, hi);
4188 lo.check_error();
4189 return expr(lo.ctx(), r);
4190 }
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::function(), function(), context::function(), function(), context::function(), function(), context::function(), function(), context::function(), function(), context::function(), function(), context::function(), function(), function(), context::function(), context::function(), function(), context::recfun(), recfun(), recfun(), context::recfun(), context::recfun(), context::recfun(), recfun(), context::recfun(), context::recfun(), recfun(), and context::user_propagate_function().

◆ re_complement()

expr re_complement ( expr const a)
inline

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

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

◆ re_diff()

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

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

4175 {
4176 check_context(a, b);
4177 context& ctx = a.ctx();
4178 Z3_ast r = Z3_mk_re_diff(ctx, a, b);
4179 ctx.check_error();
4180 return expr(ctx, r);
4181 }
Z3_ast Z3_API Z3_mk_re_diff(Z3_context c, Z3_ast re1, Z3_ast re2)
Create the difference of regular expressions.

◆ re_empty()

expr re_empty ( sort const s)
inline

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

4157 {
4158 Z3_ast r = Z3_mk_re_empty(s.ctx(), s);
4159 s.check_error();
4160 return expr(s.ctx(), r);
4161 }
Z3_ast Z3_API Z3_mk_re_empty(Z3_context c, Z3_sort re)
Create an empty regular expression of sort re.

◆ re_full()

expr re_full ( sort const s)
inline

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

4162 {
4163 Z3_ast r = Z3_mk_re_full(s.ctx(), s);
4164 s.check_error();
4165 return expr(s.ctx(), r);
4166 }
Z3_ast Z3_API Z3_mk_re_full(Z3_context c, Z3_sort re)
Create an universal regular expression of sort re.

◆ re_intersect()

expr re_intersect ( expr_vector const args)
inline

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

4167 {
4168 assert(args.size() > 0);
4169 context& ctx = args[0u].ctx();
4170 array<Z3_ast> _args(args);
4171 Z3_ast r = Z3_mk_re_intersect(ctx, _args.size(), _args.ptr());
4172 ctx.check_error();
4173 return expr(ctx, r);
4174 }
Z3_ast Z3_API Z3_mk_re_intersect(Z3_context c, unsigned n, Z3_ast const args[])
Create the intersection of the regular languages.

◆ recfun() [1/4]

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

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

3999 {
4000 return range.ctx().recfun(name, d1, d2, range);
4001 }
func_decl recfun(symbol const &name, unsigned arity, sort const *domain, sort const &range)
Definition z3++.h:3754

◆ recfun() [2/4]

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

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

3996 {
3997 return range.ctx().recfun(name, d1, range);
3998 }

◆ recfun() [3/4]

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

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

3993 {
3994 return range.ctx().recfun(name, arity, domain, range);
3995 }

◆ recfun() [4/4]

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

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

3990 {
3991 return range.ctx().recfun(name, arity, domain, range);
3992 }

◆ rem() [1/3]

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

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

1674 {
1675 if (a.is_fpa() && b.is_fpa()) {
1677 } else {
1678 _Z3_MK_BIN_(a, b, Z3_mk_rem);
1679 }
1680 }
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 1681 of file z3++.h.

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

◆ rem() [3/3]

expr rem ( int  a,
expr const b 
)
inline

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

1682{ 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 3162 of file z3++.h.

3162 {
3163 Z3_tactic r = Z3_tactic_repeat(t.ctx(), t, max);
3164 t.check_error();
3165 return tactic(t.ctx(), r);
3166 }
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...

◆ reset_params()

void reset_params ( )
inline

Definition at line 83 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...

◆ round_fpa_to_closest_integer()

expr round_fpa_to_closest_integer ( expr const t)
inline

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

2099 {
2100 assert(t.is_fpa());
2101 Z3_ast r = Z3_mk_fpa_round_to_integral(t.ctx(), t.ctx().fpa_rounding_mode(), t);
2102 t.check_error();
2103 return expr(t.ctx(), r);
2104 }
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 2078 of file z3++.h.

2078 {
2079 assert(t.is_bv());
2080 Z3_ast r = Z3_mk_fpa_to_fp_signed(t.ctx(), t.ctx().fpa_rounding_mode(), t, s);
2081 t.check_error();
2082 return expr(t.ctx(), r);
2083 }
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 2197 of file z3++.h.

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

Referenced by sdiv(), and sdiv().

◆ sdiv() [2/3]

expr sdiv ( expr const a,
int  b 
)
inline

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

2198{ 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:2197

◆ sdiv() [3/3]

expr sdiv ( int  a,
expr const b 
)
inline

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

2199{ 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 4003 of file z3++.h.

4003 {
4004 check_context(a, i);
4005 Z3_ast r = Z3_mk_select(a.ctx(), a, i);
4006 a.check_error();
4007 return expr(a.ctx(), r);
4008 }
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[](), and select().

◆ select() [2/3]

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

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

4012 {
4013 check_context(a, i);
4015 Z3_ast r = Z3_mk_select_n(a.ctx(), a, idxs.size(), idxs.ptr());
4016 a.check_error();
4017 return expr(a.ctx(), r);
4018 }
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 4009 of file z3++.h.

4009 {
4010 return select(a, a.ctx().num_val(i, a.get_sort().array_domain()));
4011 }
expr select(expr const &a, expr const &i)
forward declarations
Definition z3++.h:4003

◆ set_add()

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

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

4069 {
4070 MK_EXPR2(Z3_mk_set_add, s, e);
4071 }
Z3_ast Z3_API Z3_mk_set_add(Z3_context c, Z3_ast set, Z3_ast elem)
Add an element to a set.

◆ set_complement()

expr set_complement ( expr const a)
inline

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

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

◆ set_del()

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

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

4073 {
4074 MK_EXPR2(Z3_mk_set_del, s, e);
4075 }
Z3_ast Z3_API Z3_mk_set_del(Z3_context c, Z3_ast set, Z3_ast elem)
Remove an element to a set.

◆ set_difference()

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

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

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

◆ set_intersect()

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

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

4085 {
4086 check_context(a, b);
4087 Z3_ast es[2] = { a, b };
4088 Z3_ast r = Z3_mk_set_intersect(a.ctx(), 2, es);
4089 a.check_error();
4090 return expr(a.ctx(), r);
4091 }
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.

◆ set_member()

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

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

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

◆ set_param() [1/3]

void set_param ( char const param,
bool  value 
)
inline

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

81{ 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 80 of file z3++.h.

80{ Z3_global_param_set(param, value); }

◆ set_param() [3/3]

void set_param ( char const param,
int  value 
)
inline

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

82{ 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 4105 of file z3++.h.

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

◆ set_union()

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

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

4077 {
4078 check_context(a, b);
4079 Z3_ast es[2] = { a, b };
4080 Z3_ast r = Z3_mk_set_union(a.ctx(), 2, es);
4081 a.check_error();
4082 return expr(a.ctx(), r);
4083 }
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.

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

2293{ 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,...

◆ sge() [1/3]

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

signed greater than or equal to operator for bitvectors.

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

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

Referenced by sge(), and sge().

◆ sge() [2/3]

expr sge ( expr const a,
int  b 
)
inline

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

2159{ 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:2158

◆ sge() [3/3]

expr sge ( int  a,
expr const b 
)
inline

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

2160{ 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 2164 of file z3++.h.

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

Referenced by sgt(), and sgt().

◆ sgt() [2/3]

expr sgt ( expr const a,
int  b 
)
inline

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

2165{ 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:2164

◆ sgt() [3/3]

expr sgt ( int  a,
expr const b 
)
inline

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

2166{ 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 2232 of file z3++.h.

2232{ 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(), and shl().

◆ shl() [2/3]

expr shl ( expr const a,
int  b 
)
inline

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

2233{ 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:2232

◆ shl() [3/3]

expr shl ( int  a,
expr const b 
)
inline

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

2234{ 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 2146 of file z3++.h.

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

Referenced by sle(), and sle().

◆ sle() [2/3]

expr sle ( expr const a,
int  b 
)
inline

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

2147{ 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:2146

◆ sle() [3/3]

expr sle ( int  a,
expr const b 
)
inline

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

2148{ 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 2152 of file z3++.h.

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

Referenced by slt(), and slt().

◆ slt() [2/3]

expr slt ( expr const a,
int  b 
)
inline

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

2153{ 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:2152

◆ slt() [3/3]

expr slt ( int  a,
expr const b 
)
inline

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

2154{ 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 2218 of file z3++.h.

2218{ return to_expr(a.ctx(), Z3_mk_bvsmod(a.ctx(), a, b)); }

Referenced by smod(), and smod().

◆ smod() [2/3]

expr smod ( expr const a,
int  b 
)
inline

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

2219{ 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:2218

◆ smod() [3/3]

expr smod ( int  a,
expr const b 
)
inline

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

2220{ return smod(b.ctx().num_val(a, b.get_sort()), b); }

◆ sqrt()

expr sqrt ( expr const a,
expr const rm 
)
inline

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

2032 {
2033 check_context(a, rm);
2034 assert(a.is_fpa());
2035 Z3_ast r = Z3_mk_fpa_sqrt(a.ctx(), rm, a);
2036 a.check_error();
2037 return expr(a.ctx(), r);
2038 }
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 2211 of file z3++.h.

2211{ 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(), and srem().

◆ srem() [2/3]

expr srem ( expr const a,
int  b 
)
inline

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

2212{ 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:2211

◆ srem() [3/3]

expr srem ( int  a,
expr const b 
)
inline

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

2213{ return srem(b.ctx().num_val(a, b.get_sort()), b); }

◆ star()

expr star ( expr const re)
inline

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

4154 {
4156 }
Z3_ast Z3_API Z3_mk_re_star(Z3_context c, Z3_ast re)
Create the regular language re*.

◆ store() [1/5]

expr store ( expr const a,
expr const i,
expr const v 
)
inline

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

4020 {
4022 Z3_ast r = Z3_mk_store(a.ctx(), a, i, v);
4023 a.check_error();
4024 return expr(a.ctx(), r);
4025 }
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(), and store().

◆ store() [2/5]

expr store ( expr const a,
expr  i,
int  v 
)
inline

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

4028{ 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:4020

◆ store() [3/5]

expr store ( expr const a,
expr_vector const i,
expr const v 
)
inline

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

4032 {
4035 Z3_ast r = Z3_mk_store_n(a.ctx(), a, idxs.size(), idxs.ptr(), v);
4036 a.check_error();
4037 return expr(a.ctx(), r);
4038 }
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 4027 of file z3++.h.

4027{ 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 4029 of file z3++.h.

4029 {
4030 return store(a, a.ctx().num_val(i, a.get_sort().array_domain()), a.ctx().num_val(v, a.get_sort().array_range()));
4031 }

◆ suffixof()

expr suffixof ( expr const a,
expr const b 
)
inline

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

4118 {
4119 check_context(a, b);
4120 Z3_ast r = Z3_mk_seq_suffix(a.ctx(), a, b);
4121 a.check_error();
4122 return expr(a.ctx(), r);
4123 }
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.

◆ sum()

expr sum ( expr_vector const args)
inline

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

2463 {
2464 assert(args.size() > 0);
2465 context& ctx = args[0u].ctx();
2466 array<Z3_ast> _args(args);
2467 Z3_ast r = Z3_mk_add(ctx, _args.size(), _args.ptr());
2468 ctx.check_error();
2469 return expr(ctx, r);
2470 }

◆ to_check_result()

check_result to_check_result ( Z3_lbool  l)
inline

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

147 {
148 if (l == Z3_L_TRUE) return sat;
149 else if (l == Z3_L_FALSE) return unsat;
150 return unknown;
151 }
@ Z3_L_TRUE
Definition z3_api.h:61
@ Z3_L_FALSE
Definition z3_api.h:59

Referenced by solver::check(), optimize::check(), optimize::check(), solver::check(), solver::check(), solver::consequences(), fixedpoint::query(), and fixedpoint::query().

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

2124 {
2125 c.check_error();
2128 Z3_get_ast_kind(c, a) == Z3_VAR_AST ||
2130 return expr(c, a);
2131 }
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:144
@ Z3_VAR_AST
Definition z3_api.h:145
@ Z3_NUMERAL_AST
Definition z3_api.h:143
@ Z3_QUANTIFIER_AST
Definition z3_api.h:146

Referenced by ashr(), lshr(), sdiv(), sext(), sge(), sgt(), shl(), sle(), slt(), smod(), srem(), 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 2138 of file z3++.h.

2138 {
2139 c.check_error();
2140 return func_decl(c, f);
2141 }
Function declaration (aka function definition). It is the signature of interpreted and uninterpreted ...
Definition z3++.h:777

Referenced by linear_order(), partial_order(), piecewise_linear_order(), and tree_order().

◆ to_re()

expr to_re ( expr const s)
inline

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

4142 {
4144 }
Z3_ast Z3_API Z3_mk_seq_to_re(Z3_context c, Z3_ast seq)
Create a regular expression that accepts the sequence seq.

◆ to_real()

expr to_real ( expr const a)
inline

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

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

◆ to_sort()

sort to_sort ( context c,
Z3_sort  s 
)
inline

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

2133 {
2134 c.check_error();
2135 return sort(c, s);
2136 }
A Z3 sort (aka type). Every expression (i.e., formula or term) in Z3 has a sort.
Definition z3++.h:674

Referenced by context::enumeration_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 2304 of file z3++.h.

2304 {
2305 return to_func_decl(a.ctx(), Z3_mk_tree_order(a.ctx(), a, index));
2306 }
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.

◆ try_for()

tactic try_for ( tactic const t,
unsigned  ms 
)
inline

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

3173 {
3174 Z3_tactic r = Z3_tactic_try_for(t.ctx(), t, ms);
3175 t.check_error();
3176 return tactic(t.ctx(), r);
3177 }
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 2085 of file z3++.h.

2085 {
2086 assert(t.is_bv());
2087 Z3_ast r = Z3_mk_fpa_to_fp_unsigned(t.ctx(), t.ctx().fpa_rounding_mode(), t, s);
2088 t.check_error();
2089 return expr(t.ctx(), r);
2090 }
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 2204 of file z3++.h.

2204{ 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(), and udiv().

◆ udiv() [2/3]

expr udiv ( expr const a,
int  b 
)
inline

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

2205{ 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:2204

◆ udiv() [3/3]

expr udiv ( int  a,
expr const b 
)
inline

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

2206{ 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 2184 of file z3++.h.

2184{ return to_expr(a.ctx(), Z3_mk_bvuge(a.ctx(), a, b)); }

Referenced by uge(), and uge().

◆ uge() [2/3]

expr uge ( expr const a,
int  b 
)
inline

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

2185{ 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:2184

◆ uge() [3/3]

expr uge ( int  a,
expr const b 
)
inline

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

2186{ 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 2190 of file z3++.h.

2190{ 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(), and ugt().

◆ ugt() [2/3]

expr ugt ( expr const a,
int  b 
)
inline

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

2191{ 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:2190

◆ ugt() [3/3]

expr ugt ( int  a,
expr const b 
)
inline

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

2192{ 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 2172 of file z3++.h.

2172{ 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(), and ule().

◆ ule() [2/3]

expr ule ( expr const a,
int  b 
)
inline

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

2173{ 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:2172

◆ ule() [3/3]

expr ule ( int  a,
expr const b 
)
inline

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

2174{ 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 2178 of file z3++.h.

2178{ 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(), and ult().

◆ ult() [2/3]

expr ult ( expr const a,
int  b 
)
inline

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

2179{ 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:2178

◆ ult() [3/3]

expr ult ( int  a,
expr const b 
)
inline

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

2180{ 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 2225 of file z3++.h.

2225{ 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(), and urem().

◆ urem() [2/3]

expr urem ( expr const a,
int  b 
)
inline

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

2226{ 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:2225

◆ urem() [3/3]

expr urem ( int  a,
expr const b 
)
inline

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

2227{ return urem(b.ctx().num_val(a, b.get_sort()), b); }

◆ when()

tactic when ( probe const p,
tactic const t 
)
inline

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

3497 {
3498 check_context(p, t);
3499 Z3_tactic r = Z3_tactic_when(t.ctx(), p, t);
3500 t.check_error();
3501 return tactic(t.ctx(), r);
3502 }
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...

◆ with() [1/2]

simplifier with ( simplifier const t,
params const p 
)
inline

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

3229 {
3230 Z3_simplifier r = Z3_simplifier_using_params(t.ctx(), t, p);
3231 t.check_error();
3232 return simplifier(t.ctx(), r);
3233 }
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 3168 of file z3++.h.

3168 {
3169 Z3_tactic r = Z3_tactic_using_params(t.ctx(), t, p);
3170 t.check_error();
3171 return tactic(t.ctx(), r);
3172 }
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 1967 of file z3++.h.

1967{ 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 2253 of file z3++.h.

2253{ 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,...