Skip to content

Commit 0d6946a

Browse files
Add --incremental-loop to CBMC
for incremental unwinding and assertion checking of a specified loop.
1 parent 3007f9a commit 0d6946a

File tree

3 files changed

+42
-1
lines changed

3 files changed

+42
-1
lines changed

regression/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ add_subdirectory(goto-instrument)
3131
add_subdirectory(cpp)
3232
add_subdirectory(cbmc-concurrency)
3333
add_subdirectory(cbmc-cover)
34+
add_subdirectory(cbmc-incr-oneloop)
3435
add_subdirectory(goto-instrument-typedef)
3536
add_subdirectory(smt2_solver)
3637
add_subdirectory(smt2_strings)

regression/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ DIRS = cbmc \
99
cpp \
1010
cbmc-concurrency \
1111
cbmc-cover \
12+
cbmc-incr-oneloop \
1213
goto-instrument-typedef \
1314
smt2_solver \
1415
smt2_strings \

src/cbmc/cbmc_parse_options.cpp

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ Author: Daniel Kroening, [email protected]
4141
#include <goto-checker/multi_path_symex_checker.h>
4242
#include <goto-checker/multi_path_symex_only_checker.h>
4343
#include <goto-checker/properties.h>
44+
#include <goto-checker/single_loop_incremental_symex_checker.h>
4445
#include <goto-checker/single_path_symex_checker.h>
4546
#include <goto-checker/single_path_symex_only_checker.h>
4647
#include <goto-checker/stop_on_fail_verifier.h>
@@ -329,6 +330,29 @@ void cbmc_parse_optionst::get_command_line_options(optionst &options)
329330
"max-node-refinement",
330331
cmdline.get_value("max-node-refinement"));
331332

333+
if(cmdline.isset("incremental-loop"))
334+
{
335+
options.set_option(
336+
"incremental-loop", cmdline.get_value("incremental-loop"));
337+
options.set_option("refine", true);
338+
options.set_option("refine-arrays", true);
339+
340+
if(cmdline.isset("unwind-min"))
341+
options.set_option("unwind-min", cmdline.get_value("unwind-min"));
342+
343+
if(cmdline.isset("unwind-max"))
344+
options.set_option("unwind-max", cmdline.get_value("unwind-max"));
345+
346+
if(cmdline.isset("ignore-properties-before-unwind-min"))
347+
options.set_option("ignore-properties-before-unwind-min", true);
348+
349+
if(cmdline.isset("paths"))
350+
{
351+
error() << "--paths not supported with --incremental-loop" << eom;
352+
exit(CPROVER_EXIT_USAGE_ERROR);
353+
}
354+
}
355+
332356
// SMT Options
333357

334358
if(cmdline.isset("smt1"))
@@ -609,7 +633,22 @@ int cbmc_parse_optionst::doit()
609633

610634
std::unique_ptr<goto_verifiert> verifier = nullptr;
611635

612-
if(
636+
if(options.is_set("incremental-loop"))
637+
{
638+
if(options.get_bool_option("stop-on-fail"))
639+
{
640+
verifier = util_make_unique<
641+
stop_on_fail_verifiert<single_loop_incremental_symex_checkert>>(
642+
options, ui_message_handler, goto_model);
643+
}
644+
else
645+
{
646+
verifier = util_make_unique<all_properties_verifier_with_trace_storaget<
647+
single_loop_incremental_symex_checkert>>(
648+
options, ui_message_handler, goto_model);
649+
}
650+
}
651+
else if(
613652
options.get_bool_option("stop-on-fail") && options.get_bool_option("paths"))
614653
{
615654
verifier =

0 commit comments

Comments
 (0)