Skip to content

Commit

Permalink
Merge pull request #804 from diffblue/cadical
Browse files Browse the repository at this point in the history
add cadical solver option
  • Loading branch information
tautschnig authored Nov 10, 2024
2 parents e7fb61e + 007d669 commit 9d8f0af
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 8 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/pull-request-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ jobs:
echo "CCACHE_DIR=$PWD/.ccache" >> $GITHUB_ENV
- name: Zero ccache stats and limit in size
run: ccache -z --max-size=500M
- name: Get minisat
- name: Get cadical and minisat
run: |
make -C lib/cbmc/src minisat2-download
make -C lib/cbmc/src cadical-download minisat2-download
- name: Build with make
run: make -C src -j4 CXX="ccache g++"
run: make -C src -j4 CXX="ccache g++" MINISAT2=../../minisat-2.2.1 CADICAL=../../cadical
- name: Run unit tests
run: make -C unit -j4 CXX="ccache g++"
- name: Run the ebmc tests with SAT
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# EBMC 5.4

* BMC: Cadical support with --cadical

# EBMC 5.3

* SystemVerilog: fix for nets implicitly declared for port connections
Expand Down
1 change: 1 addition & 0 deletions src/ebmc/ebmc_parse_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class ebmc_parse_optionst:public parse_options_baset
"(interpolation-word)(interpolator):(bdd)"
"(ranking-function):"
"(smt2)(bitwuzla)(boolector)(cvc3)(cvc4)(cvc5)(mathsat)(yices)(z3)"
"(minisat)(cadical)"
"(aig)(stop-induction)(stop-minimize)(start):(coverage)(naive)"
"(compute-ct)(dot-netlist)(smv-netlist)(vcd):"
"(random-traces)(trace-steps):(random-seed):(traces):"
Expand Down
28 changes: 23 additions & 5 deletions src/ebmc/ebmc_solver_factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ Author: Daniel Kroening, [email protected]
#include <solvers/flattening/boolbv.h>
#include <solvers/prop/prop.h>
#include <solvers/sat/satcheck.h>
#include <solvers/sat/satcheck_cadical.h>
#include <solvers/sat/satcheck_minisat2.h>
#include <solvers/smt2/smt2_dec.h>

#include "ebmc_error.h"
Expand Down Expand Up @@ -136,17 +138,33 @@ ebmc_solver_factoryt ebmc_solver_factory(const cmdlinet &cmdline)
else
{
// the 'default' solver
return [](const namespacet &ns, message_handlert &message_handler)
return [&cmdline](const namespacet &ns, message_handlert &message_handler)
{
auto prop = std::unique_ptr<propt>(new satcheckt{message_handler});
std::unique_ptr<propt> sat_solver;

if(cmdline.isset("cadical"))
{
#ifdef SATCHECK_CADICAL
sat_solver =
std::unique_ptr<propt>(new satcheck_cadicalt{message_handler});
#else
throw ebmc_errort() << "support for Cadical not configured";
#endif
}
else
{
sat_solver = std::unique_ptr<propt>(
new satcheck_minisat_simplifiert{message_handler});
}

messaget message(message_handler);
message.status() << "Using " << prop->solver_text() << messaget::eom;
message.status() << "Using " << sat_solver->solver_text()
<< messaget::eom;

auto dec = std::unique_ptr<stack_decision_proceduret>(
new boolbvt{ns, *prop, message_handler});
new boolbvt{ns, *sat_solver, message_handler});

return ebmc_solvert{std::move(prop), std::move(dec)};
return ebmc_solvert{std::move(sat_solver), std::move(dec)};
};
}
}

0 comments on commit 9d8f0af

Please sign in to comment.