@@ -54,7 +54,7 @@ void bmct::error_trace()
54
54
goto_tracet &goto_trace=safety_checkert::error_trace;
55
55
build_goto_trace (equation, prop_conv, ns, goto_trace);
56
56
57
- switch (ui )
57
+ switch (ui_message_handler. get_ui () )
58
58
{
59
59
case ui_message_handlert::uit::PLAIN:
60
60
result () << " Counterexample:" << eom;
@@ -72,8 +72,10 @@ void bmct::error_trace()
72
72
73
73
case ui_message_handlert::uit::JSON_UI:
74
74
{
75
+ if (status ().tellp () > 0 )
76
+ status () << eom; // force end of previous message
75
77
json_stream_objectt &json_result =
76
- status (). json_stream ().push_back_stream_object ();
78
+ ui_message_handler. get_json_stream ().push_back_stream_object ();
77
79
const goto_trace_stept &step=goto_trace.steps .back ();
78
80
json_result[" property" ] =
79
81
json_stringt (step.pc ->source_location .get_property_id ());
@@ -153,7 +155,7 @@ void bmct::report_success()
153
155
{
154
156
result () << " VERIFICATION SUCCESSFUL" << eom;
155
157
156
- switch (ui )
158
+ switch (ui_message_handler. get_ui () )
157
159
{
158
160
case ui_message_handlert::uit::PLAIN:
159
161
break ;
@@ -180,7 +182,7 @@ void bmct::report_failure()
180
182
{
181
183
result () << " VERIFICATION FAILED" << eom;
182
184
183
- switch (ui )
185
+ switch (ui_message_handler. get_ui () )
184
186
{
185
187
case ui_message_handlert::uit::PLAIN:
186
188
break ;
@@ -294,7 +296,7 @@ safety_checkert::resultt bmct::execute(
294
296
295
297
if (options.get_bool_option (" show-vcc" ))
296
298
{
297
- show_vcc (options, get_message_handler (), ui , ns, equation);
299
+ show_vcc (options, ui_message_handler , ns, equation);
298
300
return safety_checkert::resultt::SAFE; // to indicate non-error
299
301
}
300
302
@@ -420,7 +422,7 @@ void bmct::show()
420
422
{
421
423
if (options.get_bool_option (" show-vcc" ))
422
424
{
423
- show_vcc (options, get_message_handler (), ui , ns, equation);
425
+ show_vcc (options, ui_message_handler , ns, equation);
424
426
}
425
427
426
428
if (options.get_bool_option (" program-only" ))
@@ -478,15 +480,14 @@ int bmct::do_language_agnostic_bmc(
478
480
const path_strategy_choosert &path_strategy_chooser,
479
481
const optionst &opts,
480
482
abstract_goto_modelt &model,
481
- const ui_message_handlert::uit &ui,
482
- messaget &message,
483
+ ui_message_handlert &ui,
483
484
std::function<void (bmct &, const symbol_tablet &)> driver_configure_bmc,
484
485
std::function<bool(void )> callback_after_symex)
485
486
{
486
487
safety_checkert::resultt final_result = safety_checkert::resultt::UNKNOWN;
487
488
safety_checkert::resultt tmp_result = safety_checkert::resultt::UNKNOWN;
488
489
const symbol_tablet &symbol_table = model.get_symbol_table ();
489
- message_handlert &mh = message. get_message_handler ( );
490
+ messaget message (ui );
490
491
std::unique_ptr<path_storaget> worklist;
491
492
std::string strategy = opts.get_option (" exploration-strategy" );
492
493
INVARIANT (
@@ -496,13 +497,15 @@ int bmct::do_language_agnostic_bmc(
496
497
try
497
498
{
498
499
{
499
- cbmc_solverst solvers (opts, symbol_table, message.get_message_handler ());
500
- solvers.set_ui (ui);
500
+ cbmc_solverst solvers (
501
+ opts,
502
+ symbol_table,
503
+ ui,
504
+ ui.get_ui () == ui_message_handlert::uit::XML_UI);
501
505
std::unique_ptr<cbmc_solverst::solvert> cbmc_solver;
502
506
cbmc_solver = solvers.get_solver ();
503
507
prop_convt &pc = cbmc_solver->prop_conv ();
504
- bmct bmc (opts, symbol_table, mh, pc, *worklist, callback_after_symex);
505
- bmc.set_ui (ui);
508
+ bmct bmc (opts, symbol_table, ui, pc, *worklist, callback_after_symex);
506
509
if (driver_configure_bmc)
507
510
driver_configure_bmc (bmc, symbol_table);
508
511
tmp_result = bmc.run (model);
@@ -546,16 +549,19 @@ int bmct::do_language_agnostic_bmc(
546
549
<< " Starting new path (" << worklist->size ()
547
550
<< " to go)\n "
548
551
<< message.eom ;
549
- cbmc_solverst solvers (opts, symbol_table, message.get_message_handler ());
550
- solvers.set_ui (ui);
552
+ cbmc_solverst solvers (
553
+ opts,
554
+ symbol_table,
555
+ ui,
556
+ ui.get_ui () == ui_message_handlert::uit::XML_UI);
551
557
std::unique_ptr<cbmc_solverst::solvert> cbmc_solver;
552
558
cbmc_solver = solvers.get_solver ();
553
559
prop_convt &pc = cbmc_solver->prop_conv ();
554
560
path_storaget::patht &resume = worklist->peek ();
555
561
path_explorert pe (
556
562
opts,
557
563
symbol_table,
558
- mh ,
564
+ ui ,
559
565
pc,
560
566
resume.equation ,
561
567
resume.state ,
0 commit comments