Skip to content

Commit 0e34712

Browse files
committed
add cadical solver option
1 parent a7b8510 commit 0e34712

File tree

3 files changed

+18
-8
lines changed

3 files changed

+18
-8
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ 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
4545
run: make -C src -j4 CXX="ccache g++"
4646
- name: Run the ebmc tests with SAT

src/ebmc/ebmc_parse_options.h

Lines changed: 1 addition & 0 deletions
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

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ Author: Daniel Kroening, [email protected]
1212

1313
#include <solvers/flattening/boolbv.h>
1414
#include <solvers/prop/prop.h>
15-
#include <solvers/sat/satcheck.h>
15+
#include <solvers/sat/satcheck_cadical.h>
16+
#include <solvers/sat/satcheck_minisat2.h>
1617
#include <solvers/smt2/smt2_dec.h>
1718

1819
#include "ebmc_error.h"
@@ -136,17 +137,25 @@ ebmc_solver_factoryt ebmc_solver_factory(const cmdlinet &cmdline)
136137
else
137138
{
138139
// the 'default' solver
139-
return [](const namespacet &ns, message_handlert &message_handler)
140+
return [&cmdline](const namespacet &ns, message_handlert &message_handler)
140141
{
141-
auto prop = std::unique_ptr<propt>(new satcheckt{message_handler});
142+
std::unique_ptr<propt> sat_solver;
143+
144+
if(cmdline.isset("cadical"))
145+
sat_solver =
146+
std::unique_ptr<propt>(new satcheck_cadicalt{message_handler});
147+
else
148+
sat_solver = std::unique_ptr<propt>(
149+
new satcheck_minisat_simplifiert{message_handler});
142150

143151
messaget message(message_handler);
144-
message.status() << "Using " << prop->solver_text() << messaget::eom;
152+
message.status() << "Using " << sat_solver->solver_text()
153+
<< messaget::eom;
145154

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

149-
return ebmc_solvert{std::move(prop), std::move(dec)};
158+
return ebmc_solvert{std::move(sat_solver), std::move(dec)};
150159
};
151160
}
152161
}

0 commit comments

Comments
 (0)