File tree 5 files changed +16
-3
lines changed 5 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -90,6 +90,8 @@ class bmct:public safety_checkert
90
90
symex.constant_propagation =options.get_bool_option (" propagation" );
91
91
symex.record_coverage =
92
92
!options.get_option (" symex-coverage-report" ).empty ();
93
+ symex.self_loops_to_assumptions =
94
+ options.get_bool_option (" self-loops-to-assumptions" );
93
95
}
94
96
95
97
virtual resultt run (const goto_functionst &goto_functions)
Original file line number Diff line number Diff line change @@ -187,6 +187,12 @@ void cbmc_parse_optionst::get_command_line_options(optionst &options)
187
187
else
188
188
options.set_option (" propagation" , true );
189
189
190
+ // transform self loops to assumptions
191
+ if (cmdline.isset (" no-self-loops-to-assumptions" ))
192
+ options.set_option (" self-loops-to-assumptions" , false );
193
+ else
194
+ options.set_option (" self-loops-to-assumptions" , true );
195
+
190
196
// all checks supported by goto_check
191
197
PARSE_OPTIONS_GOTO_CHECK (cmdline, options);
192
198
Original file line number Diff line number Diff line change @@ -71,6 +71,8 @@ class optionst;
71
71
" (arrays-uf-always)(arrays-uf-never)" \
72
72
" (string-abstraction)(no-arch)(arch):" \
73
73
" (round-to-nearest)(round-to-plus-inf)(round-to-minus-inf)(round-to-zero)" \
74
+ " (graphml-witness):" \
75
+ " (no-self-loops-to-assumptions)" \
74
76
" (localize-faults)(localize-faults-method):" \
75
77
OPT_GOTO_TRACE \
76
78
" (claim):(show-claims)(fixedbv)(floatbv)(all-claims)(all-properties)" // legacy, and will eventually disappear // NOLINT(whitespace/line_length)
Original file line number Diff line number Diff line change @@ -74,6 +74,7 @@ class goto_symext
74
74
: total_vccs(0 ),
75
75
remaining_vccs (0 ),
76
76
constant_propagation(true ),
77
+ self_loops_to_assumptions(true ),
77
78
language_mode(),
78
79
outer_symbol_table(outer_symbol_table),
79
80
ns(outer_symbol_table),
@@ -210,6 +211,7 @@ class goto_symext
210
211
unsigned total_vccs, remaining_vccs;
211
212
212
213
bool constant_propagation;
214
+ bool self_loops_to_assumptions;
213
215
214
216
optionst options;
215
217
Original file line number Diff line number Diff line change @@ -58,9 +58,10 @@ void goto_symext::symex_goto(statet &state)
58
58
if (!forward) // backwards?
59
59
{
60
60
// is it label: goto label; or while(cond); - popular in SV-COMP
61
- if (goto_target==state.source .pc ||
62
- (instruction.incoming_edges .size ()==1 &&
63
- *instruction.incoming_edges .begin ()==goto_target))
61
+ if (self_loops_to_assumptions &&
62
+ (goto_target==state.source .pc ||
63
+ (instruction.incoming_edges .size ()==1 &&
64
+ *instruction.incoming_edges .begin ()==goto_target)))
64
65
{
65
66
// generate assume(false) or a suitable negation if this
66
67
// instruction is a conditional goto
You can’t perform that action at this time.
0 commit comments