Commit c2a1a9ef by Alan Mishchenko

Implementing rollback in the updated solver.

parent a2228ee0
...@@ -1322,6 +1322,7 @@ void sat_solver2_delete(sat_solver2* s) ...@@ -1322,6 +1322,7 @@ void sat_solver2_delete(sat_solver2* s)
veci_delete( pCore ); veci_delete( pCore );
ABC_FREE( pCore ); ABC_FREE( pCore );
*/ */
// if ( s->fProofLogging )
// Sat_ProofCheck( s ); // Sat_ProofCheck( s );
// delete vectors // delete vectors
...@@ -1516,17 +1517,17 @@ void solver2_reducedb(sat_solver2* s) ...@@ -1516,17 +1517,17 @@ void solver2_reducedb(sat_solver2* s)
{ {
pArray = veci_begin(&s->wlists[i]); pArray = veci_begin(&s->wlists[i]);
for ( j = k = 0; k < veci_size(&s->wlists[i]); k++ ) for ( j = k = 0; k < veci_size(&s->wlists[i]); k++ )
if ( pArray[k] & 1 ) if ( !(pArray[k] & 1) ) // problem clause
pArray[j++] = pArray[k]; pArray[j++] = pArray[k];
else if ( !(c = clause_read(s, pArray[k]))->mark ) else if ( !(c = clause_read(s, pArray[k]))->mark ) // useful learned clause
pArray[j++] = c->Id; pArray[j++] = (c->Id << 1) | 1;
veci_resize(&s->wlists[i],j); veci_resize(&s->wlists[i],j);
} }
// compact units // compact units
if ( s->fProofLogging ) if ( s->fProofLogging )
for ( i = 0; i < s->size; i++ ) for ( i = 0; i < s->size; i++ )
if ( s->units[i] && (s->units[i] & 1) ) if ( s->units[i] && (s->units[i] & 1) )
s->units[i] = clause_read(s, s->units[i])->Id; s->units[i] = (clause_read(s, s->units[i])->Id << 1) | 1;
// compact clauses // compact clauses
satset_foreach_entry_vec( &s->learnt_live, &s->learnts, c, i ) satset_foreach_entry_vec( &s->learnt_live, &s->learnts, c, i )
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment