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(crate) mod bitscan;
19pub mod builder;
20pub mod cancel;
21pub(crate) mod config;
22pub mod constraint;
23pub(crate) mod csp;
24pub mod domain;
25pub mod error;
26pub mod ordering;
27pub mod puzzles;
28#[cfg(feature = "py")]
29pub mod py;
30pub mod solver;
31pub mod variable;
32
33pub use builder::assignment::{
34 AssignmentBuilder, AssignmentError, AssignmentSolution, SENTINEL, assignment,
35};
36pub use cancel::CancelToken;
37pub use config::{Csp, OptimizationMode, PropagationStrategy, Pruning, SolveConfig, SolveStats};
38pub use csp::solve::Unsatisfiable;
39pub use error::CspError;
40pub use puzzles::sudoku;