[][src]Struct varisat::cnf::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.

Implementations

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 is_empty(&self) -> bool[src]

Whether the set of clauses is empty.

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

Iterator over all clauses.

Trait Implementations

impl Debug for CnfFormula[src]

impl Default for CnfFormula[src]

impl Eq for CnfFormula[src]

impl ExtendFormula 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]

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T> From<T> for T[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]

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<V, T> VZip<V> for T where
    V: MultiLane<T>,