C++ Reference: class LiteralWatchers
Note: This documentation is automatically generated.
Stores the 2-watched literals data structure. See http://www.cs.berkeley.edu/~necula/autded/lecture24-sat.pdf for detail.This class is also responsible for owning the clause memory and all related information.
TODO(user): Rename ClauseManager. This does more than just watching the clauses and is the place where all the clauses are stored.
Method | |
---|---|
AddClause | Return type: Arguments: Adds a new clause and perform initial propagation for this clause only. |
AddClause | Return type: Arguments: |
AddRemovableClause | Return type: Arguments: Same as AddClause() for a removable clause. This is only called on learned conflict, so this should never have all its literal at false (CHECKED). |
AllClausesInCreationOrder | Return type: |
Attach | Return type: Arguments: Attaches the given clause. The first two literal of the clause must be unassigned and the clause must not be already attached. |
AttachAllClauses | Return type: |
CleanUpWatchers | Return type: |
DeleteRemovedClauses | Return type: Reclaims the memory of the lazily removed clauses (their size was set to zero) and remove them from AllClausesInCreationOrder() this work in O(num_clauses()). |
Detach | Return type: Arguments: Detaches the given clause right away. TODO(user): It might be better to have a "slower" mode in PropagateOnFalse() that deal with detached clauses in the watcher list and is activated until the next CleanUpWatchers() calls. |
DetachAllClauses | Return type: During an inprocessing phase, it is easier to detach all clause first, then simplify and then reattach them. Note however that during these two calls, it is not possible to use the solver unit-progation. Important: When reattach is called, we assume that none of their literal are fixed, so we don't do any special checks. These functions can be called multiple-time and do the right things. This way before doing something, you can call the corresponding function and be sure to be in a good state. I.e. always AttachAllClauses() before propagation and DetachAllClauses() before going to do an inprocessing pass that might transform them. |
InprocessingAddClause | Return type: Arguments: This can return nullptr if new_clause was of size one or two as these are treated differently. Note that none of the variable should be fixed in the given new clause. |
InprocessingFixLiteral | Return type: Arguments: |
InprocessingRemoveClause | Return type: Arguments: These must only be called between [Detach/Attach]AllClauses() calls. |
InprocessingRewriteClause | Return type: Arguments: |
IsRemovable | Return type: Arguments: True if removing this clause will not change the set of feasible solution. This is the case for clauses that were learned during search. Note however that some learned clause are kept forever (heuristics) and do not appear here. |
LazyDetach | Return type: Arguments: Lazily detach the given clause. The deletion will actually occur when CleanUpWatchers() is called. The later needs to be called before any other function in this class can be called. This is DCHECKed. Note that we remove the clause from clauses_info_ right away. |
literal_size | Return type: The number of different literals (always twice the number of variables). |
LiteralWatchers | Return type: Arguments: |
~LiteralWatchers | |
mutable_clauses_info | Return type: |
NextClauseToMinimize | Return type: Really basic algorithm to return a clause to try to minimize. We simply loop over the clause that we keep forever, in creation order. This starts by the problem clauses and then the learned one that we keep forever. |
num_clauses | Return type: |
num_inspected_clause_literals | Return type: |
num_inspected_clauses | Return type: Total number of clauses inspected during calls to PropagateOnFalse(). |
num_removable_clauses | Return type: |
num_watched_clauses | Return type: Number of clauses currently watched. |
Propagate | Return type: Arguments: SatPropagator API. |
Reason | Return type: Arguments: |
ReasonClause | Return type: Arguments: Returns the reason of the variable at given trail_index. This only works for variable propagated by this class and is almost the same as Reason() with a different return format. |
ResetToMinimizeIndex | Return type: Restart the scan in NextClauseToMinimize() from the first problem clause. |
Resize | Return type: Arguments: Must be called before adding clauses referring to such variables. |
SetDratProofHandler | Return type: Arguments: |
WatcherListOnFalse | Return type: Arguments: This is exposed since some inprocessing code can heuristically exploit the currently watched literal and blocking literal to do some simplification. |