GRATgen: Verifier Class Reference

GRATgen

Classes | Public Member Functions | List of all members
Verifier Class Reference

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 ()
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
const vector< trail_item_t > & | 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.

## Detailed Description

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)

## Member Enumeration Documentation

## ◆ acres_t

enum Verifier::acres_t
| strong

Result of adding a clause.

Enumerator
NORMAL | Clause is 2-undec, and has been added to watchlists.
UNIT | Clause is a unit clause, assignment has been updated.
TAUT | Clause is a tautology, it has been ignored.
CONFLICT | Clause is a conflict clause. It has not been added.

## Constructor & Destructor Documentation

## ◆ Verifier()

Verifier::Verifier | ( | ClauseDB & | _db | ) |
| 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!

## Member Function Documentation

## ◆ bwd_pass()

void Verifier::bwd_pass | ( | bool | show_status_bar | ) |

Perform backwards pass, starting at the specified item.

Parameters

  show_status_bar | Wether to print a status bar

## ◆ for_marked_from()

template<typename T >

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.

Parameters

  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!

See also
  Conflict_Analysis

## ◆ fwd_pass()

pos_t Verifier::fwd_pass | ( |  | ) |

Perform forward pass.

Returns
  relative position of conflict clause

## ◆ init_after_parsing()

void Verifier::init_after_parsing | ( | Synch_Data * | _sdata | ) |
| inline

Initialize after parsing has been completed.

See also
  Object_Lifetimes

## ◆ mark_clause()

void Verifier::mark_clause | ( | lit_t * | cl | ) |

Mark clause and literals in clause, recursively.

See also
  Conflict_Analysis

## ◆ mark_var()

void Verifier::mark_var | ( | size_t | v | ) |
| inline

Mark reason for this variable to be set, recursively.

See also
  Conflict_Analysis

## ◆ propagate_units()

lit_t* Verifier::propagate_units | ( |  | ) |
| 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().

Returns
  Conflict clause or nullptr

See also
  Core_First_Unit_Propagation

## ◆ sync_marked()

bool Verifier::sync_marked | ( | bool | force | ) |

Synchronize marked clauses.

May give up to acquire lock if not too many clauses to synchronize.

Parameters

  force | Force synchronization.

The documentation for this class was generated from the following file:

- gratgen.cpp