GRATgen
|
Main functionality for DRAT certificate verification. More...
Public Member Functions | |
Verifier (ClauseDB &_db) | |
Construct verifier using a specified clause database, instead of creating an own copy. More... | |
~Verifier () | |
Destructor. | |
void | init_after_parsing (Synch_Data *_sdata) |
Initialize after parsing has been completed. More... | |
Verifier (Verifier const &vrf) | |
Initialize a verifier with a copy of the specified clause database. | |
Verifier & | operator= (Verifier const &vrf) |
Assign the verifier to be a copy of the specified verifier, using its own clause database and state. | |
Verifier (Verifier const &&vrf)=delete | |
Verifier & | operator= (Verifier const &&vrf)=delete |
lit_t * | propagate_units () |
Do unit propagation. More... | |
pos_t | fwd_pass () |
Perform forward pass. More... | |
void | bwd_pass (bool show_status_bar) |
Perform backwards pass, starting at the specified item. More... | |
size_t | get_cnt_verified () |
Used for debugging only. | |
Assignment | |
bool | is_true (lit_t l) |
Query wether literal is assigned to true. | |
bool | is_false (lit_t l) |
Query wether literal is assigned to false. | |
void | assign_true (lit_t l, lit_t *reason) |
Assign literal to true. | |
Backtracking and marking | |
vector< trail_item_t > const & | get_trail () const |
Get trail. | |
size_t | trail_pos () |
Get trail position where next item is added. | |
const vector< bool > & | get_fwd_vmarked () |
Get marking information collected for forward trail. | |
void | rollback (size_t pos) |
Rollback to specfied trail position. | |
template<typename T > | |
void | for_marked_from (size_t pos, T const &ucr) |
Dump vmarked clauses from pos (inclusive), by calling ucr(cl). More... | |
void | mark_var (size_t v) |
Mark reason for this variable to be set, recursively. More... | |
void | mark_clause (lit_t *cl) |
Mark clause and literals in clause, recursively. More... | |
bool | sync_marked (bool force) |
Synchronize marked clauses. More... | |
void | sync_incoming_marked () |
Synchronize only incoming marked clauses. | |
Adding and removing clauses | |
enum | acres_t { acres_t::NORMAL, acres_t::UNIT, acres_t::TAUT, acres_t::CONFLICT } |
Result of adding a clause. More... | |
acres_t | add_clause (lit_t *cl) |
Add a clause and update the internal data structures. | |
bool | rem_clause (lit_t *cl) |
Remove clause from watchlist. Returns true if clause actually was in watchlists. | |
void | readd_clause (lit_t *cl) |
Only clauses that where on watchlists may be readded. Watched literals must not have changed since deletion. | |
Main functionality for DRAT certificate verification.
There may be many concurrent verifiers, each working with its own copy of the clause database, and each having its own state (including assignment, trail, 2wl)
|
strong |
|
inline |
Construct verifier using a specified clause database, instead of creating an own copy.
As clause databases tend to get huge, it is important for memory efficiency not to have an unused copy of the clause database lying around.
Warning: After a verifier is started on a clause database, it will modify the watched literals in there, such that concurrently initializing more verifiers from this database is undefined behaviour!
void Verifier::bwd_pass | ( | bool | show_status_bar | ) |
Perform backwards pass, starting at the specified item.
show_status_bar | Wether to print a status bar |
void Verifier::for_marked_from | ( | size_t | pos, |
T const & | ucr | ||
) |
Dump vmarked clauses from pos (inclusive), by calling ucr(cl).
This function is used to emit the relevant unit propagations for reaching a conflict, before backtracking.
pos | Position (inclusive) to dump vmarked trail items |
ucr | Callback invoked with the reason for each of the vmarked trail items. |
TODO: Could be combined with backtracking, to have only one iteration over the trail!
pos_t Verifier::fwd_pass | ( | ) |
Perform forward pass.
|
inline |
Initialize after parsing has been completed.
void Verifier::mark_clause | ( | lit_t * | cl | ) |
Mark clause and literals in clause, recursively.
|
inline |
Mark reason for this variable to be set, recursively.
|
inline |
Do unit propagation.
Select core-first heuristics according to cfg_core_first. Note: Unit propagation does not perform conflict analysis, this must be invoked afterwards, with mark_clause().
bool Verifier::sync_marked | ( | bool | force | ) |
Synchronize marked clauses.
May give up to acquire lock if not too many clauses to synchronize.
force | Force synchronization. |