29#ifndef Z3_EXAMPLE_Z3EXPR_H
30#define Z3_EXAMPLE_Z3EXPR_H
41 static z3::context *
ctx;
79 if (this->
id() != rhs.
id())
124 return e.to_string();
129 return e.is_numeral();
144 return e.get_numeral_int64();
149 return e.get_numeral_int();
230 return shl(
lhs.getExpr(),
rhs.getExpr());
240 return z3::bv2int(
e.getExpr(), isSigned);
271 return eq(
lhs.getExpr().simplify(),
rhs.getExpr().simplify());
316struct std::hash<
SVF::Z3Expr>
Z3Expr(const Z3Expr &z3Expr)
const z3::expr & getExpr() const
static z3::solver & getSolver()
Get z3 solver, singleton design here to make sure we only have one context.
friend Z3Expr operator!=(const Z3Expr &lhs, const Z3Expr &rhs)
const std::string to_string() const
friend Z3Expr operator|(const Z3Expr &lhs, const Z3Expr &rhs)
friend Z3Expr operator>(const Z3Expr &lhs, const Z3Expr &rhs)
friend Z3Expr operator%(const Z3Expr &lhs, const Z3Expr &rhs)
static z3::solver * solver
friend Z3Expr operator||(const Z3Expr &lhs, const Z3Expr &rhs)
friend Z3Expr bv2int(const Z3Expr &e, bool isSigned)
static Z3Expr AND(const Z3Expr &lhs, const Z3Expr &rhs)
compute AND, used for branch condition
static std::string dumpStr(const Z3Expr &z3Expr)
output Z3 expression as a string
friend Z3Expr ashr(const Z3Expr &lhs, const Z3Expr &rhs)
u32_t hash() const
get hash id
friend Z3Expr operator&(const Z3Expr &lhs, const Z3Expr &rhs)
friend Z3Expr operator*(const Z3Expr &lhs, const Z3Expr &rhs)
Z3Expr(const z3::expr &_e)
friend Z3Expr operator>=(const Z3Expr &lhs, const Z3Expr &rhs)
friend Z3Expr shl(const Z3Expr &lhs, const Z3Expr &rhs)
static u32_t getExprSize(const Z3Expr &z3Expr)
get the number of subexpression of a Z3 expression
z3::sort get_sort() const
friend Z3Expr operator==(const Z3Expr &lhs, const Z3Expr &rhs)
friend Z3Expr ite(const Z3Expr &cond, const Z3Expr &lhs, const Z3Expr &rhs)
friend Z3Expr operator/(const Z3Expr &lhs, const Z3Expr &rhs)
friend Z3Expr operator<=(const Z3Expr &lhs, const Z3Expr &rhs)
static Z3Expr NEG(const Z3Expr &z3Expr)
compute NEG
static z3::expr nullExpr()
null expression
friend Z3Expr operator<(const Z3Expr &lhs, const Z3Expr &rhs)
static void releaseSolver()
release z3 solver
static void releaseContext()
release z3 context
int get_numeral_int() const
static Z3Expr getTrueCond()
Return the unique true condition.
virtual ~Z3Expr()=default
static Z3Expr OR(const Z3Expr &lhs, const Z3Expr &rhs)
compute OR, used for branch condition
Z3Expr & operator=(const Z3Expr &rhs)
friend Z3Expr operator!(const Z3Expr &lhs)
friend bool eq(const Z3Expr &lhs, const Z3Expr &rhs)
friend Z3Expr int2bv(u32_t n, const Z3Expr &e)
static z3::context & getContext()
Get z3 context, singleton design here to make sure we only have one context.
int64_t get_numeral_int64() const
friend Z3Expr operator&&(const Z3Expr &lhs, const Z3Expr &rhs)
friend Z3Expr operator^(const Z3Expr &lhs, const Z3Expr &rhs)
friend Z3Expr operator-(const Z3Expr &lhs, const Z3Expr &rhs)
static Z3Expr getFalseCond()
Return the unique false condition.
friend Z3Expr operator+(const Z3Expr &lhs, const Z3Expr &rhs)
friend std::ostream & operator<<(std::ostream &out, const Z3Expr &expr)
llvm::IRBuilder IRBuilder
size_t operator()(const SVF::Z3Expr &z3Expr) const