void Proof::deleted(ClauseId gone) { if (trav != NULL) trav->deleted(gone); if (!fp.null()){ putUInt(fp, ((id_counter - gone) << 1) | 1); putUInt(fp, 0); } }
ClauseId Proof::addRoot(vec<Lit>& cl) { cl.copyTo(clause); sortUnique(clause); if (trav != NULL) trav->root(clause); if (!fp.null()){ putUInt(fp, index(clause[0]) << 1); for (int i = 1; i < clause.size(); i++) putUInt(fp, index(clause[i]) - index(clause[i-1])); putUInt(fp, 0); // (0 is safe terminator since we removed duplicates) } return id_counter++; }
ClauseId Proof::endChain() { assert(chain_id.size() == chain_lit.size() + 1); if (chain_id.size() == 1) return chain_id[0]; else{ if (trav != NULL) trav->chain(chain_id, chain_lit); if (!fp.null()){ putUInt(fp, ((id_counter - chain_id[0]) << 1) | 1); for (int i = 0; i < chain_lit.size(); i++) putUInt(fp, index(chain_lit[i])+1 ), putUInt(fp, id_counter - chain_id[i+1]); putUInt(fp, 0); } return id_counter++; } }