Struct satoxid::VarMap[][src]

pub struct VarMap<V> { /* fields omitted */ }
Expand description

Mapper from user defined variables and integer sat variables.

VarMap is serializable if the serde feature in enabled.

Implementations

impl<V: SatVar> VarMap<V>[src]

pub fn add_var(&mut self, lit: impl Into<VarType<V>>) -> i32[src]

Translates a value of type V to a integer SAT variable used by the backend. If var wasn’t already used it generates a new SAT variable. Depending on whether var is Pos or Neg the returned value is positive or negative.

pub fn get_var(&self, lit: impl Into<VarType<V>>) -> Option<i32>[src]

Same as add_var but it won’t insert new Lit<V> instead returning None.

pub fn lookup(&self, lit: i32) -> Option<Lit<V>>[src]

Lookup the correct V based on the integer SAT variable. Like add_var it keeps the polarity of the input.

impl<V> VarMap<V>[src]

pub fn new_var(&mut self) -> i32[src]

Generates fresh (unused) SAT integer variable.

Trait Implementations

impl<V: Debug> Debug for VarMap<V>[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl<V> Default for VarMap<V>[src]

fn default() -> Self[src]

Returns the “default value” for a type. Read more

impl<V: SatVar> PartialEq<VarMap<V>> for VarMap<V>[src]

fn eq(&self, other: &Self) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

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

This method tests for !=.

impl<V: SatVar> Eq for VarMap<V>[src]

Auto Trait Implementations

impl<V> RefUnwindSafe for VarMap<V> where
    V: RefUnwindSafe

impl<V> Send for VarMap<V> where
    V: Send

impl<V> Sync for VarMap<V> where
    V: Sync

impl<V> Unpin for VarMap<V> where
    V: Unpin

impl<V> UnwindSafe for VarMap<V> where
    V: UnwindSafe

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.