#sat-solver #rust-sat #default #rustsat-cadical

rustsat-cadical

Interface to the SAT solver CaDiCaL for the RustSAT library

17 unstable releases (4 breaking)

0.7.0 Apr 3, 2025
0.4.6 Mar 27, 2025
0.4.4 Feb 19, 2025
0.4.3 Dec 20, 2024
0.2.0 Oct 30, 2023

#573 in Math

Download history 162/week @ 2024-12-18 27/week @ 2024-12-25 12/week @ 2025-01-01 63/week @ 2025-01-08 34/week @ 2025-01-15 10/week @ 2025-01-22 24/week @ 2025-02-05 18/week @ 2025-02-12 183/week @ 2025-02-19 18/week @ 2025-02-26 27/week @ 2025-03-05 22/week @ 2025-03-12 108/week @ 2025-03-19 209/week @ 2025-03-26 187/week @ 2025-04-02

530 downloads per month
Used in 2 crates

MIT license

2MB
54K SLoC

C++ 31K SLoC // 0.1% comments Rust 23K SLoC // 0.0% comments

crates.io docs.rs License

rustsat-cadical - Interface to the CaDiCaL SAT Solver for RustSAT

Armin Biere's SAT solver CaDiCaL to be used with the RustSAT library.

Note: at the moment this crate is known to not work on Windows since CaDiCaL is non-trivial to get to work on Windows.

Features

  • debug: if this feature is enabled, the Cpp library will be built with debug and check functionality if the Rust project is built in debug mode. API tracing via the CADICAL_API_TRACE environment variable is also enabled in debug mode.
  • safe: disable writing through popen for more safe usage of the library in applications
  • quiet: exclude message and profiling code (logging too)
  • logging: include logging code (but disabled by default)
  • tracing: always include CaDiCaL API tracing via the CADICAL_API_TRACE environment variable and the CaDiCaL::trace_api_calls method

CaDiCaL Versions

CaDiCaL versions can be selected via cargo crate features. All CaDiCaL versions from Version 1.5.0 up to Version 2.1.3 are available. For the full list of versions and the changelog see the CaDiCaL releases.

Without any features selected, the newest version will be used. If conflicting CaDiCaL versions are requested, the newest requested version will be selected.

If the determined version is not the newest available, and no custom source directory is specified (see customization below), the CaDiCaL source code is downloaded at compile time, which requires network access.

Customization

In order to build a custom version of CaDiCaL, this crate supports two environment variables to customize the Cpp source code that CaDiCaL is built from.

  • CADICAL_PATCHES allows to specify a list of colon-separated paths to patch files that will be applied to the CaDiCaL source repository before building it. These patches are applied in order of appearance after the patches of this crate have been applied.
  • CADICAL_SRC_DIR allows for overriding where the Cpp library is built from. By default this crate fetches the appropriate code from the GitHub repository. If this variable is set, the directory specified there is used instead. Note that when using this variable, the crate will not apply any patches, the user is responsible for applying the appropriate and necessary patches from the patches/ directory.

Dependencies

~4–16MB
~238K SLoC