Skip to content

Commit f94473b

Browse files
Use goto verifier for --paths in JBMC
We can now use single_path_symex_checkert instead of bmct.
1 parent 936da23 commit f94473b

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
@@ -66,6 +66,8 @@ Author: Daniel Kroening, [email protected]
6666
#include <java_bytecode/java_enum_static_init_unwind_handler.h>
6767
#include <java_bytecode/java_multi_path_symex_checker.h>
6868
#include <java_bytecode/java_multi_path_symex_only_checker.h>
69+
#include <java_bytecode/java_single_path_symex_checker.h>
70+
#include <java_bytecode/java_single_path_symex_only_checker.h>
6971
#include <java_bytecode/remove_exceptions.h>
7072
#include <java_bytecode/remove_instanceof.h>
7173
#include <java_bytecode/remove_java_new.h>
@@ -559,46 +561,83 @@ int jbmc_parse_optionst::doit()
559561
options.get_bool_option("program-only") ||
560562
options.get_bool_option("show-vcc"))
561563
{
562-
if(!options.get_bool_option("paths"))
564+
std::unique_ptr<goto_verifiert> verifier;
565+
if(options.get_bool_option("paths"))
563566
{
564-
all_properties_verifiert<java_multi_path_symex_only_checkert> verifier(
567+
verifier = util_make_unique<
568+
all_properties_verifiert<java_single_path_symex_only_checkert>>(
569+
options, ui_message_handler, goto_model);
570+
}
571+
else
572+
{
573+
verifier = util_make_unique<
574+
all_properties_verifiert<java_multi_path_symex_only_checkert>>(
565575
options, ui_message_handler, goto_model);
566-
(void)verifier();
567-
return CPROVER_EXIT_SUCCESS;
568576
}
577+
578+
(void)(*verifier)();
579+
return CPROVER_EXIT_SUCCESS;
569580
}
570581

571582
if(
572583
options.get_bool_option("dimacs") ||
573584
!options.get_option("outfile").empty())
574585
{
575-
if(!options.get_bool_option("paths"))
586+
std::unique_ptr<goto_verifiert> verifier;
587+
if(options.get_bool_option("paths"))
576588
{
577-
stop_on_fail_verifiert<multi_path_symex_checkert> verifier(
589+
verifier = util_make_unique<
590+
stop_on_fail_verifiert<java_single_path_symex_checkert>>(
578591
options, ui_message_handler, goto_model);
579-
(void)verifier();
580-
return CPROVER_EXIT_SUCCESS;
581592
}
593+
else
594+
{
595+
verifier = util_make_unique<
596+
stop_on_fail_verifiert<java_multi_path_symex_checkert>>(
597+
options, ui_message_handler, goto_model);
598+
}
599+
600+
(void)(*verifier)();
601+
return CPROVER_EXIT_SUCCESS;
582602
}
583603

584604
std::unique_ptr<goto_verifiert> verifier = nullptr;
585605

586606
if(
587-
!options.get_bool_option("paths") && !options.is_set("cover") &&
588-
!options.get_bool_option("dimacs") &&
607+
!options.is_set("cover") && !options.get_bool_option("dimacs") &&
589608
options.get_option("outfile").empty())
590609
{
591610
if(options.get_bool_option("stop-on-fail"))
592611
{
593-
verifier = util_make_unique<
594-
stop_on_fail_verifiert<java_multi_path_symex_checkert>>(
595-
options, ui_message_handler, goto_model);
612+
if(options.get_bool_option("paths"))
613+
{
614+
verifier = util_make_unique<
615+
stop_on_fail_verifiert<java_single_path_symex_checkert>>(
616+
options, ui_message_handler, goto_model);
617+
}
618+
else
619+
{
620+
verifier = util_make_unique<
621+
stop_on_fail_verifiert<java_multi_path_symex_checkert>>(
622+
options, ui_message_handler, goto_model);
623+
}
596624
}
597625
else
598626
{
599-
verifier = util_make_unique<all_properties_verifier_with_trace_storaget<
600-
java_multi_path_symex_checkert>>(
601-
options, ui_message_handler, goto_model);
627+
if(options.get_bool_option("paths"))
628+
{
629+
verifier =
630+
util_make_unique<all_properties_verifier_with_trace_storaget<
631+
java_single_path_symex_checkert>>(
632+
options, ui_message_handler, goto_model);
633+
}
634+
else
635+
{
636+
verifier =
637+
util_make_unique<all_properties_verifier_with_trace_storaget<
638+
java_multi_path_symex_checkert>>(
639+
options, ui_message_handler, goto_model);
640+
}
602641
}
603642
}
604643

0 commit comments

Comments
 (0)