Commit 6f4bb33c by Alan Mishchenko

Variable timeframe abstraction.

parent f80841a5
...@@ -1402,6 +1402,7 @@ int Gia_VtaPerform( Gia_Man_t * pAig, Gia_ParVta_t * pPars ) ...@@ -1402,6 +1402,7 @@ int Gia_VtaPerform( Gia_Man_t * pAig, Gia_ParVta_t * pPars )
assert( pPars->nFramesMax == 0 || pPars->nFramesStart <= pPars->nFramesMax ); assert( pPars->nFramesMax == 0 || pPars->nFramesStart <= pPars->nFramesMax );
// start the manager // start the manager
p = Vga_ManStart( pAig, pPars ); p = Vga_ManStart( pAig, pPars );
p->pSat->fVerbose = p->pPars->fVerbose;
sat_solver2_set_learntmax( p->pSat, pPars->nLearntMax ); sat_solver2_set_learntmax( p->pSat, pPars->nLearntMax );
// set runtime limit // set runtime limit
if ( p->pPars->nTimeOut ) if ( p->pPars->nTimeOut )
......
...@@ -516,7 +516,7 @@ Vec_Int_t * Aig_Gla3ManPerform( Aig_Man_t * pAig, int nStart, int nFramesMax, in ...@@ -516,7 +516,7 @@ Vec_Int_t * Aig_Gla3ManPerform( Aig_Man_t * pAig, int nStart, int nFramesMax, in
Aig_Gla3ManStop( p ); Aig_Gla3ManStop( p );
return NULL; return NULL;
} }
sat_solver2_set_random( p->pSat, fSkipRand ); p->pSat->fNotUseRandom = fSkipRand;
p->timePre += clock() - clk; p->timePre += clock() - clk;
// set runtime limit // set runtime limit
......
...@@ -1154,6 +1154,7 @@ sat_solver2* sat_solver2_new(void) ...@@ -1154,6 +1154,7 @@ sat_solver2* sat_solver2_new(void)
s->fSkipSimplify = 1; s->fSkipSimplify = 1;
s->fNotUseRandom = 0; s->fNotUseRandom = 0;
s->nLearntMax = 0; s->nLearntMax = 0;
s->fVerbose = 0;
// prealloc clause // prealloc clause
assert( !s->clauses.ptr ); assert( !s->clauses.ptr );
...@@ -1220,7 +1221,6 @@ void sat_solver2_setnvars(sat_solver2* s,int n) ...@@ -1220,7 +1221,6 @@ void sat_solver2_setnvars(sat_solver2* s,int n)
*((int*)s->vi + var) = 0; //s->vi[var].val = varX; *((int*)s->vi + var) = 0; //s->vi[var].val = varX;
s->levels [var] = 0; s->levels [var] = 0;
s->assigns [var] = varX; s->assigns [var] = varX;
s->orderpos[var] = veci_size(&s->order);
s->reasons [var] = 0; s->reasons [var] = 0;
if ( s->fProofLogging ) if ( s->fProofLogging )
s->units [var] = 0; s->units [var] = 0;
...@@ -1232,6 +1232,7 @@ void sat_solver2_setnvars(sat_solver2* s,int n) ...@@ -1232,6 +1232,7 @@ void sat_solver2_setnvars(sat_solver2* s,int n)
s->model [var] = 0; s->model [var] = 0;
// does not hold because variables enqueued at top level will not be reinserted in the heap // does not hold because variables enqueued at top level will not be reinserted in the heap
// assert(veci_size(&s->order) == var); // assert(veci_size(&s->order) == var);
s->orderpos[var] = veci_size(&s->order);
veci_push(&s->order,var); veci_push(&s->order,var);
order_update(s, var); order_update(s, var);
} }
...@@ -1420,6 +1421,7 @@ void sat_solver2_reducedb(sat_solver2* s) ...@@ -1420,6 +1421,7 @@ void sat_solver2_reducedb(sat_solver2* s)
c->mark = 1; c->mark = 1;
} }
// report the results // report the results
if ( s->fVerbose )
printf( "reduceDB: Keeping %7d out of %7d clauses (%5.2f %%) ", printf( "reduceDB: Keeping %7d out of %7d clauses (%5.2f %%) ",
veci_size(&s->learnt_live), s->stats.learnts, 100.0 * veci_size(&s->learnt_live) / s->stats.learnts ); veci_size(&s->learnt_live), s->stats.learnts, 100.0 * veci_size(&s->learnt_live) / s->stats.learnts );
...@@ -1488,6 +1490,7 @@ void sat_solver2_reducedb(sat_solver2* s) ...@@ -1488,6 +1490,7 @@ void sat_solver2_reducedb(sat_solver2* s)
Sat_ProofReduce( s ); Sat_ProofReduce( s );
TimeTotal += clock() - clk; TimeTotal += clock() - clk;
if ( s->fVerbose )
Abc_PrintTime( 1, "Time", TimeTotal ); Abc_PrintTime( 1, "Time", TimeTotal );
} }
...@@ -1548,6 +1551,7 @@ void sat_solver2_rollback( sat_solver2* s ) ...@@ -1548,6 +1551,7 @@ void sat_solver2_rollback( sat_solver2* s )
// reset watcher lists // reset watcher lists
for ( i = 2*s->iVarPivot; i < 2*s->size; i++ ) for ( i = 2*s->iVarPivot; i < 2*s->size; i++ )
s->wlists[i].size = 0; s->wlists[i].size = 0;
// clean the room
for ( i = s->iVarPivot; i < s->size; i++ ) for ( i = s->iVarPivot; i < s->size; i++ )
{ {
*((int*)s->vi + i) = 0; *((int*)s->vi + i) = 0;
......
...@@ -106,6 +106,7 @@ struct sat_solver2_t ...@@ -106,6 +106,7 @@ struct sat_solver2_t
int fNotUseRandom; // do not allow random decisions with a fixed probability int fNotUseRandom; // do not allow random decisions with a fixed probability
int fSkipSimplify; // set to one to skip simplification of the clause database int fSkipSimplify; // set to one to skip simplification of the clause database
int fProofLogging; // enable proof-logging int fProofLogging; // enable proof-logging
int fVerbose;
// clauses // clauses
veci clauses; // clause memory veci clauses; // clause memory
...@@ -240,13 +241,6 @@ static inline int sat_solver2_set_runtime_limit(sat_solver2* s, int Limit) ...@@ -240,13 +241,6 @@ static inline int sat_solver2_set_runtime_limit(sat_solver2* s, int Limit)
return temp; return temp;
} }
static inline int sat_solver2_set_random(sat_solver2* s, int fNotUseRandom)
{
int temp = s->fNotUseRandom;
s->fNotUseRandom = fNotUseRandom;
return temp;
}
static inline int sat_solver2_set_learntmax(sat_solver2* s, int nLearntMax) static inline int sat_solver2_set_learntmax(sat_solver2* s, int nLearntMax)
{ {
int temp = s->nLearntMax; int temp = s->nLearntMax;
......
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