RustSAT: A Library For SAT Solving in Rust
Christoph Jabs
TL;DR
RustSAT addresses the barrier to using SAT solving in Rust by providing a unified library for problem construction, solver interfacing, and high-level constraint encodings, with multiple solver backends and C/Python APIs. It emphasizes safety and performance through Rust's type system, trait-based interfaces, and zero-cost abstractions, while enabling practical workflows in configuration, puzzle solving, and MaxSAT. Empirical aspects highlight favorable performance relative to PySAT in solution enumeration and minimal overhead when calling solvers directly, underscoring the potential to boost Rust-based SAT tooling. The open-source, well-documented design aims to broaden adoption of SAT techniques in Rust-centric applications.
Abstract
State-of-the-art Boolean satisfiability (SAT) solvers constitute a practical and competitive approach for solving various real-world problems. To encourage their widespread adoption, the relatively high barrier of entry following from the low level syntax of SAT and the expert knowledge required to achieve tight integration with SAT solvers should be further reduced. We present RustSAT, a library with the aim of making SAT solving technology readily available in the Rust programming language. RustSAT provides functionality for helping with generating (Max)SAT instances, writing them to, or reading them from files. Furthermore, RustSAT includes interfaces to various state-of-the-art SAT solvers available with a unified Rust API. Lastly, RustSAT implements several encodings for higher level constraints (at-most-one, cardinality, and pseudo-Boolean), which are also available via a C and Python API.
