Skip to content

Commit 2c81dc2

Browse files
Use goto verifier for --paths in CBMC
1 parent 4f8d146 commit 2c81dc2

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
@@ -38,6 +38,7 @@ Author: Daniel Kroening, [email protected]
3838
#include <goto-checker/multi_path_symex_checker.h>
3939
#include <goto-checker/multi_path_symex_only_checker.h>
4040
#include <goto-checker/properties.h>
41+
#include <goto-checker/single_path_symex_checker.h>
4142
#include <goto-checker/single_path_symex_only_checker.h>
4243
#include <goto-checker/stop_on_fail_verifier.h>
4344

@@ -573,13 +574,22 @@ int cbmc_parse_optionst::doit()
573574
if(
574575
options.get_bool_option("dimacs") || !options.get_option("outfile").empty())
575576
{
576-
if(!options.get_bool_option("paths"))
577+
std::unique_ptr<goto_verifiert> verifier;
578+
if(options.get_bool_option("paths"))
577579
{
578-
stop_on_fail_verifiert<multi_path_symex_checkert> verifier(
579-
options, ui_message_handler, goto_model);
580-
(void)verifier();
581-
return CPROVER_EXIT_SUCCESS;
580+
verifier =
581+
util_make_unique<stop_on_fail_verifiert<single_path_symex_checkert>>(
582+
options, ui_message_handler, goto_model);
583+
}
584+
else
585+
{
586+
verifier =
587+
util_make_unique<stop_on_fail_verifiert<multi_path_symex_checkert>>(
588+
options, ui_message_handler, goto_model);
582589
}
590+
591+
(void)(*verifier)();
592+
return CPROVER_EXIT_SUCCESS;
583593
}
584594

585595
if(options.is_set("cover"))
@@ -598,20 +608,36 @@ int cbmc_parse_optionst::doit()
598608
std::unique_ptr<goto_verifiert> verifier = nullptr;
599609

600610
if(
601-
!options.get_bool_option("paths") && !options.is_set("cover") &&
602-
!options.get_bool_option("dimacs") && options.get_option("outfile").empty())
611+
!options.is_set("cover") && !options.get_bool_option("dimacs") &&
612+
options.get_option("outfile").empty())
603613
{
604614
if(options.get_bool_option("stop-on-fail"))
605615
{
606-
verifier =
607-
util_make_unique<stop_on_fail_verifiert<multi_path_symex_checkert>>(
608-
options, ui_message_handler, goto_model);
616+
if(options.get_bool_option("paths"))
617+
{
618+
verifier =
619+
util_make_unique<stop_on_fail_verifiert<single_path_symex_checkert>>(
620+
options, ui_message_handler, goto_model);
621+
}
622+
else
623+
{
624+
verifier =
625+
util_make_unique<stop_on_fail_verifiert<multi_path_symex_checkert>>(
626+
options, ui_message_handler, goto_model);
627+
}
609628
}
610629
else
611630
{
612-
verifier = util_make_unique<
613-
all_properties_verifier_with_trace_storaget<multi_path_symex_checkert>>(
614-
options, ui_message_handler, goto_model);
631+
if(options.get_bool_option("paths"))
632+
{
633+
verifier = util_make_unique<all_properties_verifier_with_trace_storaget<
634+
single_path_symex_checkert>>(options, ui_message_handler, goto_model);
635+
}
636+
else
637+
{
638+
verifier = util_make_unique<all_properties_verifier_with_trace_storaget<
639+
multi_path_symex_checkert>>(options, ui_message_handler, goto_model);
640+
}
615641
}
616642
}
617643

0 commit comments

Comments
 (0)