1 #ifndef __SMT_HPP_DEFINED__ 2 #define __SMT_HPP_DEFINED__ 4 #include <boost/shared_ptr.hpp> 9 #include <unordered_map> 17 typedef std::unordered_map<
const Node*, z3::expr, decltype(&
nodeHash),
92 z3::context&
ctx()
const {
return c; }
110 template <
typename T>
114 expr ci =
c.bool_const(name.c_str());
115 z3::expr mi = m.eval(ci,
true);
116 Z3_lbool bi = Z3_get_bool_value(
c, mi);
117 ILA_ASSERT(bi != Z3_L_UNDEF,
"Unable to extract bool from model.");
118 return bi == Z3_L_TRUE;
130 unsigned nargs = op->
nArgs();
131 for (
unsigned i = 1; i != nargs; i++) {
133 expr ci =
c.bool_const(name.c_str());
135 expr vi_next = ite(ci, vi, vi_);
159 const std::string&
suffix);
165 z3::expr getIOCnst(
const Node* n,
const py::object& result);
mp_int_t getNumeralCppInt(z3::model &m, const Node *r)
Definition: bitvec.hpp:83
bool getChoiceBool(z3::model &m, const ChoiceExpr< T > *op, int i)
Definition: smt.hpp:111
z3::expr getArgCnst(const Node *n, int i)
Definition: smt.hpp:42
z3::expr getArgExpr(const Node *n, int i)
Definition: smt.hpp:40
virtual z3::expr getBvOpExpr(const BitvectorOp *op)
virtual void operator()(const Node *n)
virtual z3::expr getBoolOpExpr(const BoolOp *op)
Z3ExprAdapter(z3::context &c, const std::string &suffix)
virtual z3::expr getBVInRangeCnst(const BVInRange *op)
std::string extractNumeralString(z3::model &m, const Node *r)
virtual z3::expr getBitvectorVarExpr(const BitvectorVar *bvv)
z3::context & ctx() const
Definition: smt.hpp:92
boost::multiprecision::cpp_int mp_int_t
Definition: common.hpp:9
z3::expr getCnst(const Node *n)
#define ILA_ASSERT(b, msg)
Definition: util.hpp:9
Definition: choice.hpp:47
virtual z3::expr getFuncVarExpr(const FuncVar *fv)
bool simplify
Definition: smt.hpp:21
std::string name_suffix
Added to every name.
Definition: smt.hpp:34
bool nodeEqual(const Node *left, const Node *right)
void clear()
Definition: smt.hpp:95
virtual z3::expr getMemOpExpr(const MemOp *mw)
z3::expr _getChoiceExpr(const ChoiceExpr< T > *op)
Definition: smt.hpp:126
~Z3FixedpointAdapter()
Definition: smt.hpp:173
virtual z3::expr getBoolVarExpr(const BoolVar *bv)
size_t nodeHash(const Node *n)
expr_map_t exprmap
Definition: smt.hpp:25
Definition: abstraction.hpp:21
const std::string & getNameSuffix() const
Definition: smt.hpp:122
z3::expr getExpr(const Node *n)
Definition: bitvec.hpp:38
void setNameSuffix(const std::string &ns)
Definition: smt.hpp:121
std::string suffix
Definition: smt.hpp:31
virtual unsigned nArgs() const
Definition: choice.hpp:86
Definition: bvinrange.hpp:13
virtual z3::expr getMemVarExpr(const MemVar *mv)
virtual z3::expr getBVInRangeExpr(const BVInRange *op)
expr_map_t cnstmap
Definition: smt.hpp:26
Z3FixedpointAdapter(z3::context &c, const std::string &suffix)
Definition: smt.hpp:170
std::unordered_map< const Node *, z3::expr, decltype(&nodeHash), decltype(&nodeEqual)> expr_map_t
Definition: smt.hpp:19
bool getBoolValue(z3::model &m, const Node *r)
virtual z3::expr getChoiceExpr(const BoolChoice *op)
int getNumeralInt(z3::model &m, const Node *r)
z3::context & c
Definition: smt.hpp:29
void _populateExprMap(const Node *n)
const DistInput * distInp
Definition: smt.hpp:148
z3::expr _getArg(const expr_map_t &m, const Node *n, int i)
const char * getChoiceVarName(unsigned i) const
Definition: choice.hpp:98
void _populateCnstMap(const Node *n)