Skip to content

Commit 4aca32d

Browse files
Use goto verifier for --paths in CBMC
1 parent c5734a2 commit 4aca32d

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

@@ -571,32 +572,57 @@ int cbmc_parse_optionst::doit()
571572
if(
572573
options.get_bool_option("dimacs") || !options.get_option("outfile").empty())
573574
{
574-
if(!options.get_bool_option("paths"))
575+
std::unique_ptr<goto_verifiert> verifier;
576+
if(options.get_bool_option("paths"))
575577
{
576-
stop_on_fail_verifiert<multi_path_symex_checkert> verifier(
577-
options, ui_message_handler, goto_model);
578-
(void)verifier();
579-
return CPROVER_EXIT_SUCCESS;
578+
verifier =
579+
util_make_unique<stop_on_fail_verifiert<single_path_symex_checkert>>(
580+
options, ui_message_handler, goto_model);
581+
}
582+
else
583+
{
584+
verifier =
585+
util_make_unique<stop_on_fail_verifiert<multi_path_symex_checkert>>(
586+
options, ui_message_handler, goto_model);
580587
}
588+
589+
(void)(*verifier)();
590+
return CPROVER_EXIT_SUCCESS;
581591
}
582592

583593
std::unique_ptr<goto_verifiert> verifier = nullptr;
584594

585595
if(
586-
!options.get_bool_option("paths") && !options.is_set("cover") &&
587-
!options.get_bool_option("dimacs") && options.get_option("outfile").empty())
596+
!options.is_set("cover") && !options.get_bool_option("dimacs") &&
597+
options.get_option("outfile").empty())
588598
{
589599
if(options.get_bool_option("stop-on-fail"))
590600
{
591-
verifier =
592-
util_make_unique<stop_on_fail_verifiert<multi_path_symex_checkert>>(
593-
options, ui_message_handler, goto_model);
601+
if(options.get_bool_option("paths"))
602+
{
603+
verifier =
604+
util_make_unique<stop_on_fail_verifiert<single_path_symex_checkert>>(
605+
options, ui_message_handler, goto_model);
606+
}
607+
else
608+
{
609+
verifier =
610+
util_make_unique<stop_on_fail_verifiert<multi_path_symex_checkert>>(
611+
options, ui_message_handler, goto_model);
612+
}
594613
}
595614
else
596615
{
597-
verifier = util_make_unique<
598-
all_properties_verifier_with_trace_storaget<multi_path_symex_checkert>>(
599-
options, ui_message_handler, goto_model);
616+
if(options.get_bool_option("paths"))
617+
{
618+
verifier = util_make_unique<all_properties_verifier_with_trace_storaget<
619+
single_path_symex_checkert>>(options, ui_message_handler, goto_model);
620+
}
621+
else
622+
{
623+
verifier = util_make_unique<all_properties_verifier_with_trace_storaget<
624+
multi_path_symex_checkert>>(options, ui_message_handler, goto_model);
625+
}
600626
}
601627
}
602628

0 commit comments

Comments
 (0)