@@ -149,7 +149,14 @@ std::unique_ptr<solver_factoryt::solvert> solver_factoryt::get_solver()
149
149
options.get_option (" incremental-smt2-solver" );
150
150
if (!incremental_smt2_solver.empty ())
151
151
{
152
- const auto out_filename = options.get_option (" outfile" );
152
+ if (options.get_option (" outfile" ) != " " )
153
+ {
154
+ throw invalid_command_line_argument_exceptiont (
155
+ " Argument --outfile is incompatible with --incremental-smt2-solver. "
156
+ " Use --dump-smt-formula instead." ,
157
+ " --outfile" );
158
+ }
159
+ const auto out_filename = options.get_option (" dump-smt-formula" );
153
160
return get_incremental_smt2 (incremental_smt2_solver, out_filename);
154
161
}
155
162
if (options.get_bool_option (" smt2" ))
@@ -332,7 +339,8 @@ solver_factoryt::get_string_refinement()
332
339
std::move (decision_procedure), std::move (prop));
333
340
}
334
341
335
- std::unique_ptr<std::ofstream> open_outfile_and_check (const std::string &filename)
342
+ std::unique_ptr<std::ofstream>
343
+ open_outfile_and_check (const std::string &filename, const std::string &arg_name)
336
344
{
337
345
if (filename.empty ())
338
346
return nullptr ;
@@ -346,7 +354,7 @@ std::unique_ptr<std::ofstream> open_outfile_and_check(const std::string &filenam
346
354
if (!*out)
347
355
{
348
356
throw invalid_command_line_argument_exceptiont (
349
- " failed to open file: " + filename, " --filename " );
357
+ " failed to open file: " + filename, arg_name );
350
358
}
351
359
352
360
std::cout << " Outputting SMTLib formula to file: " << filename << " \n " ;
@@ -360,7 +368,9 @@ std::unique_ptr<solver_factoryt::solvert> solver_factoryt::get_incremental_smt2(
360
368
no_beautification ();
361
369
362
370
auto solver_process = util_make_unique<smt_piped_solver_processt>(
363
- std::move (solver_command), message_handler, open_outfile_and_check (outfile));
371
+ std::move (solver_command),
372
+ message_handler,
373
+ open_outfile_and_check (outfile, " --dump-smt-formula" ));
364
374
365
375
return util_make_unique<solvert>(
366
376
util_make_unique<smt2_incremental_decision_proceduret>(
@@ -416,7 +426,7 @@ solver_factoryt::get_smt2(smt2_dect::solvert solver)
416
426
}
417
427
else
418
428
{
419
- auto out = open_outfile_and_check (filename);
429
+ auto out = open_outfile_and_check (filename, " --outfile " );
420
430
421
431
auto smt2_conv = util_make_unique<smt2_convt>(
422
432
ns,
@@ -558,6 +568,10 @@ void parse_solver_options(const cmdlinet &cmdline, optionst &options)
558
568
if (cmdline.isset (" outfile" ))
559
569
options.set_option (" outfile" , cmdline.get_value (" outfile" ));
560
570
571
+ if (cmdline.isset (" dump-smt-formula" ))
572
+ options.set_option (
573
+ " dump-smt-formula" , cmdline.get_value (" dump-smt-formula" ));
574
+
561
575
if (cmdline.isset (" write-solver-stats-to" ))
562
576
{
563
577
options.set_option (
0 commit comments