Struct splr::types::Lit[][src]

pub struct Lit { /* fields omitted */ }

Literal encoded on u32 as:

  • the literal corresponding to a positive occurrence of *variable n is 2 * n and
  • that for the negative one is 2 * n + 1.

Examples

use splr::types::*;
assert_eq!(2usize, Lit::from(-1i32).into());
assert_eq!(3usize, Lit::from( 1i32).into());
assert_eq!(4usize, Lit::from(-2i32).into());
assert_eq!(5usize, Lit::from( 2i32).into());
assert_eq!( 1i32, Lit::from( 1i32).into());
assert_eq!(-1i32, Lit::from(-1i32).into());
assert_eq!( 2i32, Lit::from( 2i32).into());
assert_eq!(-2i32, Lit::from(-2i32).into());

Trait Implementations

impl Clone for Lit[src]

impl Copy for Lit[src]

impl Debug for Lit[src]

impl Default for Lit[src]

impl Display for Lit[src]

impl Eq for Lit[src]

impl From<(usize, Option<bool>)> for Lit[src]

impl From<(usize, bool)> for Lit[src]

impl From<ClauseId> for Lit[src]

impl From<Lit> for ClauseId[src]

impl From<i32> for Lit[src]

impl From<usize> for Lit[src]

impl Hash for Lit[src]

impl Index<&'_ Lit> for Eliminator[src]

type Output = LitOccurs

The returned type after indexing.

impl Index<Lit> for Eliminator[src]

type Output = LitOccurs

The returned type after indexing.

impl IndexMut<&'_ Lit> for Eliminator[src]

impl IndexMut<Lit> for Eliminator[src]

impl LitIF for Lit[src]

Examples

use splr::types::*;
assert_eq!(Lit::from(1i32), Lit::from_assign(1 as VarId, true));
assert_eq!(Lit::from(2i32), Lit::from_assign(2 as VarId, true));
assert_eq!(1, Lit::from_assign(1, true).vi());
assert_eq!(1, Lit::from_assign(1, false).vi());
assert_eq!(2, Lit::from_assign(2, true).vi());
assert_eq!(2, Lit::from_assign(2, false).vi());
assert_eq!(Lit::from( 1i32), !Lit::from(-1i32));
assert_eq!(Lit::from(-1i32), !Lit::from( 1i32));
assert_eq!(Lit::from( 2i32), !Lit::from(-2i32));
assert_eq!(Lit::from(-2i32), !Lit::from( 2i32));

impl Not for Lit[src]

type Output = Lit

The resulting type after applying the ! operator.

impl Ord for Lit[src]

impl PartialEq<Lit> for Lit[src]

impl PartialOrd<Lit> for Lit[src]

impl StructuralEq for Lit[src]

impl StructuralPartialEq for Lit[src]

Auto Trait Implementations

impl RefUnwindSafe for Lit

impl Send for Lit

impl Sync for Lit

impl Unpin for Lit

impl UnwindSafe for Lit

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<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[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.