[][src]Struct batsat::clause::Lit

#[repr(transparent)]pub struct Lit(_);

Implementations

impl Lit[src]

pub const UNDEF: Lit[src]

pub const ERROR: Lit[src]

pub fn new(var: Var, sign: bool) -> Self[src]

pub fn idx(&self) -> u32[src]

pub fn sign(&self) -> bool[src]

pub fn var(&self) -> Var[src]

pub fn apply_sign(&self, sign: bool) -> Lit[src]

lit.apply_sign(b) keeps the same sign if b==true, flips sign otherwise

use batsat::*;
let mut sat = BasicSolver::default();
let lit1 = Lit::new(sat.new_var_default(), true);
assert_eq!(lit1, lit1.apply_sign(true));
assert_eq!(!lit1, lit1.apply_sign(false));
let lit2 = Lit::new(sat.new_var_default(), false);
assert_ne!(lit1.var(), lit2.var());
assert_eq!(lit2, lit2.apply_sign(true));
assert_eq!(!lit2, lit2.apply_sign(false));

Trait Implementations

impl AsIndex for Lit[src]

impl BitXor<bool> for Lit[src]

type Output = Self

The resulting type after applying the ^ operator.

impl BitXorAssign<bool> for Lit[src]

impl Clone for Lit[src]

impl Copy for Lit[src]

impl Debug for Lit[src]

impl Eq for Lit[src]

impl Hash for Lit[src]

impl Not for Lit[src]

type Output = Self

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

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, 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.