pub trait Backend: Debug + Send {
// Required methods
fn new_var(&mut self) -> Var;
fn add_clause(&mut self, lits: &[Lit]);
fn solve_assuming(&mut self, assumptions: &[Lit], limits: Limits) -> Answer;
fn failed_assumptions(&self) -> Vec<Lit>;
fn conflicts(&self) -> u64;
fn propagations(&self) -> u64;
// Provided methods
fn add_clause_watching(&mut self, lits: &[Lit], watches: [Lit; 2]) { ... }
fn exact_conflicts(&self) -> bool { ... }
}Expand description
A SAT search behind a circuit that grows (Incremental): bitwright’s
own Solver, or another one a host links in (CaDiCaL, through the bitwright-cadical
crate). Variables are numbered from 0 in the order they are made. A backend can be sent to
another thread, so that what holds one can.
Required Methods§
Sourcefn add_clause(&mut self, lits: &[Lit])
fn add_clause(&mut self, lits: &[Lit])
Adds a clause.
Sourcefn solve_assuming(&mut self, assumptions: &[Lit], limits: Limits) -> Answer
fn solve_assuming(&mut self, assumptions: &[Lit], limits: Limits) -> Answer
Whether the clauses and assumptions hold together, within limits of search
counted from this call (a search that counts otherwise honours them as it can). The
assumptions are of this call only; what the search learned stays.
Sourcefn failed_assumptions(&self) -> Vec<Lit>
fn failed_assumptions(&self) -> Vec<Lit>
After solve_assuming answered Unsat: assumptions of that call that conflict with
the clauses (none when the clauses alone are contradictory).
Sourcefn propagations(&self) -> u64
fn propagations(&self) -> u64
Propagations of every search so far (0 from a search that does not count them).
Provided Methods§
Sourcefn add_clause_watching(&mut self, lits: &[Lit], watches: [Lit; 2])
fn add_clause_watching(&mut self, lits: &[Lit], watches: [Lit; 2])
Adds a clause, with two of its literals to watch first if the search can use the hint. The default ignores it.
Sourcefn exact_conflicts(&self) -> bool
fn exact_conflicts(&self) -> bool
Whether conflicts is an exact count of search conflicts (false
for a backend that does not expose its conflict counter).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".