38#define MAX_CALL_NUM (1000000)
39#define MAX_ITEM_NUM (1<<20)
40#define MAX_PAGE_NUM (1<<11)
41#define MAX_VARS_NUM (1<<14)
42#define MAX_CUBE_NUM 63
146static inline int Gia_StaHasValue0(
Gia_StaAre_t *
p,
int iReg ) {
return Abc_InfoHasBit(
p->pData, iReg << 1 ); }
147static inline int Gia_StaHasValue1(
Gia_StaAre_t *
p,
int iReg ) {
return Abc_InfoHasBit(
p->pData, (iReg << 1) + 1 ); }
149static inline void Gia_StaSetValue0(
Gia_StaAre_t *
p,
int iReg ) { Abc_InfoSetBit(
p->pData, iReg << 1 ); }
150static inline void Gia_StaSetValue1(
Gia_StaAre_t *
p,
int iReg ) { Abc_InfoSetBit(
p->pData, (iReg << 1) + 1 ); }
160#define Gia_ManAreForEachCubeList( p, pList, pCube ) \
161 for ( pCube = pList; Gia_StaIsGood(p, pCube); pCube = Gia_StaNext(p, pCube) )
162#define Gia_ManAreForEachCubeList2( p, iList, pCube, iCube ) \
163 for ( iCube = Gia_Ptr2Int(iList), pCube = Gia_ManAreSta(p, iList); \
164 Gia_StaIsGood(p, pCube); \
165 iCube = Gia_Ptr2Int(pCube->iNext), pCube = Gia_StaNext(p, pCube) )
166#define Gia_ManAreForEachCubeStore( p, pCube, i ) \
167 for ( i = 1; i < p->nStas && (pCube = Gia_ManAreStaInt(p, i)); i++ )
168#define Gia_ManAreForEachCubeVec( vVec, p, pCube, i ) \
169 for ( i = 0; i < Vec_IntSize(vVec) && (pCube = Gia_ManAreStaInt(p, Vec_IntEntry(vVec,i))); i++ )
188 unsigned Mint, Mask = 0;
189 int i, m, nMints, nDashes = 0, Dashes[32];
191 for ( i = 0; i < nVars; i++ )
193 if ( Gia_StaHasValue0( pCube, i ) )
195 if ( Gia_StaHasValue1( pCube, i ) )
198 Dashes[nDashes++] = i;
201 nMints = (1 << nDashes);
202 for ( m = 0; m < nMints; m++ )
205 for ( i = 0; i < nVars; i++ )
207 Mint |= (1 << Dashes[i]);
208 Abc_InfoSetBit( pStore, Mint );
227 int i, nMemSize, Counter = 0;
228 if ( Gia_ManRegNum(
p->pAig) > 30 )
230 nMemSize = Abc_BitWordNum( 1 << Gia_ManRegNum(
p->pAig) );
233 if ( Gia_StaIsUsed(pCube) )
235 for ( i = 0; i < nMemSize; i++ )
236 Counter += Gia_WordCountOnes( pMemory[i] );
254 if ( Gia_ObjIsCi(pObj) )
256 if ( Gia_ObjIsTravIdCurrent(
p, pObj) )
258 Gia_ObjSetTravIdCurrent(
p, pObj);
259 assert( Gia_ObjIsAnd(pObj) );
262 pObj->
fMark0 = Gia_ObjFanin0(pObj)->fMark0 | Gia_ObjFanin1(pObj)->fMark0;
264 Vec_IntPush( vRes, Gia_ObjId(
p, pObj) );
287 vRes = Vec_IntAlloc( 100 );
288 Vec_IntPush( vRes, Gia_ObjId(
p, pPivot) );
290 Gia_ObjSetTravIdCurrent(
p, Gia_ManConst0(
p) );
294 if ( Gia_ObjFanin0(pObj)->fMark0 )
295 Vec_IntPush( vRes, Gia_ObjId(
p, pObj) );
319 vRes = Vec_PtrAlloc( Gia_ManCiNum(
p) );
340 for ( w = 0; w <
nWords; w++ )
341 if ( p1->pData[w] != p2->pData[w] )
360 for ( w = 0; w <
nWords; w++ )
361 if ( ((p1->pData[w] ^ p2->pData[w]) >> 1) & (p1->pData[w] ^ p2->pData[w]) & 0x55555555 )
380 for ( w = 0; w <
nWords; w++ )
381 if ( (p1->pData[w] | p2->pData[w]) != p2->pData[w] )
400 for ( w = 0; w <
nWords; w++ )
401 Counter += Gia_WordCountOnes( (~(p1->pData[w] ^ (p1->pData[w] >> 1))) & (p2->pData[w] ^ (p2->pData[w] >> 1)) & 0x55555555 );
422 for ( w = 0; w <
nWords; w++ )
424 Word = (~(p1->pData[w] ^ (p1->pData[w] >> 1))) & (p2->pData[w] ^ (p2->pData[w] >> 1)) & 0x55555555;
427 if ( !Gia_WordHasOneBit(Word) )
433 iVar = 16 * w + Gia_WordFindFirstBit( Word ) / 2;
454 for ( w = 0; w <
nWords; w++ )
456 Word = (p1->pData[w] ^ p2->pData[w]) & ((p1->pData[w] ^ p2->pData[w]) >> 1) & 0x55555555;
459 if ( !Gia_WordHasOneBit(Word) )
465 iVar = 16 * w + Gia_WordFindFirstBit( Word ) / 2;
487 p->nWords = Abc_BitWordNum( 2 * Gia_ManRegNum(pAig) );
492 p->vCiLits = Vec_VecDupInt(
p->vCiTfos );
493 p->vCubesA = Vec_IntAlloc( 100 );
494 p->vCubesB = Vec_IntAlloc( 100 );
516 Vec_IntFree(
p->vCubesA );
517 Vec_IntFree(
p->vCubesB );
518 Vec_VecFree(
p->vCiTfos );
519 Vec_VecFree(
p->vCiLits );
520 for ( i = 0; i <
p->nObjPages; i++ )
523 for ( i = 0; i <
p->nStaPages; i++ )
547 printf(
"ERA manager has run out of memory after allocating 2B internal nodes.\n" );
554 return Gia_ManAreObjInt(
p,
p->nObjs++ );
574 printf(
"ERA manager has run out of memory after allocating 2B state cubes.\n" );
577 if (
p->ppStas[
p->nStaPages] == NULL )
593 return Gia_ManAreStaInt(
p,
p->nStas++ );
609 memset( pSta, 0,
p->nSize << 2 );
610 if ( pSta == Gia_ManAreStaLast(
p) )
638 pSta = Gia_ManAreCreateSta(
p );
641 if ( pObj->
Value == 0 )
642 Gia_StaSetValue0( pSta, i );
643 else if ( pObj->
Value == 1 )
644 Gia_StaSetValue1( pSta, i );
666 return Gia_ManAreCreateStaNew(
p );
684 int i, Count0 = 0, Count1 = 0, Count2 = 0;
685 printf(
"%4d %4d : ",
p->iStaCur,
p->nStas-1 );
686 printf(
"Prev %4d ", Gia_Ptr2Int(pSta->
iPrev) );
687 printf(
"%p ", pSta );
690 if ( Gia_StaHasValue0(pSta, i) )
691 printf(
"0" ), Count0++;
692 else if ( Gia_StaHasValue1(pSta, i) )
693 printf(
"1" ), Count1++;
695 printf(
"-" ), Count2++;
697 printf(
" 0 =%3d", Count0 );
698 printf(
" 1 =%3d", Count1 );
699 printf(
" - =%3d", Count2 );
718 for ( pSta = Gia_ManAreStaInt(
p, iState); Gia_StaIsGood(
p, pSta); pSta = Gia_StaPrev(
p, pSta) )
739 Counter += Gia_StaIsUsed(pCube);
758 return Gia_ManAreListCountListUsed(
p, Root );
759 pObj = Gia_ManAreObj(
p, Root);
797 if ( Gia_StaIsUsed(pCube) )
817 return Gia_ManArePrintListUsed(
p, Root );
818 pObj = Gia_ManAreObj(
p, Root);
856 int Count0, Count1, Count2;
857 int iVarThis, iVarBest = -1, WeightThis, WeightBest = -1;
858 for ( iVarThis = 0; iVarThis < Gia_ManRegNum(
p->pAig); iVarThis++ )
860 Count0 = Count1 = Count2 = 0;
863 if ( Gia_StaIsUnused(pCube) )
865 if ( Gia_StaHasValue0(pCube, iVarThis) )
867 else if ( Gia_StaHasValue1(pCube, iVarThis) )
874 if ( (!Count0 && !Count1) || (!Count0 && !Count2) || (!Count1 && !Count2) )
876 WeightThis = Count0 + Count1 - (Count0 > Count1 ? Count0 - Count1 : Count1 - Count0);
877 if ( WeightBest < WeightThis )
879 WeightBest = WeightThis;
883 if ( iVarBest == -1 )
885 Gia_ManArePrintListUsed(
p, List );
886 printf(
"Error: Best variable not found!!!\n" );
909 pNode = Gia_ManAreCreateObj(
p );
911 for ( iCube = *pRoot, pCube = Gia_ManAreSta(
p, iCube), iNext = pCube->
iNext;
912 Gia_StaIsGood(
p, pCube);
913 iCube = iNext, pCube = Gia_ManAreSta(
p, iCube), iNext = pCube->iNext )
915 if ( Gia_StaIsUnused(pCube) )
917 if ( Gia_StaHasValue0(pCube, pNode->
iVar) )
918 pCube->iNext = pNode->
F[0], pNode->
F[0] = iCube, pNode->
nStas0++;
919 else if ( Gia_StaHasValue1(pCube, pNode->
iVar) )
920 pCube->iNext = pNode->
F[1], pNode->
F[1] = iCube, pNode->
nStas1++;
922 pCube->iNext = pNode->
F[2], pNode->
F[2] = iCube, pNode->
nStas2++;
924 *pRoot = Gia_Int2Ptr(
p->nObjs - 1);
925 assert( pNode == Gia_ManAreObj(
p, *pRoot) );
948 for ( iCube = iList, pCube = Gia_ManAreSta(
p, iCube), iNext = pCube->
iNext;
949 Gia_StaIsGood(
p, pCube);
950 iCube = iNext, pCube = Gia_ManAreSta(
p, iCube), iNext = pCube->iNext )
952 if ( Gia_StaIsUnused(pCube) )
954 pCube->iNext = *pRoot;
978printf(
"Trying cube: " );
984 if ( Gia_StaIsUnused( pCube ) )
986 if ( Gia_StaAreDisjoint( pSta, pCube,
p->nWords ) )
988 if ( Gia_StaAreContain( pCube, pSta,
p->nWords ) )
992printf(
"Contained in " );
995 Gia_ManAreRycycleSta(
p, pSta );
998 if ( Gia_StaAreContain( pSta, pCube,
p->nWords ) )
1002printf(
"Contains " );
1005 Gia_StaSetUnused( pCube );
1008 iVar = Gia_StaAreSharpVar( pSta, pCube,
p->nWords );
1013printf(
"Sharped by " );
1018 assert( !Gia_StaHasValue0(pSta, iVar) && !Gia_StaHasValue1(pSta, iVar) );
1019 assert( Gia_StaHasValue0(pCube, iVar) ^ Gia_StaHasValue1(pCube, iVar) );
1020 if ( Gia_StaHasValue0(pCube, iVar) )
1021 Gia_StaSetValue1( pSta, iVar );
1023 Gia_StaSetValue0( pSta, iVar );
1043 pSta->
iNext = *pRoot;
1044 *pRoot = Gia_Int2Ptr(
p->nStas - 1 );
1045 assert( pSta == Gia_ManAreSta(
p, *pRoot) );
1048printf(
"Adding cube: " );
1068 if ( Gia_StaHasValue0(pSta, pObj->
iVar) )
1070 if ( Gia_ObjHasBranch0(pObj) )
1073 RetValue = Gia_ManAreCubeCheckList(
p, pObj->
F, pSta );
1074 if ( RetValue == 0 )
1077 else if ( Gia_StaHasValue1(pSta, pObj->
iVar) )
1079 if ( Gia_ObjHasBranch1(pObj) )
1082 RetValue = Gia_ManAreCubeCheckList(
p, pObj->
F + 1, pSta );
1083 if ( RetValue == 0 )
1086 if ( Gia_ObjHasBranch2(pObj) )
1088 return Gia_ManAreCubeCheckList(
p, pObj->
F + 2, pSta );
1104 if ( Gia_StaHasValue0(pSta, pObj->
iVar) )
1106 if ( Gia_ObjHasBranch0(pObj) )
1110 Gia_ManAreCubeAddToList(
p, pObj->
F, pSta );
1113 pObj->
nStas0 = Gia_ManAreListCountListUsed(
p, pObj->
F[0] );
1115 Gia_ManAreCompress(
p, pObj->
F );
1118 Gia_ManAreRebalance(
p, pObj->
F );
1124 else if ( Gia_StaHasValue1(pSta, pObj->
iVar) )
1126 if ( Gia_ObjHasBranch1(pObj) )
1130 Gia_ManAreCubeAddToList(
p, pObj->
F+1, pSta );
1133 pObj->
nStas1 = Gia_ManAreListCountListUsed(
p, pObj->
F[1] );
1135 Gia_ManAreCompress(
p, pObj->
F+1 );
1138 Gia_ManAreRebalance(
p, pObj->
F+1 );
1146 if ( Gia_ObjHasBranch2(pObj) )
1150 Gia_ManAreCubeAddToList(
p, pObj->
F+2, pSta );
1153 pObj->
nStas2 = Gia_ManAreListCountListUsed(
p, pObj->
F[2] );
1155 Gia_ManAreCompress(
p, pObj->
F+2 );
1158 Gia_ManAreRebalance(
p, pObj->
F+2 );
1185 if ( Gia_StaIsUnused( pCube ) )
1187 if ( Gia_StaAreDisjoint( pSta, pCube,
p->nWords ) )
1204 if ( iCube <= p->iStaCur )
1205 Vec_IntPush(
p->vCubesA, iCube );
1207 Vec_IntPush(
p->vCubesB, iCube );
1226 if ( Gia_StaHasValue0(pSta, pObj->
iVar) )
1228 if ( Gia_ObjHasBranch0(pObj) )
1231 RetValue = Gia_ManAreCubeCollectList(
p, pObj->
F, pSta );
1232 if ( RetValue == 0 )
1235 else if ( Gia_StaHasValue1(pSta, pObj->
iVar) )
1237 if ( Gia_ObjHasBranch1(pObj) )
1240 RetValue = Gia_ManAreCubeCollectList(
p, pObj->
F + 1, pSta );
1241 if ( RetValue == 0 )
1244 if ( Gia_ObjHasBranch2(pObj) )
1246 return Gia_ManAreCubeCollectList(
p, pObj->
F + 2, pSta );
1265 Vec_IntClear(
p->vCubesA );
1266 Vec_IntClear(
p->vCubesB );
1274 if ( Gia_StaIsUnused( pCube ) )
1276 if ( Gia_StaAreDisjoint( pSta, pCube,
p->nWords ) )
1278 if ( Gia_StaAreContain( pCube, pSta,
p->nWords ) )
1280 Gia_ManAreRycycleSta(
p, pSta );
1283 if ( Gia_StaAreContain( pSta, pCube,
p->nWords ) )
1285 Gia_StaSetUnused( pCube );
1288 iVar = Gia_StaAreSharpVar( pSta, pCube,
p->nWords );
1291 assert( !Gia_StaHasValue0(pSta, iVar) && !Gia_StaHasValue1(pSta, iVar) );
1292 assert( Gia_StaHasValue0(pCube, iVar) ^ Gia_StaHasValue1(pCube, iVar) );
1293 if ( Gia_StaHasValue0(pCube, iVar) )
1294 Gia_StaSetValue1( pSta, iVar );
1296 Gia_StaSetValue0( pSta, iVar );
1301 if ( Gia_StaIsUnused( pCube ) )
1303 if ( Gia_StaAreDisjoint( pSta, pCube,
p->nWords ) )
1305 if ( Gia_StaAreContain( pCube, pSta,
p->nWords ) )
1307 Gia_ManAreRycycleSta(
p, pSta );
1310 if ( Gia_StaAreContain( pSta, pCube,
p->nWords ) )
1312 Gia_StaSetUnused( pCube );
1315 iVar = Gia_StaAreSharpVar( pSta, pCube,
p->nWords );
1318 assert( !Gia_StaHasValue0(pSta, iVar) && !Gia_StaHasValue1(pSta, iVar) );
1319 assert( Gia_StaHasValue0(pCube, iVar) ^ Gia_StaHasValue1(pCube, iVar) );
1320 if ( Gia_StaHasValue0(pCube, iVar) )
1321 Gia_StaSetValue1( pSta, iVar );
1323 Gia_StaSetValue0( pSta, iVar );
1362 Gia_ManAreRebalance(
p, &
p->Root );
1372 RetValue = Gia_ManAreCubeCheckList(
p, &
p->Root, pSta );
1374 Gia_ManAreCubeAddToList(
p, &
p->Root, pSta );
1394 if ( Gia_ObjIsTravIdCurrent(
p, pObj) )
1396 Gia_ObjSetTravIdCurrent(
p, pObj);
1397 if ( Gia_ObjIsCi(pObj) )
1402 assert( Gia_ObjIsAnd(pObj) );
1428 if ( pObj->
Value <= 1 )
1435 if ( pObjMax == NULL || pObjMax->
Value < pObj->
Value )
1438 return pObjMax->
Value > 1 ? pObjMax : NULL;
1454 if ( Gia_ObjIsTravIdCurrent(
p, pObj) )
1456 Gia_ObjSetTravIdCurrent(
p, pObj);
1457 if ( Gia_ObjIsCi(pObj) )
1459 assert( Gia_ObjIsAnd(pObj) );
1478 int i, CountCur, CountMax = 0;
1481 pObjNew = Gia_ManObj(
p->pNew, Abc_Lit2Var(pObj->
Value) );
1482 if ( Gia_ObjIsConst0(pObjNew) )
1489 CountMax = Abc_MaxInt( CountMax, CountCur );
1511 pObjNew = Gia_ManObj(
p->pNew, Abc_Lit2Var(pObj->
Value) );
1512 if ( Gia_ObjIsConst0(pObjNew) )
1514 if ( Abc_LitIsCompl(pObj->
Value) )
1550 if ( (pPivot = Gia_ManAreMostUsedPi(
p)) == NULL )
1554 pNew = Gia_ManAreCreateStaNew(
p );
1556 p->fStopped = (
p->fMiter && (Gia_ManCheckPOstatus(
p) & 1));
1563 Gia_ManAreCubeProcess(
p, pNew );
1564 p->timeCube += Abc_Clock() - clk;
1568 vTfos = Vec_VecEntryInt(
p->vCiTfos, Gia_ObjCioId(pPivot) );
1569 vLits = Vec_VecEntryInt(
p->vCiLits, Gia_ObjCioId(pPivot) );
1570 assert( Vec_IntSize(vTfos) == Vec_IntSize(vLits) );
1573 Vec_IntWriteEntry( vLits, i, pObj->
Value );
1574 if ( Gia_ObjIsAnd(pObj) )
1576 else if ( Gia_ObjIsCo(pObj) )
1577 pObj->
Value = Gia_ObjFanin0Copy(pObj);
1580 assert( Gia_ObjIsCi(pObj) );
1589 if ( Gia_ObjIsAnd(pObj) )
1591 else if ( Gia_ObjIsCo(pObj) )
1592 pObj->
Value = Gia_ObjFanin0Copy(pObj);
1595 assert( Gia_ObjIsCi(pObj) );
1603 pObj->
Value = Vec_IntEntry( vLits, i );
1624 pSta = Gia_ManAreSta(
p, Sta );
1625 if ( Gia_StaIsUnused(pSta) )
1628 if (
p->pNew && Gia_ManObjNum(
p->pNew) > 1000000 )
1634 if (
p->pNew == NULL )
1639 Gia_ManConst0(
p->pAig)->Value = 0;
1641 pObj->
Value = Gia_ManAppendCi(
p->pNew);
1645 if ( Gia_StaHasValue0( pSta, i ) )
1647 else if ( Gia_StaHasValue1( pSta, i ) )
1650 pObj->
Value = Abc_Var2Lit( Gia_ObjId(
p->pNew, Gia_ManCi(
p->pNew, Gia_ObjCioId(pObj)) ), 0 );
1655 pObj->
Value = Gia_ObjFanin0Copy(pObj);
1662 printf(
"Exceeded the limit on the number of transitions from a state cube (%d).\n",
MAX_CALL_NUM );
1667 p->timeAig += Abc_Clock() - clk;
1685 printf(
"States =%10d. Reached =%10d. R = %5.3f. Depth =%6d. Mem =%9.2f MB. ",
1691 ABC_PRT(
"Time", Abc_Clock() - Time );
1695 ABC_PRTr(
"Time", Abc_Clock() - Time );
1719 printf(
"Currently can only handle circuit with up to %d registers.\n",
MAX_VARS_NUM );
1726 Gia_ManAreCubeProcess(
p, Gia_ManAreCreateStaInit(
p) );
1727 for (
p->iStaCur = 1;
p->iStaCur <
p->nStas;
p->iStaCur++ )
1741 printf(
"%s after finding %d state cubes (%d not contained) with depth %d. ",
1742 p->fStopped ?
"Stopped" :
"Completed",
1743 p->nStas, Gia_ManAreListCountUsed(
p),
1745 ABC_PRT(
"Time", Abc_Clock() - clk );
1747 Abc_Print( 1,
"Output %d of miter \"%s\" was asserted in frame %d.\n",
1751 ABC_PRTP(
"Cofactoring",
p->timeAig -
p->timeCube, Abc_Clock() - clk );
1752 ABC_PRTP(
"Containment",
p->timeCube, Abc_Clock() - clk );
1753 ABC_PRTP(
"Other ", Abc_Clock() - clk -
p->timeAig, Abc_Clock() - clk );
1754 ABC_PRTP(
"TOTAL ", Abc_Clock() - clk, Abc_Clock() - clk );
1756 if ( Gia_ManRegNum(pAig) <= 30 )
1759 printf(
"The number of unique state minterms in computed state cubes is %d. ",
Gia_ManCountMinterms(
p) );
1760 ABC_PRT(
"Time", Abc_Clock() - clk );
1771 printf(
"Generated counter-example is INVALID. \n" );
1773 printf(
"Generated counter-example verified correctly. \n" );
1806 pCnf =
Cnf_Derive( pAig2, Gia_ManCoNum(
p->pAig) );
1812 p->vAssumps = Vec_IntAlloc( 100 );
1813 p->vCofVars = Vec_IntAlloc( 100 );
1832 Vec_IntFree(
p->vSatNumCis );
1833 Vec_IntFree(
p->vSatNumCos );
1834 Vec_IntFree(
p->vAssumps );
1835 Vec_IntFree(
p->vCofVars );
1856 Vec_IntClear(
p->vAssumps );
1857 for ( i = 0; i < Gia_ManRegNum(
p->pAig); i++ )
1859 if ( Gia_StaHasValue0(pCur, i) )
1860 Vec_IntPush(
p->vAssumps, Abc_Var2Lit( Vec_IntEntry(
p->vSatNumCis, Gia_ManPiNum(
p->pAig)+i), 1 ) );
1861 else if ( Gia_StaHasValue1(pCur, i) )
1862 Vec_IntPush(
p->vAssumps, Abc_Var2Lit( Vec_IntEntry(
p->vSatNumCis, Gia_ManPiNum(
p->pAig)+i), 0 ) );
1865 for ( i = 0; i < Gia_ManRegNum(
p->pAig); i++ )
1867 if ( Gia_StaHasValue0(pNext, i) )
1868 Vec_IntPush(
p->vAssumps, Abc_Var2Lit( Vec_IntEntry(
p->vSatNumCos, Gia_ManPoNum(
p->pAig)+i), 1 ) );
1869 else if ( Gia_StaHasValue1(pNext, i) )
1870 Vec_IntPush(
p->vAssumps, Abc_Var2Lit( Vec_IntEntry(
p->vSatNumCos, Gia_ManPoNum(
p->pAig)+i), 0 ) );
1872 if ( iOutFailed >= 0 )
1874 assert( iOutFailed < Gia_ManPoNum(
p->pAig) );
1875 Vec_IntPush(
p->vAssumps, Abc_Var2Lit( Vec_IntEntry(
p->vSatNumCos, iOutFailed), 0 ) );
1879 (ABC_INT64_T)1000000, (ABC_INT64_T)0, (ABC_INT64_T)0, (ABC_INT64_T)0 );
1882 printf(
"SAT problem is not satisfiable. Failure...\n" );
1887 Vec_IntClear(
p->vCofVars );
1888 for ( i = 0; i < Gia_ManPiNum(
p->pAig); i++ )
1890 if ( sat_solver_var_value( (
sat_solver *)
p->pSat, Vec_IntEntry(
p->vSatNumCis, i) ) )
1891 Vec_IntPush(
p->vCofVars, i );
1894 for ( i = 0; i < Gia_ManRegNum(
p->pAig); i++ )
1896 if ( Gia_StaHasValue0(pCur, i) )
1897 assert( sat_solver_var_value( (
sat_solver *)
p->pSat, Vec_IntEntry(
p->vSatNumCis, Gia_ManPiNum(
p->pAig)+i) ) == 0 );
1898 else if ( Gia_StaHasValue1(pCur, i) )
1899 assert( sat_solver_var_value( (
sat_solver *)
p->pSat, Vec_IntEntry(
p->vSatNumCis, Gia_ManPiNum(
p->pAig)+i) ) == 1 );
1901 if ( sat_solver_var_value( (
sat_solver *)
p->pSat, Vec_IntEntry(
p->vSatNumCis, Gia_ManPiNum(
p->pAig)+i) ) == 0 )
1902 Gia_StaSetValue0( pCur, i );
1904 Gia_StaSetValue1( pCur, i );
1928 vStates = Vec_PtrAlloc( 1000 );
1929 for ( pSta = pLast; Gia_StaIsGood(
p, pSta); pSta = Gia_StaPrev(
p, pSta) )
1930 if ( pSta != pLast )
1931 Vec_PtrPush( vStates, pSta );
1932 assert( Vec_PtrSize(vStates) >= 1 );
1934 pCex =
Abc_CexAlloc( Gia_ManRegNum(
p->pAig), Gia_ManPiNum(
p->pAig), Vec_PtrSize(vStates) );
1935 pCex->iFrame = Vec_PtrSize(vStates)-1;
1936 pCex->iPo =
p->iOutFail;
1947 Abc_InfoSetBit( pCex->pData, Gia_ManRegNum(
p->pAig) + (Vec_PtrSize(vStates)-1-i) * Gia_ManPiNum(
p->pAig) +
Var );
1951 Vec_PtrFree( vStates );
#define ABC_PRTP(a, t, T)
#define ABC_CALLOC(type, num)
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
void Aig_ManSetRegNum(Aig_Man_t *p, int nRegs)
void Aig_ManStop(Aig_Man_t *p)
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Vec_Int_t * Cnf_DataCollectCoSatNums(Cnf_Dat_t *pCnf, Aig_Man_t *p)
Cnf_Dat_t * Cnf_Derive(Aig_Man_t *pAig, int nOutputs)
struct Cnf_Dat_t_ Cnf_Dat_t
void Cnf_DataFree(Cnf_Dat_t *p)
Vec_Int_t * Cnf_DataCollectCiSatNums(Cnf_Dat_t *pCnf, Aig_Man_t *p)
Aig_Man_t * Gia_ManToAig(Gia_Man_t *p, int fChoices)
void Gia_ManArePrintCube(Gia_ManAre_t *p, Gia_StaAre_t *pSta)
int Gia_ManArePrintUsed_rec(Gia_ManAre_t *p, Gia_PtrAre_t Root, int fTree)
void Gia_ManAreCubeAddToTree_rec(Gia_ManAre_t *p, Gia_ObjAre_t *pObj, Gia_StaAre_t *pSta)
int Gia_ManCheckPOs_rec(Gia_Man_t *p, Gia_Obj_t *pObj)
Gia_ManAre_t * Gia_ManAreCreate(Gia_Man_t *pAig)
#define Gia_ManAreForEachCubeVec(vVec, p, pCube, i)
int Gia_ManDeriveCiTfo_rec(Gia_Man_t *p, Gia_Obj_t *pObj, Vec_Int_t *vRes)
#define Gia_ManAreForEachCubeList2(p, iList, pCube, iCube)
int Gia_ManAreFindBestVar(Gia_ManAre_t *p, Gia_PtrAre_t List)
#define Gia_ManAreForEachCubeStore(p, pCube, i)
struct Gia_ObjAre_t_ Gia_ObjAre_t
void Gia_ManAreDeriveCexSatStop(Gia_ManAre_t *p)
int Gia_ManAreCubeCheckTree_rec(Gia_ManAre_t *p, Gia_ObjAre_t *pObj, Gia_StaAre_t *pSta)
int Gia_ManAreDepth(Gia_ManAre_t *p, int iState)
void Gia_ManCountMintermsInCube(Gia_StaAre_t *pCube, int nVars, unsigned *pStore)
FUNCTION DEFINITIONS ///.
int Gia_ManAreListCountUsed_rec(Gia_ManAre_t *p, Gia_PtrAre_t Root, int fTree)
#define MAX_CALL_NUM
DECLARATIONS ///.
int Gia_ManAreDeriveNexts(Gia_ManAre_t *p, Gia_PtrAre_t Sta)
#define Gia_ManAreForEachCubeList(p, pList, pCube)
Abc_Cex_t * Gia_ManAreDeriveCex(Gia_ManAre_t *p, Gia_StaAre_t *pLast)
int Gia_ManCountMinterms(Gia_ManAre_t *p)
int Gia_ManAreDeriveNexts_rec(Gia_ManAre_t *p, Gia_PtrAre_t Sta)
int Gia_ManAreCubeCollectTree_rec(Gia_ManAre_t *p, Gia_ObjAre_t *pObj, Gia_StaAre_t *pSta)
void Gia_ManArePrintReport(Gia_ManAre_t *p, abctime Time, int fFinal)
struct Gia_PtrAre_t_ Gia_PtrAre_t
int Gia_ManAreCubeCheckTree(Gia_ManAre_t *p, Gia_StaAre_t *pSta)
ABC_NAMESPACE_IMPL_END ABC_NAMESPACE_IMPL_START void Gia_ManAreDeriveCexSatStart(Gia_ManAre_t *p)
Vec_Int_t * Gia_ManDeriveCiTfoOne(Gia_Man_t *p, Gia_Obj_t *pPivot)
int Gia_ManArePerform(Gia_Man_t *pAig, int nStatesMax, int fMiter, int fVerbose)
void Gia_ManAreFree(Gia_ManAre_t *p)
struct Gia_ManAre_t_ Gia_ManAre_t
void Gia_ManAreMostUsedPi_rec(Gia_Man_t *p, Gia_Obj_t *pObj)
void Gia_ManAreDeriveCexSat(Gia_ManAre_t *p, Gia_StaAre_t *pCur, Gia_StaAre_t *pNext, int iOutFailed)
union Gia_PtrAreInt_t_ Gia_PtrAreInt_t
Vec_Vec_t * Gia_ManDeriveCiTfo(Gia_Man_t *p)
struct Gia_StaAre_t_ Gia_StaAre_t
void Gia_ManStop(Gia_Man_t *p)
Gia_Man_t * Gia_ManDup(Gia_Man_t *p)
#define Gia_ManForEachRo(p, pObj, i)
#define Gia_ManForEachPo(p, pObj, i)
#define Gia_ManForEachAnd(p, pObj, i)
void Gia_ManHashAlloc(Gia_Man_t *p)
Gia_Man_t * Gia_ManStart(int nObjsMax)
FUNCTION DEFINITIONS ///.
struct Gia_Obj_t_ Gia_Obj_t
struct Gia_Man_t_ Gia_Man_t
#define Gia_ManForEachObjVec(vVec, p, pObj, i)
void Gia_ManCleanMark0(Gia_Man_t *p)
int Gia_ManVerifyCex(Gia_Man_t *pAig, Abc_Cex_t *p, int fDualOut)
DECLARATIONS ///.
int Gia_ManHashAnd(Gia_Man_t *p, int iLit0, int iLit1)
void Gia_ManIncrementTravId(Gia_Man_t *p)
#define Gia_ManForEachCo(p, pObj, i)
#define Gia_ManForEachCi(p, pObj, i)
#define Gia_ManForEachRi(p, pObj, i)
void * Cnf_DataWriteIntoSolver(Cnf_Dat_t *p, int nFrames, int fInit)
void sat_solver_delete(sat_solver *s)
ABC_NAMESPACE_IMPL_START Abc_Cex_t * Abc_CexAlloc(int nRegs, int nRealPis, int nFrames)
DECLARATIONS ///.
typedefABC_NAMESPACE_HEADER_START struct Abc_Cex_t_ Abc_Cex_t
INCLUDES ///.
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
typedefABC_NAMESPACE_HEADER_START struct Vec_Vec_t_ Vec_Vec_t
INCLUDES ///.