Struct splr::types::Lit [−][src]
Literal encoded on u32
as:
- the literal corresponding to a positive occurrence of *variable
n
is2 * 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]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Index<&'_ Lit> for Eliminator
[src]
type Output = LitOccurs
The returned type after indexing.
fn index(&self, l: &Lit) -> &Self::Output
[src]
impl Index<Lit> for Eliminator
[src]
type Output = LitOccurs
The returned type after indexing.
fn index(&self, l: Lit) -> &Self::Output
[src]
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));
fn as_bool(&self) -> bool
[src]
fn from_assign(vi: VarId, p: bool) -> Lit
[src]
fn vi(self) -> VarId
[src]
fn is_none(&self) -> bool
[src]
impl Not for Lit
[src]
impl Ord for Lit
[src]
fn cmp(&self, other: &Lit) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<Lit> for Lit
[src]
impl PartialOrd<Lit> for Lit
[src]
fn partial_cmp(&self, other: &Lit) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
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]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,