Struct splr::cdb::ClauseDB[][src]

pub struct ClauseDB {
    pub bi_clause: Vec<HashMap<Lit, ClauseId>>,
    pub watch_cache: Vec<Vec<(ClauseId, Lit)>>,
    pub lbd_of_dp_ema: Ema,
    pub eliminated_permanent: Vec<Vec<Lit>>,
    // some fields omitted
}
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

bi_clause: Vec<HashMap<Lit, ClauseId>>

hashed representation of binary clauses.

Note

This means a biclause [l0, l1] is stored at bi_clause[l0] instead of bi_clause[!l0].

watch_cache: Vec<Vec<(ClauseId, Lit)>>

container of watch literals

lbd_of_dp_ema: Ema

EMA of LBD of clauses used in conflict analysis (dependency graph)

eliminated_permanent: Vec<Vec<Lit>>

Trait Implementations

return one’s activity.

return average activity

set activity

modify one’s activity at conflict analysis in conflict_analyze in solver.

update internal counter.

modify one’s activity at value assignment in assign.

modify one’s activity at value assignment in unit propagation.

modify one’s activity at value un-assignment in cancel_until.

update reward decay.

remove a clause temporally

push back a clause

Warning

this function is the only function that makes dead clauses

return the length of clause.

return true if it’s empty.

return an iterator.

return a mutable iterator.

return a watcher list for bi-clauses

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

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

detach the watch_cache referred by the head of a watch_cache iterator

register the clause to the previous watch cache

restore detached watch cache

Merge two watch cache

swap the first two literals in a clause.

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. Read more

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

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

update watches of the clause

generic clause transformer (not in use)

check satisfied and nullified literals in a clause

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

update LBD then convert a learnt clause to permanent if needed.

check the condition to reduce. Read more

record an asserted literal to unsat certification.

save the certification record to a file.

check the number of clauses Read more

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. Read more

minimize a clause.

complete bi-clause network

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

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

The returned type after indexing.

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

The returned type after indexing.

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

The returned type after indexing.

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

The returned type after indexing.

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

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

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

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

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

make and return an object from Config and CNFDescription.

update by a solver event.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.