@@ -465,6 +465,9 @@ void cbmc_parse_optionst::get_command_line_options(optionst &options)
465
465
if (cmdline.isset (" cover-function-only" ))
466
466
options.set_option (" cover-function-only" , true );
467
467
468
+ if (cmdline.isset (" assertions-as-assumptions" ))
469
+ options.set_option (" assertions-as-assumptions" , true );
470
+
468
471
if (cmdline.isset (" java-disable-mocks" ))
469
472
options.set_option (" java-disable-mocks" , true );
470
473
}
@@ -952,6 +955,20 @@ bool cbmc_parse_optionst::process_goto_program(
952
955
get_message_handler (), goto_functions);
953
956
}
954
957
958
+ if (cmdline.isset (" assertions-as-assumptions" ))
959
+ {
960
+ // turn assertions (from generic checks) into assumptions
961
+ Forall_goto_functions (f_it, goto_functions)
962
+ {
963
+ goto_programt &body=f_it->second .body ;
964
+ Forall_goto_program_instructions (i_it, body)
965
+ {
966
+ if (i_it->is_assert ())
967
+ i_it->type = goto_program_instruction_typet::ASSUME;
968
+ }
969
+ }
970
+ }
971
+
955
972
// add failed symbols
956
973
// needs to be done before pointer analysis
957
974
add_failed_symbols (symbol_table);
@@ -1166,7 +1183,8 @@ void cbmc_parse_optionst::help()
1166
1183
" --classpath dir/jar set the classpath\n "
1167
1184
" --main-class class-name set the name of the main class\n "
1168
1185
" --gen-java-test-case generate test case\n "
1169
- " --cover-function-only add coverage instrumentation only to the entry function"
1186
+ " --cover-function-only add coverage instrumentation only to the entry function"
1187
+ " --assertions-as-assumptions convert assertions from generic checks into assumptions"
1170
1188
" \n "
1171
1189
" Semantic transformations:\n "
1172
1190
" --nondet-static add nondeterministic initialization of variables with static lifetime\n "
0 commit comments