File tree Expand file tree Collapse file tree 3 files changed +16
-5
lines changed Expand file tree Collapse file tree 3 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -214,7 +214,7 @@ void smt2_convt::write_footer()
214
214
{
215
215
out << " (check-sat-assuming (" ;
216
216
for (const auto &assumption : assumptions)
217
- convert_literal (to_literal_expr ( assumption). get_literal () );
217
+ convert_literal (assumption);
218
218
out << " ))\n " ;
219
219
}
220
220
else
@@ -227,7 +227,7 @@ void smt2_convt::write_footer()
227
227
for (const auto &assumption : assumptions)
228
228
{
229
229
out << " (assert " ;
230
- convert_literal (to_literal_expr ( assumption). get_literal () );
230
+ convert_literal (assumption);
231
231
out << " )"
232
232
<< " \n " ;
233
233
}
@@ -323,7 +323,7 @@ decision_proceduret::resultt smt2_convt::dec_solve(const exprt &assumption)
323
323
write_footer ();
324
324
else
325
325
{
326
- assumptions.push_back (literal_exprt ( convert (assumption) ));
326
+ assumptions.push_back (convert (assumption));
327
327
write_footer ();
328
328
assumptions.pop_back ();
329
329
}
@@ -987,7 +987,9 @@ void smt2_convt::push(const std::vector<exprt> &_assumptions)
987
987
{
988
988
INVARIANT (assumptions.empty (), " nested contexts are not supported" );
989
989
990
- assumptions = _assumptions;
990
+ assumptions.reserve (_assumptions.size ());
991
+ for (auto &assumption : _assumptions)
992
+ assumptions.push_back (convert (assumption));
991
993
}
992
994
993
995
void smt2_convt::pop ()
Original file line number Diff line number Diff line change @@ -102,7 +102,7 @@ class smt2_convt : public stack_decision_proceduret
102
102
unordered_map<irep_idt, std::function<void (const exprt &)>, irep_id_hash>;
103
103
converterst converters;
104
104
105
- std::vector<exprt > assumptions;
105
+ std::vector<literalt > assumptions;
106
106
boolbv_widtht boolbv_width;
107
107
108
108
std::size_t number_of_solver_calls = 0 ;
Original file line number Diff line number Diff line change @@ -42,12 +42,21 @@ decision_proceduret::resultt smt2_dect::dec_solve(const exprt &assumption)
42
42
temp_file_stderr (" smt2_dec_stderr_" , " " );
43
43
44
44
const auto write_problem_to_file = [&](std::ofstream problem_out) {
45
+ if (assumption.is_not_nil ())
46
+ assumptions.push_back (convert (assumption));
47
+
45
48
cached_output << stringstream.str ();
46
49
stringstream.str (std::string{});
50
+
47
51
write_footer ();
52
+
53
+ if (assumption.is_not_nil ())
54
+ assumptions.pop_back ();
55
+
48
56
problem_out << cached_output.str () << stringstream.str ();
49
57
stringstream.str (std::string{});
50
58
};
59
+
51
60
write_problem_to_file (std::ofstream (
52
61
temp_file_problem (), std::ios_base::out | std::ios_base::trunc));
53
62
You can’t perform that action at this time.
0 commit comments