375 int fPrintClauses = 0;
379 int iFrame, RetValue = -1;
380 int nOutDigits = Abc_Base10Log( Saig_ManPoNum(
p->pAig) );
381 abctime clkStart = Abc_Clock(), clkOne = 0;
382 p->timeToStop =
p->pPars->nTimeOut ?
p->pPars->nTimeOut * CLOCKS_PER_SEC + Abc_Clock(): 0;
385 if (
p->pPars->fSolveAll )
387 if ( Aig_ObjChild0(pObj) == Aig_ManConst0(
p->pAig) )
389 Vec_IntWriteEntry(
p->pPars->vOutMap, iFrame, 1 );
390 p->pPars->nProveOuts++;
391 if (
p->pPars->fUseBridge )
395 p->pPars->timeLastSolved = Abc_Clock();
397 if ( Vec_VecSize(
p->vClauses) == 0 )
400 iFrame = Vec_VecSize(
p->vClauses) - 1;
404 if (
p->pPars->fVerbose )
405 Abc_Print( 1,
"IPDR: Checking the reloaded length-%d trace...", iFrame + 1 ) ;
407 if (
p->pPars->fVerbose )
408 Abc_Print( 1,
" Passed!\n" ) ;
413 p->iUseFrame = Abc_MaxInt(iFrame, 1);
415 if (
p->pPars->fVerbose )
417 Abc_Print( 1,
"IPDR: Pushing the reloaded clauses. Before:\n" );
423 if (
p->pPars->fVerbose )
425 Abc_Print( 1,
"IPDR: Finished pushing. After:\n" );
437 if (
p->pPars->fUseAbs &&
p->vAbsFlops == NULL && iFrame >= 1 )
439 assert(
p->vAbsFlops == NULL );
440 p->vAbsFlops = Vec_IntStart( Saig_ManRegNum(
p->pAig) );
441 p->vMapFf2Ppi = Vec_IntStartFull( Saig_ManRegNum(
p->pAig) );
442 p->vMapPpi2Ff = Vec_IntAlloc( 100 );
451 if (
p->pPars->fUseAbs &&
p->vAbsFlops == NULL && iFrame == 1 )
454 assert(
p->vAbsFlops == NULL );
455 p->vAbsFlops = Vec_IntStart( Saig_ManRegNum(
p->pAig) );
456 p->vMapFf2Ppi = Vec_IntStartFull( Saig_ManRegNum(
p->pAig) );
457 p->vMapPpi2Ff = Vec_IntAlloc( 100 );
465 assert( iFrame == Vec_PtrSize(
p->vSolvers)-1 );
466 p->iUseFrame = Abc_MaxInt(iFrame, 1);
470 if (
p->vCexes && Vec_PtrEntry(
p->vCexes,
p->iOutCur) )
473 if (
p->pTime4Outs &&
p->pTime4Outs[
p->iOutCur] == 0 )
476 if ( Aig_ObjChild0(pObj) == Aig_ManConst0(
p->pAig) )
479 if ( Aig_ObjChild0(pObj) == Aig_ManConst1(
p->pAig) )
481 if ( !
p->pPars->fSolveAll )
483 pCexNew =
Abc_CexMakeTriv( Aig_ManRegNum(
p->pAig), Saig_ManPiNum(
p->pAig), Saig_ManPoNum(
p->pAig), iFrame*Saig_ManPoNum(
p->pAig)+
p->iOutCur );
484 p->pAig->pSeqModel = pCexNew;
487 pCexNew = (
p->pPars->fUseBridge ||
p->pPars->fStoreCex) ?
Abc_CexMakeTriv( Aig_ManRegNum(
p->pAig), Saig_ManPiNum(
p->pAig), Saig_ManPoNum(
p->pAig), iFrame*Saig_ManPoNum(
p->pAig)+
p->iOutCur ) : (
Abc_Cex_t *)(ABC_PTRINT_T)1;
488 p->pPars->nFailOuts++;
489 if (
p->pPars->vOutMap ) Vec_IntWriteEntry(
p->pPars->vOutMap,
p->iOutCur, 0 );
490 if ( !
p->pPars->fNotVerbose )
491 Abc_Print( 1,
"Output %*d was trivially asserted in frame %2d (solved %*d out of %*d outputs).\n",
492 nOutDigits,
p->iOutCur, iFrame, nOutDigits,
p->pPars->nFailOuts, nOutDigits, Saig_ManPoNum(
p->pAig) );
493 assert( Vec_PtrEntry(
p->vCexes,
p->iOutCur) == NULL );
494 if (
p->pPars->fUseBridge )
496 Vec_PtrWriteEntry(
p->vCexes,
p->iOutCur, pCexNew );
497 if (
p->pPars->pFuncOnFail &&
p->pPars->pFuncOnFail(
p->iOutCur,
p->pPars->fStoreCex ? (
Abc_Cex_t *)Vec_PtrEntry(
p->vCexes,
p->iOutCur) : NULL) )
499 if (
p->pPars->fVerbose )
501 if ( !
p->pPars->fSilent )
502 Abc_Print( 1,
"Quitting due to callback on fail in frame %d.\n", iFrame );
503 p->pPars->iFrame = iFrame;
506 if (
p->pPars->nFailOuts +
p->pPars->nDropOuts == Saig_ManPoNum(
p->pAig) )
507 return p->pPars->nFailOuts ? 0 : -1;
508 p->pPars->timeLastSolved = Abc_Clock();
514 assert(
p->pTime4Outs[
p->iOutCur] > 0 );
515 clkOne = Abc_Clock();
516 p->timeToStopOne =
p->pTime4Outs[
p->iOutCur] + Abc_Clock();
520 if (
p->pPars->nTimeOutGap &&
p->pPars->timeLastSolved && Abc_Clock() >
p->pPars->timeLastSolved +
p->pPars->nTimeOutGap * CLOCKS_PER_SEC )
522 if (
p->pPars->fVerbose )
524 if ( !
p->pPars->fSilent )
525 Abc_Print( 1,
"Reached gap timeout (%d seconds) in frame %d.\n",
p->pPars->nTimeOutGap, iFrame );
526 p->pPars->iFrame = iFrame;
532 if ( RetValue == -1 )
534 if (
p->pPars->fVerbose )
536 if (
p->timeToStop && Abc_Clock() >
p->timeToStop )
537 Abc_Print( 1,
"Reached timeout (%d seconds) in frame %d.\n",
p->pPars->nTimeOut, iFrame );
538 else if (
p->pPars->nTimeOutGap &&
p->pPars->timeLastSolved && Abc_Clock() >
p->pPars->timeLastSolved +
p->pPars->nTimeOutGap * CLOCKS_PER_SEC )
539 Abc_Print( 1,
"Reached gap timeout (%d seconds) in frame %d.\n",
p->pPars->nTimeOutGap, iFrame );
540 else if (
p->timeToStopOne && Abc_Clock() >
p->timeToStopOne )
546 else if (
p->pPars->nConfLimit )
547 Abc_Print( 1,
"Reached conflict limit (%d) in frame %d.\n",
p->pPars->nConfLimit, iFrame );
548 else if (
p->pPars->fVerbose )
549 Abc_Print( 1,
"Computation cancelled by the callback in frame %d.\n", iFrame );
550 p->pPars->iFrame = iFrame;
556 if ( RetValue == -1 )
558 if (
p->pPars->fVerbose )
560 if (
p->timeToStop && Abc_Clock() >
p->timeToStop )
561 Abc_Print( 1,
"Reached timeout (%d seconds) in frame %d.\n",
p->pPars->nTimeOut, iFrame );
562 else if (
p->pPars->nTimeOutGap &&
p->pPars->timeLastSolved && Abc_Clock() >
p->pPars->timeLastSolved +
p->pPars->nTimeOutGap * CLOCKS_PER_SEC )
563 Abc_Print( 1,
"Reached gap timeout (%d seconds) in frame %d.\n",
p->pPars->nTimeOutGap, iFrame );
564 else if (
p->timeToStopOne && Abc_Clock() >
p->timeToStopOne )
570 else if (
p->pPars->nConfLimit )
571 Abc_Print( 1,
"Reached conflict limit (%d) in frame %d.\n",
p->pPars->nConfLimit, iFrame );
572 else if (
p->pPars->fVerbose )
573 Abc_Print( 1,
"Computation cancelled by the callback in frame %d.\n", iFrame );
574 p->pPars->iFrame = iFrame;
581 Abc_Print( 1,
"*** Clauses after frame %d:\n", iFrame );
584 if (
p->pPars->fVerbose && !
p->pPars->fUseAbs )
586 p->pPars->iFrame = iFrame;
587 if ( !
p->pPars->fSolveAll )
591 p->tAbs += Abc_Clock() - clk;
600 p->pAig->pSeqModel = pCex;
602 if (
p->pPars->fVerbose &&
p->pPars->fUseAbs )
606 p->pPars->nFailOuts++;
608 if (
p->pPars->vOutMap ) Vec_IntWriteEntry(
p->pPars->vOutMap,
p->iOutCur, 0 );
609 assert( Vec_PtrEntry(
p->vCexes,
p->iOutCur) == NULL );
610 if (
p->pPars->fUseBridge )
612 Vec_PtrWriteEntry(
p->vCexes,
p->iOutCur, pCexNew );
613 if (
p->pPars->pFuncOnFail &&
p->pPars->pFuncOnFail(
p->iOutCur,
p->pPars->fStoreCex ? (
Abc_Cex_t *)Vec_PtrEntry(
p->vCexes,
p->iOutCur) : NULL) )
615 if (
p->pPars->fVerbose )
617 if ( !
p->pPars->fSilent )
618 Abc_Print( 1,
"Quitting due to callback on fail in frame %d.\n", iFrame );
619 p->pPars->iFrame = iFrame;
622 if ( !
p->pPars->fNotVerbose )
623 Abc_Print( 1,
"Output %*d was asserted in frame %2d (%2d) (solved %*d out of %*d outputs).\n",
624 nOutDigits,
p->iOutCur, iFrame, iFrame, nOutDigits,
p->pPars->nFailOuts, nOutDigits, Saig_ManPoNum(
p->pAig) );
625 if (
p->pPars->nFailOuts == Saig_ManPoNum(
p->pAig) )
631 if (
p->pPars->fVerbose )
639 abctime timeSince = Abc_Clock() - clkOne;
640 assert(
p->pTime4Outs[
p->iOutCur] > 0 );
641 p->pTime4Outs[
p->iOutCur] = (
p->pTime4Outs[
p->iOutCur] > timeSince) ?
p->pTime4Outs[
p->iOutCur] - timeSince : 0;
642 if (
p->pTime4Outs[
p->iOutCur] == 0 && Vec_PtrEntry(
p->vCexes,
p->iOutCur) == NULL )
644 p->pPars->nDropOuts++;
645 if (
p->pPars->vOutMap )
646 Vec_IntWriteEntry(
p->pPars->vOutMap,
p->iOutCur, -1 );
647 if ( !
p->pPars->fNotVerbose )
648 Abc_Print( 1,
"Timing out on output %*d in frame %d.\n", nOutDigits,
p->iOutCur, iFrame );
650 p->timeToStopOne = 0;
662 if (
p->pPars->fUseAbs &&
p->vAbsFlops && !fRefined )
666 Vec_IntFill(
p->vAbsFlops, Vec_IntSize(
p->vAbsFlops ), 0 );
668 for ( k = 0; k < pSet->
nLits; k++ )
669 Vec_IntWriteEntry(
p->vAbsFlops, Abc_Lit2Var(pSet->
Lits[k]), 1 );
672 if (
p->pPars->fVerbose )
679 p->nQueLim =
p->pPars->nRestLimit;
685 Abc_Print( 1,
"*** Clauses after frame %d:\n", iFrame );
690 if ( RetValue == -1 )
692 if (
p->pPars->fVerbose )
694 if ( !
p->pPars->fSilent )
696 if (
p->timeToStop && Abc_Clock() >
p->timeToStop )
697 Abc_Print( 1,
"Reached timeout (%d seconds) in frame %d.\n",
p->pPars->nTimeOut, iFrame );
699 Abc_Print( 1,
"Reached conflict limit (%d) in frame.\n",
p->pPars->nConfLimit, iFrame );
701 p->pPars->iFrame = iFrame;
706 if (
p->pPars->fVerbose )
708 if ( !
p->pPars->fSilent )
710 if ( !
p->pPars->fSilent )
712 p->pPars->iFrame = iFrame;
714 p->pPars->nProveOuts = Saig_ManPoNum(
p->pAig) -
p->pPars->nFailOuts -
p->pPars->nDropOuts;
716 if (
p->pPars->vOutMap )
717 for ( iFrame = 0; iFrame < Saig_ManPoNum(
p->pAig); iFrame++ )
718 if ( Vec_IntEntry(
p->pPars->vOutMap, iFrame) == -2 )
720 Vec_IntWriteEntry(
p->pPars->vOutMap, iFrame, 1 );
721 if (
p->pPars->fUseBridge )
724 if (
p->pPars->nProveOuts == Saig_ManPoNum(
p->pAig) )
726 if (
p->pPars->nFailOuts > 0 )
730 if (
p->pPars->fVerbose )
734 if (
p->pPars->pFuncStop &&
p->pPars->pFuncStop(
p->pPars->RunId) )
736 p->pPars->iFrame = iFrame;
739 if (
p->timeToStop && Abc_Clock() >
p->timeToStop )
743 Abc_Print( 1,
"*** Clauses after frame %d:\n", iFrame );
746 if (
p->pPars->fVerbose )
748 if ( !
p->pPars->fSilent )
749 Abc_Print( 1,
"Reached timeout (%d seconds) in frame %d.\n",
p->pPars->nTimeOut, iFrame );
750 p->pPars->iFrame = iFrame;
753 if (
p->pPars->nTimeOutGap &&
p->pPars->timeLastSolved && Abc_Clock() >
p->pPars->timeLastSolved +
p->pPars->nTimeOutGap * CLOCKS_PER_SEC )
757 Abc_Print( 1,
"*** Clauses after frame %d:\n", iFrame );
760 if (
p->pPars->fVerbose )
762 if ( !
p->pPars->fSilent )
763 Abc_Print( 1,
"Reached gap timeout (%d seconds) in frame %d.\n",
p->pPars->nTimeOutGap, iFrame );
764 p->pPars->iFrame = iFrame;
767 if (
p->pPars->nFrameMax && iFrame >=
p->pPars->nFrameMax )
769 if (
p->pPars->fVerbose )
771 if ( !
p->pPars->fSilent )
772 Abc_Print( 1,
"Reached limit on the number of timeframes (%d).\n",
p->pPars->nFrameMax );
773 p->pPars->iFrame = iFrame;