pub struct ClauseDatabase { /* private fields */ }Expand description
Database of clauses with memory pool
Implementations§
Source§impl ClauseDatabase
impl ClauseDatabase
Sourcepub fn stats(&self) -> &ClauseDatabaseStats
pub fn stats(&self) -> &ClauseDatabaseStats
Get statistics about the clause database
Sourcepub fn add(&mut self, clause: Clause) -> ClauseId
pub fn add(&mut self, clause: Clause) -> ClauseId
Add a clause to the database
Uses the memory pool (free list) to reuse deleted clause slots when available
Sourcepub fn add_original(&mut self, lits: impl IntoIterator<Item = Lit>) -> ClauseId
pub fn add_original(&mut self, lits: impl IntoIterator<Item = Lit>) -> ClauseId
Add an original clause
Sourcepub fn add_learned(&mut self, lits: impl IntoIterator<Item = Lit>) -> ClauseId
pub fn add_learned(&mut self, lits: impl IntoIterator<Item = Lit>) -> ClauseId
Add a learned clause
Sourcepub fn get_mut(&mut self, id: ClauseId) -> Option<&mut Clause>
pub fn get_mut(&mut self, id: ClauseId) -> Option<&mut Clause>
Get a mutable reference to a clause
Sourcepub fn remove(&mut self, id: ClauseId)
pub fn remove(&mut self, id: ClauseId)
Mark a clause as deleted
The deleted clause slot is added to the free list for reuse (memory pool)
Sourcepub fn compact(&mut self)
pub fn compact(&mut self)
Compact the database by removing deleted clauses from the free list
This should be called periodically to prevent the free list from growing too large
Sourcepub fn num_original(&self) -> usize
pub fn num_original(&self) -> usize
Get the number of original clauses
Sourcepub fn num_learned(&self) -> usize
pub fn num_learned(&self) -> usize
Get the number of learned clauses
Sourcepub fn iter_ids(&self) -> impl Iterator<Item = ClauseId> + '_
pub fn iter_ids(&self) -> impl Iterator<Item = ClauseId> + '_
Iterate over all non-deleted clause IDs
Sourcepub fn bump_activity(&mut self, id: ClauseId, increment: f64)
pub fn bump_activity(&mut self, id: ClauseId, increment: f64)
Bump activity of a clause
Sourcepub fn decay_activity(&mut self, factor: f64)
pub fn decay_activity(&mut self, factor: f64)
Decay all clause activities
Trait Implementations§
Source§impl Debug for ClauseDatabase
impl Debug for ClauseDatabase
Auto Trait Implementations§
impl Freeze for ClauseDatabase
impl RefUnwindSafe for ClauseDatabase
impl Send for ClauseDatabase
impl Sync for ClauseDatabase
impl Unpin for ClauseDatabase
impl UnsafeUnpin for ClauseDatabase
impl UnwindSafe for ClauseDatabase
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more