#sat-solver #sat #solver #satisfiability #logic #minisat

sys cadical

Rust bindings for the CaDiCaL SAT solver

14 releases

0.1.14 Nov 25, 2022
0.1.13 Oct 30, 2020
0.1.12 Jun 18, 2020

#654 in Math

Download history 4/week @ 2023-11-20 50/week @ 2024-01-15 14/week @ 2024-01-22 31/week @ 2024-02-19 31/week @ 2024-02-26 9/week @ 2024-03-04

71 downloads per month
Used in 5 crates (4 directly)

MIT license

795KB
18K SLoC

C++ 17K SLoC // 0.2% comments Rust 524 SLoC

CaDiCaL SAT solver

Build Status Crate Documentation GitHub

This is a stand alone crate that contains both the C++ source code of the CaDiCaL incremental SAT solver together with its Rust binding. The C++ files are compiled and statically linked during the build process. This crate works on Linux, Apple OSX, Windows, Android, iOS, Raspberry Pi, NetBSD and FreeBSD.

CaDiCaL won first place in the SAT track of the SAT Race 2019 and second overall place. It was written by Armin Biere, and it is available under the MIT license.

The literals are unwrapped positive and negative integers, exactly as in the DIMACS format. The common IPASIR operations are presented in a safe Rust interface.

let mut sat: cadical::Solver = Default::default();
sat.add_clause([1, 2]);
sat.add_clause([-1, 2]);
assert_eq!(sat.solve(), Some(true));
assert_eq!(sat.value(2), Some(true));

The C++ library is build with assertions disabled and with optimization level 3 by default. C++ assertions are enabled only when cargo is building a debug version and the cpp-debug feature of the library is enabled.

Dependencies