summaryrefslogtreecommitdiffstats
path: root/src/sat
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2019-11-01 00:58:12 +0200
committerAlan Mishchenko <alanmi@berkeley.edu>2019-11-01 00:58:12 +0200
commit6b2fe00cd82f0229777a6beb2390858834551399 (patch)
treef4ba85a0d1aa0888e7fef966d01b5ef6aa03d4dc /src/sat
parent7f503dc73738b79ed388091f903e8df879c21ac7 (diff)
downloadabc-6b2fe00cd82f0229777a6beb2390858834551399.tar.gz
abc-6b2fe00cd82f0229777a6beb2390858834551399.tar.bz2
abc-6b2fe00cd82f0229777a6beb2390858834551399.zip
Changes to several APIs.
Diffstat (limited to 'src/sat')
-rw-r--r--src/sat/bsat/satSolver.c28
1 files changed, 22 insertions, 6 deletions
diff --git a/src/sat/bsat/satSolver.c b/src/sat/bsat/satSolver.c
index 31ae8dae..2f3a84db 100644
--- a/src/sat/bsat/satSolver.c
+++ b/src/sat/bsat/satSolver.c
@@ -217,16 +217,32 @@ static inline int order_select(sat_solver* s, float random_var_freq) // selectv
void sat_solver_set_var_activity(sat_solver* s, int * pVars, int nVars)
{
int i;
- assert( s->VarActType == 1 );
for (i = 0; i < s->size; i++)
s->activity[i] = 0;
- s->var_inc = Abc_Dbl2Word(1);
- for ( i = 0; i < nVars; i++ )
+ if ( s->VarActType == 0 )
{
- int iVar = pVars ? pVars[i] : i;
- s->activity[iVar] = Abc_Dbl2Word(nVars-i);
- order_update( s, iVar );
+ s->var_inc = (1 << 5);
+ s->var_decay = -1;
+ for ( i = 0; i < nVars; i++ )
+ {
+ int iVar = pVars ? pVars[i] : i;
+ s->activity[iVar] = s->var_inc*(nVars-i);
+ if (s->orderpos[iVar] != -1)
+ order_update( s, iVar );
+ }
}
+ else if ( s->VarActType == 1 )
+ {
+ s->var_inc = Abc_Dbl2Word(1);
+ for ( i = 0; i < nVars; i++ )
+ {
+ int iVar = pVars ? pVars[i] : i;
+ s->activity[iVar] = Abc_Dbl2Word(nVars-i);
+ if (s->orderpos[iVar] != -1)
+ order_update( s, iVar );
+ }
+ }
+ else assert( 0 );
}
//=================================================================================================