From ab5c1692dba713599e2dbe966c0d65996943bb99 Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Sat, 14 Sep 2013 12:23:46 -0700 Subject: Handling the case when all outputs are undecided in 'pdr -a' with per-output timeout. --- src/proof/pdr/pdrCore.c | 8 ++------ src/proof/pdr/pdrMan.c | 1 + 2 files changed, 3 insertions(+), 6 deletions(-) (limited to 'src/proof/pdr') diff --git a/src/proof/pdr/pdrCore.c b/src/proof/pdr/pdrCore.c index 5294e020..e671d00f 100644 --- a/src/proof/pdr/pdrCore.c +++ b/src/proof/pdr/pdrCore.c @@ -610,8 +610,6 @@ int Pdr_ManSolveInt( Pdr_Man_t * p ) if ( p->pPars->vOutMap ) Vec_IntWriteEntry( p->pPars->vOutMap, p->iOutCur, 0 ); Abc_Print( 1, "Output %*d was trivially asserted in frame %2d (solved %*d out of %*d outputs).\n", nOutDigits, p->iOutCur, k, nOutDigits, p->pPars->nFailOuts, nOutDigits, Saig_ManPoNum(p->pAig) ); - if ( p->vCexes == NULL ) - p->vCexes = Vec_PtrStart( Saig_ManPoNum(p->pAig) ); assert( Vec_PtrEntry(p->vCexes, p->iOutCur) == NULL ); Vec_PtrWriteEntry( p->vCexes, p->iOutCur, p->pPars->fStoreCex ? Pdr_ManDeriveCex(p) : (void *)(ABC_PTRINT_T)1 ); if ( p->pPars->pFuncOnFail && p->pPars->pFuncOnFail(p->iOutCur, p->pPars->fStoreCex ? (Abc_Cex_t *)Vec_PtrEntry(p->vCexes, p->iOutCur) : NULL) ) @@ -712,8 +710,6 @@ int Pdr_ManSolveInt( Pdr_Man_t * p ) } p->pPars->nFailOuts++; if ( p->pPars->vOutMap ) Vec_IntWriteEntry( p->pPars->vOutMap, p->iOutCur, 0 ); - if ( p->vCexes == NULL ) - p->vCexes = Vec_PtrStart( Saig_ManPoNum(p->pAig) ); assert( Vec_PtrEntry(p->vCexes, p->iOutCur) == NULL ); Vec_PtrWriteEntry( p->vCexes, p->iOutCur, p->pPars->fStoreCex ? Pdr_ManDeriveCex(p) : (void *)(ABC_PTRINT_T)1 ); if ( p->pPars->pFuncOnFail && p->pPars->pFuncOnFail(p->iOutCur, p->pPars->fStoreCex ? (Abc_Cex_t *)Vec_PtrEntry(p->vCexes, p->iOutCur) : NULL) ) @@ -743,7 +739,7 @@ int Pdr_ManSolveInt( Pdr_Man_t * p ) abctime timeSince = Abc_Clock() - clkOne; assert( p->pTime4Outs[p->iOutCur] > 0 ); p->pTime4Outs[p->iOutCur] = (p->pTime4Outs[p->iOutCur] > timeSince) ? p->pTime4Outs[p->iOutCur] - timeSince : 0; - if ( p->pTime4Outs[p->iOutCur] == 0 && (p->vCexes == NULL || Vec_PtrEntry(p->vCexes, p->iOutCur) == NULL) ) + if ( p->pTime4Outs[p->iOutCur] == 0 && Vec_PtrEntry(p->vCexes, p->iOutCur) == NULL ) // undecided { p->pPars->nDropOuts++; if ( p->pPars->vOutMap ) @@ -799,7 +795,7 @@ int Pdr_ManSolveInt( Pdr_Man_t * p ) for ( k = 0; k < Saig_ManPoNum(p->pAig); k++ ) if ( Vec_IntEntry(p->pPars->vOutMap, k) == -2 ) // unknown Vec_IntWriteEntry( p->pPars->vOutMap, k, 1 ); // unsat - return p->vCexes ? 0 : 1; // UNSAT + return (Vec_PtrCountZero(p->vCexes) == Vec_PtrSize(p->vCexes)) ? 1 : 0; // UNSAT } if ( p->pPars->fVerbose ) Pdr_ManPrintProgress( p, 0, Abc_Clock() - clkStart ); diff --git a/src/proof/pdr/pdrMan.c b/src/proof/pdr/pdrMan.c index 9aa68aaa..af7c424a 100644 --- a/src/proof/pdr/pdrMan.c +++ b/src/proof/pdr/pdrMan.c @@ -85,6 +85,7 @@ Pdr_Man_t * Pdr_ManStart( Aig_Man_t * pAig, Pdr_Par_t * pPars, Vec_Int_t * vPrio } if ( pPars->fSolveAll ) { + p->vCexes = Vec_PtrStart( Saig_ManPoNum(p->pAig) ); p->pPars->vOutMap = Vec_IntAlloc( Saig_ManPoNum(pAig) ); Vec_IntFill( p->pPars->vOutMap, Saig_ManPoNum(pAig), -2 ); } -- cgit v1.2.3