pub struct TwoSatSolver { /* private fields */ }Expand description
Evaluate a 2-CNF formula (given as list of clauses over bool variables).
Returns true if satisfiable (2-SAT, solved via Kosaraju SCC).
Implementations§
Source§impl TwoSatSolver
impl TwoSatSolver
Sourcepub fn add_clause(&mut self, a: usize, b: usize)
pub fn add_clause(&mut self, a: usize, b: usize)
Add clause (a OR b). a and b are literals: 2var for positive, 2var+1 for negative.
Auto Trait Implementations§
impl Freeze for TwoSatSolver
impl RefUnwindSafe for TwoSatSolver
impl Send for TwoSatSolver
impl Sync for TwoSatSolver
impl Unpin for TwoSatSolver
impl UnsafeUnpin for TwoSatSolver
impl UnwindSafe for TwoSatSolver
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more