Skip to content

Build cbmc with cadical using make and IPASIR #6047

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

Merged
merged 4 commits into from
Apr 28, 2021

Conversation

TGWDB
Copy link
Contributor

@TGWDB TGWDB commented Apr 22, 2021

This adds documentation for CaDiCaL with IPASIR linking to cbmc. This is tested for Ubuntu and MacOS.

Note that while CaDiCaL can be compiled for Windows (Cygwin), there are problems with building cbmc that need to be fixed, and also problems with Cygwin handling of some libraries. For this reason Windows build support is not included in this PR, although this may come later (or via cmake).

  • Each commit message has a non-empty body, explaining why the change was made.
  • Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • White-space or formatting changes outside the feature-related changed lines are in commits of their own.

TGWDB added 2 commits April 20, 2021 12:05
This commit adds the first instructions for building cbmc with
CaDiCaL 1.4.0 using the IPASIR interface in cbmc.
@codecov
Copy link

codecov bot commented Apr 22, 2021

Codecov Report

Merging #6047 (a89fc93) into develop (7663a57) will decrease coverage by 0.39%.
The diff coverage is 60.86%.

❗ Current head a89fc93 differs from pull request most recent head a22fb03. Consider uploading reports for the commit a22fb03 to get more accurate results
Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #6047      +/-   ##
===========================================
- Coverage    74.30%   73.91%   -0.40%     
===========================================
  Files         1444     1444              
  Lines       157453   157448       -5     
===========================================
- Hits        116995   116373     -622     
- Misses       40458    41075     +617     
Impacted Files Coverage Δ
src/solvers/smt2/smt2_conv.h 100.00% <ø> (ø)
src/solvers/smt2/smt2_conv.cpp 60.38% <52.94%> (ø)
src/solvers/smt2/smt2_solver.cpp 83.11% <65.51%> (ø)
src/ansi-c/gcc_types.cpp 41.86% <0.00%> (-46.52%) ⬇️
src/solvers/prop/prop.cpp 42.85% <0.00%> (-42.86%) ⬇️
src/ansi-c/ansi_c_entry_point.cpp 63.55% <0.00%> (-23.84%) ⬇️
src/util/parse_options.cpp 57.57% <0.00%> (-22.23%) ⬇️
src/ansi-c/scanner.l 39.93% <0.00%> (-21.80%) ⬇️
src/goto-programs/read_goto_binary.cpp 30.84% <0.00%> (-16.83%) ⬇️
src/ansi-c/c_storage_spec.cpp 82.05% <0.00%> (-15.39%) ⬇️
... and 68 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4889328...a22fb03. Read the comment docs.

Comment on lines +385 to +389
The [CaDiCaL](https://github.com/arminbiere/cadical) solver supports the
[IPASIR](https://github.com/biotomas/ipasir) C interface to incremental SAT
solvers, which is also supported by CBMC. So the process for producing a CBMC
with CaDiCaL build is to build CaDiCaL as a static library then compile CBMC
with the IPASIR build options and link to the CaDiCaL static library.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While that is one way of doing it, it's also possible to use the simpler approach using -Dsat_impl=cadical (with cmake) or make -C src cadical-download followed by make -C src CADICAL=../../cadical.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. This was to document how to do it with the IPASIR interface.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I figured as much from the commit message, but could you perhaps also include a few words on those simpler approaches? I don't think the remainder of the section makes clear that this is only needed when choosing the IPASIR approach. (That said, it may be worth pondering long term whether we should stop supporting interfaces other than IPASIR to simplify maintenance.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pushed a change now that I believe clarifies how to build and link different SAT solvers and makes clear the differences.

This adds documentation on alternativer SAT solvers and how to compile
them using different builds processed and linking methods. In particular
this not documents the make and cmake build processes for CaDiCaL and
glucose, as well as general IPASIR linking.
Improves clarity of the documentation for building CBMC with
alternative SAT solvers.
Copy link
Contributor

@thomasspriggs thomasspriggs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGMT

@thomasspriggs thomasspriggs merged commit f5b18ff into diffblue:develop Apr 28, 2021
@TGWDB TGWDB mentioned this pull request May 7, 2021
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants