Commit a019dd21 by Alan Mishchenko

Improved abstraction refinement.

parent cfc82efb
...@@ -1303,7 +1303,7 @@ void Gla_ManStop( Gla_Man_t * p ) ...@@ -1303,7 +1303,7 @@ void Gla_ManStop( Gla_Man_t * p )
Gla_Obj_t * pGla; Gla_Obj_t * pGla;
int i; int i;
// if ( p->pPars->fVerbose ) if ( p->pPars->fVerbose )
Abc_Print( 1, "SAT solver: Var = %d Cla = %d Conf = %d Lrn = %d Reduce = %d Cex = %d Objs+ = %d\n", Abc_Print( 1, "SAT solver: Var = %d Cla = %d Conf = %d Lrn = %d Reduce = %d Cex = %d Objs+ = %d\n",
sat_solver2_nvars(p->pSat), sat_solver2_nclauses(p->pSat), sat_solver2_nconflicts(p->pSat), sat_solver2_nvars(p->pSat), sat_solver2_nclauses(p->pSat), sat_solver2_nconflicts(p->pSat),
sat_solver2_nlearnts(p->pSat), p->pSat->nDBreduces, p->nCexes, p->nObjAdded ); sat_solver2_nlearnts(p->pSat), p->pSat->nDBreduces, p->nCexes, p->nObjAdded );
...@@ -2102,8 +2102,8 @@ finish: ...@@ -2102,8 +2102,8 @@ finish:
{ {
if ( p->pPars->fVerbose && Status == -1 ) if ( p->pPars->fVerbose && Status == -1 )
printf( "\n" ); printf( "\n" );
if ( pAig->vGateClasses != NULL ) // if ( pAig->vGateClasses != NULL )
Abc_Print( 1, "Replacing the old abstraction by a new one.\n" ); // Abc_Print( 1, "Replacing the old abstraction by a new one.\n" );
Vec_IntFreeP( &pAig->vGateClasses ); Vec_IntFreeP( &pAig->vGateClasses );
pAig->vGateClasses = Gla_ManTranslate( p ); pAig->vGateClasses = Gla_ManTranslate( p );
if ( Status == -1 ) if ( Status == -1 )
......
...@@ -440,7 +440,7 @@ void Ga2_ManStop( Ga2_Man_t * p ) ...@@ -440,7 +440,7 @@ void Ga2_ManStop( Ga2_Man_t * p )
{ {
Vec_IntFreeP( &p->pGia->vMapping ); Vec_IntFreeP( &p->pGia->vMapping );
Gia_ManSetPhase( p->pGia ); Gia_ManSetPhase( p->pGia );
// if ( p->pPars->fVerbose ) if ( p->pPars->fVerbose )
Abc_Print( 1, "SAT solver: Var = %d Cla = %d Conf = %d Lrn = %d Reduce = %d Cex = %d ObjsAdded = %d\n", Abc_Print( 1, "SAT solver: Var = %d Cla = %d Conf = %d Lrn = %d Reduce = %d Cex = %d ObjsAdded = %d\n",
sat_solver2_nvars(p->pSat), sat_solver2_nclauses(p->pSat), sat_solver2_nvars(p->pSat), sat_solver2_nclauses(p->pSat),
sat_solver2_nconflicts(p->pSat), sat_solver2_nlearnts(p->pSat), sat_solver2_nconflicts(p->pSat), sat_solver2_nlearnts(p->pSat),
...@@ -1527,7 +1527,11 @@ int Ga2_ManPerform( Gia_Man_t * pAig, Gia_ParVta_t * pPars ) ...@@ -1527,7 +1527,11 @@ int Ga2_ManPerform( Gia_Man_t * pAig, Gia_ParVta_t * pPars )
goto finish; goto finish;
assert( RetValue == l_False ); assert( RetValue == l_False );
if ( c == 0 ) if ( c == 0 )
{
p->pPars->nFramesNoChange++;
break; break;
}
p->pPars->nFramesNoChange = 0;
// derive the core // derive the core
assert( p->pSat->pPrf2 != NULL ); assert( p->pSat->pPrf2 != NULL );
...@@ -1601,16 +1605,16 @@ finish: ...@@ -1601,16 +1605,16 @@ finish:
// analize the results // analize the results
if ( pAig->pCexSeq == NULL ) if ( pAig->pCexSeq == NULL )
{ {
if ( pAig->vGateClasses != NULL ) // if ( pAig->vGateClasses != NULL )
Abc_Print( 1, "Replacing the old abstraction by a new one.\n" ); // Abc_Print( 1, "Replacing the old abstraction by a new one.\n" );
Vec_IntFreeP( &pAig->vGateClasses ); Vec_IntFreeP( &pAig->vGateClasses );
pAig->vGateClasses = Ga2_ManAbsTranslate( p ); pAig->vGateClasses = Ga2_ManAbsTranslate( p );
if ( Status == l_Undef ) if ( Status == l_Undef )
{ {
if ( p->pPars->nTimeOut && clock() >= p->pSat->nRuntimeLimit ) if ( p->pPars->nTimeOut && clock() >= p->pSat->nRuntimeLimit )
Abc_Print( 1, "SAT solver ran out of time at %d sec in frame %d. ", p->pPars->nTimeOut, f ); Abc_Print( 1, "Timeout %d sec in frame %d with a %d-stable abstraction. ", p->pPars->nTimeOut, f, p->pPars->nFramesNoChange );
else if ( pPars->nConfLimit && sat_solver2_nconflicts(p->pSat) >= pPars->nConfLimit ) else if ( pPars->nConfLimit && sat_solver2_nconflicts(p->pSat) >= pPars->nConfLimit )
Abc_Print( 1, "SAT solver ran out of resources at %d conflicts in frame %d. ", pPars->nConfLimit, f ); Abc_Print( 1, "Exceeded %d conflicts in frame %d with a %d-stable abstraction. ", pPars->nConfLimit, f, p->pPars->nFramesNoChange );
else if ( Vec_IntSize(p->vAbs) >= p->nMarked * (100 - pPars->nRatioMin) / 100 ) else if ( Vec_IntSize(p->vAbs) >= p->nMarked * (100 - pPars->nRatioMin) / 100 )
Abc_Print( 1, "The ratio of abstracted objects is less than %d %% in frame %d. ", pPars->nRatioMin, f ); Abc_Print( 1, "The ratio of abstracted objects is less than %d %% in frame %d. ", pPars->nRatioMin, f );
else else
...@@ -1619,7 +1623,7 @@ finish: ...@@ -1619,7 +1623,7 @@ finish:
else else
{ {
p->pPars->iFrame++; p->pPars->iFrame++;
Abc_Print( 1, "SAT solver completed %d frames and produced an abstraction. ", f ); Abc_Print( 1, "SAT solver completed %d frames and produced a %d-stable abstraction. ", f, p->pPars->nFramesNoChange );
} }
} }
else else
......
...@@ -721,6 +721,7 @@ Vec_Int_t * Ga2_FilterSelected( Rnm_Man_t * p, Vec_Int_t * vSelect ) ...@@ -721,6 +721,7 @@ Vec_Int_t * Ga2_FilterSelected( Rnm_Man_t * p, Vec_Int_t * vSelect )
Vec_Int_t * Rnm_ManRefine( Rnm_Man_t * p, Abc_Cex_t * pCex, Vec_Int_t * vMap, int fPropFanout, int fVerbose ) Vec_Int_t * Rnm_ManRefine( Rnm_Man_t * p, Abc_Cex_t * pCex, Vec_Int_t * vMap, int fPropFanout, int fVerbose )
{ {
int fVerify = 0; int fVerify = 0;
int fPostProcess = 1;
Vec_Int_t * vSelected = Vec_IntAlloc( 100 ); Vec_Int_t * vSelected = Vec_IntAlloc( 100 );
Vec_Int_t * vNew; Vec_Int_t * vNew;
clock_t clk, clk2 = clock(); clock_t clk, clk2 = clock();
...@@ -754,16 +755,19 @@ Vec_Int_t * Rnm_ManRefine( Rnm_Man_t * p, Abc_Cex_t * pCex, Vec_Int_t * vMap, in ...@@ -754,16 +755,19 @@ Vec_Int_t * Rnm_ManRefine( Rnm_Man_t * p, Abc_Cex_t * pCex, Vec_Int_t * vMap, in
p->timeBwd += clock() - clk; p->timeBwd += clock() - clk;
} }
vNew = Ga2_FilterSelected( p, vSelected ); if ( fPostProcess )
if ( Vec_IntSize(vNew) > 0 )
{ {
Vec_IntFree( vSelected ); vNew = Ga2_FilterSelected( p, vSelected );
vSelected = vNew; if ( Vec_IntSize(vNew) > 0 )
} {
else Vec_IntFree( vSelected );
{ vSelected = vNew;
Vec_IntFree( vNew ); }
// printf( "\nBig refinement.\n" ); else
{
Vec_IntFree( vNew );
// printf( "\nBig refinement.\n" );
}
} }
// clean values // clean values
......
...@@ -1064,7 +1064,7 @@ Vta_Man_t * Vga_ManStart( Gia_Man_t * pGia, Gia_ParVta_t * pPars ) ...@@ -1064,7 +1064,7 @@ Vta_Man_t * Vga_ManStart( Gia_Man_t * pGia, Gia_ParVta_t * pPars )
***********************************************************************/ ***********************************************************************/
void Vga_ManStop( Vta_Man_t * p ) void Vga_ManStop( Vta_Man_t * p )
{ {
// if ( p->pPars->fVerbose ) if ( p->pPars->fVerbose )
Abc_Print( 1, "SAT solver: Var = %d Cla = %d Conf = %d Lrn = %d Reduce = %d Cex = %d Objs+ = %d\n", Abc_Print( 1, "SAT solver: Var = %d Cla = %d Conf = %d Lrn = %d Reduce = %d Cex = %d Objs+ = %d\n",
sat_solver2_nvars(p->pSat), sat_solver2_nclauses(p->pSat), sat_solver2_nconflicts(p->pSat), sat_solver2_nvars(p->pSat), sat_solver2_nclauses(p->pSat), sat_solver2_nconflicts(p->pSat),
sat_solver2_nlearnts(p->pSat), p->pSat->nDBreduces, p->nCexes, p->nObjAdded ); sat_solver2_nlearnts(p->pSat), p->pSat->nDBreduces, p->nCexes, p->nObjAdded );
...@@ -1706,8 +1706,8 @@ finish: ...@@ -1706,8 +1706,8 @@ finish:
else else
{ {
assert( Vec_PtrSize(p->vCores) > 0 ); assert( Vec_PtrSize(p->vCores) > 0 );
if ( pAig->vObjClasses != NULL ) // if ( pAig->vObjClasses != NULL )
Abc_Print( 1, "Replacing the old abstraction by a new one.\n" ); // Abc_Print( 1, "Replacing the old abstraction by a new one.\n" );
Vec_IntFreeP( &pAig->vObjClasses ); Vec_IntFreeP( &pAig->vObjClasses );
pAig->vObjClasses = Gia_VtaFramesToAbs( (Vec_Vec_t *)p->vCores ); pAig->vObjClasses = Gia_VtaFramesToAbs( (Vec_Vec_t *)p->vCores );
if ( Status == -1 ) if ( Status == -1 )
......
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