Commit 9fc1cd0b by Alan Mishchenko

Enabling multi-output solving in 'pdr'.

parent 58d4012a
...@@ -2145,10 +2145,10 @@ int Abc_NtkDarBmc3( Abc_Ntk_t * pNtk, Saig_ParBmc_t * pPars, int fOrDecomp ) ...@@ -2145,10 +2145,10 @@ int Abc_NtkDarBmc3( Abc_Ntk_t * pNtk, Saig_ParBmc_t * pPars, int fOrDecomp )
else else
{ {
int nOutputs = Saig_ManPoNum(pMan) - Saig_ManConstrNum(pMan); int nOutputs = Saig_ManPoNum(pMan) - Saig_ManConstrNum(pMan);
if ( Vec_PtrCountZero(pMan->vSeqModelVec) == 0 ) if ( pMan->vSeqModelVec == NULL || Vec_PtrCountZero(pMan->vSeqModelVec) == nOutputs )
Abc_Print( 1, "All %d outputs are found to be SAT. ", nOutputs );
else if ( Vec_PtrCountZero(pMan->vSeqModelVec) == nOutputs )
Abc_Print( 1, "None of the %d outputs is found to be SAT. ", nOutputs ); Abc_Print( 1, "None of the %d outputs is found to be SAT. ", nOutputs );
else if ( Vec_PtrCountZero(pMan->vSeqModelVec) == 0 )
Abc_Print( 1, "All %d outputs are found to be SAT. ", nOutputs );
else else
Abc_Print( 1, "Some outputs (%d out of %d) are proved SAT. ", Abc_Print( 1, "Some outputs (%d out of %d) are proved SAT. ",
nOutputs - Vec_PtrCountZero(pMan->vSeqModelVec), nOutputs ); nOutputs - Vec_PtrCountZero(pMan->vSeqModelVec), nOutputs );
...@@ -2719,23 +2719,37 @@ int Abc_NtkDarPdr( Abc_Ntk_t * pNtk, Pdr_Par_t * pPars ) ...@@ -2719,23 +2719,37 @@ int Abc_NtkDarPdr( Abc_Ntk_t * pNtk, Pdr_Par_t * pPars )
RetValue = Pdr_ManSolve( pMan, pPars ); RetValue = Pdr_ManSolve( pMan, pPars );
if ( !pPars->fSilent ) if ( !pPars->fSilent )
{ {
if ( RetValue == 1 ) if ( pPars->fSolveAll )
Abc_Print( 1, "Property proved. " );
else if ( RetValue == 0 )
{ {
if ( pMan->pSeqModel == NULL ) int nOutputs = Saig_ManPoNum(pMan) - Saig_ManConstrNum(pMan);
Abc_Print( 1, "Abc_NtkDarPdr(): Counter-example is not available.\n" ); if ( pMan->vSeqModelVec == NULL || Vec_PtrCountZero(pMan->vSeqModelVec) == nOutputs )
Abc_Print( 1, "None of the %d outputs is found to be SAT. ", nOutputs );
else if ( Vec_PtrCountZero(pMan->vSeqModelVec) == 0 )
Abc_Print( 1, "All %d outputs are found to be SAT. ", nOutputs );
else else
Abc_Print( 1, "Some outputs (%d out of %d) are proved SAT. ",
nOutputs - Vec_PtrCountZero(pMan->vSeqModelVec), nOutputs );
}
else
{
if ( RetValue == 1 )
Abc_Print( 1, "Property proved. " );
else if ( RetValue == 0 )
{ {
Abc_Print( 1, "Output %d of miter \"%s\" was asserted in frame %d. ", pMan->pSeqModel->iPo, pNtk->pName, pMan->pSeqModel->iFrame ); if ( pMan->pSeqModel == NULL )
if ( !Saig_ManVerifyCex( pMan, pMan->pSeqModel ) ) Abc_Print( 1, "Abc_NtkDarPdr(): Counter-example is not available.\n" );
Abc_Print( 1, "Abc_NtkDarPdr(): Counter-example verification has FAILED.\n" ); else
{
Abc_Print( 1, "Output %d of miter \"%s\" was asserted in frame %d. ", pMan->pSeqModel->iPo, pNtk->pName, pMan->pSeqModel->iFrame );
if ( !Saig_ManVerifyCex( pMan, pMan->pSeqModel ) )
Abc_Print( 1, "Abc_NtkDarPdr(): Counter-example verification has FAILED.\n" );
}
} }
else if ( RetValue == -1 )
Abc_Print( 1, "Property UNDECIDED. " );
else
assert( 0 );
} }
else if ( RetValue == -1 )
Abc_Print( 1, "Property UNDECIDED. " );
else
assert( 0 );
ABC_PRT( "Time", clock() - clk ); ABC_PRT( "Time", clock() - clk );
} }
ABC_FREE( pNtk->pSeqModel ); ABC_FREE( pNtk->pSeqModel );
......
...@@ -606,7 +606,7 @@ int Pdr_ManSolveInt( Pdr_Man_t * p ) ...@@ -606,7 +606,7 @@ int Pdr_ManSolveInt( Pdr_Man_t * p )
else if ( p->pPars->fVerbose ) else if ( p->pPars->fVerbose )
Abc_Print( 1, "Computation cancelled by the callback.\n" ); Abc_Print( 1, "Computation cancelled by the callback.\n" );
p->pPars->iFrame = k; p->pPars->iFrame = k;
return -1; return p->vCexes ? 0 : -1;
} }
if ( RetValue == 0 ) if ( RetValue == 0 )
{ {
...@@ -620,7 +620,7 @@ int Pdr_ManSolveInt( Pdr_Man_t * p ) ...@@ -620,7 +620,7 @@ int Pdr_ManSolveInt( Pdr_Man_t * p )
else if ( p->pPars->fVerbose ) else if ( p->pPars->fVerbose )
Abc_Print( 1, "Computation cancelled by the callback.\n" ); Abc_Print( 1, "Computation cancelled by the callback.\n" );
p->pPars->iFrame = k; p->pPars->iFrame = k;
return -1; return p->vCexes ? 0 : -1;
} }
if ( RetValue == 0 ) if ( RetValue == 0 )
{ {
...@@ -676,9 +676,14 @@ int Pdr_ManSolveInt( Pdr_Man_t * p ) ...@@ -676,9 +676,14 @@ int Pdr_ManSolveInt( Pdr_Man_t * p )
if ( p->pPars->fVerbose ) if ( p->pPars->fVerbose )
Pdr_ManPrintProgress( p, 1, clock() - clkStart ); Pdr_ManPrintProgress( p, 1, clock() - clkStart );
if ( !p->pPars->fSilent ) if ( !p->pPars->fSilent )
Abc_Print( 1, "Reached conflict limit (%d).\n", p->pPars->nConfLimit ); {
if ( p->timeToStop && clock() > p->timeToStop )
Abc_Print( 1, "Reached timeout (%d seconds).\n", p->pPars->nTimeOut );
else
Abc_Print( 1, "Reached conflict limit (%d).\n", p->pPars->nConfLimit );
}
p->pPars->iFrame = k; p->pPars->iFrame = k;
return -1; return p->vCexes ? 0 : -1;
} }
if ( RetValue ) if ( RetValue )
{ {
...@@ -689,7 +694,7 @@ int Pdr_ManSolveInt( Pdr_Man_t * p ) ...@@ -689,7 +694,7 @@ int Pdr_ManSolveInt( Pdr_Man_t * p )
if ( !p->pPars->fSilent ) if ( !p->pPars->fSilent )
Pdr_ManVerifyInvariant( p ); Pdr_ManVerifyInvariant( p );
p->pPars->iFrame = k; p->pPars->iFrame = k;
return 1; // UNSAT return p->vCexes ? 0 : 1; // UNSAT
} }
if ( p->pPars->fVerbose ) if ( p->pPars->fVerbose )
Pdr_ManPrintProgress( p, 0, clock() - clkStart ); Pdr_ManPrintProgress( p, 0, clock() - clkStart );
...@@ -698,7 +703,7 @@ int Pdr_ManSolveInt( Pdr_Man_t * p ) ...@@ -698,7 +703,7 @@ int Pdr_ManSolveInt( Pdr_Man_t * p )
if ( p->pPars->pFuncStop && p->pPars->pFuncStop(p->pPars->RunId) ) if ( p->pPars->pFuncStop && p->pPars->pFuncStop(p->pPars->RunId) )
{ {
p->pPars->iFrame = k; p->pPars->iFrame = k;
return -1; return p->vCexes ? 0 : -1;
} }
if ( p->timeToStop && clock() > p->timeToStop ) if ( p->timeToStop && clock() > p->timeToStop )
{ {
...@@ -712,7 +717,7 @@ int Pdr_ManSolveInt( Pdr_Man_t * p ) ...@@ -712,7 +717,7 @@ int Pdr_ManSolveInt( Pdr_Man_t * p )
if ( !p->pPars->fSilent ) if ( !p->pPars->fSilent )
Abc_Print( 1, "Reached timeout (%d seconds).\n", p->pPars->nTimeOut ); Abc_Print( 1, "Reached timeout (%d seconds).\n", p->pPars->nTimeOut );
p->pPars->iFrame = k; p->pPars->iFrame = k;
return -1; return p->vCexes ? 0 : -1;
} }
if ( p->pPars->nFrameMax && k >= p->pPars->nFrameMax ) if ( p->pPars->nFrameMax && k >= p->pPars->nFrameMax )
{ {
...@@ -721,10 +726,10 @@ int Pdr_ManSolveInt( Pdr_Man_t * p ) ...@@ -721,10 +726,10 @@ int Pdr_ManSolveInt( Pdr_Man_t * p )
if ( !p->pPars->fSilent ) if ( !p->pPars->fSilent )
Abc_Print( 1, "Reached limit on the number of timeframes (%d).\n", p->pPars->nFrameMax ); Abc_Print( 1, "Reached limit on the number of timeframes (%d).\n", p->pPars->nFrameMax );
p->pPars->iFrame = k; p->pPars->iFrame = k;
return -1; return p->vCexes ? 0 : -1;
} }
} }
return RetValue; return p->vCexes ? 0 : RetValue;
} }
/**Function************************************************************* /**Function*************************************************************
......
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