Skip to content

Commit 1472cdf

Browse files
committed
Bump to cbmc-develop and make compileable [WIP]
1: there is no `bmct` so hw-cbmc uses the verifier factory 2: smt2 support is dropped for now (smt decision procedure don't have access to `propt`, have to find out how to convert properties at world-level) 3: `aigt` support now lives in trans-netlist (copied from 5.8) (strange clang-formatting in ebmc-solvers)
1 parent 2a2d3c1 commit 1472cdf

File tree

86 files changed

+2232
-1305
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+2232
-1305
lines changed

lib/cbmc

Submodule cbmc updated 6276 files

regression/ebmc/Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
default: tests.log
22

3+
include ../../lib/cbmc/src/config.inc
4+
include ../../lib/cbmc/src/common
5+
36
test:
47
@../test.pl -c ../../../src/ebmc/ebmc
58

6-
tests.log: ../test.pl ../../../src/ebmc/ebmc
9+
tests.log: ../test.pl
710
@../test.pl
811

912
show:

src/Makefile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
DIRS = ebmc hw-cbmc trans-word-level trans-netlist verilog vhdl smvlang ic3 aiger
22

3-
CPROVER_DIR = lib/cbmc/src
3+
EBMC_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
4+
CPROVER_DIR = $(EBMC_DIR)/../lib/cbmc/src
45
export CPROVER_DIR
6+
export EBMC_DIR
57

68
all: hw-cbmc.dir ebmc.dir
79

@@ -22,8 +24,8 @@ hw-cbmc.dir: trans-word-level.dir trans-netlist.dir verilog.dir \
2224
# building cbmc proper
2325
.PHONY: cprover.dir
2426
cprover.dir:
25-
$(MAKE) $(MAKEARGS) -C ../$(CPROVER_DIR) \
26-
CXXFLAGS='-D"LOCAL_IREP_IDS=<../../../src/hw_cbmc_irep_ids.h>" -Wall -pedantic -Werror -Wno-deprecated-declarations'
27+
$(MAKE) $(MAKEARGS) -C $(CPROVER_DIR) \
28+
CXXFLAGS='-D"LOCAL_IREP_IDS=<$(EBMC_DIR)/hw_cbmc_irep_ids.h>" -Wall -pedantic -Werror -Wno-deprecated-declarations -g'
2729

2830
clean: $(patsubst %, %_clean, $(SUBDIRS))
2931

src/aiger/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
SRC = aiger_language.cpp
22

3-
include ../config.inc
3+
include $(CPROVER_DIR)/config.inc
4+
include $(CPROVER_DIR)/common
45

5-
INCLUDES= -I $(CBMC)/src
6+
INCLUDES= -I $(CPROVER_DIR)
67

78
CLEANFILES =
89

src/ebmc/Makefile

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,20 @@ SRC = \
1919
show_trans.cpp \
2020
#empty line
2121

22-
OBJ+= $(CBMC)/src/util/util$(LIBEXT) \
23-
$(CBMC)/src/langapi/langapi$(LIBEXT) \
24-
$(CBMC)/src/goto-programs/system_library_symbols$(OBJEXT) \
25-
$(CBMC)/src/solvers/solvers$(LIBEXT) \
26-
$(CBMC)/src/big-int/big-int$(LIBEXT) \
22+
OBJ+= $(CPROVER_DIR)/util/util$(LIBEXT) \
23+
$(CPROVER_DIR)/langapi/langapi$(LIBEXT) \
24+
$(CPROVER_DIR)/goto-programs/system_library_symbols$(OBJEXT) \
25+
$(CPROVER_DIR)/solvers/solvers$(LIBEXT) \
26+
$(CPROVER_DIR)/big-int/big-int$(LIBEXT) \
27+
$(CPROVER_DIR)/util/c_types$(OBJEXT) \
28+
$(CPROVER_DIR)/goto-programs/xml_expr$(OBJEXT) \
2729
../trans-netlist/trans-netlist$(LIBEXT) \
2830
../trans-word-level/trans-word-level$(LIBEXT) \
2931
../smvlang/smvlang$(LIBEXT) \
3032
../aiger/aiger$(LIBEXT) \
31-
../ic3/libic3$(LIBEXT)
33+
../ic3/libic3$(LIBEXT) \
34+
../trans-netlist/aig$(OBJEXT) \
35+
../trans-netlist/aig_prop$(OBJEXT)
3236

3337
ifdef MODULE_INTERPOLATION
3438
CXXFLAGS += -DHAVE_INTERPOLATION
@@ -53,9 +57,10 @@ ifneq ($(wildcard ../vhdl/Makefile),)
5357
CXXFLAGS += -DHAVE_VHDL
5458
endif
5559

56-
include ../config.inc
60+
include $(CPROVER_DIR)/config.inc
61+
include $(CPROVER_DIR)/common
5762

58-
INCLUDES= -I .. -I $(CBMC)/src
63+
INCLUDES= -I $(CPROVER_DIR) -I ..
5964

6065
CXXFLAGS += -D'LOCAL_IREP_IDS=<hw_cbmc_irep_ids.h>'
6166

src/ebmc/bdd_engine.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Author: Daniel Kroening, [email protected]
99
#include <iostream>
1010
#include <algorithm>
1111

12-
#include <solvers/miniBDD/miniBDD.h>
12+
#include <solvers/bdd/miniBDD/miniBDD.h>
1313
#include <solvers/sat/satcheck.h>
1414

1515
#include <trans-netlist/aig_prop.h>
@@ -349,7 +349,7 @@ void bdd_enginet::compute_counterexample(
349349

350350
bmc_mapt bmc_map;
351351

352-
satcheckt solver;
352+
satcheckt solver{*message_handler};
353353
bmc_map.map_timeframes(netlist, number_of_timeframes, solver);
354354

355355
const namespacet ns(symbol_table);
@@ -372,7 +372,7 @@ void bdd_enginet::compute_counterexample(
372372

373373
case propt::resultt::P_UNSATISFIABLE:
374374
throw "SAT solver says UNSAT!";
375-
375+
case propt::resultt::P_ERROR:
376376
default:
377377
throw "unexpected result from SAT solver";
378378
}
@@ -717,9 +717,8 @@ void bdd_enginet::get_atomic_propositions(const exprt &expr)
717717

718718
assert(expr.type().id()==ID_bool);
719719

720-
aig_prop_constraintt aig_prop(netlist);
721-
aig_prop.set_message_handler(get_message_handler());
722-
720+
aig_prop_constraintt aig_prop(netlist, *message_handler);
721+
723722
const namespacet ns(symbol_table);
724723

725724
literalt l=instantiate_convert(

src/ebmc/cegar/simulate.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ bool bmc_cegart::simulate(unsigned bound)
2929
{
3030
status() << "Simulating Counterexample" << eom;
3131

32-
satcheckt satcheck;
32+
satcheckt satcheck{*message_handler};
3333
cnft &solver=satcheck;
3434

3535
unwind(bound, concrete_netlist, solver);
@@ -41,9 +41,8 @@ bool bmc_cegart::simulate(unsigned bound)
4141
case propt::resultt::P_SATISFIABLE:
4242
status() << "SAT: bug found within bound" << eom;
4343

44-
show_counterexample(
45-
properties, prop_bv, get_message_handler(), solver, bmc_map,
46-
ns, ui_message_handlert::uit::PLAIN);
44+
show_counterexample(properties, prop_bv, get_message_handler(), solver,
45+
bmc_map, ns);
4746
return true;
4847

4948
case propt::resultt::P_UNSATISFIABLE:

src/ebmc/cegar/verify.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ bool bmc_cegart::verify(unsigned bound)
2626
{
2727
status() << "Checking Abstract Model (bound=" << bound << ")" << eom;
2828

29-
satcheckt satcheck;
29+
satcheckt satcheck{*message_handler};
3030
cnft &solver=satcheck;
3131

3232
unwind(bound, abstract_netlist, solver);

src/ebmc/diatest.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ Author: Daniel Kroening, [email protected]
2424
2525
\*******************************************************************/
2626

27-
void diatest(bool efficient, unsigned no_states, unsigned state_bits)
28-
{
27+
void diatest(bool efficient, unsigned no_states, unsigned state_bits,
28+
message_handlert &message_handler) {
2929
std::cout << (efficient?"Efficient:":"Simple:") << '\n';
3030

31-
dimacs_cnft solver;
31+
dimacs_cnft solver{message_handler};
3232

3333
std::vector<bvt> states;
3434

@@ -67,13 +67,13 @@ void diatest(bool efficient, unsigned no_states, unsigned state_bits)
6767
6868
\*******************************************************************/
6969

70-
void diatest(unsigned bound, unsigned state_bits)
71-
{
70+
void diatest(unsigned bound, unsigned state_bits,
71+
message_handlert &message_handler) {
7272
unsigned no_states=bound+1;
7373

7474
std::cout << "Testing recurrence diameter computation:" << '\n';
7575
std::cout << "States: " << no_states << '\n';
7676
std::cout << "State bits: " << state_bits << '\n';
77-
diatest(0, no_states, state_bits);
78-
diatest(1, no_states, state_bits);
77+
diatest(0, no_states, state_bits, message_handler);
78+
diatest(1, no_states, state_bits, message_handler);
7979
}

0 commit comments

Comments
 (0)