diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2013-05-18 10:52:07 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2013-05-18 10:52:07 -0700 |
commit | 0328488bdf845b711f74d2e1a30cbab4f63de825 (patch) | |
tree | f53a86c28ce0fee1bfce8fa541bcac17c7e2bbdf /src/sat/bsat/satSolver.c | |
parent | 29ee997bb922974b13582532ea9e6dd80a48f928 (diff) | |
download | abc-0328488bdf845b711f74d2e1a30cbab4f63de825.tar.gz abc-0328488bdf845b711f74d2e1a30cbab4f63de825.tar.bz2 abc-0328488bdf845b711f74d2e1a30cbab4f63de825.zip |
SAT variable profiling.
Diffstat (limited to 'src/sat/bsat/satSolver.c')
-rw-r--r-- | src/sat/bsat/satSolver.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/sat/bsat/satSolver.c b/src/sat/bsat/satSolver.c index 8f3098d8..31d4b0df 100644 --- a/src/sat/bsat/satSolver.c +++ b/src/sat/bsat/satSolver.c @@ -466,6 +466,12 @@ static int clause_create_new(sat_solver* s, lit* begin, lit* end, int learnt) static inline int sat_solver_enqueue(sat_solver* s, lit l, int from) { int v = lit_var(l); + if ( s->pFreqs[v] == 0 ) +// { + s->pFreqs[v] = 1; +// s->nVarUsed++; +// } + #ifdef VERBOSEDEBUG printf(L_IND"enqueue("L_LIT")\n", L_ind, L_lit(l)); #endif @@ -1033,6 +1039,8 @@ void sat_solver_setnvars(sat_solver* s,int n) s->activity = ABC_REALLOC(unsigned, s->activity, s->cap); s->activity2 = ABC_REALLOC(unsigned, s->activity2,s->cap); #endif + s->pFreqs = ABC_REALLOC(char, s->tags, s->cap); + if ( s->factors ) s->factors = ABC_REALLOC(double, s->factors, s->cap); s->orderpos = ABC_REALLOC(int, s->orderpos, s->cap); @@ -1054,6 +1062,7 @@ void sat_solver_setnvars(sat_solver* s,int n) #else s->activity[var] = (1<<10); #endif + s->pFreqs[var] = 0; if ( s->factors ) s->factors [var] = 0; // *((int*)s->vi + var) = 0; s->vi[var].val = varX; @@ -1106,6 +1115,7 @@ void sat_solver_delete(sat_solver* s) ABC_FREE(s->tags ); ABC_FREE(s->activity ); ABC_FREE(s->activity2); + ABC_FREE(s->pFreqs ); ABC_FREE(s->factors ); ABC_FREE(s->orderpos ); ABC_FREE(s->reasons ); @@ -1321,7 +1331,7 @@ void sat_solver_reducedb(sat_solver* s) // report the results TimeTotal += clock() - clk; - if ( s->fVerbose ) +// if ( s->fVerbose ) { Abc_Print(1, "reduceDB: Keeping %7d out of %7d clauses (%5.2f %%) ", s->stats.learnts, nLearnedOld, 100.0 * s->stats.learnts / nLearnedOld ); |