Skip to content

Commit 9d8f0af

Browse files
authored
Merge pull request #804 from diffblue/cadical
add cadical solver option
2 parents e7fb61e + 007d669 commit 9d8f0af

File tree

4 files changed

+31
-8
lines changed

4 files changed

+31
-8
lines changed

.github/workflows/pull-request-checks.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ jobs:
3838
echo "CCACHE_DIR=$PWD/.ccache" >> $GITHUB_ENV
3939
- name: Zero ccache stats and limit in size
4040
run: ccache -z --max-size=500M
41-
- name: Get minisat
41+
- name: Get cadical and minisat
4242
run: |
43-
make -C lib/cbmc/src minisat2-download
43+
make -C lib/cbmc/src cadical-download minisat2-download
4444
- name: Build with make
45-
run: make -C src -j4 CXX="ccache g++"
45+
run: make -C src -j4 CXX="ccache g++" MINISAT2=../../minisat-2.2.1 CADICAL=../../cadical
4646
- name: Run unit tests
4747
run: make -C unit -j4 CXX="ccache g++"
4848
- name: Run the ebmc tests with SAT

CHANGELOG

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# EBMC 5.4
2+
3+
* BMC: Cadical support with --cadical
4+
15
# EBMC 5.3
26

37
* SystemVerilog: fix for nets implicitly declared for port connections

src/ebmc/ebmc_parse_options.h

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ class ebmc_parse_optionst:public parse_options_baset
4242
"(interpolation-word)(interpolator):(bdd)"
4343
"(ranking-function):"
4444
"(smt2)(bitwuzla)(boolector)(cvc3)(cvc4)(cvc5)(mathsat)(yices)(z3)"
45+
"(minisat)(cadical)"
4546
"(aig)(stop-induction)(stop-minimize)(start):(coverage)(naive)"
4647
"(compute-ct)(dot-netlist)(smv-netlist)(vcd):"
4748
"(random-traces)(trace-steps):(random-seed):(traces):"

src/ebmc/ebmc_solver_factory.cpp

+23-5
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ Author: Daniel Kroening, [email protected]
1313
#include <solvers/flattening/boolbv.h>
1414
#include <solvers/prop/prop.h>
1515
#include <solvers/sat/satcheck.h>
16+
#include <solvers/sat/satcheck_cadical.h>
17+
#include <solvers/sat/satcheck_minisat2.h>
1618
#include <solvers/smt2/smt2_dec.h>
1719

1820
#include "ebmc_error.h"
@@ -136,17 +138,33 @@ ebmc_solver_factoryt ebmc_solver_factory(const cmdlinet &cmdline)
136138
else
137139
{
138140
// the 'default' solver
139-
return [](const namespacet &ns, message_handlert &message_handler)
141+
return [&cmdline](const namespacet &ns, message_handlert &message_handler)
140142
{
141-
auto prop = std::unique_ptr<propt>(new satcheckt{message_handler});
143+
std::unique_ptr<propt> sat_solver;
144+
145+
if(cmdline.isset("cadical"))
146+
{
147+
#ifdef SATCHECK_CADICAL
148+
sat_solver =
149+
std::unique_ptr<propt>(new satcheck_cadicalt{message_handler});
150+
#else
151+
throw ebmc_errort() << "support for Cadical not configured";
152+
#endif
153+
}
154+
else
155+
{
156+
sat_solver = std::unique_ptr<propt>(
157+
new satcheck_minisat_simplifiert{message_handler});
158+
}
142159

143160
messaget message(message_handler);
144-
message.status() << "Using " << prop->solver_text() << messaget::eom;
161+
message.status() << "Using " << sat_solver->solver_text()
162+
<< messaget::eom;
145163

146164
auto dec = std::unique_ptr<stack_decision_proceduret>(
147-
new boolbvt{ns, *prop, message_handler});
165+
new boolbvt{ns, *sat_solver, message_handler});
148166

149-
return ebmc_solvert{std::move(prop), std::move(dec)};
167+
return ebmc_solvert{std::move(sat_solver), std::move(dec)};
150168
};
151169
}
152170
}

0 commit comments

Comments
 (0)