Skip to content

Commit 7cc920f

Browse files
Symex-driven lazy loading uses goto-checker
goes now through goto-checker classes instead of bmct/all_propertiest.
1 parent 5ca02a6 commit 7cc920f

File tree

3 files changed

+19
-42
lines changed

3 files changed

+19
-42
lines changed

jbmc/src/jbmc/jbmc_parse_options.cpp

Lines changed: 13 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -514,22 +514,6 @@ int jbmc_parse_optionst::doit()
514514
return 0;
515515
}
516516

517-
std::function<void(bmct &, const symbol_tablet &)> configure_bmc = nullptr;
518-
if(options.get_bool_option("java-unwind-enum-static"))
519-
{
520-
configure_bmc =
521-
[](bmct &bmc, const symbol_tablet &symbol_table) {
522-
bmc.add_loop_unwind_handler([&symbol_table](
523-
const call_stackt &context,
524-
unsigned loop_number,
525-
unsigned unwind,
526-
unsigned &max_unwind) {
527-
return java_enum_static_init_unwind_handler(
528-
context, loop_number, unwind, max_unwind, symbol_table);
529-
});
530-
};
531-
}
532-
533517
object_factory_params.set(options);
534518

535519
stub_objects_are_not_null =
@@ -557,11 +541,15 @@ int jbmc_parse_optionst::doit()
557541
if(get_goto_program_ret != -1)
558542
return get_goto_program_ret;
559543

560-
if(!options.get_bool_option("symex-driven-lazy-loading"))
561544
{
562545
if(
563546
options.get_bool_option("program-only") ||
564-
options.get_bool_option("show-vcc"))
547+
options.get_bool_option("show-vcc") ||
548+
(options.get_bool_option("symex-driven-lazy-loading") &&
549+
(cmdline.isset("show-symbol-table") || cmdline.isset("list-symbols") ||
550+
cmdline.isset("show-goto-functions") ||
551+
cmdline.isset("list-goto-functions") ||
552+
cmdline.isset("show-properties") || cmdline.isset("show-loops"))))
565553
{
566554
if(options.get_bool_option("paths"))
567555
{
@@ -576,6 +564,13 @@ int jbmc_parse_optionst::doit()
576564
(void)verifier();
577565
}
578566

567+
if(options.get_bool_option("symex-driven-lazy-loading"))
568+
{
569+
// We can only output these after goto-symex has run.
570+
(void)show_loaded_symbols(*goto_model_ptr);
571+
(void)show_loaded_functions(*goto_model_ptr);
572+
}
573+
579574
return CPROVER_EXIT_SUCCESS;
580575
}
581576

@@ -662,30 +657,6 @@ int jbmc_parse_optionst::doit()
662657
verifier->report();
663658
return result_to_exit_code(result);
664659
}
665-
else
666-
{
667-
lazy_goto_modelt &lazy_goto_model =
668-
dynamic_cast<lazy_goto_modelt &>(*goto_model_ptr);
669-
670-
// Provide show-goto-functions and similar dump functions after symex
671-
// executes. If --paths is active, these dump routines run after every
672-
// paths iteration. Its return value indicates that if we ran any dump
673-
// function, then we should skip the actual solver phase.
674-
auto callback_after_symex = [this, &lazy_goto_model]() {
675-
if(show_loaded_symbols(lazy_goto_model))
676-
return true;
677-
return show_loaded_functions(lazy_goto_model);
678-
};
679-
680-
// The `configure_bmc` callback passed will enable enum-unwind-static if
681-
// applicable.
682-
return bmct::do_language_agnostic_bmc(
683-
options,
684-
lazy_goto_model,
685-
ui_message_handler,
686-
configure_bmc,
687-
callback_after_symex);
688-
}
689660
}
690661

691662
int jbmc_parse_optionst::get_goto_program(

src/goto-checker/multi_path_symex_only_checker.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ void multi_path_symex_only_checkert::update_properties(
7575
propertiest &properties,
7676
std::unordered_set<irep_idt> &updated_properties)
7777
{
78+
if(options.get_bool_option("symex-driven-lazy-loading"))
79+
update_properties_from_goto_model(properties, goto_model);
80+
7881
update_properties_status_from_symex_target_equation(
7982
properties, updated_properties, equation);
8083
// Since we will not symex any further we can decide the status

src/goto-checker/single_path_symex_only_checker.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,9 @@ void single_path_symex_only_checkert::update_properties(
143143
std::unordered_set<irep_idt> &updated_properties,
144144
const symex_target_equationt &equation)
145145
{
146+
if(options.get_bool_option("symex-driven-lazy-loading"))
147+
update_properties_from_goto_model(properties, goto_model);
148+
146149
update_properties_status_from_symex_target_equation(
147150
properties, updated_properties, equation);
148151
}

0 commit comments

Comments
 (0)