-
Notifications
You must be signed in to change notification settings - Fork 274
Add CaDiCaL support to CMake #4758
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
FWIW: running the regression suite with CaDiCaL appears to be quite a bit slower, but an evaluation on more realistic benchmarks is yet to be done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Build script stuff looks fine to me, no opinion on the solvers stuff that I'm not that familiar with
src/solvers/CMakeLists.txt
Outdated
download_project(PROJ cadical | ||
URL https://github.com/arminbiere/cadical/archive/sr19.tar.gz | ||
PATCH_COMMAND true | ||
COMMAND CXX=${CXX_COMPILER} CXXFLAGS=-O3 ./configure --debug |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Double-check: is the --debug
asking configure
for verbose output, or setting -g
for the build, or could it even be overriding the -O3
given in CXXFLAGS
to get -g -O0
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did double-check when building locally: it just adds -g
, the -O3
from CXXFLAGS
is passed on as desired.
Codecov Report
@@ Coverage Diff @@
## develop #4758 +/- ##
========================================
Coverage 69.66% 69.67%
========================================
Files 1248 1248
Lines 100873 100874 +1
========================================
+ Hits 70278 70279 +1
Misses 30595 30595
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✔️
Passed Diffblue compatibility checks (cbmc commit: 7931e35).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/114606145
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have any strong opinions on this, but it should probably build cadical
on CI and run the tests?
src/solvers/sat/satcheck_cadical.cpp
Outdated
@@ -79,6 +79,21 @@ propt::resultt satcheck_cadicalt::do_prop_solve() | |||
} | |||
else | |||
{ | |||
// if assumptions contains false, we need this to be UNSAT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⛏️ I don't understand this change or why the assume falses need special casing, but it should probably go in its own commit explaining in more detail why this is required
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Preferably with a test that only passes with this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for the record: this is done in keeping with other solvers, and thus about the way in which we use the solver interface. I agree that a test would be useful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, the reason why 'assume false' needs special casing is that SAT solvers don't have a 'false' literal.
31b75e2
to
ab8b90b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems good to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest to merge also #5305 so that we can use the other solvers too without having to implement hardness_collectort everywhere.
c442def
to
d0db452
Compare
575d549
to
e8b2338
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tautschnig I'm noticing that the second commit has quite a few related changes at once. Is there any chance these could be split up into indivial commits that still make sense on their own? No real issue with the changes themselves.
|
||
set_target_properties( | ||
cadical | ||
PROPERTIES IMPORTED_LOCATION ${cadical_SOURCE_DIR}/build/libcadical.a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will only work on Linux, is that OK? If cadical also works on Windows/OSX it'd be nice if just used something like find_library
here to get a more portable library path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cadical's makefile hard-codes this, so I don't think it'll work out of the box on other platforms.
} | ||
} | ||
|
||
for(const auto &a : assumptions) | ||
solver->assume(a.dimacs()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to do this now? This wasn't here previously?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Support for assumptions simply was missing before.
I'm not entirely convinced this adds value: the previous implementation was pretty broken, and not really usable. All these changes are necessary to make things work. |
A SAT instance that is satisfiable need not remain so when adding clauses. Solvers strictly asserting this (such as Cadical) would refuse getting the model of a satisfiable instance after having added further clauses since the last solve() call. Thus, request the values of all approximations first, and only then add further constraints. Doing so makes cbmc-library/Float-div1-refine pass again, even when using Cadical.
Add CMake configuration to build using CaDiCaL, which was already supported with Makefiles. Also bump the version of CaDiCaL to rel-1.3.0 and fix the use of the cnf_solvert interface. Run the ubuntu-18_04-package GitHub PR action with -Dsat_impl=cadical to avoid future regressions. Fixes: diffblue#5348
Add CMake configuration to build using CaDiCaL, which was already
supported with Makefiles. Also bump the version of CaDiCaL to sr19 and
fix the use of the cnf_solvert interface.