00001 00021 #include "msatInt.h" 00022 00026 00030 00042 void Msat_SolverVarBumpActivity( Msat_Solver_t * p, Msat_Lit_t Lit ) 00043 { 00044 Msat_Var_t Var; 00045 if ( p->dVarDecay < 0 ) // (negative decay means static variable order -- don't bump) 00046 return; 00047 Var = MSAT_LIT2VAR(Lit); 00048 p->pdActivity[Var] += p->dVarInc; 00049 // p->pdActivity[Var] += p->dVarInc * p->pFactors[Var]; 00050 if ( p->pdActivity[Var] > 1e100 ) 00051 Msat_SolverVarRescaleActivity( p ); 00052 Msat_OrderUpdate( p->pOrder, Var ); 00053 } 00054 00066 void Msat_SolverVarDecayActivity( Msat_Solver_t * p ) 00067 { 00068 if ( p->dVarDecay >= 0 ) 00069 p->dVarInc *= p->dVarDecay; 00070 } 00071 00083 void Msat_SolverVarRescaleActivity( Msat_Solver_t * p ) 00084 { 00085 int i; 00086 for ( i = 0; i < p->nVars; i++ ) 00087 p->pdActivity[i] *= 1e-100; 00088 p->dVarInc *= 1e-100; 00089 } 00090 00102 void Msat_SolverClaBumpActivity( Msat_Solver_t * p, Msat_Clause_t * pC ) 00103 { 00104 float Activ; 00105 Activ = Msat_ClauseReadActivity(pC); 00106 if ( Activ + p->dClaInc > 1e20 ) 00107 { 00108 Msat_SolverClaRescaleActivity( p ); 00109 Activ = Msat_ClauseReadActivity( pC ); 00110 } 00111 Msat_ClauseWriteActivity( pC, Activ + (float)p->dClaInc ); 00112 } 00113 00125 void Msat_SolverClaDecayActivity( Msat_Solver_t * p ) 00126 { 00127 p->dClaInc *= p->dClaDecay; 00128 } 00129 00141 void Msat_SolverClaRescaleActivity( Msat_Solver_t * p ) 00142 { 00143 Msat_Clause_t ** pLearned; 00144 int nLearned, i; 00145 float Activ; 00146 nLearned = Msat_ClauseVecReadSize( p->vLearned ); 00147 pLearned = Msat_ClauseVecReadArray( p->vLearned ); 00148 for ( i = 0; i < nLearned; i++ ) 00149 { 00150 Activ = Msat_ClauseReadActivity( pLearned[i] ); 00151 Msat_ClauseWriteActivity( pLearned[i], Activ * (float)1e-20 ); 00152 } 00153 p->dClaInc *= 1e-20; 00154 } 00155 00159 00160