@@ -54,9 +54,10 @@ smt2_convt::smt2_convt(
54
54
solvert _solver,
55
55
std::ostream &_out)
56
56
: use_FPA_theory(false ),
57
+ use_array_of_bool(false ),
57
58
use_as_const(false ),
59
+ use_check_sat_assuming(false ),
58
60
use_datatypes(false ),
59
- use_array_of_bool(false ),
60
61
use_lambda_for_array(false ),
61
62
emit_set_logic(true ),
62
63
ns(_ns),
@@ -81,8 +82,9 @@ smt2_convt::smt2_convt(
81
82
break ;
82
83
83
84
case solvert::CPROVER_SMT2:
84
- use_as_const = true ;
85
85
use_array_of_bool = true ;
86
+ use_as_const = true ;
87
+ use_check_sat_assuming = true ;
86
88
emit_set_logic = false ;
87
89
break ;
88
90
@@ -100,8 +102,9 @@ smt2_convt::smt2_convt(
100
102
break ;
101
103
102
104
case solvert::Z3:
103
- use_as_const = true ;
104
105
use_array_of_bool = true ;
106
+ use_as_const = true ;
107
+ use_check_sat_assuming = true ;
105
108
use_lambda_for_array = true ;
106
109
emit_set_logic = false ;
107
110
use_datatypes = true ;
@@ -173,26 +176,36 @@ void smt2_convt::write_footer(std::ostream &os)
173
176
{
174
177
os << " \n " ;
175
178
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 );
180
182
183
+ if (use_check_sat_assuming && !assumptions.empty ())
184
+ {
185
+ os << " (check-sat-assuming (" ;
181
186
for (const auto &assumption : assumptions)
182
- {
183
- os << " (assert " ;
184
187
convert_literal (to_literal_expr (assumption).get_literal ());
185
- os << " )"
186
- << " \n " ;
187
- }
188
+ os << " ))\n " ;
188
189
}
190
+ else
191
+ {
192
+ // add the assumptions, if any
193
+ if (!assumptions.empty ())
194
+ {
195
+ os << " ; assumptions\n " ;
189
196
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
+ }
193
208
194
- os << " (check-sat)"
195
- << " \n " ;
196
209
os << " \n " ;
197
210
198
211
if (solver!=solvert::BOOLECTOR)
0 commit comments