Struct splr::cdb::ClauseDB

source ·
pub struct ClauseDB {
    pub eliminated_permanent: Vec<Vec<Lit>>,
    /* private fields */
}
Expand description

Clause database

 use crate::{splr::config::Config, splr::types::*};
 use crate::splr::cdb::ClauseDB;
 let cdb = ClauseDB::instantiate(&Config::default(), &CNFDescription::default());

Fields§

§eliminated_permanent: Vec<Vec<Lit>>

Trait Implementations§

source§

impl ClauseDBIF for ClauseDB

source§

fn remove_clause(&mut self, cid: ClauseId)

Warning

this function is the only function that makes dead clauses

source§

fn reduce(&mut self, asg: &mut impl AssignIF, setting: ReductionType)

reduce the number of ‘learnt’ or removable clauses.

source§

fn dump_cnf(&self, asg: &impl AssignIF, fname: &Path)

dump all active clauses and assertions as a CNF file.

source§

fn len(&self) -> usize

return the length of clause.
source§

fn is_empty(&self) -> bool

return true if it’s empty.
source§

fn iter(&self) -> Iter<'_, Clause>

return an iterator.
source§

fn iter_mut(&mut self) -> IterMut<'_, Clause>

return a mutable iterator.
return binary links: BinaryLinkList connected with a Lit.
source§

fn fetch_watch_cache_entry(&self, lit: Lit, wix: usize) -> (ClauseId, Lit)

source§

fn watch_cache_iter(&mut self, l: Lit) -> WatchCacheIterator

replace the mutable watcher list with an empty one, and return the list
source§

fn detach_watch_cache(&mut self, l: Lit, iter: &mut WatchCacheIterator)

detach the watch_cache referred by the head of a watch_cache iterator
source§

fn merge_watch_cache(&mut self, p: Lit, wc: Vec<(ClauseId, Lit)>)

Merge two watch cache
source§

fn swap_watch(&mut self, cid: ClauseId)

swap the first two literals in a clause.
source§

fn new_clause( &mut self, asg: &mut impl AssignIF, vec: &mut Vec<Lit>, learnt: bool ) -> RefClause

allocate a new clause and return its id. Note this removes an eliminated Lit p from a clause. This is an O(n) function! This returns true if the clause became a unit clause. And this is called only from Eliminator::strengthen_clause.
source§

fn new_clause_sandbox( &mut self, asg: &mut impl AssignIF, vec: &mut Vec<Lit> ) -> RefClause

source§

fn remove_clause_sandbox(&mut self, cid: ClauseId)

un-register a clause cid from clause database and make the clause dead.
source§

fn transform_by_restoring_watch_cache( &mut self, l: Lit, iter: &mut WatchCacheIterator, op: Option<Lit> )

push back a watch literal cache by adjusting the iterator for lit
source§

fn transform_by_elimination(&mut self, cid: ClauseId, p: Lit) -> RefClause

update watches of the clause
source§

fn transform_by_replacement( &mut self, cid: ClauseId, new_lits: &mut Vec<Lit> ) -> RefClause

generic clause transformer (not in use)
source§

fn transform_by_simplification( &mut self, asg: &mut impl AssignIF, cid: ClauseId ) -> RefClause

check satisfied and nullified literals in a clause
source§

fn transform_by_updating_watch( &mut self, cid: ClauseId, old: usize, new: usize, removed: bool )

swap i-th watch with j-th literal then update watch caches correctly
source§

fn update_at_analysis(&mut self, asg: &impl AssignIF, cid: ClauseId) -> bool

update flags. return true if it’s learnt.
source§

fn reset(&mut self)

remove all learnt clauses.
source§

fn certificate_add_assertion(&mut self, lit: Lit)

record an asserted literal to unsat certification.
source§

fn certificate_save(&mut self)

save the certification record to a file.
source§

fn check_size(&self) -> Result<bool, SolverError>

check the number of clauses Read more
source§

fn validate(&self, model: &[Option<bool>], strict: bool) -> Option<ClauseId>

returns None if the given assignment is a model of a problem. Otherwise returns a clause which is not satisfiable under a given assignment. Clauses with an unassigned literal are treated as falsified in strict mode.
source§

fn minimize_with_bi_clauses(&mut self, asg: &impl AssignIF, vec: &mut Vec<Lit>)

minimize a clause.
source§

fn complete_bi_clauses(&mut self, asg: &mut impl AssignIF)

complete bi-clause network
source§

impl Clone for ClauseDB

source§

fn clone(&self) -> ClauseDB

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ClauseDB

source§

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

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

impl Default for ClauseDB

source§

fn default() -> ClauseDB

Returns the “default value” for a type. Read more
source§

impl Index<&ClauseId> for ClauseDB

§

type Output = Clause

The returned type after indexing.
source§

fn index(&self, cid: &ClauseId) -> &Clause

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

impl Index<ClauseId> for ClauseDB

§

type Output = Clause

The returned type after indexing.
source§

fn index(&self, cid: ClauseId) -> &Clause

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

impl Index<Range<usize>> for ClauseDB

§

type Output = [Clause]

The returned type after indexing.
source§

fn index(&self, r: Range<usize>) -> &[Clause]

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

impl Index<RangeFrom<usize>> for ClauseDB

§

type Output = [Clause]

The returned type after indexing.
source§

fn index(&self, r: RangeFrom<usize>) -> &[Clause]

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

impl IndexMut<&ClauseId> for ClauseDB

source§

fn index_mut(&mut self, cid: &ClauseId) -> &mut Clause

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

impl IndexMut<ClauseId> for ClauseDB

source§

fn index_mut(&mut self, cid: ClauseId) -> &mut Clause

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

impl IndexMut<Range<usize>> for ClauseDB

source§

fn index_mut(&mut self, r: Range<usize>) -> &mut [Clause]

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

impl IndexMut<RangeFrom<usize>> for ClauseDB

source§

fn index_mut(&mut self, r: RangeFrom<usize>) -> &mut [Clause]

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

impl Instantiate for ClauseDB

source§

fn instantiate(config: &Config, cnf: &CNFDescription) -> ClauseDB

make and return an object from Config and CNFDescription.
source§

fn handle(&mut self, e: SolverEvent)

update by a solver event.
source§

impl PropertyDereference<Tf64, f64> for ClauseDB

source§

fn derefer(&self, k: Tf64) -> f64

source§

impl PropertyDereference<Tusize, usize> for ClauseDB

source§

fn derefer(&self, k: Tusize) -> usize

source§

impl PropertyReference<TEma, EmaView> for ClauseDB

source§

fn refer(&self, k: TEma) -> &EmaView

source§

impl StochasticLocalSearchIF for ClauseDB

returns the decision level of the given assignment and the one of the final assignment. Note: the lower level a set of clauses make a conflict at, the higher learning rate a solver can keep and the better learnt clauses we will have. This would be a better criteria that can be used in CDCL solvers.
source§

impl VivifyIF for ClauseDB

source§

fn vivify( &mut self, asg: &mut AssignStack, state: &mut State ) -> MaybeInconsistent

vivify clauses under asg

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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 Twhere U: TryFrom<T>,

§

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.