4 #ifndef ILANG_TARGET_SMT_Z3_EXPR_ADAPTER_H__
5 #define ILANG_TARGET_SMT_Z3_EXPR_ADAPTER_H__
7 #include <unordered_map>
30 z3::expr
GetExpr(
const ExprPtr& expr,
const std::string& suffix =
"");
36 inline z3::context&
context()
const {
return ctx_; }
45 return func->GetZ3FuncDecl(ctx_);
48 inline auto BoolAnd(
const z3::expr& a,
const z3::expr& b) {
return a && b; }
50 inline auto Equal(
const z3::expr& a,
const z3::expr& b) {
return a == b; }
54 typedef std::unordered_map<const ExprPtr, z3::expr, Z3AdapterHash>
ExprMap;
62 std::string suffix_ =
"";
66 void PopulateExprMap(
const ExprPtr& expr);
72 #endif // ILANG_TARGET_SMT_Z3_EXPR_ADAPTER_H__
auto Equal(const z3::expr &a, const z3::expr &b)
Unified SmtShim interface to EQUAL two z3::expr.
Definition: z3_expr_adapter.h:50
auto GetShimFunc(const FuncPtr &func)
Unified SmtShim interface to get z3::func_decl.
Definition: z3_expr_adapter.h:44
Expr::ExprPtr ExprPtr
Pointer type for normal use of Expr.
Definition: expr.h:138
The function object for hashing Expr. The hash value is the id of the symbol, which is supposed to be...
Definition: expr.h:144
Z3ExprAdapter(z3::context &ctx)
Constructor.
ExprHash Z3AdapterHash
The function object for hashing Expr in generating z3 expression.
Definition: z3_expr_adapter.h:17
auto BoolAnd(const z3::expr &a, const z3::expr &b)
Unified SmtShim interface to AND two boolean z3::expr.
Definition: z3_expr_adapter.h:48
Func::FuncPtr FuncPtr
Pointer type for normal use of Func.
Definition: func.h:83
z3::expr GetExpr(const ExprPtr &expr, const std::string &suffix="")
Get the z3 expression of the AST node.
std::unordered_map< const ExprPtr, const ExprPtr, ExprHash > ExprMap
Type for mapping between Expr.
Definition: expr.h:151
void operator()(const ExprPtr &expr)
Function object for getting z3 expression.
z3::context & context() const
Return the underlying z3 context.
Definition: z3_expr_adapter.h:36
The class for generating z3 expression from an ILA.
Definition: z3_expr_adapter.h:20
auto GetShimExpr(const ExprPtr &expr, const std::string &suffix)
Unified SmtShim interface to get z3::expr.
Definition: z3_expr_adapter.h:40
~Z3ExprAdapter()
~Default destructor.