[][src]Struct varisat::CnfFormula

pub struct CnfFormula { /* fields omitted */ }

A formula in conjunctive normal form (CNF).

Equivalent to Vec<Vec> but more efficient as it uses a single buffer for all literals.

Methods

impl CnfFormula[src]

pub fn new() -> CnfFormula[src]

Create an empty CNF formula.

pub fn var_count(&self) -> usize[src]

Number of variables in the formula.

This also counts missing variables if a variable with a higher index is present. A vector of this length can be indexed with the variable indices present.

pub fn set_var_count(&mut self, count: usize)[src]

Increase the number of variables in the formula.

If the parameter is less than the current variable count do nothing.

pub fn len(&self) -> usize[src]

Number of clauses in the formula.

pub fn iter(&self) -> impl Iterator<Item = &[Lit]>[src]

Iterator over all clauses.

Trait Implementations

impl Debug for CnfFormula[src]

impl<Clauses, Item> From<Clauses> for CnfFormula where
    Clauses: IntoIterator<Item = Item>,
    Item: Borrow<[Lit]>, 
[src]

Convert an iterable of Lit slices into a CnfFormula

impl PartialEq<CnfFormula> for CnfFormula[src]

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl Eq for CnfFormula[src]

impl ExtendFormula for CnfFormula[src]

fn new_lit(&mut self) -> Lit[src]

Add a new variable to the formula and return it as positive literal.

Important traits for NewVarIter<'a, F, V>
fn new_var_iter(&mut self, count: usize) -> NewVarIter<Self, Var>[src]

Iterator over multiple new variables.

Important traits for NewVarIter<'a, F, V>
fn new_lit_iter(&mut self, count: usize) -> NewVarIter<Self, Lit>[src]

Iterator over multiple new literals.

fn new_vars<Vars>(&mut self) -> Vars where
    Vars: UniformTuple<Var>, 
[src]

Add multiple new variables and return them. Read more

fn new_lits<Lits>(&mut self) -> Lits where
    Lits: UniformTuple<Lit>, 
[src]

Add multiple new variables and return them as positive literals. Read more

impl Default for CnfFormula[src]

Auto Trait Implementations

impl Send for CnfFormula

impl Sync for CnfFormula

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<Reference, Outer, OuterFieldType, Inner> HasPart<Nested<Outer, Inner>> for Reference where
    Inner: Part,
    Outer: Part<PartType = Field<OuterFieldType>>,
    OuterFieldType: HasPart<Inner, RawTarget = OuterFieldType> + PartialRefTarget + ?Sized,
    Reference: HasPart<Outer> + ?Sized
[src]