pub trait SatSolver: AddConstraints<Clause> + AddConstraints<Formula> {
type Status: SolverState;
// Required methods
fn new() -> Self;
fn solve(&mut self) -> Self::Status;
fn val(&mut self, lit: i32) -> bool;
fn load_model(&mut self) -> Model;
fn block_model(&mut self);
}Expand description
This trait captures the interface of a SAT solver.
Its trait constraints require that its implementation is able to add clauses and formulas as constraints.
Required Associated Types§
type Status: SolverState
Required Methods§
Sourcefn val(&mut self, lit: i32) -> bool
fn val(&mut self, lit: i32) -> bool
After Self::solve returns sat, query the solver for the boolean value of the SAT variable lit.
Requirement: lit must be a SAT variable present in the constraints.
Sourcefn load_model(&mut self) -> Model
fn load_model(&mut self) -> Model
After Self::solve returns sat, obtain the full model.
Sourcefn block_model(&mut self)
fn block_model(&mut self)
After Self::solve returns sat, block the current model. It is useful for model enumeration.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.