| Crates.io | oxiz-sat |
| lib.rs | oxiz-sat |
| version | 0.1.2 |
| created_at | 2026-01-12 04:30:26.418909+00 |
| updated_at | 2026-01-21 05:19:25.891883+00 |
| description | High-performance CDCL SAT Solver for OxiZ |
| homepage | |
| repository | https://github.com/cool-japan/oxiz |
| max_upload_size | |
| id | 2036991 |
| size | 993,412 |
CDCL SAT solver implementation for OxiZ.
This crate implements a modern Conflict-Driven Clause Learning (CDCL) SAT solver with:
┌─────────────────────────────────────────┐
│ Solver │
├─────────────────────────────────────────┤
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ │
│ │ Trail │ │ Watched │ │ VSIDS │ │
│ │ │ │ Lists │ │ │ │
│ └─────────┘ └─────────┘ └─────────┘ │
├─────────────────────────────────────────┤
│ Clause Database │
└─────────────────────────────────────────┘
use oxiz_sat::{Solver, SolverResult, Lit, Var};
let mut solver = Solver::new();
// Create variables
let x = solver.new_var();
let y = solver.new_var();
let z = solver.new_var();
// Add clauses: (x OR y) AND (NOT x OR z) AND (NOT y OR NOT z)
solver.add_clause([Lit::pos(x), Lit::pos(y)]);
solver.add_clause([Lit::neg(x), Lit::pos(z)]);
solver.add_clause([Lit::neg(y), Lit::neg(z)]);
match solver.solve() {
SolverResult::Sat => {
let model = solver.model();
println!("SAT: {:?}", model);
}
SolverResult::Unsat => println!("UNSAT"),
SolverResult::Unknown => println!("UNKNOWN"),
}
literalLiteral and variable representation:
Var - Variable indexLit - Signed literal (variable + polarity)LBool - Three-valued logic (True, False, Undef)clauseClause representation and database:
Clause - Immutable clause with literalsClauseRef - Reference to clause in databaseClauseDatabase - Storage for all clausestrailAssignment trail for backtracking:
watchedTwo-watched literal scheme:
vsidsVSIDS branching heuristic:
The solver is optimized for:
MIT OR Apache-2.0