@@ -19,7 +19,8 @@ symex_bmc_incremental_one_loopt::symex_bmc_incremental_one_loopt(
1919 symex_target_equationt &target,
2020 const optionst &options,
2121 path_storaget &path_storage,
22- guard_managert &guard_manager)
22+ guard_managert &guard_manager,
23+ ui_message_handlert::uit output_ui)
2324 : symex_bmct(
2425 message_handler,
2526 outer_symbol_table,
@@ -33,7 +34,8 @@ symex_bmc_incremental_one_loopt::symex_bmc_incremental_one_loopt(
3334 : std::numeric_limits<unsigned>::max()),
3435 incr_min_unwind(
3536 options.is_set(" unwind-min" ) ? options.get_signed_int_option(" unwind-min" )
36- : 0)
37+ : 0),
38+ output_ui(output_ui)
3739{
3840 ignore_assertions =
3941 incr_min_unwind >= 1 &&
@@ -56,6 +58,7 @@ bool symex_bmc_incremental_one_loopt::should_stop_unwind(
5658 this_loop_limit = incr_max_unwind;
5759 if (unwind + 1 >= incr_min_unwind)
5860 ignore_assertions = false ;
61+
5962 abort_unwind_decision = tvt (unwind >= this_loop_limit);
6063 }
6164 else
@@ -85,6 +88,7 @@ bool symex_bmc_incremental_one_loopt::should_stop_unwind(
8588 abort_unwind_decision.is_known (), " unwind decision should be taken by now" );
8689 bool abort = abort_unwind_decision.is_true ();
8790
91+ log_unwinding (unwind);
8892 log.statistics () << (abort ? " Not unwinding" : " Unwinding" ) << " loop " << id
8993 << " iteration " << unwind;
9094
@@ -131,3 +135,29 @@ bool symex_bmc_incremental_one_loopt::resume(
131135
132136 return should_pause_symex;
133137}
138+ void symex_bmc_incremental_one_loopt::log_unwinding (unsigned unwind)
139+ {
140+ const std::string unwind_num = std::to_string (unwind);
141+ switch (output_ui)
142+ {
143+ case ui_message_handlert::uit::PLAIN:
144+ {
145+ log.statistics () << " Current unwinding: " << unwind_num << messaget::eom;
146+ break ;
147+ }
148+ case ui_message_handlert::uit::XML_UI:
149+ {
150+ xmlt xml (" current-unwinding" );
151+ xml.data = unwind_num;
152+ log.statistics () << xml << messaget::eom;
153+ break ;
154+ }
155+ case ui_message_handlert::uit::JSON_UI:
156+ {
157+ json_objectt json;
158+ json[" currentUnwinding" ] = json_numbert (unwind_num);
159+ log.statistics () << json << messaget::eom;
160+ break ;
161+ }
162+ }
163+ }
0 commit comments