[−][src]Trait ipasir::IpasirSolver
The IPASIR interface a SAT solver has to implement to be conforming.
Required methods
fn signature(&self) -> &'static str
Returns name and version of the incremental SAT solving implementation.
fn init() -> Self
fn add_clause<I, L>(&mut self, lits: I) where
I: IntoIterator<Item = L>,
L: Into<Lit>,
I: IntoIterator<Item = L>,
L: Into<Lit>,
Adds a clause to the solver.
The clause is defined to contain all yielded literals of the given iterator.
Note
- Clauses added this way cannot be removed.
- The addition of removable clauses can be simulated using activation literals and assumptions.
States
- Required: any
- After: INPUT
fn assume(&mut self, lit: Lit)
fn solve(&mut self) -> Result<SolveResponse>
fn val(&mut self, lit: Lit) -> Result<LitValue>
fn failed(&mut self, lit: Lit) -> Result<bool>
Queries if the given literal was used to prove unsatisfiability.
States
- Required: UNSAT
- After: UNSAT
fn set_terminate<F>(&mut self, callback: F) where
F: FnMut() -> SolveControl + 'static,
F: FnMut() -> SolveControl + 'static,
Set a callback handler used to indicate a terminate requirement to the solver.
Note
The solver will periodically query this handler and check its return value during solving.
States
- Required: any
- After: same
fn set_learn<F>(&mut self, max_len: usize, callback: F) where
F: FnMut(Clause) + 'static,
F: FnMut(Clause) + 'static,
Set a callback function used to extract learned clauses up to a given length from the solver.
Note
- The solver will call this function for each learned clause that is not longer than the maximum length.
- The solver calls the callback function with the parameter
state
that was passed intoset_learn
.
States
- Required: any
- After: same
Implementors
impl IpasirSolver for Solver
[src]
fn signature(&self) -> &'static str
[src]
fn init() -> Solver
[src]
fn add_clause<I, L>(&mut self, lits: I) where
I: IntoIterator<Item = L>,
L: Into<Lit>,
[src]
I: IntoIterator<Item = L>,
L: Into<Lit>,
fn assume(&mut self, lit: Lit)
[src]
fn solve(&mut self) -> Result<SolveResponse>
[src]
fn val(&mut self, lit: Lit) -> Result<LitValue>
[src]
fn failed(&mut self, lit: Lit) -> Result<bool>
[src]
fn set_terminate<F>(&mut self, cb: F) where
F: FnMut() -> SolveControl + 'static,
[src]
F: FnMut() -> SolveControl + 'static,
fn set_learn<F>(&mut self, max_len: usize, cb: F) where
F: FnMut(Clause) + 'static,
[src]
F: FnMut(Clause) + 'static,