@@ -54,9 +54,10 @@ smt2_convt::smt2_convt(
5454 solvert _solver,
5555 std::ostream &_out)
5656 : use_FPA_theory(false ),
57+ use_array_of_bool(false ),
5758 use_as_const(false ),
59+ use_check_sat_assuming(false ),
5860 use_datatypes(false ),
59- use_array_of_bool(false ),
6061 use_lambda_for_array(false ),
6162 emit_set_logic(true ),
6263 ns(_ns),
@@ -81,8 +82,9 @@ smt2_convt::smt2_convt(
8182 break ;
8283
8384 case solvert::CPROVER_SMT2:
84- use_as_const = true ;
8585 use_array_of_bool = true ;
86+ use_as_const = true ;
87+ use_check_sat_assuming = true ;
8688 emit_set_logic = false ;
8789 break ;
8890
@@ -100,8 +102,9 @@ smt2_convt::smt2_convt(
100102 break ;
101103
102104 case solvert::Z3:
103- use_as_const = true ;
104105 use_array_of_bool = true ;
106+ use_as_const = true ;
107+ use_check_sat_assuming = true ;
105108 use_lambda_for_array = true ;
106109 emit_set_logic = false ;
107110 use_datatypes = true ;
@@ -173,26 +176,36 @@ void smt2_convt::write_footer(std::ostream &os)
173176{
174177 os << " \n " ;
175178
176- // add the assumptions, if any
177- if (!assumptions.empty ())
178- {
179- os << " ; assumptions\n " ;
179+ // fix up the object sizes
180+ for (const auto &object : object_sizes)
181+ define_object_size (object.second , object.first );
180182
183+ if (use_check_sat_assuming && !assumptions.empty ())
184+ {
185+ os << " (check-sat-assuming (" ;
181186 for (const auto &assumption : assumptions)
182- {
183- os << " (assert " ;
184187 convert_literal (to_literal_expr (assumption).get_literal ());
185- os << " )"
186- << " \n " ;
187- }
188+ os << " ))\n " ;
188189 }
190+ else
191+ {
192+ // add the assumptions, if any
193+ if (!assumptions.empty ())
194+ {
195+ os << " ; assumptions\n " ;
189196
190- // fix up the object sizes
191- for (const auto &object : object_sizes)
192- define_object_size (object.second , object.first );
197+ for (const auto &assumption : assumptions)
198+ {
199+ os << " (assert " ;
200+ convert_literal (to_literal_expr (assumption).get_literal ());
201+ os << " )"
202+ << " \n " ;
203+ }
204+ }
205+
206+ os << " (check-sat)\n " ;
207+ }
193208
194- os << " (check-sat)"
195- << " \n " ;
196209 os << " \n " ;
197210
198211 if (solver!=solvert::BOOLECTOR)
0 commit comments