Crates.io | rssat |
lib.rs | rssat |
version | 0.1.4 |
source | src |
created_at | 2024-09-30 04:52:31.14052 |
updated_at | 2024-09-30 10:04:30.698059 |
description | rssat is a Rust library that provides Rust bindings for multiple popular SAT solvers |
homepage | |
repository | https://github.com/francisol/rssat.git |
max_upload_size | |
id | 1391327 |
size | 53,331 |
rssat is a Rust library that provides Rust bindings for multiple popular SAT solvers. Currently supported solvers include:
We thank the contributors of these excellent projects.
Unified Rust interface for different SAT solvers
Support for adding clauses
Solving SAT problems and returning results
Access to native bindings for advanced functionality
Support reading formulas from files
To build RSsat, you need the following tools and libraries:
[dependencies]
rssat = "0.1.2"
Here's a simple example using the CaDiCaL solver:
use rssat::solver::{CaDiCaLSolver, Status,Solver};
fn main() {
let mut solver = CaDiCaLSolver::new();
solver.add_clause(&vec![1, 2]);
solver.add_clause(&vec![-1, -2]);
solver.add_clause(&vec![3]);
match solver.solve() {
Status::SATISFIABLE(vec) => {
println!("Satisfiable solution: {:?}", vec);
},
Status::UNSATISFIABLE => {
println!("Unsatisfiable");
},
Status::UNKNOWN => {
println!("Unknown");
},
}
}
For advanced usage, you can access the native bindings of each solver. This allows you to use solver-specific features that are not part of the unified interface.
Improve documentation to enhance user experience
Issue reports and pull requests are welcome!
MIT License