Trait Encode

Source
pub trait Encode {
    // Required methods
    fn n_lits(&self) -> usize;
    fn encode<Col>(
        &mut self,
        collector: &mut Col,
        var_manager: &mut dyn ManageVars,
    ) -> Result<(), OutOfMemory>
       where Col: CollectClauses;
}
Expand description

Trait for all at-most-1 encodings

Required Methods§

Source

fn n_lits(&self) -> usize

Gets the number of literals in the encoding

Source

fn encode<Col>( &mut self, collector: &mut Col, var_manager: &mut dyn ManageVars, ) -> Result<(), OutOfMemory>
where Col: CollectClauses,

Encodes and enforces the at-most-1 constraint

§Errors

If the clause collector runs out of memory, returns crate::OutOfMemory.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl Encode for Bitwise

Source§

impl Encode for Ladder

Source§

impl Encode for Pairwise

Source§

impl<const N: usize, Sub> Encode for Bimander<N, Sub>
where Sub: Encode + FromIterator<Lit> + From<Vec<Lit>>,

Source§

impl<const N: usize, Sub> Encode for Commander<N, Sub>
where Sub: Encode + FromIterator<Lit> + From<Vec<Lit>>,