Skip to content

Commit 082871a

Browse files
Factor out bmct building blocks int bmc_util
This is an intermediate step in order to reuse the building blocks in the new implementation of bmct. The old implementation is functional until it can be replaced by the new one.
1 parent 5af9fed commit 082871a

File tree

11 files changed

+390
-276
lines changed

11 files changed

+390
-276
lines changed

jbmc/src/jbmc/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ OBJ += ../$(CPROVER_DIR)/src/ansi-c/ansi-c$(LIBEXT) \
4040
../$(CPROVER_DIR)/src/json/json$(LIBEXT) \
4141
../$(CPROVER_DIR)/src/cbmc/all_properties$(OBJEXT) \
4242
../$(CPROVER_DIR)/src/cbmc/bmc$(OBJEXT) \
43+
../$(CPROVER_DIR)/src/cbmc/bmc_util$(OBJEXT) \
4344
../$(CPROVER_DIR)/src/cbmc/bmc_cover$(OBJEXT) \
4445
../$(CPROVER_DIR)/src/cbmc/counterexample_beautification$(OBJEXT) \
4546
../$(CPROVER_DIR)/src/cbmc/fault_localization$(OBJEXT) \

jbmc/unit/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ java-testing-utils-clean:
8484
BMC_DEPS =$(CPROVER_DIR)/src/cbmc/all_properties$(OBJEXT) \
8585
$(CPROVER_DIR)/src/cbmc/bmc$(OBJEXT) \
8686
$(CPROVER_DIR)/src/cbmc/bmc_cover$(OBJEXT) \
87+
$(CPROVER_DIR)/src/cbmc/bmc_util$(OBJEXT) \
8788
$(CPROVER_DIR)/src/cbmc/cbmc_languages$(OBJEXT) \
8889
$(CPROVER_DIR)/src/cbmc/cbmc_parse_options$(OBJEXT) \
8990
$(CPROVER_DIR)/src/cbmc/counterexample_beautification$(OBJEXT) \

src/cbmc/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
SRC = all_properties.cpp \
22
bmc.cpp \
33
bmc_cover.cpp \
4+
bmc_util.cpp \
45
cbmc_languages.cpp \
56
cbmc_main.cpp \
67
cbmc_parse_options.cpp \

src/cbmc/all_properties.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ Author: Daniel Kroening, [email protected]
1414
#include <algorithm>
1515
#include <chrono>
1616

17+
#include <cbmc/bmc_util.h>
18+
1719
#include <util/xml.h>
1820
#include <util/json.h>
1921

@@ -55,7 +57,9 @@ safety_checkert::resultt bmc_all_propertiest::operator()()
5557

5658
auto solver_start=std::chrono::steady_clock::now();
5759

58-
bmc.do_conversion();
60+
convert_symex_target_equation(
61+
bmc.equation, bmc.prop_conv, get_message_handler());
62+
bmc.freeze_program_variables();
5963

6064
// Collect _all_ goals in `goal_map'.
6165
// This maps property IDs to 'goalt'
@@ -144,9 +148,9 @@ safety_checkert::resultt bmc_all_propertiest::operator()()
144148
bool safe=(cover_goals.number_covered()==0);
145149

146150
if(safe)
147-
bmc.report_success(); // legacy, might go away
151+
report_success(bmc.ui_message_handler); // legacy, might go away
148152
else
149-
bmc.report_failure(); // legacy, might go away
153+
report_failure(bmc.ui_message_handler); // legacy, might go away
150154

151155
return safe?safety_checkert::resultt::SAFE:safety_checkert::resultt::UNSAFE;
152156
}

0 commit comments

Comments
 (0)