[][src]Struct rate_common::clausedatabase::ClauseDatabase

pub struct ClauseDatabase { /* fields omitted */ }

Stores clauses in a flat buffer

Methods

impl ClauseDatabase[src]

pub fn new() -> ClauseDatabase[src]

Create an empty clause database.

pub fn number_of_clauses(&self) -> ClauseIdentifierType[src]

Returns the total number that are stored.

pub fn last_clause(&self) -> Clause[src]

Returns the clause that was added last.

pub fn push_literal(&mut self, literal: Literal)[src]

Add a literal to the current clause. Finish the clause if the literal is 0.

This must be called after a call to open_clause() but before the call to close_clause().

pub fn open_clause(&mut self) -> Clause[src]

Make a new clause.

pub fn pop_clause(&mut self)[src]

Delete the last clause.

pub fn clause_to_string(&self, clause: Clause) -> String[src]

Give the DIMACS representation of a clause.

FIXME: possibly inefficient, use clause::write_clause() instead.

pub fn clause(&self, clause: Clause) -> &[Literal][src]

The literals in the the clause.

pub fn clause_range(&self, clause: Clause) -> Range<usize>[src]

The internal offsets of the literals in the the clause.

pub fn watches(&self, head: usize) -> [Literal; 2][src]

The first two literals in the clause.

pub fn clause2offset(&self, clause: Clause) -> usize[src]

Convert a clause identifier to the offset of the clause.

pub fn offset2clause(&self, head: usize) -> Clause[src]

Convert a clause offset to the identifier of the clause.

pub fn swap(&mut self, a: usize, b: usize)[src]

Swap the literal at the given offsets in the clause database.

pub fn fields(&self, clause: Clause) -> &u32[src]

Access the metadata for this clause.

pub fn fields_mut(&mut self, clause: Clause) -> &mut u32[src]

Access the mutable metadata for this clause.

pub fn fields_from_offset(&self, offset: usize) -> &u32[src]

Access the metadata for the clause with this offset. This is possibly more efficient than fields().

pub fn fields_mut_from_offset(&mut self, offset: usize) -> &mut u32[src]

Access the mutable metadata for the clause with this offset. This is possibly more efficient than fields().

pub fn shrink_to_fit(&mut self)[src]

Trait Implementations

impl HeapSpace for ClauseDatabase[src]

impl PartialEq<ClauseDatabase> for ClauseDatabase[src]

impl Index<usize> for ClauseDatabase[src]

type Output = Literal

The returned type after indexing.

impl IndexMut<usize> for ClauseDatabase[src]

impl Debug for ClauseDatabase[src]

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, 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> BorrowMut<T> for T where
    T: ?Sized
[src]

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

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