ilang  1.1.4
ILAng: A Modeling and Verification Platform for SoCs
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Macros
smt_shim.h
Go to the documentation of this file.
1 
4 #ifndef ILANG_TARGET_SMT_SMT_SHIM_H__
5 #define ILANG_TARGET_SMT_SMT_SHIM_H__
6 
7 #include <ilang/ila/ast/func.h>
8 #include <ilang/ila/ast_hub.h>
9 
11 namespace ilang {
12 
15 template <class Generator> class SmtShim {
16 public:
18  SmtShim(Generator& gen) : gen_(gen) {}
19 
20 private:
22  Generator& gen_;
24  typedef decltype(gen_.GetShimExpr(nullptr, "")) ShimExprType;
25 
26 public:
28  inline auto GetShimExpr(const ExprPtr& expr, const std::string& suffix = "") {
29  return gen_.GetShimExpr(expr, suffix);
30  }
32  inline auto GetShimFunc(const FuncPtr& func) {
33  return gen_.GetShimFunc(func);
34  }
36  inline auto BoolAnd(const ShimExprType& a, const ShimExprType& b) {
37  return gen_.BoolAnd(a, b);
38  }
40  inline auto Equal(const ShimExprType& a, const ShimExprType& b) {
41  return gen_.Equal(a, b);
42  }
44  inline Generator& get() const { return gen_; }
45 
46 }; // class SmtShim
47 
48 } // namespace ilang
49 
50 #endif // ILANG_TARGET_SMT_SMT_SHIM_H__
Expr::ExprPtr ExprPtr
Pointer type for normal use of Expr.
Definition: expr.h:138
SmtShim(Generator &gen)
Constructor.
Definition: smt_shim.h:18
auto GetShimExpr(const ExprPtr &expr, const std::string &suffix="")
Unified interface to get expression.
Definition: smt_shim.h:28
auto Equal(const ShimExprType &a, const ShimExprType &b)
Unified interface to Equal two expressions.
Definition: smt_shim.h:40
Func::FuncPtr FuncPtr
Pointer type for normal use of Func.
Definition: func.h:83
auto GetShimFunc(const FuncPtr &func)
Unified interface to get function declaration.
Definition: smt_shim.h:32
A templated class for wrapping z3 and smt-switch to provide a unified interface for different applica...
Definition: smt_shim.h:15
auto BoolAnd(const ShimExprType &a, const ShimExprType &b)
Unified interface to AND two boolean expressions.
Definition: smt_shim.h:36