15
15
16
16
#include < limits>
17
17
18
- #include < util/source_location.h>
19
18
#include < util/simplify_expr.h>
19
+ #include < util/source_location.h>
20
20
21
21
symex_bmct::symex_bmct (
22
22
message_handlert &mh,
@@ -35,28 +35,28 @@ void symex_bmct::symex_step(
35
35
const get_goto_functiont &get_goto_function,
36
36
statet &state)
37
37
{
38
- const source_locationt &source_location= state.source .pc ->source_location ;
38
+ const source_locationt &source_location = state.source .pc ->source_location ;
39
39
40
- if (!source_location.is_nil () && last_source_location!= source_location)
40
+ if (!source_location.is_nil () && last_source_location != source_location)
41
41
{
42
- log .debug () << " BMC at " << source_location.as_string ()
43
- << " (depth " << state.depth << ' )' << log .eom ;
42
+ log .debug () << " BMC at " << source_location.as_string () << " (depth "
43
+ << state.depth << ' )' << log .eom ;
44
44
45
- last_source_location= source_location;
45
+ last_source_location = source_location;
46
46
}
47
47
48
- const goto_programt::const_targett cur_pc= state.source .pc ;
49
- const guardt cur_guard= state.guard ;
48
+ const goto_programt::const_targett cur_pc = state.source .pc ;
49
+ const guardt cur_guard = state.guard ;
50
50
51
- if (!state. guard . is_false () &&
52
- state.source .pc ->is_assume () &&
53
- simplify_expr (state.source .pc ->guard , ns).is_false ())
51
+ if (
52
+ !state. guard . is_false () && state.source .pc ->is_assume () &&
53
+ simplify_expr (state.source .pc ->guard , ns).is_false ())
54
54
{
55
55
log .statistics () << " aborting path on assume(false) at "
56
56
<< state.source .pc ->source_location << " thread "
57
57
<< state.source .thread_nr ;
58
58
59
- const irep_idt &c= state.source .pc ->source_location .get_comment ();
59
+ const irep_idt &c = state.source .pc ->source_location .get_comment ();
60
60
if (!c.empty ())
61
61
log .statistics () << " : " << c;
62
62
@@ -77,9 +77,9 @@ void symex_bmct::symex_step(
77
77
// taken an impossible transition); thus we synthesize a
78
78
// transition from the goto instruction to its target to make
79
79
// sure the goto is considered covered
80
- if (cur_pc-> is_goto () &&
81
- cur_pc->get_target ()!= state.source .pc &&
82
- cur_pc->guard .is_true ())
80
+ if (
81
+ cur_pc-> is_goto () && cur_pc->get_target () != state.source .pc &&
82
+ cur_pc->guard .is_true ())
83
83
symex_coverage.covered (cur_pc, cur_pc->get_target ());
84
84
else if (!state.guard .is_false ())
85
85
symex_coverage.covered (cur_pc, state.source .pc );
@@ -90,18 +90,18 @@ void symex_bmct::merge_goto(
90
90
const statet::goto_statet &goto_state,
91
91
statet &state)
92
92
{
93
- const goto_programt::const_targett prev_pc= goto_state.source .pc ;
94
- const guardt prev_guard= goto_state.guard ;
93
+ const goto_programt::const_targett prev_pc = goto_state.source .pc ;
94
+ const guardt prev_guard = goto_state.guard ;
95
95
96
96
goto_symext::merge_goto (goto_state, state);
97
97
98
98
PRECONDITION (prev_pc->is_goto ());
99
- if (record_coverage &&
100
- // could the branch possibly be taken?
101
- !prev_guard. is_false () &&
102
- !state.guard .is_false () &&
103
- // branches only, no single-successor goto
104
- !prev_pc->guard .is_true ())
99
+ if (
100
+ record_coverage &&
101
+ // could the branch possibly be taken?
102
+ !prev_guard. is_false () && !state.guard .is_false () &&
103
+ // branches only, no single-successor goto
104
+ !prev_pc->guard .is_true ())
105
105
symex_coverage.covered (prev_pc, state.source .pc );
106
106
}
107
107
@@ -110,10 +110,10 @@ bool symex_bmct::should_stop_unwind(
110
110
const goto_symex_statet::call_stackt &context,
111
111
unsigned unwind)
112
112
{
113
- const irep_idt id= goto_programt::loop_id (*source.pc );
113
+ const irep_idt id = goto_programt::loop_id (*source.pc );
114
114
115
115
tvt abort_unwind_decision;
116
- unsigned this_loop_limit= std::numeric_limits<unsigned >::max ();
116
+ unsigned this_loop_limit = std::numeric_limits<unsigned >::max ();
117
117
118
118
for (auto handler : loop_unwind_handlers)
119
119
{
@@ -127,7 +127,7 @@ bool symex_bmct::should_stop_unwind(
127
127
// / --unwind options to decide:
128
128
if (abort_unwind_decision.is_unknown ())
129
129
{
130
- auto limit= unwindset.get_limit (id, source.thread_nr );
130
+ auto limit = unwindset.get_limit (id, source.thread_nr );
131
131
132
132
if (!limit.has_value ())
133
133
abort_unwind_decision = tvt (false );
@@ -142,7 +142,7 @@ bool symex_bmct::should_stop_unwind(
142
142
log .statistics () << (abort ? " Not unwinding" : " Unwinding" ) << " loop " << id
143
143
<< " iteration " << unwind;
144
144
145
- if (this_loop_limit!= std::numeric_limits<unsigned >::max ())
145
+ if (this_loop_limit != std::numeric_limits<unsigned >::max ())
146
146
log .statistics () << " (" << this_loop_limit << " max)" ;
147
147
148
148
log .statistics () << " " << source.pc ->source_location << " thread "
@@ -157,7 +157,7 @@ bool symex_bmct::get_unwind_recursion(
157
157
unsigned unwind)
158
158
{
159
159
tvt abort_unwind_decision;
160
- unsigned this_loop_limit= std::numeric_limits<unsigned >::max ();
160
+ unsigned this_loop_limit = std::numeric_limits<unsigned >::max ();
161
161
162
162
for (auto handler : recursion_unwind_handlers)
163
163
{
@@ -170,7 +170,7 @@ bool symex_bmct::get_unwind_recursion(
170
170
// / --unwind options to decide:
171
171
if (abort_unwind_decision.is_unknown ())
172
172
{
173
- auto limit= unwindset.get_limit (id, thread_nr);
173
+ auto limit = unwindset.get_limit (id, thread_nr);
174
174
175
175
if (!limit.has_value ())
176
176
abort_unwind_decision = tvt (false );
@@ -182,14 +182,14 @@ bool symex_bmct::get_unwind_recursion(
182
182
abort_unwind_decision.is_known (), " unwind decision should be taken by now" );
183
183
bool abort = abort_unwind_decision.is_true ();
184
184
185
- if (unwind> 0 || abort )
185
+ if (unwind > 0 || abort )
186
186
{
187
- const symbolt &symbol= ns.lookup (id);
187
+ const symbolt &symbol = ns.lookup (id);
188
188
189
189
log .statistics () << (abort ? " Not unwinding" : " Unwinding" ) << " recursion "
190
190
<< symbol.display_name () << " iteration " << unwind;
191
191
192
- if (this_loop_limit!= std::numeric_limits<unsigned >::max ())
192
+ if (this_loop_limit != std::numeric_limits<unsigned >::max ())
193
193
log .statistics () << " (" << this_loop_limit << " max)" ;
194
194
195
195
log .statistics () << log .eom ;
0 commit comments