188 int nDigits, Digit, k;
189 nDigits = (1 << nFans) / 4;
190 for ( k = nDigits - 1; k >= 0; k-- )
192 Digit = ((pTruth[k/8] >> ((k%8) * 4)) & 15);
194 fprintf( pFile,
"%d", Digit );
196 fprintf( pFile,
"%c",
'A' + Digit-10 );
213 int nDigits, Digit, k;
214 nDigits = (1 << nFans) / 4;
215 for ( k = nDigits - 1; k >= 0; k-- )
217 Digit = ((pTruth[k/8] >> ((k%8) * 4)) & 15);
219 *pBuff++ =
'0' + Digit;
221 *pBuff++ =
'A' + Digit-10;
246 assert( Id < pNtk->nVars );
247 fprintf( pFile,
"%c",
'a' + Id );
254 fprintf( pFile,
"Const1" );
269 fprintf( pFile,
"[" );
271 fprintf( pFile,
"(" );
275 fprintf( pFile,
"!" );
277 if ( i < pObj->nFans - 1 )
278 fprintf( pFile,
"%c", Symbol );
281 fprintf( pFile,
"]" );
283 fprintf( pFile,
")" );
301 fprintf( pFile,
"!" );
326 assert( Id < pNtk->nVars );
327 fprintf( pFile,
"%c",
'a' + Id );
334 fprintf( pFile,
"Const1" );
351 fprintf( pFile,
"(" );
355 fprintf( pFile,
"!" );
357 if ( i < pObj->nFans - 1 )
358 fprintf( pFile,
"%c", Symbol );
360 fprintf( pFile,
")" );
376 fprintf( pFile,
"F = " );
378 fprintf( pFile,
"!" );
403 assert( Id < pNtk->nVars );
411 sprintf( pBuff,
"%s",
"Const1" );
412 return pBuff +
strlen(
"Const1");
434 if ( i < pObj->nFans - 1 )
563 unsigned * pTruthRes, * pTruthFans[16], * pTruthTemp;
564 unsigned i, iLit, fCompl;
574 assert( Id < pNtk->nVars );
590 iLit = pObj->
pFans[0];
665 unsigned * pTruthRes;
669 for ( i = 0; i < (int)pNtk->
nVars; i++ )
693 unsigned * pTruthRes, * pTruthFans[16], * pTruthTemp;
694 unsigned i, iLit, fCompl, nPartial = 0;
704 assert( Id < pNtk->nVars );
705 assert( !uSupp || uSupp != (uSupp & ~(1<<Id)) );
721 iLit = pObj->
pFans[0];
739 pTruthFans[i] = NULL;
777 if ( uSupp && nPartial )
783 assert( i < pObj->nFans );
784 return pTruthFans[i];
825 unsigned * pTruthRes;
832 for ( i = 0; i < (int)pNtk->
nVars; i++ )
857 unsigned * pTruthRes, * pTruthFans[16], * pTruthTemp;
858 unsigned i, iLit, fCompl, nPartial, uSuppFan, uSuppCur;
867 assert( Id < pNtk->nVars );
880 if ( uSupp & uSuppCur )
883 uSuppFan |= uSuppCur;
888 if ( nPartial == 0 || nPartial == pObj->
nFans )
893 if ( uSuppFan != (uSuppFan & uSupp) )
930 assert( uSuppFan == (uSuppFan & uSupp) );
931 assert( nPartial < pObj->nFans );
978 assert( i < pObj->nFans );
1026 unsigned * pTruthRes, uSuppAll;
1033 if ( (uSupp & uSuppAll) == 0 )
1039 if ( (uSupp & uSuppAll) == uSuppAll )
1047 for ( i = 0; i < (int)pNtk->
nVars; i++ )
1146 unsigned iLit, i, Res0, Res1;
1155 if ( Res0 == 0 && Res1 > 0 )
1157 if ( Res0 > 0 && Res1 == 0 )
1160 return nLutSize - 2;
1163 if ( (
int)pObj->
nFans > nLutSize )
1173 return nLutSize - pObj->
nFans;
1195 if ( Counter >= 1000 )
1214 unsigned i, nSizeMax = 0;
1219 if ( nSizeMax < pObj->nFans )
1220 nSizeMax = pObj->
nFans;
1239 unsigned i, nSizeMax = 0;
1244 if ( nSizeMax < pObj->nFans )
1246 nSizeMax = pObj->
nFans;
1267 unsigned i, uSupport = 0;
1294 unsigned i, iLitFanin;
1299 piLitsNew[(*nLitsNew)++] = iLit;
1321 unsigned i, iLitFanin;
1326 piLitsNew[(*nLitsNew)++] = iLit;
1351 unsigned * pTruth, * pTruthNew;
1352 unsigned i, iLitFanin, piLitsNew[16], nLitsNew = 0;
1363 for ( i = 0; i < pObjNew->
nFans; i++ )
1372 for ( i = 0; i < pObjNew->
nFans; i++ )
1399 if ( pObj->
nFans == 3 &&
1400 (pTruthNew[0] == 0xCACACACA || pTruthNew[0] == 0xC5C5C5C5 ||
1401 pTruthNew[0] == 0x3A3A3A3A || pTruthNew[0] == 0x35353535) )
1404 if ( pTruthNew[0] == 0xC5C5C5C5 )
1406 else if ( pTruthNew[0] == 0x3A3A3A3A )
1408 else if ( pTruthNew[0] == 0x35353535 )
1413 pTruthNew[0] = 0xCACACACA;
1417 unsigned char Temp = pObjNew->
pFans[0];
1419 pObjNew->
pFans[1] = Temp;
1488 void Kit_DsdCompSort(
int pPrios[],
unsigned uSupps[],
unsigned short * piLits,
int nVars,
unsigned piLitsRes[] )
1490 int nSuppSizes[16], Priority[16], pOrder[16];
1491 int i, k, iVarBest, SuppMax, PrioMax;
1493 for ( i = 0; i < nVars; i++ )
1498 for ( k = 0; k < 16; k++ )
1499 if ( uSupps[i] & (1 << k) )
1500 Priority[i] =
KIT_MIN( Priority[i], pPrios[k] );
1501 assert( Priority[i] != 16 );
1510 for ( i = 0; i < nVars; i++ )
1512 if ( SuppMax < nSuppSizes[i] || (SuppMax == nSuppSizes[i] && PrioMax < Priority[i]) )
1514 SuppMax = nSuppSizes[i];
1515 PrioMax = Priority[i];
1519 assert( iVarBest != -1 );
1522 piLitsRes[k++] = piLits[iVarBest];
1523 for ( i = 0; i < nVars; i++ )
1525 if ( pOrder[i] == iVarBest )
1527 piLitsRes[k++] = piLits[pOrder[i]];
1547 unsigned * pTruth, * pTruthNew;
1548 unsigned i, piLitsNew[16], uSupps[16];
1549 int iLitFanin, iLitNew;
1565 for ( i = 1; i < pObj->
nFans; i++ )
1569 pObjNew->
pFans[1] = iLitNew;
1587 for ( i = 1; i < pObj->
nFans; i++ )
1591 pObjNew->
pFans[1] = iLitNew;
1674 unsigned * pIn, * pOut, * pTemp, k;
1675 int i, v, Temp, uSuppFanin, iFaninLit, WeightMax, FaninMax, nSwaps;
1687 for ( v = 0; v < 16; v++ )
1688 if ( uSuppFanin & (1 << v) )
1689 Weights[k] += pFreqs[v] - 1;
1694 for ( k = 0; k < pObj->
nFans; k++ )
1695 if ( WeightMax < Weights[k] )
1697 WeightMax = Weights[k];
1701 if ( FaninMax == -1 )
1708 for ( v = FaninMax-1; v >= 0; v-- )
1711 Temp = pObj->
pFans[v];
1713 pObj->
pFans[v+1] = Temp;
1716 pTemp = pIn; pIn = pOut; pOut = pTemp;
1738 unsigned uSupport, k;
1747 assert( uSupport <= 0xFFFF );
1773 uSupport = p->
pSupps[0] = 0;
1782 assert( uSupport <= 0xFFFF );
1800 unsigned iLit, i, RetValue;
1842 unsigned iLit, i, RetValue;
1848 if ( pObj->
nFans < 2 )
1852 RetValue = ((int)pObj->
nFans - 1);
1854 RetValue = ((int)pObj->
nFans - 1) * 3;
1899 for ( i = 0; i < pNtk->
nNodes; i++ )
1903 Counter += ((int)pObj->
nFans - 1);
1905 Counter += ((int)pObj->
nFans - 1) * 3;
1926 for ( i = 0; i < pObj0->
nFans; i++ )
1930 for ( k = 0; k < pObj1->
nFans; k++ )
1975 unsigned * pCofs2[2] = { pNtk->
pMem, pNtk->
pMem + nWords };
1977 int i, iLit0, iLit1, nFans0, nFans1, nPairs;
1978 int fEquals[2][2], fOppos, fPairs[4][4];
1979 unsigned j, k, nFansNew, uSupp0, uSupp1;
1990 for ( j = k = 0; j < pObj->
nFans; j++ )
1991 if ( uSupp & (1 << j) )
1999 if ( pObj->
nFans == 1 )
2002 if ( pTruth[0] == 0x55555555 )
2005 assert( pTruth[0] == 0xAAAAAAAA );
2013 for ( i = pObj->
nFans - 1; i >= 0; i-- )
2027 if ( fEquals[0][0] + fEquals[0][1] + fEquals[1][0] + fEquals[1][1] + fOppos == 0 )
2032 assert( uSupp == (uSupp0 | uSupp1 | (1<<i)) );
2033 if ( uSupp0 & uSupp1 )
2038 for ( k = 0; k < pObj->
nFans; k++ )
2040 pRes0->
pFans[k] = (uSupp0 & (1 << k))? pObj->
pFans[k] : 127;
2041 pRes1->
pFans[k] = (uSupp1 & (1 << k))? pObj->
pFans[k] : 127;
2047 pTruth[0] = 0xCACACACA;
2062 pRes->
pFans[0] = pObj->
pFans[i]; pObj->
pFans[i] = 127; uSupp &= ~(1 << i);
2067 if ( fEquals[0][0] )
2071 else if ( fEquals[0][1] )
2076 else if ( fEquals[1][0] )
2082 else if ( fEquals[1][1] )
2104 for ( i = pObj->
nFans - 1; i >= 0; i-- )
2113 assert( uSupp == (uSupp0 | uSupp1 | (1<<i)) );
2115 if ( uSupp0 == 0 || uSupp1 == 0 )
2121 assert( uSupp0 && uSupp1 );
2125 if ( nFans0 == 1 && nFans1 == 1 )
2140 if ( (fEquals[0][0] && fEquals[0][1]) || (fEquals[1][0] && fEquals[1][1]) )
2147 pRes->
pFans[0] = pObj->
pFans[iLit0]; pObj->
pFans[iLit0] = 127; uSupp &= ~(1 << iLit0);
2148 pRes->
pFans[1] = pObj->
pFans[iLit1]; pObj->
pFans[iLit1] = 127; uSupp &= ~(1 << iLit1);
2156 if ( fEquals[1][0] && fEquals[1][1] )
2165 for ( k = i+1; k < pObj->
nFans; k++ )
2179 nPairs = fPairs[0][1] + fPairs[0][2] + fPairs[0][3] + fPairs[1][2] + fPairs[1][3] + fPairs[2][3];
2180 if ( nPairs != 3 && nPairs != 2 )
2188 pRes->
pFans[1] = pObj->
pFans[i]; pObj->
pFans[i] = 127; uSupp &= ~(1 << i);
2189 if ( !fPairs[0][1] && !fPairs[0][2] && !fPairs[0][3] )
2195 else if ( !fPairs[1][0] && !fPairs[1][2] && !fPairs[1][3] )
2200 else if ( !fPairs[2][0] && !fPairs[2][1] && !fPairs[2][3] )
2205 else if ( !fPairs[3][0] && !fPairs[3][1] && !fPairs[3][2] )
2218 assert( fPairs[0][3] && fPairs[1][2] );
2229 if ( nDecMux > 0 && (
int)pObj->
nFans > nDecMux )
2237 for ( k = 0; k < pObj->
nFans; k++ )
2243 pTruth[0] = 0xCACACACA;
2278 for ( i = 0; i < nVars; i++ )
2284 if ( nVarsReal == 0 )
2288 if ( pTruth[0] == 0 )
2292 if ( nVarsReal == 1 )
2392 unsigned i, * pTruth;
2396 pTruth = pTruthInit;
2403 printf(
"Function: " );
2409 for ( i = 0; i < pNtk->
nVars; i++ )
2418 printf(
"Cof%d0: ", i );
2429 printf(
"Cof%d1: ", i );
2474 printf(
"Verification failed.\n" );
2499 printf(
"Verification failed.\n" );
2547 printf(
"Verification failed.\n" );
2574 int Counter1 = 0, Counter2 = 0;
2576 pFile = fopen(
"5npn/npn4.txt",
"r" );
2577 for ( i = 0; fgets( Buffer, 100, pFile ); i++ )
2581 uTruth = ((uTruth & 0xffff) << 16) | (uTruth & 0xffff);
2593 printf(
"%3d : Non-DSD function %s %s\n", i, Buffer + 2, RetValue?
"implementable" :
"" );
2597 Counter2 += RetValue;
2611 printf(
"Verification failed.\n" );
2617 printf(
"non-DSD = %d implementable = %d\n", Counter1, Counter2 );
2636 int i, k, v,
Var, nVars, iFaninLit;
2639 for ( i = 0; i < nSize; i++ )
2646 if ( pObj->
nFans == 3 )
2655 for ( v = 0; v < nVars; v++ )
2656 if ( pVars[v] == Var )
2659 pVars[nVars++] =
Var;
2681 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
2682 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
2683 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
2684 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
2685 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
2688 unsigned * ppCofs[5][16];
2689 int pTryVars[16], nTryVars;
2690 int nPrimeSizeMin, nPrimeSizeMax, nPrimeSizeCur;
2691 int nSuppSizeMin, nSuppSizeMax, iVarBest;
2692 int i, k, v, nStep, nSize, nMemSize;
2697 ppCofs[0][0] =
ABC_ALLOC(
unsigned, 80 * nMemSize );
2699 for ( i = 0; i < 5; i++ )
2700 for ( k = 0; k < 16; k++ )
2701 ppCofs[i][k] = ppCofs[0][0] + nMemSize * nSize++;
2709 printf(
"\nProcessing prime function with %d support variables:\n", nVars );
2712 for ( nStep = 0; nStep < nLimit; nStep++ )
2714 nSize = (1 << nStep);
2717 if ( nTryVars == 0 )
2721 nPrimeSizeMin = 10000;
2722 nSuppSizeMin = 10000;
2723 for ( v = 0; v < nTryVars; v++ )
2727 for ( i = 0; i < nSize; i++ )
2732 ppNtks[nStep+1][2*i+0] =
Kit_DsdDecompose( ppCofs[nStep+1][2*i+0], nVars );
2733 ppNtks[nStep+1][2*i+1] =
Kit_DsdDecompose( ppCofs[nStep+1][2*i+1], nVars );
2736 nPrimeSizeMax =
KIT_MAX( nPrimeSizeMax, nPrimeSizeCur );
2738 nPrimeSizeMax =
KIT_MAX( nPrimeSizeMax, nPrimeSizeCur );
2747 if ( nPrimeSizeMin > nPrimeSizeMax || (nPrimeSizeMin == nPrimeSizeMax && nSuppSizeMin > nSuppSizeMax) )
2749 nPrimeSizeMin = nPrimeSizeMax;
2750 nSuppSizeMin = nSuppSizeMax;
2751 iVarBest = pTryVars[v];
2754 assert( iVarBest != -1 );
2757 pCofVars[nStep] = iVarBest;
2759 for ( i = 0; i < nSize; i++ )
2763 ppNtks[nStep+1][2*i+0] =
Kit_DsdDecompose( ppCofs[nStep+1][2*i+0], nVars );
2764 ppNtks[nStep+1][2*i+1] =
Kit_DsdDecompose( ppCofs[nStep+1][2*i+1], nVars );
2767 ppNtks[nStep+1][2*i+0] =
Kit_DsdExpand( pTemp = ppNtks[nStep+1][2*i+0] );
2769 ppNtks[nStep+1][2*i+1] =
Kit_DsdExpand( pTemp = ppNtks[nStep+1][2*i+1] );
2772 printf(
"Cof%d%d: ", nStep+1, 2*i+0 );
2773 Kit_DsdPrint( stdout, ppNtks[nStep+1][2*i+0] ), printf(
"\n" );
2774 printf(
"Cof%d%d: ", nStep+1, 2*i+1 );
2775 Kit_DsdPrint( stdout, ppNtks[nStep+1][2*i+1] ), printf(
"\n" );
2781 for ( i = 0; i < 5; i++ )
2782 for ( k = 0; k < 16; k++ )
2787 assert( nStep <= nLimit );
2806 unsigned * ppCofs[5][16];
2808 int nPrimeSizeMax, nPrimeSizeCur, nSuppSizeMax;
2809 int i, k, v1, v2, v3, v4, s, nSteps, nSize, nMemSize;
2822 ppCofs[0][0] =
ABC_ALLOC(
unsigned, 80 * nMemSize );
2824 for ( i = 0; i < 5; i++ )
2825 for ( k = 0; k < 16; k++ )
2826 ppCofs[i][k] = ppCofs[0][0] + nMemSize * nSize++;
2832 if ( nCofLevel == 1 )
2833 for ( v1 = 0; v1 < nVars; v1++ )
2836 piCofVar[nSteps++] = v1;
2838 printf(
" Variables { " );
2839 for ( i = 0; i < nSteps; i++ )
2840 printf(
"%c ",
'a' + piCofVar[i] );
2844 for ( s = 1; s <= nSteps; s++ )
2846 for ( k = 0; k < s; k++ )
2849 for ( i = 0; i < nSize; i++ )
2857 nSize = (1 << nSteps);
2860 for ( i = 0; i < nSize; i++ )
2867 printf(
"Cof%d%d: ", nSteps, i );
2872 nPrimeSizeMax =
KIT_MAX( nPrimeSizeMax, nPrimeSizeCur );
2876 printf(
"Max = %2d. Supps = %2d.\n", nPrimeSizeMax, nSuppSizeMax );
2879 if ( nCofLevel == 2 )
2880 for ( v1 = 0; v1 < nVars; v1++ )
2881 for ( v2 = v1+1; v2 < nVars; v2++ )
2884 piCofVar[nSteps++] = v1;
2885 piCofVar[nSteps++] = v2;
2887 printf(
" Variables { " );
2888 for ( i = 0; i < nSteps; i++ )
2889 printf(
"%c ",
'a' + piCofVar[i] );
2893 for ( s = 1; s <= nSteps; s++ )
2895 for ( k = 0; k < s; k++ )
2898 for ( i = 0; i < nSize; i++ )
2906 nSize = (1 << nSteps);
2909 for ( i = 0; i < nSize; i++ )
2916 printf(
"Cof%d%d: ", nSteps, i );
2921 nPrimeSizeMax =
KIT_MAX( nPrimeSizeMax, nPrimeSizeCur );
2925 printf(
"Max = %2d. Supps = %2d.\n", nPrimeSizeMax, nSuppSizeMax );
2928 if ( nCofLevel == 3 )
2929 for ( v1 = 0; v1 < nVars; v1++ )
2930 for ( v2 = v1+1; v2 < nVars; v2++ )
2931 for ( v3 = v2+1; v3 < nVars; v3++ )
2934 piCofVar[nSteps++] = v1;
2935 piCofVar[nSteps++] = v2;
2936 piCofVar[nSteps++] = v3;
2938 printf(
" Variables { " );
2939 for ( i = 0; i < nSteps; i++ )
2940 printf(
"%c ",
'a' + piCofVar[i] );
2944 for ( s = 1; s <= nSteps; s++ )
2946 for ( k = 0; k < s; k++ )
2949 for ( i = 0; i < nSize; i++ )
2957 nSize = (1 << nSteps);
2960 for ( i = 0; i < nSize; i++ )
2967 printf(
"Cof%d%d: ", nSteps, i );
2972 nPrimeSizeMax =
KIT_MAX( nPrimeSizeMax, nPrimeSizeCur );
2976 printf(
"Max = %2d. Supps = %2d.\n", nPrimeSizeMax, nSuppSizeMax );
2979 if ( nCofLevel == 4 )
2980 for ( v1 = 0; v1 < nVars; v1++ )
2981 for ( v2 = v1+1; v2 < nVars; v2++ )
2982 for ( v3 = v2+1; v3 < nVars; v3++ )
2983 for ( v4 = v3+1; v4 < nVars; v4++ )
2986 piCofVar[nSteps++] = v1;
2987 piCofVar[nSteps++] = v2;
2988 piCofVar[nSteps++] = v3;
2989 piCofVar[nSteps++] = v4;
2991 printf(
" Variables { " );
2992 for ( i = 0; i < nSteps; i++ )
2993 printf(
"%c ",
'a' + piCofVar[i] );
2997 for ( s = 1; s <= nSteps; s++ )
2999 for ( k = 0; k < s; k++ )
3002 for ( i = 0; i < nSize; i++ )
3010 nSize = (1 << nSteps);
3013 for ( i = 0; i < nSize; i++ )
3020 printf(
"Cof%d%d: ", nSteps, i );
3025 nPrimeSizeMax =
KIT_MAX( nPrimeSizeMax, nPrimeSizeCur );
3029 printf(
"Max = %2d. Supps = %2d.\n", nPrimeSizeMax, nSuppSizeMax );
3050 static const char * pNames[222] = {
3052 "F = (!d*(!c*(!b*!a)))",
3054 "F = (!d*(!c*(b+a)))",
3055 "F = (!d*(!c*!(b*a)))",
3057 "F = (!d*16(a,b,c))",
3058 "F = (!d*17(a,b,c))",
3059 "F = (!d*18(a,b,c))",
3060 "F = (!d*19(a,b,c))",
3061 "F = (!d*CA(!b,!c,a))",
3062 "F = (!d*(c+!(!b*!a)))",
3063 "F = (!d*!(c*!(!b*!a)))",
3065 "F = (!d*3D(a,b,c))",
3067 "F = (!d*(c+(b+!a)))",
3068 "F = (!d*6B(a,b,c))",
3069 "F = (!d*!(c*!(b+a)))",
3070 "F = (!d*7E(a,b,c))",
3071 "F = (!d*!(c*(b*a)))",
3073 "F = 0116(a,b,c,d)",
3074 "F = 0117(a,b,c,d)",
3075 "F = 0118(a,b,c,d)",
3076 "F = 0119(a,b,c,d)",
3077 "F = 011A(a,b,c,d)",
3078 "F = 011B(a,b,c,d)",
3079 "F = 29((!b*!a),c,d)",
3080 "F = 2B((!b*!a),c,d)",
3081 "F = 012C(a,b,c,d)",
3082 "F = 012D(a,b,c,d)",
3083 "F = 012F(a,b,c,d)",
3084 "F = 013C(a,b,c,d)",
3085 "F = 013D(a,b,c,d)",
3086 "F = 013E(a,b,c,d)",
3087 "F = 013F(a,b,c,d)",
3088 "F = 0168(a,b,c,d)",
3089 "F = 0169(a,b,c,d)",
3090 "F = 016A(a,b,c,d)",
3091 "F = 016B(a,b,c,d)",
3092 "F = 016E(a,b,c,d)",
3093 "F = 016F(a,b,c,d)",
3094 "F = 017E(a,b,c,d)",
3095 "F = 017F(a,b,c,d)",
3096 "F = 0180(a,b,c,d)",
3097 "F = 0181(a,b,c,d)",
3098 "F = 0182(a,b,c,d)",
3099 "F = 0183(a,b,c,d)",
3100 "F = 0186(a,b,c,d)",
3101 "F = 0187(a,b,c,d)",
3102 "F = 0189(a,b,c,d)",
3103 "F = 018B(a,b,c,d)",
3104 "F = 018F(a,b,c,d)",
3105 "F = 0196(a,b,c,d)",
3106 "F = 0197(a,b,c,d)",
3107 "F = 0198(a,b,c,d)",
3108 "F = 0199(a,b,c,d)",
3109 "F = 019A(a,b,c,d)",
3110 "F = 019B(a,b,c,d)",
3111 "F = 019E(a,b,c,d)",
3112 "F = 019F(a,b,c,d)",
3113 "F = 42(a,(!c*!b),d)",
3114 "F = 46(a,(!c*!b),d)",
3115 "F = 4A(a,(!c*!b),d)",
3116 "F = CA((!c*!b),!d,a)",
3117 "F = 01AC(a,b,c,d)",
3118 "F = 01AD(a,b,c,d)",
3119 "F = 01AE(a,b,c,d)",
3120 "F = 01AF(a,b,c,d)",
3121 "F = 01BC(a,b,c,d)",
3122 "F = 01BD(a,b,c,d)",
3123 "F = 01BE(a,b,c,d)",
3124 "F = 01BF(a,b,c,d)",
3125 "F = 01E8(a,b,c,d)",
3126 "F = 01E9(a,b,c,d)",
3127 "F = 01EA(a,b,c,d)",
3128 "F = 01EB(a,b,c,d)",
3129 "F = 25((!b*!a),c,d)",
3130 "F = !CA(d,c,(!b*!a))",
3131 "F = (d+!(!c*(!b*!a)))",
3133 "F = 033D(a,b,c,d)",
3135 "F = ((!d*!a)+(!c*!b))",
3136 "F = !(!(!c*!b)*!(!d*!a))",
3137 "F = 0358(a,b,c,d)",
3138 "F = 0359(a,b,c,d)",
3139 "F = 035A(a,b,c,d)",
3140 "F = 035B(a,b,c,d)",
3141 "F = 035E(a,b,c,d)",
3142 "F = 035F(a,b,c,d)",
3143 "F = 0368(a,b,c,d)",
3144 "F = 0369(a,b,c,d)",
3145 "F = 036A(a,b,c,d)",
3146 "F = 036B(a,b,c,d)",
3147 "F = 036C(a,b,c,d)",
3148 "F = 036D(a,b,c,d)",
3149 "F = 036E(a,b,c,d)",
3150 "F = 036F(a,b,c,d)",
3151 "F = 037C(a,b,c,d)",
3152 "F = 037D(a,b,c,d)",
3153 "F = 037E(a,b,c,d)",
3155 "F = 03C1(a,b,c,d)",
3157 "F = 03C5(a,b,c,d)",
3158 "F = 03C6(a,b,c,d)",
3159 "F = 03C7(a,b,c,d)",
3161 "F = 03D4(a,b,c,d)",
3162 "F = 03D5(a,b,c,d)",
3163 "F = 03D6(a,b,c,d)",
3164 "F = 03D7(a,b,c,d)",
3165 "F = 03D8(a,b,c,d)",
3166 "F = 03D9(a,b,c,d)",
3167 "F = 03DB(a,b,c,d)",
3168 "F = 03DC(a,b,c,d)",
3169 "F = 03DD(a,b,c,d)",
3170 "F = 03DE(a,b,c,d)",
3172 "F = ((d+c)*(b+a))",
3173 "F = 0661(a,b,c,d)",
3174 "F = 0662(a,b,c,d)",
3175 "F = 0663(a,b,c,d)",
3176 "F = (!(d*c)*(b+a))",
3177 "F = 0667(a,b,c,d)",
3178 "F = 29((b+a),c,d)",
3179 "F = 066B(a,b,c,d)",
3180 "F = 2B((b+a),c,d)",
3181 "F = 0672(a,b,c,d)",
3182 "F = 0673(a,b,c,d)",
3183 "F = 0676(a,b,c,d)",
3184 "F = 0678(a,b,c,d)",
3185 "F = 0679(a,b,c,d)",
3186 "F = 067A(a,b,c,d)",
3187 "F = 067B(a,b,c,d)",
3188 "F = 067E(a,b,c,d)",
3189 "F = 24((b+a),c,d)",
3190 "F = 0691(a,b,c,d)",
3191 "F = 0693(a,b,c,d)",
3192 "F = 26((b+a),c,d)",
3193 "F = 0697(a,b,c,d)",
3194 "F = !CA(d,c,(b+a))",
3195 "F = 06B0(a,b,c,d)",
3196 "F = 06B1(a,b,c,d)",
3197 "F = 06B2(a,b,c,d)",
3198 "F = 06B3(a,b,c,d)",
3199 "F = 06B4(a,b,c,d)",
3200 "F = 06B5(a,b,c,d)",
3201 "F = 06B6(a,b,c,d)",
3202 "F = 06B7(a,b,c,d)",
3203 "F = 06B9(a,b,c,d)",
3204 "F = 06BD(a,b,c,d)",
3205 "F = 2C((b+a),c,d)",
3206 "F = 06F1(a,b,c,d)",
3207 "F = 06F2(a,b,c,d)",
3208 "F = CA((b+a),!d,c)",
3209 "F = (d+!(!c*!(b+!a)))",
3210 "F = 0776(a,b,c,d)",
3211 "F = 16((b*a),c,d)",
3212 "F = 0779(a,b,c,d)",
3213 "F = 077A(a,b,c,d)",
3214 "F = 077E(a,b,c,d)",
3215 "F = 07B0(a,b,c,d)",
3216 "F = 07B1(a,b,c,d)",
3217 "F = 07B4(a,b,c,d)",
3218 "F = 07B5(a,b,c,d)",
3219 "F = 07B6(a,b,c,d)",
3220 "F = 07BC(a,b,c,d)",
3221 "F = 07E0(a,b,c,d)",
3222 "F = 07E1(a,b,c,d)",
3223 "F = 07E2(a,b,c,d)",
3224 "F = 07E3(a,b,c,d)",
3225 "F = 07E6(a,b,c,d)",
3226 "F = 07E9(a,b,c,d)",
3227 "F = 1C((b*a),c,d)",
3228 "F = 07F1(a,b,c,d)",
3229 "F = 07F2(a,b,c,d)",
3230 "F = (d+!(!c*!(b*a)))",
3232 "F = 1668(a,b,c,d)",
3233 "F = 1669(a,b,c,d)",
3234 "F = 166A(a,b,c,d)",
3235 "F = 166B(a,b,c,d)",
3236 "F = 166E(a,b,c,d)",
3237 "F = 167E(a,b,c,d)",
3238 "F = 1681(a,b,c,d)",
3239 "F = 1683(a,b,c,d)",
3240 "F = 1686(a,b,c,d)",
3241 "F = 1687(a,b,c,d)",
3242 "F = 1689(a,b,c,d)",
3243 "F = 168B(a,b,c,d)",
3244 "F = 168E(a,b,c,d)",
3245 "F = 1696(a,b,c,d)",
3246 "F = 1697(a,b,c,d)",
3247 "F = 1698(a,b,c,d)",
3248 "F = 1699(a,b,c,d)",
3249 "F = 169A(a,b,c,d)",
3250 "F = 169B(a,b,c,d)",
3251 "F = 169E(a,b,c,d)",
3252 "F = 16A9(a,b,c,d)",
3253 "F = 16AC(a,b,c,d)",
3254 "F = 16AD(a,b,c,d)",
3255 "F = 16BC(a,b,c,d)",
3256 "F = (d+E9(a,b,c))",
3257 "F = 177E(a,b,c,d)",
3258 "F = 178E(a,b,c,d)",
3259 "F = 1796(a,b,c,d)",
3260 "F = 1798(a,b,c,d)",
3261 "F = 179A(a,b,c,d)",
3262 "F = 17AC(a,b,c,d)",
3263 "F = (d+E8(a,b,c))",
3264 "F = (d+E7(a,b,c))",
3265 "F = 19E1(a,b,c,d)",
3266 "F = 19E3(a,b,c,d)",
3267 "F = (d+E6(a,b,c))",
3268 "F = 1BD8(a,b,c,d)",
3269 "F = (d+CA(b,c,a))",
3270 "F = (d+(c+(!b*!a)))",
3274 return (
char **)pNames;
Kit_DsdNtk_t * Kit_DsdExpand(Kit_DsdNtk_t *p)
int Kit_DsdCheckVar4Dec2(Kit_DsdNtk_t *pNtk0, Kit_DsdNtk_t *pNtk1)
static void Kit_TruthAndPhase(unsigned *pOut, unsigned *pIn0, unsigned *pIn1, int nVars, int fCompl0, int fCompl1)
void Kit_DsdWriteFromTruth(char *pBuffer, unsigned *pTruth, int nVars)
int Kit_TruthBestCofVar(unsigned *pTruth, int nVars, unsigned *pCof0, unsigned *pCof1)
void Cloud_Quit(CloudManager *dd)
static Kit_DsdObj_t * Kit_DsdNtkRoot(Kit_DsdNtk_t *pNtk)
int Kit_DsdExpandNode_rec(Kit_DsdNtk_t *pNew, Kit_DsdNtk_t *p, int iLit)
static unsigned Kit_DsdObjOffset(int nFans)
unsigned * Kit_DsdTruthComputeOne(Kit_DsdMan_t *p, Kit_DsdNtk_t *pNtk, unsigned uSupp)
char ** Kit_DsdNpn4ClassNames()
#define KIT_MIN(a, b)
MACRO DEFINITIONS ///.
static int Kit_TruthWordNum(int nVars)
int Kit_DsdShrink_rec(Kit_DsdNtk_t *pNew, Kit_DsdNtk_t *p, int iLit, int pPrios[])
Kit_DsdNtk_t * Kit_DsdNtkAlloc(int nVars)
CloudManager * Cloud_Init(int nVars, int nBits)
FUNCTION DEFINITIONS ///.
void Kit_DsdPrintFromTruth(unsigned *pTruth, int nVars)
void Kit_TruthSwapAdjacentVars(unsigned *pOut, unsigned *pIn, int nVars, int Start)
DECLARATIONS ///.
static void Kit_TruthFill(unsigned *pOut, int nVars)
struct Kit_DsdObj_t_ Kit_DsdObj_t
void Kit_DsdPrintFromTruth2(FILE *pFile, unsigned *pTruth, int nVars)
void Kit_DsdVerify(Kit_DsdNtk_t *pNtk, unsigned *pTruth, int nVars)
#define ABC_REALLOC(type, obj, num)
unsigned Kit_DsdNonDsdSupports(Kit_DsdNtk_t *pNtk)
Kit_DsdNtk_t * Kit_DsdDecomposeInt(unsigned *pTruth, int nVars, int nDecMux)
int Kit_DsdFindLargeBox_rec(Kit_DsdNtk_t *pNtk, int Id, int Size)
static Kit_DsdObj_t * Kit_DsdNtkObj(Kit_DsdNtk_t *pNtk, int Id)
static int Abc_Var2Lit(int Var, int fCompl)
unsigned * Kit_TruthCompose(CloudManager *dd, unsigned *pTruth, int nVars, unsigned **pInputs, int nVarsAll, Vec_Ptr_t *vStore, Vec_Int_t *vNodes)
void Kit_TruthChangePhase(unsigned *pTruth, int nVars, int iVar)
void Kit_TruthMuxVar(unsigned *pOut, unsigned *pCof0, unsigned *pCof1, int nVars, int iVar)
#define ABC_ALLOC(type, num)
static int Kit_TruthIsEqual(unsigned *pIn0, unsigned *pIn1, int nVars)
static int Kit_TruthIsConst0(unsigned *pIn, int nVars)
void Kit_DsdExpandCollectXor_rec(Kit_DsdNtk_t *p, unsigned iLit, unsigned *piLitsNew, int *nLitsNew)
Kit_DsdObj_t * Kit_DsdObjAlloc(Kit_DsdNtk_t *pNtk, Kit_Dsd_t Type, int nFans)
#define Kit_DsdObjForEachFanin(pNtk, pObj, iLit, i)
unsigned Kit_DsdGetSupports(Kit_DsdNtk_t *p)
static int Abc_LitNotCond(int Lit, int c)
char * Kit_DsdWrite_rec(char *pBuff, Kit_DsdNtk_t *pNtk, int Id)
int Kit_DsdTestCofs(Kit_DsdNtk_t *pNtk, unsigned *pTruthInit)
unsigned * Kit_DsdTruthComputeNodeOne_rec(Kit_DsdMan_t *p, Kit_DsdNtk_t *pNtk, int Id, unsigned uSupp)
unsigned * Kit_DsdTruthCompute(Kit_DsdMan_t *p, Kit_DsdNtk_t *pNtk)
void Kit_DsdPrint(FILE *pFile, Kit_DsdNtk_t *pNtk)
void Kit_DsdPrint2_rec(FILE *pFile, Kit_DsdNtk_t *pNtk, int Id)
unsigned * Kit_DsdTruthComputeNode_rec(Kit_DsdMan_t *p, Kit_DsdNtk_t *pNtk, int Id)
void Kit_TruthCofactor0New(unsigned *pOut, unsigned *pIn, int nVars, int iVar)
static Vec_Ptr_t * Vec_PtrAllocTruthTables(int nVars)
char * Kit_DsdWriteHex(char *pBuff, unsigned *pTruth, int nFans)
int Kit_DsdCofactoring(unsigned *pTruth, int nVars, int *pCofVars, int nLimit, int fVerbose)
int Kit_DsdEval(unsigned *pTruth, int nVars, int nLutSize)
static int Kit_TruthIsConst1(unsigned *pIn, int nVars)
static int Abc_LitIsCompl(int Lit)
#define Kit_DsdNtkForEachObj(pNtk, pObj, i)
static void Kit_TruthXor(unsigned *pOut, unsigned *pIn0, unsigned *pIn1, int nVars)
void Kit_DsdPrint_rec(FILE *pFile, Kit_DsdNtk_t *pNtk, int Id)
void Kit_DsdPrecompute4Vars()
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
void Kit_DsdWrite(char *pBuff, Kit_DsdNtk_t *pNtk)
void Kit_DsdPrintHex(FILE *pFile, unsigned *pTruth, int nFans)
Kit_DsdNtk_t * Kit_DsdDecompose(unsigned *pTruth, int nVars)
void Kit_DsdTruthPartial(Kit_DsdMan_t *p, Kit_DsdNtk_t *pNtk, unsigned *pTruthRes, unsigned uSupp)
static unsigned * Kit_DsdObjTruth(Kit_DsdObj_t *pObj)
void Kit_DsdTruthPartialTwo(Kit_DsdMan_t *p, Kit_DsdNtk_t *pNtk, unsigned uSupp, int iVar, unsigned *pTruthCo, unsigned *pTruthDec)
#define ABC_NAMESPACE_IMPL_END
void Kit_TruthCofactor1New(unsigned *pOut, unsigned *pIn, int nVars, int iVar)
void Kit_DsdObjFree(Kit_DsdNtk_t *p, Kit_DsdObj_t *pObj)
void Kit_DsdPrint2(FILE *pFile, Kit_DsdNtk_t *pNtk)
unsigned short nNodesAlloc
void Kit_DsdManFree(Kit_DsdMan_t *p)
unsigned * Kit_DsdTruthComputeTwo(Kit_DsdMan_t *p, Kit_DsdNtk_t *pNtk, unsigned uSupp, int iVar, unsigned *pTruthDec)
void Kit_DsdTruth(Kit_DsdNtk_t *pNtk, unsigned *pTruthRes)
int Kit_DsdCofactoringGetVars(Kit_DsdNtk_t **ppNtk, int nSize, int *pVars)
ABC_NAMESPACE_IMPL_START Kit_DsdMan_t * Kit_DsdManAlloc(int nVars, int nNodes)
DECLARATIONS ///.
unsigned * Kit_DsdTruthComputeNodeTwo_rec(Kit_DsdMan_t *p, Kit_DsdNtk_t *pNtk, int Id, unsigned uSupp, int iVar, unsigned *pTruthDec)
static void Kit_TruthNot(unsigned *pOut, unsigned *pIn, int nVars)
int Kit_DsdCountAigNodes_rec(Kit_DsdNtk_t *pNtk, int Id)
int Kit_DsdFindLargeBox(Kit_DsdNtk_t *pNtk, int Size)
static void Kit_TruthIthVar(unsigned *pTruth, int nVars, int iVar)
int Kit_DsdNonDsdSizeMax(Kit_DsdNtk_t *pNtk)
void Kit_DsdRotate(Kit_DsdNtk_t *p, int pFreqs[])
#define ABC_NAMESPACE_IMPL_START
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
int Kit_DsdCountAigNodes(Kit_DsdNtk_t *pNtk)
void Kit_TruthShrink(unsigned *pOut, unsigned *pIn, int nVars, int nVarsAll, unsigned Phase, int fReturnIn)
static int Abc_LitNot(int Lit)
void Kit_DsdCompSort(int pPrios[], unsigned uSupps[], unsigned short *piLits, int nVars, unsigned piLitsRes[])
unsigned Kit_DsdGetSupports_rec(Kit_DsdNtk_t *p, int iLit)
void Kit_DsdTest(unsigned *pTruth, int nVars)
void Kit_DsdDecompose_rec(Kit_DsdNtk_t *pNtk, Kit_DsdObj_t *pObj, unsigned uSupp, unsigned short *pPar, int nDecMux)
static int Kit_WordFindFirstBit(unsigned uWord)
static int Kit_TruthIsOpposite(unsigned *pIn0, unsigned *pIn1, int nVars)
void Kit_DsdExpandCollectAnd_rec(Kit_DsdNtk_t *p, unsigned iLit, unsigned *piLitsNew, int *nLitsNew)
int Kit_DsdCountLuts(Kit_DsdNtk_t *pNtk, int nLutSize)
int Kit_DsdRootNodeHasCommonVars(Kit_DsdObj_t *pObj0, Kit_DsdObj_t *pObj1)
unsigned Kit_TruthSupport(unsigned *pTruth, int nVars)
static void Kit_TruthCopy(unsigned *pOut, unsigned *pIn, int nVars)
static int Kit_DsdLitIsLeaf(Kit_DsdNtk_t *pNtk, int Lit)
static int Abc_Lit2Var(int Lit)
void Kit_DsdNtkFree(Kit_DsdNtk_t *pNtk)
int Kit_TruthVarInSupport(unsigned *pTruth, int nVars, int iVar)
Kit_DsdNtk_t * Kit_DsdDecomposeMux(unsigned *pTruth, int nVars, int nDecMux)
Kit_DsdNtk_t * Kit_DsdDecomposeExpand(unsigned *pTruth, int nVars)
static int Kit_DsdNtkObjNum(Kit_DsdNtk_t *pNtk)
static int Abc_LitRegular(int Lit)
int Kit_DsdCountAigNodes2(Kit_DsdNtk_t *pNtk)
static int Kit_WordCountOnes(unsigned uWord)
static unsigned Kit_DsdLitSupport(Kit_DsdNtk_t *pNtk, int Lit)
int Kit_DsdCountLuts_rec(Kit_DsdNtk_t *pNtk, int nLutSize, int Id, int *pCounter)
static void Vec_IntFree(Vec_Int_t *p)
Kit_DsdObj_t * Kit_DsdNonDsdPrimeMax(Kit_DsdNtk_t *pNtk)
void Kit_DsdPrintCofactors(unsigned *pTruth, int nVars, int nCofLevel, int fVerbose)
Kit_DsdNtk_t * Kit_DsdShrink(Kit_DsdNtk_t *p, int pPrios[])
void Kit_DsdPrintExpanded(Kit_DsdNtk_t *pNtk)
static void Kit_TruthClear(unsigned *pOut, int nVars)
int Kit_TruthSupportSize(unsigned *pTruth, int nVars)
static unsigned Kit_BitMask(int nBits)
static Vec_Ptr_t * Vec_PtrAllocSimInfo(int nEntries, int nWords)
static void Vec_PtrFree(Vec_Ptr_t *p)