[][src]Struct rate_common::assignment::Assignment

pub struct Assignment { /* fields omitted */ }

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]

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?

impl Clone for Assignment[src]

impl PartialEq<Assignment> for Assignment[src]

impl Display for Assignment[src]

impl Debug for Assignment[src]

impl Index<Literal> for Assignment[src]

type Output = bool

The returned type after indexing.

fn index(&self, literal: Literal) -> &bool[src]

This assumes that we don't ever pass a constant literal, however this can be changed if necessary.

Auto Trait Implementations

Blanket Implementations

impl<T> HeapSpace for T where
    T: Copy
[src]

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

impl<T> From<T> for 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.

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

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

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