Struct ClauseDatabase

Source
pub struct ClauseDatabase { /* private fields */ }
Expand description

Stores clauses in a flat buffer

Implementations§

Source§

impl ClauseDatabase

Source

pub fn number_of_clauses(&self) -> ClauseIdentifierType

Returns the total number that are stored.

Source

pub fn last_clause(&self) -> Clause

Returns the clause that was added last.

Source

pub fn pop_clause(&mut self)

Delete the last clause.

Source

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

Give the DIMACS representation of a clause.

Only used for debugging, prefer clause::write_clause().

Source

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

The literals in the the clause.

Source

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

The internal offsets of the literals in the the clause.

Source

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

The first two literals in the clause.

Source

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

Convert a clause identifier to the offset of the clause.

Source

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

Convert a clause offset to the identifier of the clause.

Source

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

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

Source

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

Access the metadata for this clause.

Source

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

Access the mutable metadata for this clause.

Source

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

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

Source

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

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

Source

pub fn shrink_to_fit(&mut self)

Trait Implementations§

Source§

impl ClauseStorage for ClauseDatabase

Source§

fn open_clause(&mut self) -> Clause

Initialze a new clause. Read more
Source§

fn push_literal(&mut self, literal: Literal, verbose: bool)

Add a literal to the current clause. Read more
Source§

impl Debug for ClauseDatabase

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ClauseDatabase

Source§

fn default() -> ClauseDatabase

Create an empty clause database.

Source§

impl HeapSpace for ClauseDatabase

Source§

fn heap_space(&self) -> usize

The number of bytes allocated on the heap that this owns.
Source§

impl Index<usize> for ClauseDatabase

Source§

type Output = Literal

The returned type after indexing.
Source§

fn index(&self, offset: usize) -> &Literal

Performs the indexing (container[index]) operation. Read more
Source§

impl IndexMut<usize> for ClauseDatabase

Source§

fn index_mut(&mut self, offset: usize) -> &mut Literal

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl PartialEq for ClauseDatabase

Source§

fn eq(&self, other: &ClauseDatabase) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for ClauseDatabase

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.