// to SAT solver
IdToConflicts d_assumptionConflictsDebug;
- // resolutions
+ // Resolutions.
+
+ /**
+ * Map from ClauseId to resolution chain corresponding proving the
+ * clause corresponding to the ClauseId. d_resolutionChains owns the
+ * memory of the ResChain* it contains.
+ */
IdResMap d_resolutionChains;
+
+ /*
+ * Stack containting current ResChain* we are working on. d_resStack
+ * owns the memory for the ResChain* it contains. Invariant: no
+ * ResChain* pointer can be both in d_resStack and
+ * d_resolutionChains. Memory ownership is transfered from
+ * d_resStack to d_resolutionChains via registerResolution.
+ */
ResStack d_resStack;
bool d_checkRes;
delete seen_input_it->second;
}
- // TODO: Have an expert check this.
typedef typename IdResMap::const_iterator ResolutionChainIterator;
ResolutionChainIterator resolution_it = d_resolutionChains.begin();
ResolutionChainIterator resolution_it_end = d_resolutionChains.end();
delete current;
}
+ // It could be the case that d_resStack is not empty at destruction time
+ // (for example in the SAT case).
typename ResStack::const_iterator resolution_stack_it = d_resStack.begin();
typename ResStack::const_iterator resolution_stack_it_end = d_resStack.end();
for (; resolution_stack_it != resolution_stack_it_end;
removeRedundantFromRes(res, id);
Assert(res->redundantRemoved());
- // TODO: Have someone with a clue check this.
+ // Because the SAT solver can add the same clause multiple times, it
+ // could be the case that a resolution chain for this clause already
+ // exists (e.g. when removing units in addClause).
if (hasResolutionChain(id)) {
ResChain<Solver>* current = d_resolutionChains.find(id)->second;
delete current;
template <class Solver>
void TSatProof<Solver>::cancelResChain() {
Assert(d_resStack.size() > 0);
- // TODO: Expert check.
ResolutionChain* back = d_resStack.back();
delete back;
d_resStack.pop_back();
print(conflict_id);
}
- // TODO: Run this rotation by someone.
ResChain<Solver>* res = new ResChain<Solver>(conflict_id);
// Here, the call to resolveUnit() can reallocate memory in the
// clause allocator. So reload conflict ptr each time.