@@ -222,6 +222,11 @@ make_satcheck_prop(message_handlert &message_handler, const optionst &options)
222
222
static std::unique_ptr<propt>
223
223
get_sat_solver (message_handlert &message_handler, const optionst &options)
224
224
{
225
+ const bool no_simplifier = options.get_bool_option (" beautify" ) ||
226
+ !options.get_bool_option (" sat-preprocessor" ) ||
227
+ options.get_bool_option (" refine" ) ||
228
+ options.get_bool_option (" refine-strings" );
229
+
225
230
if (options.is_set (" sat-solver" ))
226
231
{
227
232
const std::string &solver_option = options.get_option (" sat-solver" );
@@ -252,9 +257,7 @@ get_sat_solver(message_handlert &message_handler, const optionst &options)
252
257
else if (solver_option == " minisat2" )
253
258
{
254
259
#if defined SATCHECK_MINISAT2
255
- if (
256
- options.get_bool_option (" beautify" ) ||
257
- !options.get_bool_option (" sat-preprocessor" )) // no simplifier
260
+ if (no_simplifier)
258
261
{
259
262
// simplifier won't work with beautification
260
263
return make_satcheck_prop<satcheck_minisat_no_simplifiert>(
@@ -296,9 +299,7 @@ get_sat_solver(message_handlert &message_handler, const optionst &options)
296
299
else if (solver_option == " glucose" )
297
300
{
298
301
#if defined SATCHECK_GLUCOSE
299
- if (
300
- options.get_bool_option (" beautify" ) ||
301
- !options.get_bool_option (" sat-preprocessor" )) // no simplifier
302
+ if (no_simplifier)
302
303
{
303
304
// simplifier won't work with beautification
304
305
return make_satcheck_prop<satcheck_glucose_no_simplifiert>(
@@ -331,9 +332,7 @@ get_sat_solver(message_handlert &message_handler, const optionst &options)
331
332
}
332
333
333
334
// default solver
334
- if (
335
- options.get_bool_option (" beautify" ) ||
336
- !options.get_bool_option (" sat-preprocessor" )) // no simplifier
335
+ if (no_simplifier)
337
336
{
338
337
// simplifier won't work with beautification
339
338
return make_satcheck_prop<satcheck_no_simplifiert>(
@@ -396,16 +395,7 @@ std::unique_ptr<solver_factoryt::solvert> solver_factoryt::get_external_sat()
396
395
397
396
std::unique_ptr<solver_factoryt::solvert> solver_factoryt::get_bv_refinement ()
398
397
{
399
- std::unique_ptr<propt> prop = [this ]() -> std::unique_ptr<propt> {
400
- // We offer the option to disable the SAT preprocessor
401
- if (options.get_bool_option (" sat-preprocessor" ))
402
- {
403
- no_beautification ();
404
- return make_satcheck_prop<satcheckt>(message_handler, options);
405
- }
406
- return make_satcheck_prop<satcheck_no_simplifiert>(
407
- message_handler, options);
408
- }();
398
+ std::unique_ptr<propt> prop = get_sat_solver (message_handler, options);
409
399
410
400
bv_refinementt::infot info;
411
401
info.ns = &ns;
@@ -435,8 +425,7 @@ solver_factoryt::get_string_refinement()
435
425
{
436
426
string_refinementt::infot info;
437
427
info.ns = &ns;
438
- auto prop =
439
- make_satcheck_prop<satcheck_no_simplifiert>(message_handler, options);
428
+ auto prop = get_sat_solver (message_handler, options);
440
429
info.prop = prop.get ();
441
430
info.refinement_bound = DEFAULT_MAX_NB_REFINEMENT;
442
431
info.output_xml = output_xml_in_refinement;
0 commit comments