[−][src]Struct rate_common::assignment::Assignment
An assignment comprising a mapping plus a trail (vector of literals).
Note that Literal::TOP
is always assigned.
It is valid to assign both a literal and its negation - this is how we detect a conflict.
Methods
impl Assignment
[src]
pub fn new(maxvar: Variable) -> Assignment
[src]
Create an empty assignment.
pub fn len(&self) -> usize
[src]
Return the number of assigned literals.
pub fn position_in_trail(&self, literal: Literal) -> usize
[src]
Return the position in the trail where this literal was assigned.
pub fn trail_at(&self, offset: usize) -> (Literal, Reason)
[src]
Access the trail by offset.
pub fn push(&mut self, lit: Literal, reason: Reason)
[src]
Add a new literal to the trail, assigning it to true.
pub fn peek(&mut self) -> (Literal, Reason)
[src]
View the literal that was assigned last.
pub fn pop(&mut self) -> Option<(Literal, Reason)>
[src]
Unassign the literal that was assigned last.
pub fn move_to(&mut self, src: usize, dst: usize)
[src]
Move the literal at trail position src
to dst
.
pub fn resize(&mut self, level: usize)
[src]
Change the size of the trail. Note: this does not change the assigned values, only the trail.
pub fn unassign(&mut self, literal: Literal)
[src]
Remove the assignment for a literal, without modifying the trail.
pub fn set_trail_at(&mut self, offset: usize, literal: Literal, reason: Reason)
[src]
Insert a literal into the trail and assign it.
pub fn iter(&self) -> Iter<(Literal, Reason)>
[src]
Trait Implementations
impl HeapSpace for Assignment
[src]
fn heap_space(&self) -> usize
[src]
impl<'a> IntoIterator for &'a Assignment
[src]
Iterate over the literals in the trail, from oldest to newest.
type Item = &'a (Literal, Reason)
The type of the elements being iterated over.
type IntoIter = Iter<'a, (Literal, Reason)>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
impl Clone for Assignment
[src]
fn clone(&self) -> Assignment
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl PartialEq<Assignment> for Assignment
[src]
fn eq(&self, other: &Assignment) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl Display for Assignment
[src]
impl Debug for Assignment
[src]
impl Index<Literal> for Assignment
[src]
Auto Trait Implementations
impl Send for Assignment
impl Sync for Assignment
impl Unpin for Assignment
impl UnwindSafe for Assignment
impl RefUnwindSafe for Assignment
Blanket Implementations
impl<T> HeapSpace for T where
T: Copy,
[src]
T: Copy,
fn heap_space(&Self) -> usize
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
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.
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,