pub struct Cnf { /* private fields */ }Expand description
Simple type representing a CNF formula. Other than SatInstance<VM>, this
type only supports clauses and does have an internal variable manager.
Implementations§
source§impl Cnf
impl Cnf
sourcepub fn with_capacity(capacity: usize) -> Cnf
pub fn with_capacity(capacity: usize) -> Cnf
Creates a new Cnf with a given capacity of clauses
sourcepub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError>
pub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError>
Tries to reserve memory for at least additional new clauses
sourcepub fn shrink_to_fit(&mut self)
pub fn shrink_to_fit(&mut self)
Shrinks the allocated memory of the Cnf to fit the number of clauses
sourcepub fn add_clause(&mut self, clause: Clause)
pub fn add_clause(&mut self, clause: Clause)
Adds a clause to the CNF
sourcepub fn add_binary(&mut self, lit1: Lit, lit2: Lit)
pub fn add_binary(&mut self, lit1: Lit, lit2: Lit)
Adds a binary clause to the CNF
sourcepub fn add_ternary(&mut self, lit1: Lit, lit2: Lit, lit3: Lit)
pub fn add_ternary(&mut self, lit1: Lit, lit2: Lit, lit3: Lit)
Adds a ternary clause to the CNF
sourcepub fn add_lit_impl_lit(&mut self, a: Lit, b: Lit)
pub fn add_lit_impl_lit(&mut self, a: Lit, b: Lit)
sourcepub fn add_lit_impl_clause(&mut self, a: Lit, b: &[Lit])
pub fn add_lit_impl_clause(&mut self, a: Lit, b: &[Lit])
sourcepub fn add_lit_impl_cube(&mut self, a: Lit, b: &[Lit])
pub fn add_lit_impl_cube(&mut self, a: Lit, b: &[Lit])
Adds an implication of form a -> (b1 & b2 & … & bm)
sourcepub fn add_cube_impl_lit(&mut self, a: &[Lit], b: Lit)
pub fn add_cube_impl_lit(&mut self, a: &[Lit], b: Lit)
sourcepub fn add_clause_impl_lit(&mut self, a: &[Lit], b: Lit)
pub fn add_clause_impl_lit(&mut self, a: &[Lit], b: Lit)
Adds an implication of form (a1 | a2 | … | an) -> b
sourcepub fn add_cube_impl_clause(&mut self, a: &[Lit], b: &[Lit])
pub fn add_cube_impl_clause(&mut self, a: &[Lit], b: &[Lit])
sourcepub fn add_clause_impl_clause(&mut self, a: &[Lit], b: &[Lit])
pub fn add_clause_impl_clause(&mut self, a: &[Lit], b: &[Lit])
Adds an implication of form (a1 | a2 | … | an) -> (b1 | b2 | … | bm)
sourcepub fn add_clause_impl_cube(&mut self, a: &[Lit], b: &[Lit])
pub fn add_clause_impl_cube(&mut self, a: &[Lit], b: &[Lit])
Adds an implication of form (a1 | a2 | … | an) -> (b1 & b2 & … & bm)
sourcepub fn add_cube_impl_cube(&mut self, a: &[Lit], b: &[Lit])
pub fn add_cube_impl_cube(&mut self, a: &[Lit], b: &[Lit])
Adds an implication of form (a1 & a2 & … & an) -> (b1 & b2 & … & bm)
sourcepub fn join(self, other: Cnf) -> Cnf
pub fn join(self, other: Cnf) -> Cnf
Joins the current CNF with another one. Like Cnf::extend but
consumes the object and returns a new object.
sourcepub fn iter_mut(&mut self) -> IterMut<'_, Clause>
pub fn iter_mut(&mut self) -> IterMut<'_, Clause>
Returns an iterator over mutable references to the clauses
Trait Implementations§
source§impl CollectClauses for Cnf
impl CollectClauses for Cnf
source§impl Extend<Clause> for Cnf
impl Extend<Clause> for Cnf
source§fn extend<Iter: IntoIterator<Item = Clause>>(&mut self, iter: Iter)
fn extend<Iter: IntoIterator<Item = Clause>>(&mut self, iter: Iter)
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one)source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)