File tree 4 files changed +17
-4
lines changed
4 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ class goto_checkt
55
55
retain_trivial=_options.get_bool_option (" retain-trivial" );
56
56
enable_assert_to_assume=_options.get_bool_option (" assert-to-assume" );
57
57
enable_assertions=_options.get_bool_option (" assertions" );
58
+ enable_built_in_assertions=_options.get_bool_option (" built-in-assertions" );
58
59
enable_assumptions=_options.get_bool_option (" assumptions" );
59
60
error_labels=_options.get_list_option (" error-label" );
60
61
}
@@ -125,6 +126,7 @@ class goto_checkt
125
126
bool retain_trivial;
126
127
bool enable_assert_to_assume;
127
128
bool enable_assertions;
129
+ bool enable_built_in_assertions;
128
130
bool enable_assumptions;
129
131
130
132
typedef optionst::value_listt error_labelst;
@@ -1730,9 +1732,10 @@ void goto_checkt::goto_check(goto_functiont &goto_function)
1730
1732
}
1731
1733
else if (i.is_assert ())
1732
1734
{
1733
- if (i.source_location .get_bool (" user-provided" ) &&
1734
- i.source_location .get_property_class ()!=" error label" &&
1735
- !enable_assertions)
1735
+ bool is_user_provided=i.source_location .get_bool (" user-provided" );
1736
+ if ((is_user_provided && !enable_assertions &&
1737
+ i.source_location .get_property_class ()!=" error label" ) ||
1738
+ (!is_user_provided && !enable_built_in_assertions))
1736
1739
i.type =SKIP;
1737
1740
}
1738
1741
else if (i.is_assume ())
Original file line number Diff line number Diff line change @@ -237,6 +237,12 @@ void cbmc_parse_optionst::get_command_line_options(optionst &options)
237
237
else
238
238
options.set_option (" assertions" , true );
239
239
240
+ // check built-in assertions
241
+ if (cmdline.isset (" no-built-in-assertions" ))
242
+ options.set_option (" built-in-assertions" , false );
243
+ else
244
+ options.set_option (" built-in-assertions" , true );
245
+
240
246
// use assumptions
241
247
if (cmdline.isset (" no-assumptions" ))
242
248
options.set_option (" assumptions" , false );
@@ -1148,6 +1154,7 @@ void cbmc_parse_optionst::help()
1148
1154
" Program instrumentation options:\n "
1149
1155
HELP_GOTO_CHECK
1150
1156
" --no-assertions ignore user assertions\n "
1157
+ " --no-built-in-assertions ignore assertions in built-in library\n "
1151
1158
" --no-assumptions ignore user assumptions\n "
1152
1159
" --error-label label check that label is unreachable\n "
1153
1160
" --cover CC create test-suite with coverage criterion CC\n " // NOLINT(*)
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ class optionst;
32
32
" (depth):(partial-loops)(no-unwinding-assertions)(unwinding-assertions)" \
33
33
OPT_GOTO_CHECK \
34
34
" (no-assertions)(no-assumptions)" \
35
+ " (no-built-in-assertions)" \
35
36
" (xml-ui)(xml-interface)(json-ui)" \
36
37
" (smt1)(smt2)(fpa)(cvc3)(cvc4)(boolector)(yices)(z3)(opensmt)(mathsat)" \
37
38
" (no-sat-preprocessor)" \
Original file line number Diff line number Diff line change @@ -1304,7 +1304,9 @@ void goto_convertt::do_function_call_symbol(
1304
1304
goto_programt::targett t=dest.add_instruction (ASSERT);
1305
1305
t->guard =arguments[0 ];
1306
1306
t->source_location =function.source_location ();
1307
- t->source_location .set (" user-provided" , true );
1307
+ t->source_location .set (
1308
+ " user-provided" ,
1309
+ !function.source_location ().is_built_in ());
1308
1310
t->source_location .set_property_class (ID_assertion);
1309
1311
t->source_location .set_comment (description);
1310
1312
You can’t perform that action at this time.
0 commit comments