4 #ifndef ILANG_UTIL_Z3_HELPER_H__
5 #define ILANG_UTIL_Z3_HELPER_H__
21 return static_cast<__int64
>(bv_val);
26 inline z3::expr
Z3Implies(z3::context& ctx,
const z3::expr& a,
29 return z3::implies(a, b);
31 return z3::expr(ctx, Z3_mk_implies(ctx, a, b));
36 inline z3::expr
Z3Shl(z3::context& ctx,
const z3::expr& a,
const z3::expr& b) {
40 return z3::expr(ctx, Z3_mk_bvshl(ctx, a, b));
45 inline z3::expr
Z3Ashr(z3::context& ctx,
const z3::expr& a,
const z3::expr& b) {
47 return z3::ashr(a, b);
49 return z3::expr(ctx, Z3_mk_bvashr(ctx, a, b));
54 inline z3::expr
Z3Lshr(z3::context& ctx,
const z3::expr& a,
const z3::expr& b) {
56 return z3::lshr(a, b);
58 return z3::expr(ctx, Z3_mk_bvlshr(ctx, a, b));
63 inline z3::expr
Z3SRem(z3::context& ctx,
const z3::expr& a,
const z3::expr& b) {
65 return z3::srem(a, b);
67 return z3::expr(ctx, Z3_mk_bvsrem(ctx, a, b));
72 inline z3::expr
Z3URem(z3::context& ctx,
const z3::expr& a,
const z3::expr& b) {
74 return z3::urem(a, b);
76 return z3::expr(ctx, Z3_mk_bvurem(ctx, a, b));
81 inline z3::expr
Z3SMod(z3::context& ctx,
const z3::expr& a,
const z3::expr& b) {
83 return z3::smod(a, b);
85 return z3::expr(ctx, Z3_mk_bvsmod(ctx, a, b));
90 inline z3::expr
Z3ZExt(z3::context& ctx,
const z3::expr& e,
const unsigned& w) {
92 return z3::zext(e, w);
94 return z3::expr(ctx, Z3_mk_zero_ext(ctx, w, e));
99 inline z3::expr
Z3SExt(z3::context& ctx,
const z3::expr& e,
const unsigned& w) {
100 #ifndef Z3_LEGACY_API
101 return z3::sext(e, w);
103 return z3::expr(ctx, Z3_mk_sign_ext(ctx, w, e));
108 inline z3::expr
Z3LRotate(z3::context& ctx, z3::expr& e,
unsigned& w) {
109 #ifndef Z3_LEGACY_API
110 return e.rotate_left(w);
112 return z3::expr(ctx, Z3_mk_rotate_left(ctx, w, e));
117 inline z3::expr
Z3RRotate(z3::context& ctx, z3::expr& e,
unsigned& w) {
118 #ifndef Z3_LEGACY_API
119 return e.rotate_right(w);
121 return z3::expr(ctx, Z3_mk_rotate_right(ctx, w, e));
127 #ifndef Z3_LEGACY_API
128 return e.to_string();
130 return static_cast<std::string
>(Z3_ast_to_string(ctx, e));
136 #endif // ILANG_UTIL_Z3_HELPER_H__
z3::expr Z3Lshr(z3::context &ctx, const z3::expr &a, const z3::expr &b)
Interface z3 lshr ast node construction.
Definition: z3_helper.h:54
z3::expr Z3Implies(z3::context &ctx, const z3::expr &a, const z3::expr &b)
Interface z3 implies ast node construction.
Definition: z3_helper.h:26
BvValType Z3BvVal(const BvValType &bv_val)
Interface z3 bit-vector constant numeric.
Definition: z3_helper.h:17
z3::expr Z3SMod(z3::context &ctx, const z3::expr &a, const z3::expr &b)
Interface z3 shl ast node construction.
Definition: z3_helper.h:81
z3::expr Z3Shl(z3::context &ctx, const z3::expr &a, const z3::expr &b)
Interface z3 shl ast node construction.
Definition: z3_helper.h:36
z3::expr Z3RRotate(z3::context &ctx, z3::expr &e, unsigned &w)
Interface z3 right rotate ast node construction.
Definition: z3_helper.h:117
z3::expr Z3Ashr(z3::context &ctx, const z3::expr &a, const z3::expr &b)
Interface z3 ashr ast node construction.
Definition: z3_helper.h:45
std::string Z3Expr2String(z3::context &ctx, const z3::expr &e)
Return the output string of the given z3::expr.
Definition: z3_helper.h:126
z3::expr Z3URem(z3::context &ctx, const z3::expr &a, const z3::expr &b)
Interface z3 shl ast node construction.
Definition: z3_helper.h:72
z3::expr Z3LRotate(z3::context &ctx, z3::expr &e, unsigned &w)
Interface z3 left rotate ast node construction.
Definition: z3_helper.h:108
z3::expr Z3SExt(z3::context &ctx, const z3::expr &e, const unsigned &w)
Interface z3 sext ast node construction.
Definition: z3_helper.h:99
BvVal::BvValType BvValType
Data type for storing BvVal.
Definition: sort_value.h:103
z3::expr Z3SRem(z3::context &ctx, const z3::expr &a, const z3::expr &b)
Interface z3 shl ast node construction.
Definition: z3_helper.h:63
z3::expr Z3ZExt(z3::context &ctx, const z3::expr &e, const unsigned &w)
Interface z3 zext ast node construction.
Definition: z3_helper.h:90