374{
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;
383
384
385 if (
p->pPars->fSolveAll )
387 if ( Aig_ObjChild0(pObj) == Aig_ManConst0(
p->pAig) )
388 {
389 Vec_IntWriteEntry(
p->pPars->vOutMap, iFrame, 1 );
390 p->pPars->nProveOuts++;
391 if (
p->pPars->fUseBridge )
393 }
394
395 p->pPars->timeLastSolved = Abc_Clock();
396
397 if ( Vec_VecSize(
p->vClauses) == 0 )
399 else {
400 iFrame = Vec_VecSize(
p->vClauses) - 1;
401
402 if ( fCheckClauses )
403 {
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" ) ;
409 }
410
411 if ( fPushClauses )
412 {
413 p->iUseFrame = Abc_MaxInt(iFrame, 1);
414
415 if (
p->pPars->fVerbose )
416 {
417 Abc_Print( 1, "IPDR: Pushing the reloaded clauses. Before:\n" );
419 }
420
422
423 if (
p->pPars->fVerbose )
424 {
425 Abc_Print( 1, "IPDR: Finished pushing. After:\n" );
427 }
428
429 if ( RetValue )
430 {
433 return 1;
434 }
435 }
436
437 if (
p->pPars->fUseAbs &&
p->vAbsFlops == NULL && iFrame >= 1 )
438 {
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 );
443
445 }
446
447 }
448 while ( 1 )
449 {
450 int fRefined = 0;
451 if (
p->pPars->fUseAbs &&
p->vAbsFlops == NULL && iFrame == 1 )
452 {
453
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 );
458
459
460
461 }
462
463
465 assert( iFrame == Vec_PtrSize(
p->vSolvers)-1 );
466 p->iUseFrame = Abc_MaxInt(iFrame, 1);
468 {
469
470 if (
p->vCexes && Vec_PtrEntry(
p->vCexes,
p->iOutCur) )
471 continue;
472
473 if (
p->pTime4Outs &&
p->pTime4Outs[
p->iOutCur] == 0 )
474 continue;
475
476 if ( Aig_ObjChild0(pObj) == Aig_ManConst0(
p->pAig) )
477 continue;
478
479 if ( Aig_ObjChild0(pObj) == Aig_ManConst1(
p->pAig) )
480 {
481 if ( !
p->pPars->fSolveAll )
482 {
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;
485 return 0;
486 }
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) )
498 {
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;
504 return -1;
505 }
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();
509 continue;
510 }
511
513 {
514 assert(
p->pTime4Outs[
p->iOutCur] > 0 );
515 clkOne = Abc_Clock();
516 p->timeToStopOne =
p->pTime4Outs[
p->iOutCur] + Abc_Clock();
517 }
518 while ( 1 )
519 {
520 if (
p->pPars->nTimeOutGap &&
p->pPars->timeLastSolved && Abc_Clock() >
p->pPars->timeLastSolved +
p->pPars->nTimeOutGap * CLOCKS_PER_SEC )
521 {
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;
527 return -1;
528 }
530 if ( RetValue == 1 )
531 break;
532 if ( RetValue == -1 )
533 {
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 )
541 {
543 pCube = NULL;
544 break;
545 }
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;
551 return -1;
552 }
553 if ( RetValue == 0 )
554 {
556 if ( RetValue == -1 )
557 {
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 )
565 {
567 pCube = NULL;
568 break;
569 }
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;
575 return -1;
576 }
577 if ( RetValue == 0 )
578 {
579 if ( fPrintClauses )
580 {
581 Abc_Print( 1, "*** Clauses after frame %d:\n", iFrame );
583 }
584 if (
p->pPars->fVerbose && !
p->pPars->fUseAbs )
586 p->pPars->iFrame = iFrame;
587 if ( !
p->pPars->fSolveAll )
588 {
591 p->tAbs += Abc_Clock() - clk;
592 if ( pCex == NULL )
593 {
596 pCube = NULL;
597 fRefined = 1;
598 break;
599 }
600 p->pAig->pSeqModel = pCex;
601
602 if (
p->pPars->fVerbose &&
p->pPars->fUseAbs )
604 return 0;
605 }
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) )
614 {
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;
620 return -1;
621 }
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) )
626 return 0;
628 pCube = NULL;
629 break;
630 }
631 if (
p->pPars->fVerbose )
633 }
634 }
635 if ( fRefined )
636 break;
638 {
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 )
643 {
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 );
649 }
650 p->timeToStopOne = 0;
651 }
652 }
653
654
655
656
657
658
659
660
661
662 if (
p->pPars->fUseAbs &&
p->vAbsFlops && !fRefined )
663 {
665 int i, j, k;
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 );
670 }
671
672 if (
p->pPars->fVerbose )
674 if ( fRefined )
675 continue;
676
677
678
679 p->nQueLim =
p->pPars->nRestLimit;
683 if ( fPrintClauses )
684 {
685 Abc_Print( 1, "*** Clauses after frame %d:\n", iFrame );
687 }
688
690 if ( RetValue == -1 )
691 {
692 if (
p->pPars->fVerbose )
694 if ( !
p->pPars->fSilent )
695 {
696 if (
p->timeToStop && Abc_Clock() >
p->timeToStop )
697 Abc_Print( 1,
"Reached timeout (%d seconds) in frame %d.\n",
p->pPars->nTimeOut, iFrame );
698 else
699 Abc_Print( 1,
"Reached conflict limit (%d) in frame.\n",
p->pPars->nConfLimit, iFrame );
700 }
701 p->pPars->iFrame = iFrame;
702 return -1;
703 }
704 if ( RetValue )
705 {
706 if (
p->pPars->fVerbose )
708 if ( !
p->pPars->fSilent )
710 if ( !
p->pPars->fSilent )
712 p->pPars->iFrame = iFrame;
713
714 p->pPars->nProveOuts = Saig_ManPoNum(
p->pAig) -
p->pPars->nFailOuts -
p->pPars->nDropOuts;
715
716 if (
p->pPars->vOutMap )
717 for ( iFrame = 0; iFrame < Saig_ManPoNum(
p->pAig); iFrame++ )
718 if ( Vec_IntEntry(
p->pPars->vOutMap, iFrame) == -2 )
719 {
720 Vec_IntWriteEntry(
p->pPars->vOutMap, iFrame, 1 );
721 if (
p->pPars->fUseBridge )
723 }
724 if (
p->pPars->nProveOuts == Saig_ManPoNum(
p->pAig) )
725 return 1;
726 if (
p->pPars->nFailOuts > 0 )
727 return 0;
728 return -1;
729 }
730 if (
p->pPars->fVerbose )
732
733
734 if (
p->pPars->pFuncStop &&
p->pPars->pFuncStop(
p->pPars->RunId) )
735 {
736 p->pPars->iFrame = iFrame;
737 return -1;
738 }
739 if (
p->timeToStop && Abc_Clock() >
p->timeToStop )
740 {
741 if ( fPrintClauses )
742 {
743 Abc_Print( 1, "*** Clauses after frame %d:\n", iFrame );
745 }
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;
751 return -1;
752 }
753 if (
p->pPars->nTimeOutGap &&
p->pPars->timeLastSolved && Abc_Clock() >
p->pPars->timeLastSolved +
p->pPars->nTimeOutGap * CLOCKS_PER_SEC )
754 {
755 if ( fPrintClauses )
756 {
757 Abc_Print( 1, "*** Clauses after frame %d:\n", iFrame );
759 }
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;
765 return -1;
766 }
767 if (
p->pPars->nFrameMax && iFrame >=
p->pPars->nFrameMax )
768 {
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;
774 return -1;
775 }
776 }
778 return -1;
779}
struct Aig_Obj_t_ Aig_Obj_t
int IPdr_ManCheckClauses(Pdr_Man_t *p)
int Pdr_ManBlockCube(Pdr_Man_t *p, Pdr_Set_t *pCube)
int IPdr_ManRestoreAbsFlops(Pdr_Man_t *p)
int Gia_ManToBridgeResult(FILE *pFile, int Result, Abc_Cex_t *pCex, int iPoProved)
DECLARATIONS ///.
int Pdr_ManPushClauses(Pdr_Man_t *p)
void Pdr_ManPrintClauses(Pdr_Man_t *p, int kStart)
void Pdr_QueueClean(Pdr_Man_t *p)
Abc_Cex_t * Pdr_ManDeriveCexAbs(Pdr_Man_t *p)
void Pdr_ManPrintProgress(Pdr_Man_t *p, int fClose, abctime Time)
DECLARATIONS ///.
void Pdr_ManSetPropertyOutput(Pdr_Man_t *p, int k)
void Pdr_ManReportInvariant(Pdr_Man_t *p)
void Pdr_ManVerifyInvariant(Pdr_Man_t *p)
Abc_Cex_t * Pdr_ManDeriveCex(Pdr_Man_t *p)
#define Saig_ManForEachPo(p, pObj, i)
Abc_Cex_t * Abc_CexMakeTriv(int nRegs, int nTruePis, int nTruePos, int iFrameOut)
typedefABC_NAMESPACE_HEADER_START struct Abc_Cex_t_ Abc_Cex_t
INCLUDES ///.