Skip to content

Commit ecbbab3

Browse files
author
thk123
committed
Adding in printing code for each unwind
1 parent 9bde863 commit ecbbab3

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

src/goto-checker/single_loop_incremental_symex_checker.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ single_loop_incremental_symex_checkert::single_loop_incremental_symex_checkert(
3434
equation,
3535
options,
3636
path_storage,
37-
guard_manager),
37+
guard_manager,
38+
ui_message_handler.get_ui()),
3839
property_decider(options, ui_message_handler, equation, ns)
3940
{
4041
setup_symex(symex, ns, options, ui_message_handler);

src/goto-checker/symex_bmc_incremental_one_loop.cpp

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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_xml)
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_xml(output_xml)
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,14 @@ 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+
92+
if(output_xml == ui_message_handlert::uit::XML_UI)
93+
{
94+
xmlt xml("current-unwinding");
95+
xml.data = std::to_string(unwind);
96+
log.statistics() << xml;
97+
}
98+
8899
log.statistics() << (abort ? "Not unwinding" : "Unwinding") << " loop " << id
89100
<< " iteration " << unwind;
90101

src/goto-checker/symex_bmc_incremental_one_loop.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#define CPROVER_GOTO_CHECKER_SYMEX_BMC_INCREMENTAL_ONE_LOOP_H
1111

1212
#include "symex_bmc.h"
13+
#include <util/ui_message.h>
1314

1415
class symex_bmc_incremental_one_loopt : public symex_bmct
1516
{
@@ -20,7 +21,8 @@ class symex_bmc_incremental_one_loopt : public symex_bmct
2021
symex_target_equationt &,
2122
const optionst &,
2223
path_storaget &,
23-
guard_managert &);
24+
guard_managert &,
25+
ui_message_handlert::uit output_xml);
2426

2527
/// Return true if symex can be resumed
2628
bool from_entry_point_of(
@@ -44,6 +46,8 @@ class symex_bmc_incremental_one_loopt : public symex_bmct
4446
const symex_targett::sourcet &source,
4547
const call_stackt &context,
4648
unsigned unwind) override;
49+
50+
ui_message_handlert::uit output_xml;
4751
};
4852

4953
#endif // CPROVER_GOTO_CHECKER_SYMEX_BMC_INCREMENTAL_ONE_LOOP_H

0 commit comments

Comments
 (0)