Skip to main content

csp_solver/
lib.rs

1//! A generalized CSP (Constraint Satisfaction Problem) solver.
2//!
3//! This is the sole solver in the workspace. Supports:
4//! - Backtracking search with configurable pruning and variable ordering
5//! - AC-3 (Maintaining Arc Consistency) propagation
6//! - Forward checking and the AC-FC hybrid
7//! - GAC all-different (Régin 1994), default-ON
8//! - Lattice domains for monotonic fixed-point propagation
9//!
10//! The optional PyO3 (`feature = "py"`) and wasm bindings expose this same
11//! core to Python and JavaScript — they wrap it, they do not mirror a
12//! separate implementation.
13//!
14//! The crate-root surface is assembled from three internal modules:
15//! [`config`] (solve vocabulary + the `Csp<D>` container), [`csp`] (the
16//! builder methods), and [`csp::solve`] (propagation + search dispatch).
17
18pub mod adjacency;
19pub(crate) mod bitscan;
20pub mod builder;
21pub mod cancel;
22pub(crate) mod config;
23pub mod constraint;
24pub(crate) mod csp;
25pub mod domain;
26pub mod error;
27pub mod ordering;
28pub mod puzzles;
29#[cfg(feature = "py")]
30pub mod py;
31pub mod solver;
32pub mod variable;
33
34pub use builder::assignment::{
35    AssignmentBuilder, AssignmentError, AssignmentSolution, SENTINEL, assignment,
36};
37pub use cancel::CancelToken;
38pub use config::{Csp, OptimizationMode, PropagationStrategy, Pruning, SolveConfig, SolveStats};
39pub use csp::solve::Unsatisfiable;
40pub use error::CspError;
41pub use puzzles::sudoku;