Skip to content

Commit b59a98e

Browse files
Use goto verifier for --paths in JBMC
1 parent 6f451b8 commit b59a98e

File tree

1 file changed

+55
-16
lines changed

1 file changed

+55
-16
lines changed

jbmc/src/jbmc/jbmc_parse_options.cpp

Lines changed: 55 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ Author: Daniel Kroening, [email protected]
6767
#include <java_bytecode/java_enum_static_init_unwind_handler.h>
6868
#include <java_bytecode/java_multi_path_symex_checker.h>
6969
#include <java_bytecode/java_multi_path_symex_only_checker.h>
70+
#include <java_bytecode/java_single_path_symex_checker.h>
71+
#include <java_bytecode/java_single_path_symex_only_checker.h>
7072
#include <java_bytecode/remove_exceptions.h>
7173
#include <java_bytecode/remove_instanceof.h>
7274
#include <java_bytecode/remove_java_new.h>
@@ -574,46 +576,83 @@ int jbmc_parse_optionst::doit()
574576
options.get_bool_option("program-only") ||
575577
options.get_bool_option("show-vcc"))
576578
{
577-
if(!options.get_bool_option("paths"))
579+
std::unique_ptr<goto_verifiert> verifier;
580+
if(options.get_bool_option("paths"))
578581
{
579-
all_properties_verifiert<java_multi_path_symex_only_checkert> verifier(
582+
verifier = util_make_unique<
583+
all_properties_verifiert<java_single_path_symex_only_checkert>>(
584+
options, ui_message_handler, goto_model);
585+
}
586+
else
587+
{
588+
verifier = util_make_unique<
589+
all_properties_verifiert<java_multi_path_symex_only_checkert>>(
580590
options, ui_message_handler, goto_model);
581-
(void)verifier();
582-
return CPROVER_EXIT_SUCCESS;
583591
}
592+
593+
(void)(*verifier)();
594+
return CPROVER_EXIT_SUCCESS;
584595
}
585596

586597
if(
587598
options.get_bool_option("dimacs") ||
588599
!options.get_option("outfile").empty())
589600
{
590-
if(!options.get_bool_option("paths"))
601+
std::unique_ptr<goto_verifiert> verifier;
602+
if(options.get_bool_option("paths"))
591603
{
592-
stop_on_fail_verifiert<multi_path_symex_checkert> verifier(
604+
verifier = util_make_unique<
605+
stop_on_fail_verifiert<java_single_path_symex_checkert>>(
593606
options, ui_message_handler, goto_model);
594-
(void)verifier();
595-
return CPROVER_EXIT_SUCCESS;
596607
}
608+
else
609+
{
610+
verifier = util_make_unique<
611+
stop_on_fail_verifiert<java_multi_path_symex_checkert>>(
612+
options, ui_message_handler, goto_model);
613+
}
614+
615+
(void)(*verifier)();
616+
return CPROVER_EXIT_SUCCESS;
597617
}
598618

599619
std::unique_ptr<goto_verifiert> verifier = nullptr;
600620

601621
if(
602-
!options.get_bool_option("paths") && !options.is_set("cover") &&
603-
!options.get_bool_option("dimacs") &&
622+
!options.is_set("cover") && !options.get_bool_option("dimacs") &&
604623
options.get_option("outfile").empty())
605624
{
606625
if(options.get_bool_option("stop-on-fail"))
607626
{
608-
verifier = util_make_unique<
609-
stop_on_fail_verifiert<java_multi_path_symex_checkert>>(
610-
options, ui_message_handler, goto_model);
627+
if(options.get_bool_option("paths"))
628+
{
629+
verifier = util_make_unique<
630+
stop_on_fail_verifiert<java_single_path_symex_checkert>>(
631+
options, ui_message_handler, goto_model);
632+
}
633+
else
634+
{
635+
verifier = util_make_unique<
636+
stop_on_fail_verifiert<java_multi_path_symex_checkert>>(
637+
options, ui_message_handler, goto_model);
638+
}
611639
}
612640
else
613641
{
614-
verifier = util_make_unique<all_properties_verifier_with_trace_storaget<
615-
java_multi_path_symex_checkert>>(
616-
options, ui_message_handler, goto_model);
642+
if(options.get_bool_option("paths"))
643+
{
644+
verifier =
645+
util_make_unique<all_properties_verifier_with_trace_storaget<
646+
java_single_path_symex_checkert>>(
647+
options, ui_message_handler, goto_model);
648+
}
649+
else
650+
{
651+
verifier =
652+
util_make_unique<all_properties_verifier_with_trace_storaget<
653+
java_multi_path_symex_checkert>>(
654+
options, ui_message_handler, goto_model);
655+
}
617656
}
618657
}
619658

0 commit comments

Comments
 (0)