Skip to content

Commit c77f4f3

Browse files
Use goto verifier for --paths in CBMC
We can now use single_path_symex_checkert instead of bmct.
1 parent 0acbd39 commit c77f4f3

File tree

1 file changed

+39
-13
lines changed

1 file changed

+39
-13
lines changed

src/cbmc/cbmc_parse_options.cpp

Lines changed: 39 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ Author: Daniel Kroening, [email protected]
4040
#include <goto-checker/multi_path_symex_checker.h>
4141
#include <goto-checker/multi_path_symex_only_checker.h>
4242
#include <goto-checker/properties.h>
43+
#include <goto-checker/single_path_symex_checker.h>
4344
#include <goto-checker/single_path_symex_only_checker.h>
4445
#include <goto-checker/stop_on_fail_verifier.h>
4546

@@ -581,13 +582,22 @@ int cbmc_parse_optionst::doit()
581582
if(
582583
options.get_bool_option("dimacs") || !options.get_option("outfile").empty())
583584
{
584-
if(!options.get_bool_option("paths"))
585+
std::unique_ptr<goto_verifiert> verifier;
586+
if(options.get_bool_option("paths"))
585587
{
586-
stop_on_fail_verifiert<multi_path_symex_checkert> verifier(
587-
options, ui_message_handler, goto_model);
588-
(void)verifier();
589-
return CPROVER_EXIT_SUCCESS;
588+
verifier =
589+
util_make_unique<stop_on_fail_verifiert<single_path_symex_checkert>>(
590+
options, ui_message_handler, goto_model);
591+
}
592+
else
593+
{
594+
verifier =
595+
util_make_unique<stop_on_fail_verifiert<multi_path_symex_checkert>>(
596+
options, ui_message_handler, goto_model);
590597
}
598+
599+
(void)(*verifier)();
600+
return CPROVER_EXIT_SUCCESS;
591601
}
592602

593603
if(options.is_set("cover"))
@@ -606,20 +616,36 @@ int cbmc_parse_optionst::doit()
606616
std::unique_ptr<goto_verifiert> verifier = nullptr;
607617

608618
if(
609-
!options.get_bool_option("paths") && !options.is_set("cover") &&
610-
!options.get_bool_option("dimacs") && options.get_option("outfile").empty())
619+
!options.is_set("cover") && !options.get_bool_option("dimacs") &&
620+
options.get_option("outfile").empty())
611621
{
612622
if(options.get_bool_option("stop-on-fail"))
613623
{
614-
verifier =
615-
util_make_unique<stop_on_fail_verifiert<multi_path_symex_checkert>>(
616-
options, ui_message_handler, goto_model);
624+
if(options.get_bool_option("paths"))
625+
{
626+
verifier =
627+
util_make_unique<stop_on_fail_verifiert<single_path_symex_checkert>>(
628+
options, ui_message_handler, goto_model);
629+
}
630+
else
631+
{
632+
verifier =
633+
util_make_unique<stop_on_fail_verifiert<multi_path_symex_checkert>>(
634+
options, ui_message_handler, goto_model);
635+
}
617636
}
618637
else
619638
{
620-
verifier = util_make_unique<
621-
all_properties_verifier_with_trace_storaget<multi_path_symex_checkert>>(
622-
options, ui_message_handler, goto_model);
639+
if(options.get_bool_option("paths"))
640+
{
641+
verifier = util_make_unique<all_properties_verifier_with_trace_storaget<
642+
single_path_symex_checkert>>(options, ui_message_handler, goto_model);
643+
}
644+
else
645+
{
646+
verifier = util_make_unique<all_properties_verifier_with_trace_storaget<
647+
multi_path_symex_checkert>>(options, ui_message_handler, goto_model);
648+
}
623649
}
624650
}
625651

0 commit comments

Comments
 (0)