4 #ifndef ILANG_ILA_MNGR_U_SMT_SWITCH_H__
5 #define ILANG_ILA_MNGR_U_SMT_SWITCH_H__
7 #ifdef SMTSWITCH_INTERFACE
10 #include <unordered_map>
12 #include <smt-switch/smt.h>
24 SmtSwitchItf(smt::SmtSolver& solver);
30 smt::Term GetSmtTerm(
const ExprPtr& expr,
const std::string& suffix =
"");
34 inline smt::SmtSolver& solver()
const {
return solver_; }
43 inline auto GetShimExpr(
const ExprPtr& expr,
const std::string& suffix) {
44 return GetSmtTerm(expr, suffix);
47 inline auto GetShimFunc(
const FuncPtr& func) {
return Func2Term(func); }
49 inline auto BoolAnd(
const smt::Term& a,
const smt::Term& b) {
50 return solver_->make_term(smt::PrimOp::And, a, b);
53 inline auto Equal(
const smt::Term& a,
const smt::Term& b) {
54 return solver_->make_term(smt::PrimOp::Equal, a, b);
59 typedef std::unordered_map<const ExprPtr, smt::Term, ExprHash> ExprTermMap;
61 typedef std::unordered_map<const FuncPtr, smt::Term, FuncHash> FuncTermMap;
65 smt::SmtSolver& solver_;
67 ExprTermMap expr_map_;
69 FuncTermMap func_map_;
71 std::string suffix_ =
"";
75 void PopulateExprMap(
const ExprPtr& expr);
77 smt::Term ExprVar2Term(
const ExprPtr& expr);
79 smt::Term ExprConst2Term(
const ExprPtr& expr);
81 smt::Term ExprOp2Term(
const ExprPtr& expr,
const smt::TermVec& arg_terms);
83 smt::Term Func2Term(
const FuncPtr& func);
85 smt::Sort IlaSort2SmtSort(
const SortPtr& s);
91 #endif // SMTSWITCH_INTERFACE
93 #endif // ILANG_ILA_MNGR_U_SMT_SWITCH_H__
Expr::ExprPtr ExprPtr
Pointer type for normal use of Expr.
Definition: expr.h:138
Sort::SortPtr SortPtr
Pointer type for storing/passing Sort.
Definition: sort.h:82
Func::FuncPtr FuncPtr
Pointer type for normal use of Func.
Definition: func.h:83