ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
pdrUtil.c File Reference
#include "pdrInt.h"
Include dependency graph for pdrUtil.c:

Go to the source code of this file.

Macros

#define PDR_VAL0   1
 
#define PDR_VAL1   2
 
#define PDR_VALX   3
 

Functions

ABC_NAMESPACE_IMPL_START Pdr_Set_tPdr_SetAlloc (int nSize)
 DECLARATIONS ///.
 
Pdr_Set_tPdr_SetCreate (Vec_Int_t *vLits, Vec_Int_t *vPiLits)
 
Pdr_Set_tPdr_SetCreateFrom (Pdr_Set_t *pSet, int iRemove)
 
Pdr_Set_tPdr_SetCreateSubset (Pdr_Set_t *pSet, int *pLits, int nLits)
 
Pdr_Set_tPdr_SetDup (Pdr_Set_t *pSet)
 
Pdr_Set_tPdr_SetRef (Pdr_Set_t *p)
 
void Pdr_SetDeref (Pdr_Set_t *p)
 
void Pdr_SetPrint (FILE *pFile, Pdr_Set_t *p, int nRegs, Vec_Int_t *vFlopCounts)
 
void ZPdr_SetPrint (Pdr_Set_t *p)
 
Pdr_Set_tZPdr_SetIntersection (Pdr_Set_t *p1, Pdr_Set_t *p2, Hash_Int_t *keep)
 
void Pdr_SetPrintStr (Vec_Str_t *vStr, Pdr_Set_t *p, int nRegs, Vec_Int_t *vFlopCounts)
 
int Pdr_SetContains (Pdr_Set_t *pOld, Pdr_Set_t *pNew)
 
int Pdr_SetContainsSimple (Pdr_Set_t *pOld, Pdr_Set_t *pNew)
 
int Pdr_SetIsInit (Pdr_Set_t *pCube, int iRemove)
 
int Pdr_SetCompare (Pdr_Set_t **pp1, Pdr_Set_t **pp2)
 
Pdr_Obl_tPdr_OblStart (int k, int prio, Pdr_Set_t *pState, Pdr_Obl_t *pNext)
 
Pdr_Obl_tPdr_OblRef (Pdr_Obl_t *p)
 
void Pdr_OblDeref (Pdr_Obl_t *p)
 
int Pdr_QueueIsEmpty (Pdr_Man_t *p)
 
Pdr_Obl_tPdr_QueueHead (Pdr_Man_t *p)
 
Pdr_Obl_tPdr_QueuePop (Pdr_Man_t *p)
 
void Pdr_QueueClean (Pdr_Man_t *p)
 
void Pdr_QueuePush (Pdr_Man_t *p, Pdr_Obl_t *pObl)
 
void Pdr_QueuePrint (Pdr_Man_t *p)
 
void Pdr_QueueStop (Pdr_Man_t *p)
 
int Pdr_NtkFindSatAssign_rec (Aig_Man_t *pAig, Aig_Obj_t *pNode, int Value, Pdr_Set_t *pCube, int Heur)
 

Macro Definition Documentation

◆ PDR_VAL0

#define PDR_VAL0   1

Definition at line 712 of file pdrUtil.c.

◆ PDR_VAL1

#define PDR_VAL1   2

Definition at line 713 of file pdrUtil.c.

◆ PDR_VALX

#define PDR_VALX   3

Definition at line 714 of file pdrUtil.c.

Function Documentation

◆ Pdr_NtkFindSatAssign_rec()

int Pdr_NtkFindSatAssign_rec ( Aig_Man_t * pAig,
Aig_Obj_t * pNode,
int Value,
Pdr_Set_t * pCube,
int Heur )

Function*************************************************************

Synopsis [Recursively searched for a satisfying assignment.]

Description []

SideEffects []

SeeAlso []

Definition at line 745 of file pdrUtil.c.

746{
747 int Value0, Value1;
748 if ( Aig_ObjIsConst1(pNode) )
749 return 1;
750 if ( Aig_ObjIsTravIdCurrent(pAig, pNode) )
751 return ((int)pNode->fMarkA == Value);
752 Aig_ObjSetTravIdCurrent(pAig, pNode);
753 pNode->fMarkA = Value;
754 if ( Aig_ObjIsCi(pNode) )
755 {
756 if ( Saig_ObjIsLo(pAig, pNode) )
757 {
758// pCube->Lits[pCube->nLits++] = Abc_Var2Lit( Aig_ObjCioId(pNode) - Saig_ManPiNum(pAig), !Value );
759 pCube->Lits[pCube->nLits++] = Abc_Var2Lit( Aig_ObjCioId(pNode) - Saig_ManPiNum(pAig), Value );
760 pCube->Sign |= ((word)1 << (pCube->Lits[pCube->nLits-1] % 63));
761 }
762 return 1;
763 }
764 assert( Aig_ObjIsNode(pNode) );
765 // propagation
766 if ( Value )
767 {
768 if ( !Pdr_NtkFindSatAssign_rec(pAig, Aig_ObjFanin0(pNode), !Aig_ObjFaninC0(pNode), pCube, Heur) )
769 return 0;
770 return Pdr_NtkFindSatAssign_rec(pAig, Aig_ObjFanin1(pNode), !Aig_ObjFaninC1(pNode), pCube, Heur);
771 }
772 // justification
773 Value0 = Pdr_ObjSatValue( pAig, Aig_ObjFanin0(pNode), Aig_ObjFaninC0(pNode) );
774 if ( Value0 == PDR_VAL0 )
775 return 1;
776 Value1 = Pdr_ObjSatValue( pAig, Aig_ObjFanin1(pNode), Aig_ObjFaninC1(pNode) );
777 if ( Value1 == PDR_VAL0 )
778 return 1;
779 if ( Value0 == PDR_VAL1 && Value1 == PDR_VAL1 )
780 return 0;
781 if ( Value0 == PDR_VAL1 )
782 return Pdr_NtkFindSatAssign_rec(pAig, Aig_ObjFanin1(pNode), Aig_ObjFaninC1(pNode), pCube, Heur);
783 if ( Value1 == PDR_VAL1 )
784 return Pdr_NtkFindSatAssign_rec(pAig, Aig_ObjFanin0(pNode), Aig_ObjFaninC0(pNode), pCube, Heur);
785 assert( Value0 == PDR_VALX && Value1 == PDR_VALX );
786 // decision making
787// if ( rand() % 10 == Heur )
788 if ( Aig_ObjId(pNode) % 4 == Heur )
789 return Pdr_NtkFindSatAssign_rec(pAig, Aig_ObjFanin1(pNode), Aig_ObjFaninC1(pNode), pCube, Heur);
790 else
791 return Pdr_NtkFindSatAssign_rec(pAig, Aig_ObjFanin0(pNode), Aig_ObjFaninC0(pNode), pCube, Heur);
792}
unsigned __int64 word
DECLARATIONS ///.
Definition kitPerm.c:36
#define PDR_VAL1
Definition pdrUtil.c:713
#define PDR_VAL0
Definition pdrUtil.c:712
int Pdr_NtkFindSatAssign_rec(Aig_Man_t *pAig, Aig_Obj_t *pNode, int Value, Pdr_Set_t *pCube, int Heur)
Definition pdrUtil.c:745
#define PDR_VALX
Definition pdrUtil.c:714
unsigned int fMarkA
Definition aig.h:79
int Lits[0]
Definition pdrInt.h:81
int nLits
Definition pdrInt.h:80
word Sign
Definition pdrInt.h:77
#define assert(ex)
Definition util_old.h:213
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Pdr_OblDeref()

void Pdr_OblDeref ( Pdr_Obl_t * p)

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 556 of file pdrUtil.c.

557{
558 if ( --p->nRefs == 0 )
559 {
560 if ( p->pNext )
561 Pdr_OblDeref( p->pNext );
562 Pdr_SetDeref( p->pState );
563 ABC_FREE( p );
564 }
565}
#define ABC_FREE(obj)
Definition abc_global.h:267
Cube * p
Definition exorList.c:222
void Pdr_OblDeref(Pdr_Obl_t *p)
Definition pdrUtil.c:556
void Pdr_SetDeref(Pdr_Set_t *p)
Definition pdrUtil.c:208
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Pdr_OblRef()

Pdr_Obl_t * Pdr_OblRef ( Pdr_Obl_t * p)

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 539 of file pdrUtil.c.

540{
541 p->nRefs++;
542 return p;
543}
Here is the caller graph for this function:

◆ Pdr_OblStart()

Pdr_Obl_t * Pdr_OblStart ( int k,
int prio,
Pdr_Set_t * pState,
Pdr_Obl_t * pNext )

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 515 of file pdrUtil.c.

516{
517 Pdr_Obl_t * p;
518 p = ABC_ALLOC( Pdr_Obl_t, 1 );
519 p->iFrame = k;
520 p->prio = prio;
521 p->nRefs = 1;
522 p->pState = pState;
523 p->pNext = pNext;
524 p->pLink = NULL;
525 return p;
526}
#define ABC_ALLOC(type, num)
Definition abc_global.h:264
struct Pdr_Obl_t_ Pdr_Obl_t
Definition pdrInt.h:84
Here is the caller graph for this function:

◆ Pdr_QueueClean()

void Pdr_QueueClean ( Pdr_Man_t * p)

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 632 of file pdrUtil.c.

633{
634 Pdr_Obl_t * pThis;
635 while ( (pThis = Pdr_QueuePop(p)) )
636 Pdr_OblDeref( pThis );
637 pThis = NULL;
638}
Pdr_Obl_t * Pdr_QueuePop(Pdr_Man_t *p)
Definition pdrUtil.c:610
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Pdr_QueueHead()

Pdr_Obl_t * Pdr_QueueHead ( Pdr_Man_t * p)

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 594 of file pdrUtil.c.

595{
596 return p->pQueue;
597}
Here is the caller graph for this function:

◆ Pdr_QueueIsEmpty()

int Pdr_QueueIsEmpty ( Pdr_Man_t * p)

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 578 of file pdrUtil.c.

579{
580 return p->pQueue == NULL;
581}
Here is the caller graph for this function:

◆ Pdr_QueuePop()

Pdr_Obl_t * Pdr_QueuePop ( Pdr_Man_t * p)

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 610 of file pdrUtil.c.

611{
612 Pdr_Obl_t * pRes = p->pQueue;
613 if ( p->pQueue == NULL )
614 return NULL;
615 p->pQueue = p->pQueue->pLink;
616 Pdr_OblDeref( pRes );
617 p->nQueCur--;
618 return pRes;
619}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Pdr_QueuePrint()

void Pdr_QueuePrint ( Pdr_Man_t * p)

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 681 of file pdrUtil.c.

682{
683 Pdr_Obl_t * pObl;
684 for ( pObl = p->pQueue; pObl; pObl = pObl->pLink )
685 Abc_Print( 1, "Frame = %2d. Prio = %8d.\n", pObl->iFrame, pObl->prio );
686}
int prio
Definition pdrInt.h:88
Pdr_Obl_t * pLink
Definition pdrInt.h:92
int iFrame
Definition pdrInt.h:87

◆ Pdr_QueuePush()

void Pdr_QueuePush ( Pdr_Man_t * p,
Pdr_Obl_t * pObl )

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 651 of file pdrUtil.c.

652{
653 Pdr_Obl_t * pTemp, ** ppPrev;
654 p->nObligs++;
655 p->nQueCur++;
656 p->nQueMax = Abc_MaxInt( p->nQueMax, p->nQueCur );
657 Pdr_OblRef( pObl );
658 if ( p->pQueue == NULL )
659 {
660 p->pQueue = pObl;
661 return;
662 }
663 for ( ppPrev = &p->pQueue, pTemp = p->pQueue; pTemp; ppPrev = &pTemp->pLink, pTemp = pTemp->pLink )
664 if ( pTemp->iFrame > pObl->iFrame || (pTemp->iFrame == pObl->iFrame && pTemp->prio > pObl->prio) )
665 break;
666 *ppPrev = pObl;
667 pObl->pLink = pTemp;
668}
Pdr_Obl_t * Pdr_OblRef(Pdr_Obl_t *p)
Definition pdrUtil.c:539
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Pdr_QueueStop()

void Pdr_QueueStop ( Pdr_Man_t * p)

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 699 of file pdrUtil.c.

700{
701 Pdr_Obl_t * pObl;
702 while ( !Pdr_QueueIsEmpty(p) )
703 {
704 pObl = Pdr_QueuePop(p);
705 Pdr_OblDeref( pObl );
706 }
707 p->pQueue = NULL;
708 p->nQueCur = 0;
709}
int Pdr_QueueIsEmpty(Pdr_Man_t *p)
Definition pdrUtil.c:578
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Pdr_SetAlloc()

ABC_NAMESPACE_IMPL_START Pdr_Set_t * Pdr_SetAlloc ( int nSize)

DECLARATIONS ///.

CFile****************************************************************

FileName [pdrUtil.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Property driven reachability.]

Synopsis [Various utilities.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - November 20, 2010.]

Revision [

Id
pdrUtil.c,v 1.00 2010/11/20 00:00:00 alanmi Exp

] FUNCTION DEFINITIONS /// Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 46 of file pdrUtil.c.

47{
48 Pdr_Set_t * p;
49 assert( nSize >= 0 && nSize < (1<<30) );
50 p = (Pdr_Set_t *)ABC_CALLOC( char, sizeof(Pdr_Set_t) + nSize * sizeof(int) );
51 return p;
52}
#define ABC_CALLOC(type, num)
Definition abc_global.h:265
struct Pdr_Set_t_ Pdr_Set_t
Definition pdrInt.h:74

◆ Pdr_SetCompare()

int Pdr_SetCompare ( Pdr_Set_t ** pp1,
Pdr_Set_t ** pp2 )

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 485 of file pdrUtil.c.

486{
487 Pdr_Set_t * p1 = *pp1;
488 Pdr_Set_t * p2 = *pp2;
489 int i;
490 for ( i = 0; i < p1->nLits && i < p2->nLits; i++ )
491 {
492 if ( p1->Lits[i] > p2->Lits[i] )
493 return -1;
494 if ( p1->Lits[i] < p2->Lits[i] )
495 return 1;
496 }
497 if ( i == p1->nLits && i < p2->nLits )
498 return -1;
499 if ( i < p1->nLits && i == p2->nLits )
500 return 1;
501 return 0;
502}
Here is the caller graph for this function:

◆ Pdr_SetContains()

int Pdr_SetContains ( Pdr_Set_t * pOld,
Pdr_Set_t * pNew )

Function*************************************************************

Synopsis [Return 1 if pOld set-theoretically contains pNew.]

Description []

SideEffects []

SeeAlso []

Definition at line 382 of file pdrUtil.c.

383{
384 int * pOldInt, * pNewInt;
385 assert( pOld->nLits > 0 );
386 assert( pNew->nLits > 0 );
387 if ( pOld->nLits < pNew->nLits )
388 return 0;
389 if ( (pOld->Sign & pNew->Sign) != pNew->Sign )
390 return 0;
391 pOldInt = pOld->Lits + pOld->nLits - 1;
392 pNewInt = pNew->Lits + pNew->nLits - 1;
393 while ( pNew->Lits <= pNewInt )
394 {
395 if ( pOld->Lits > pOldInt )
396 return 0;
397 assert( *pNewInt != -1 );
398 assert( *pOldInt != -1 );
399 if ( *pNewInt == *pOldInt )
400 pNewInt--, pOldInt--;
401 else if ( *pNewInt < *pOldInt )
402 pOldInt--;
403 else
404 return 0;
405 }
406 return 1;
407}
Here is the caller graph for this function:

◆ Pdr_SetContainsSimple()

int Pdr_SetContainsSimple ( Pdr_Set_t * pOld,
Pdr_Set_t * pNew )

Function*************************************************************

Synopsis [Return 1 if pOld set-theoretically contains pNew.]

Description []

SideEffects []

SeeAlso []

Definition at line 420 of file pdrUtil.c.

421{
422 int * pOldInt, * pNewInt;
423 assert( pOld->nLits > 0 );
424 assert( pNew->nLits > 0 );
425 pOldInt = pOld->Lits + pOld->nLits - 1;
426 pNewInt = pNew->Lits + pNew->nLits - 1;
427 while ( pNew->Lits <= pNewInt )
428 {
429 assert( *pOldInt != -1 );
430 if ( *pNewInt == -1 )
431 {
432 pNewInt--;
433 continue;
434 }
435 if ( pOld->Lits > pOldInt )
436 return 0;
437 assert( *pNewInt != -1 );
438 assert( *pOldInt != -1 );
439 if ( *pNewInt == *pOldInt )
440 pNewInt--, pOldInt--;
441 else if ( *pNewInt < *pOldInt )
442 pOldInt--;
443 else
444 return 0;
445 }
446 return 1;
447}

◆ Pdr_SetCreate()

Pdr_Set_t * Pdr_SetCreate ( Vec_Int_t * vLits,
Vec_Int_t * vPiLits )

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 65 of file pdrUtil.c.

66{
67 Pdr_Set_t * p;
68 int i;
69 assert( Vec_IntSize(vLits) + Vec_IntSize(vPiLits) < (1<<30) );
70 p = (Pdr_Set_t *)ABC_ALLOC( char, sizeof(Pdr_Set_t) + (Vec_IntSize(vLits) + Vec_IntSize(vPiLits)) * sizeof(int) );
71 p->nLits = Vec_IntSize(vLits);
72 p->nTotal = Vec_IntSize(vLits) + Vec_IntSize(vPiLits);
73 p->nRefs = 1;
74 p->Sign = 0;
75 for ( i = 0; i < p->nLits; i++ )
76 {
77 p->Lits[i] = Vec_IntEntry(vLits, i);
78 p->Sign |= ((word)1 << (p->Lits[i] % 63));
79 }
80 Vec_IntSelectSort( p->Lits, p->nLits );
81 // remember PI literals
82 for ( i = p->nLits; i < p->nTotal; i++ )
83 p->Lits[i] = Vec_IntEntry(vPiLits, i-p->nLits);
84 return p;
85}
int nTotal
DECLARATIONS ///.
Definition cutTruth.c:37
Here is the caller graph for this function:

◆ Pdr_SetCreateFrom()

Pdr_Set_t * Pdr_SetCreateFrom ( Pdr_Set_t * pSet,
int iRemove )

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 98 of file pdrUtil.c.

99{
100 Pdr_Set_t * p;
101 int i, k = 0;
102 assert( iRemove >= 0 && iRemove < pSet->nLits );
103 p = (Pdr_Set_t *)ABC_ALLOC( char, sizeof(Pdr_Set_t) + (pSet->nTotal - 1) * sizeof(int) );
104 p->nLits = pSet->nLits - 1;
105 p->nTotal = pSet->nTotal - 1;
106 p->nRefs = 1;
107 p->Sign = 0;
108 for ( i = 0; i < pSet->nTotal; i++ )
109 {
110 if ( i == iRemove )
111 continue;
112 p->Lits[k++] = pSet->Lits[i];
113 if ( i >= pSet->nLits )
114 continue;
115 p->Sign |= ((word)1 << (pSet->Lits[i] % 63));
116 }
117 assert( k == p->nTotal );
118 return p;
119}
int nTotal
Definition pdrInt.h:79
Here is the caller graph for this function:

◆ Pdr_SetCreateSubset()

Pdr_Set_t * Pdr_SetCreateSubset ( Pdr_Set_t * pSet,
int * pLits,
int nLits )

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 132 of file pdrUtil.c.

133{
134 Pdr_Set_t * p;
135 int i, k = 0;
136 assert( nLits >= 0 && nLits <= pSet->nLits );
137 p = (Pdr_Set_t *)ABC_ALLOC( char, sizeof(Pdr_Set_t) + (nLits + pSet->nTotal - pSet->nLits) * sizeof(int) );
138 p->nLits = nLits;
139 p->nTotal = nLits + pSet->nTotal - pSet->nLits;
140 p->nRefs = 1;
141 p->Sign = 0;
142 for ( i = 0; i < nLits; i++ )
143 {
144 assert( pLits[i] >= 0 );
145 p->Lits[k++] = pLits[i];
146 p->Sign |= ((word)1 << (pLits[i] % 63));
147 }
148 Vec_IntSelectSort( p->Lits, p->nLits );
149 for ( i = pSet->nLits; i < pSet->nTotal; i++ )
150 p->Lits[k++] = pSet->Lits[i];
151 assert( k == p->nTotal );
152 return p;
153}
Here is the caller graph for this function:

◆ Pdr_SetDeref()

void Pdr_SetDeref ( Pdr_Set_t * p)

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 208 of file pdrUtil.c.

209{
210 if ( --p->nRefs == 0 )
211 ABC_FREE( p );
212}
Here is the caller graph for this function:

◆ Pdr_SetDup()

Pdr_Set_t * Pdr_SetDup ( Pdr_Set_t * pSet)

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 166 of file pdrUtil.c.

167{
168 Pdr_Set_t * p;
169 int i;
170 p = (Pdr_Set_t *)ABC_ALLOC( char, sizeof(Pdr_Set_t) + pSet->nTotal * sizeof(int) );
171 p->nLits = pSet->nLits;
172 p->nTotal = pSet->nTotal;
173 p->nRefs = 1;
174 p->Sign = pSet->Sign;
175 for ( i = 0; i < pSet->nTotal; i++ )
176 p->Lits[i] = pSet->Lits[i];
177 return p;
178}
Here is the caller graph for this function:

◆ Pdr_SetIsInit()

int Pdr_SetIsInit ( Pdr_Set_t * pCube,
int iRemove )

Function*************************************************************

Synopsis [Return 1 if the state cube contains init state (000...0).]

Description []

SideEffects []

SeeAlso []

Definition at line 460 of file pdrUtil.c.

461{
462 int i;
463 for ( i = 0; i < pCube->nLits; i++ )
464 {
465 assert( pCube->Lits[i] != -1 );
466 if ( i == iRemove )
467 continue;
468 if ( Abc_LitIsCompl( pCube->Lits[i] ) == 0 )
469 return 0;
470 }
471 return 1;
472}
Here is the caller graph for this function:

◆ Pdr_SetPrint()

void Pdr_SetPrint ( FILE * pFile,
Pdr_Set_t * p,
int nRegs,
Vec_Int_t * vFlopCounts )

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 225 of file pdrUtil.c.

226{
227 char * pBuff;
228 int i, k, Entry;
229 pBuff = ABC_ALLOC( char, nRegs + 1 );
230 for ( i = 0; i < nRegs; i++ )
231 pBuff[i] = '-';
232 pBuff[i] = 0;
233 for ( i = 0; i < p->nLits; i++ )
234 {
235 if ( p->Lits[i] == -1 )
236 continue;
237 pBuff[Abc_Lit2Var(p->Lits[i])] = (Abc_LitIsCompl(p->Lits[i])? '0':'1');
238 }
239 if ( vFlopCounts )
240 {
241 // skip some literals
242 k = 0;
243 Vec_IntForEachEntry( vFlopCounts, Entry, i )
244 if ( Entry )
245 pBuff[k++] = pBuff[i];
246 pBuff[k] = 0;
247 }
248 fprintf( pFile, "%s", pBuff );
249 ABC_FREE( pBuff );
250}
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
Definition vecInt.h:54
Here is the caller graph for this function:

◆ Pdr_SetPrintStr()

void Pdr_SetPrintStr ( Vec_Str_t * vStr,
Pdr_Set_t * p,
int nRegs,
Vec_Int_t * vFlopCounts )

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 342 of file pdrUtil.c.

343{
344 char * pBuff;
345 int i, k = 0, Entry;
346 pBuff = ABC_ALLOC( char, nRegs + 1 );
347 for ( i = 0; i < nRegs; i++ )
348 pBuff[i] = '-';
349 pBuff[i] = 0;
350 for ( i = 0; i < p->nLits; i++ )
351 {
352 if ( p->Lits[i] == -1 )
353 continue;
354 pBuff[Abc_Lit2Var(p->Lits[i])] = (Abc_LitIsCompl(p->Lits[i])? '0':'1');
355 }
356 if ( vFlopCounts )
357 {
358 // skip some literals
359 Vec_IntForEachEntry( vFlopCounts, Entry, i )
360 if ( Entry )
361 pBuff[k++] = pBuff[i];
362 pBuff[k] = 0;
363 }
364 Vec_StrPushBuffer( vStr, pBuff, k );
365 Vec_StrPush( vStr, ' ' );
366 Vec_StrPush( vStr, '1' );
367 Vec_StrPush( vStr, '\n' );
368 ABC_FREE( pBuff );
369}
Here is the caller graph for this function:

◆ Pdr_SetRef()

Pdr_Set_t * Pdr_SetRef ( Pdr_Set_t * p)

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 191 of file pdrUtil.c.

192{
193 p->nRefs++;
194 return p;
195}

◆ ZPdr_SetIntersection()

Pdr_Set_t * ZPdr_SetIntersection ( Pdr_Set_t * p1,
Pdr_Set_t * p2,
Hash_Int_t * keep )

Function*************************************************************

Synopsis [Return the intersection of p1 and p2.]

Description []

SideEffects []

SeeAlso []

Definition at line 283 of file pdrUtil.c.

284{
285 Pdr_Set_t * pIntersection;
286 Vec_Int_t * vCommonLits, * vPiLits;
287 int i, j, nLits;
288 nLits = p1->nLits;
289 if ( p2->nLits < nLits )
290 nLits = p2->nLits;
291 vCommonLits = Vec_IntAlloc( nLits );
292 vPiLits = Vec_IntAlloc( 1 );
293 for ( i = 0, j = 0; i < p1->nLits && j < p2->nLits; )
294 {
295 if ( p1->Lits[i] > p2->Lits[j] )
296 {
297 if ( Hash_IntExists( keep, p2->Lits[j] ) )
298 {
299 //about to drop a literal that should not be dropped
300 Vec_IntFree( vCommonLits );
301 Vec_IntFree( vPiLits );
302 return NULL;
303 }
304 j++;
305 }
306 else if ( p1->Lits[i] < p2->Lits[j] )
307 {
308 if ( Hash_IntExists( keep, p1->Lits[i] ) )
309 {
310 //about to drop a literal that should not be dropped
311 Vec_IntFree( vCommonLits );
312 Vec_IntFree( vPiLits );
313 return NULL;
314 }
315 i++;
316 }
317 else
318 {
319 Vec_IntPush( vCommonLits, p1->Lits[i] );
320 i++;
321 j++;
322 }
323 }
324 pIntersection = Pdr_SetCreate( vCommonLits, vPiLits );
325 Vec_IntFree( vCommonLits );
326 Vec_IntFree( vPiLits );
327 return pIntersection;
328}
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition bblif.c:37
Pdr_Set_t * Pdr_SetCreate(Vec_Int_t *vLits, Vec_Int_t *vPiLits)
Definition pdrUtil.c:65
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ZPdr_SetPrint()

void ZPdr_SetPrint ( Pdr_Set_t * p)

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 263 of file pdrUtil.c.

264{
265 int i;
266 for ( i = 0; i < p->nLits; i++)
267 printf ("%d ", p->Lits[i]);
268 printf ("\n");
269
270}
Here is the caller graph for this function: