124 std::vector<triton::usize> symExprs;
125 for (
const auto& se : ssa) {
126 symExprs.push_back(se.first);
130 std::map<triton::usize, triton::engines::symbolic::SharedSymbolicVariable> symVars;
133 symVars[var->getId()] = var;
137 this->requiredFunctions(stream);
140 for (
const auto& var : symVars) {
141 auto n = this->astCtxt->declare(this->astCtxt->variable(var.second));
142 stream << n << std::endl;
146 std::sort(symExprs.begin(), symExprs.end());
153 for (
const auto&
id : symExprs) {
155 stream << e->getFormattedExpression();
156 if (icomment && !e->getDisassembly().empty()) {
157 if (e->getComment().empty()) {
163 stream << e->getDisassembly();
170 std::vector<triton::ast::SharedAbstractNode> exprs;
171 std::vector<triton::ast::SharedAbstractNode> wl{expr->getAst()};
173 while (!wl.empty()) {
182 for (
const auto& child : n->getChildren()) {
187 for (
auto it = exprs.crbegin(); it != exprs.crend(); ++it) {
188 stream << this->astCtxt->assert_(*it) << std::endl;
191 stream <<
"(check-sat)" << std::endl;
192 stream <<
"(get-model)" << std::endl;
196 this->astCtxt->setRepresentationMode(mode);
TRITON_EXPORT std::ostream & liftToSMT(std::ostream &stream, const triton::engines::symbolic::SharedSymbolicExpression &expr, bool assert_=false, bool icomment=false)
Lifts a symbolic expression and all its references to SMT format. If assert_ is true,...
std::deque< SharedAbstractNode > search(const SharedAbstractNode &node, triton::ast::ast_e match)
Returns a deque of collected matched nodes via a depth-first pre order traversal.