21 #ifndef ABC__misc__util__utilTruth_h
22 #define ABC__misc__util__utilTruth_h
118 0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,
119 1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,
120 1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,
121 2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,
122 1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,
123 2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,
124 2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,
125 3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,4,5,5,6,5,6,6,7,5,6,6,7,6,7,7,8
154 static inline int Abc_TtGetHex(
word *
p,
int k ) {
return (
int)(p[k>>4] >> ((k<<2) & 63)) & 15; }
169 static inline int Abc_TtWordNum(
int nVars ) {
return nVars <= 6 ? 1 : 1 << (nVars-6); }
170 static inline int Abc_TtByteNum(
int nVars ) {
return nVars <= 3 ? 1 : 1 << (nVars-3); }
200 for ( w = 0; w <
nWords; w++ )
206 for ( w = 0; w <
nWords; w++ )
212 for ( w = 0; w <
nWords; w++ )
218 for ( w = 0; w <
nWords; w++ )
225 for ( w = 0; w <
nWords; w++ )
228 for ( w = 0; w <
nWords; w++ )
235 for ( w = 0; w <
nWords; w++ )
236 pOut[w] = ~(pIn1[w] & pIn2[w]);
238 for ( w = 0; w <
nWords; w++ )
239 pOut[w] = pIn1[w] & pIn2[w];
244 for ( w = 0; w <
nWords; w++ )
245 pOut[w] = pIn1[w] & ~pIn2[w];
250 for ( w = 0; w <
nWords; w++ )
251 pOut[w] = pIn1[w] | pIn2[w];
257 for ( w = 0; w <
nWords; w++ )
258 pOut[w] = pIn1[w] ^ ~pIn2[w];
260 for ( w = 0; w <
nWords; w++ )
261 pOut[w] = pIn1[w] ^ pIn2[w];
266 for ( w = 0; w <
nWords; w++ )
267 pOut[w] = (pCtrl[w] & pIn1[w]) | (~pCtrl[w] & pIn0[w]);
272 for ( w = 0; w <
nWords; w++ )
273 if ( pIn1[w] != pIn2[w] )
280 for ( w = 0; w <
nWords; w++ )
281 if ( pIn1[w] != pIn2[w] )
282 return (pIn1[w] < pIn2[w]) ? -1 : 1;
288 for ( w = nWords - 1; w >= 0; w-- )
289 if ( pIn1[w] != pIn2[w] )
290 return (pIn1[w] < pIn2[w]) ? -1 : 1;
296 for ( w = 0; w <
nWords; w++ )
304 for ( w = 0; w <
nWords; w++ )
312 for ( w = 0; w <
nWords; w++ )
318 for ( w = 0; w <
nWords; w++ )
336 for ( i = 0; i < nVars; i++ )
338 for ( k = 0; k <
nWords; k++ )
341 for ( k = 0; k <
nWords; k++ )
342 pTtElems[i][k] = (k & (1 << (i-6))) ? ~(
word)0 : 0;
347 for ( i = 0; i < nVars; i++ )
351 for ( k = 0; k <
nWords; k++ )
354 for ( k = 0; k <
nWords; k++ )
355 pTruth[k] = (k & (1 << (i-6))) ? ~(
word)0 : 0;
372 assert( iVar >= 0 && iVar < 6 );
377 assert( iVar >= 0 && iVar < 6 );
385 else if ( iVar <= 5 )
387 int w, shift = (1 << iVar);
388 for ( w = 0; w <
nWords; w++ )
395 for ( ; pIn < pLimit; pIn += 2*iStep, pOut += 2*iStep )
396 for ( i = 0; i < iStep; i++ )
399 pOut[i + iStep] = pIn[i];
407 else if ( iVar <= 5 )
409 int w, shift = (1 << iVar);
410 for ( w = 0; w <
nWords; w++ )
417 for ( ; pIn < pLimit; pIn += 2*iStep, pOut += 2*iStep )
418 for ( i = 0; i < iStep; i++ )
420 pOut[i] = pIn[i + iStep];
421 pOut[i + iStep] = pIn[i + iStep];
429 else if ( iVar <= 5 )
431 int w, shift = (1 << iVar);
432 for ( w = 0; w <
nWords; w++ )
439 for ( ; pTruth < pLimit; pTruth += 2*iStep )
440 for ( i = 0; i < iStep; i++ )
441 pTruth[i + iStep] = pTruth[i];
447 pTruth[0] = (pTruth[0] &
s_Truths6[iVar]) | ((pTruth[0] &
s_Truths6[iVar]) >> (1 << iVar));
448 else if ( iVar <= 5 )
450 int w, shift = (1 << iVar);
451 for ( w = 0; w <
nWords; w++ )
458 for ( ; pTruth < pLimit; pTruth += 2*iStep )
459 for ( i = 0; i < iStep; i++ )
460 pTruth[i] = pTruth[i + iStep];
477 assert( Num1 < Num2 && Num2 < 4 );
482 int shift1 = (Num1 >> 1) * (1 << jVar) + (Num1 & 1) * (1 << iVar);
483 int shift2 = (Num2 >> 1) * (1 << jVar) + (Num2 & 1) * (1 << iVar);
484 return ((pTruth[0] >> shift1) & Mask) == ((pTruth[0] >> shift2) & Mask);
489 int shift1 = (Num1 >> 1) * (1 << jVar) + (Num1 & 1) * (1 << iVar);
490 int shift2 = (Num2 >> 1) * (1 << jVar) + (Num2 & 1) * (1 << iVar);
492 for ( w = 0; w <
nWords; w++ )
493 if ( ((pTruth[w] >> shift1) & Mask) != ((pTruth[w] >> shift2) & Mask) )
497 if ( iVar <= 5 && jVar > 5 )
501 int shift1 = (Num1 & 1) * (1 << iVar);
502 int shift2 = (Num2 & 1) * (1 << iVar);
503 int Offset1 = (Num1 >> 1) * jStep;
504 int Offset2 = (Num2 >> 1) * jStep;
505 for ( ; pTruth < pLimit; pTruth += 2*jStep )
506 for ( j = 0; j < jStep; j++ )
507 if ( ((pTruth[j + Offset1] >> shift1) &
s_Truths6Neg[iVar]) != ((pTruth[j + Offset2] >> shift2) &
s_Truths6Neg[iVar]) )
515 int Offset1 = (Num1 >> 1) * jStep + (Num1 & 1) * iStep;
516 int Offset2 = (Num2 >> 1) * jStep + (Num2 & 1) * iStep;
517 for ( ; pTruth < pLimit; pTruth += 2*jStep )
518 for ( i = 0; i < jStep; i += 2*iStep )
519 for ( j = 0; j < iStep; j++ )
520 if ( pTruth[Offset1 + i + j] != pTruth[Offset2 + i + j] )
566 for ( i = 0; i <
nWords; i++ )
573 int i, Step = (1 << (iVar - 6));
575 for ( ; t < tLimit; t += 2*Step )
576 for ( i = 0; i < Step; i++ )
587 for ( i = 0; i <
nWords; i++ )
594 int i, Step = (1 << (iVar - 6));
596 for ( ; t < tLimit; t += 2*Step )
597 for ( i = 0; i < Step; i++ )
608 for ( i = 0; i <
nWords; i++ )
615 int i, Step = (1 << (iVar - 6));
617 for ( ; t < tLimit; t += 2*Step )
618 for ( i = 0; i < Step; i++ )
629 for ( i = 0; i <
nWords; i++ )
636 int i, Step = (1 << (iVar - 6));
638 for ( ; t < tLimit; t += 2*Step )
639 for ( i = 0; i < Step; i++ )
649 int i, Shift = (1 << iVar);
650 for ( i = 0; i <
nWords; i++ )
657 int i, Step = (1 << (iVar - 6));
659 for ( ; t < tLimit; t += 2*Step )
660 for ( i = 0; i < Step; i++ )
661 if ( t[i] != ~t[i+Step] )
681 if ( nVarS == nVarB )
686 if ( step == nWords )
689 for ( w = 0; w <
nWords; w += step )
690 for ( i = 0; i < step; i++ )
691 pInOut[w + i] = pInOut[i];
696 if ( nVarS == nVarB )
701 if ( step == nWords )
704 for ( w = 0; w <
nWords; w += step )
705 for ( i = 0; i < step; i++ )
706 pInOut[w + i] = pInOut[i];
712 nVars++, t = (t & 0x1) | ((t & 0x1) << 1);
714 nVars++, t = (t & 0x3) | ((t & 0x3) << 2);
716 nVars++, t = (t & 0xF) | ((t & 0xF) << 4);
718 nVars++, t = (t & 0xFF) | ((t & 0xFF) << 8);
720 nVars++, t = (t & 0xFFFF) | ((t & 0xFFFF) << 16);
722 nVars++, t = (t & 0xFFFFFFFF) | ((t & 0xFFFFFFFF) << 32);
740 return (HexChar >=
'0' && HexChar <=
'9') || (HexChar >=
'A' && HexChar <= 'F') || (HexChar >=
'a' && HexChar <=
'f');
744 assert( Digit >= 0 && Digit < 16 );
747 return 'A' + Digit-10;
751 assert( Digit >= 0 && Digit < 16 );
754 return 'a' + Digit-10;
758 if ( HexChar >=
'0' && HexChar <=
'9' )
759 return HexChar -
'0';
760 if ( HexChar >=
'A' && HexChar <=
'F' )
761 return HexChar -
'A' + 10;
762 if ( HexChar >=
'a' && HexChar <=
'f' )
763 return HexChar -
'a' + 10;
784 for ( pThis = pTruth; pThis < pLimit; pThis++ )
785 for ( k = 0; k < 16; k++ )
792 int k, StartK = nVars >= 6 ? 16 : (1 << (nVars - 2));
794 for ( pThis = pTruth +
Abc_TtWordNum(nVars) - 1; pThis >= pTruth; pThis-- )
795 for ( k = StartK - 1; k >= 0; k-- )
804 for ( pThis = pTruth +
Abc_TtWordNum(nVars) - 1; pThis >= pTruth; pThis-- )
805 for ( k = 0; k < 16; k++ )
812 char * pStrInit = pStr;
813 int k, StartK = nVars >= 6 ? 16 : (1 << (nVars - 2));
815 for ( pThis = pTruth +
Abc_TtWordNum(nVars) - 1; pThis >= pTruth; pThis-- )
816 for ( k = StartK - 1; k >= 0; k-- )
818 return pStr - pStrInit;
823 for ( k = nDigits - 1; k >= 0; k-- )
840 int k, nVars, Digit, nDigits;
842 if ( pString[0] ==
'0' && pString[1] ==
'x' )
850 if ( pString[0] ==
'0' || pString[0] ==
'F' )
852 pTruth[0] = (pString[0] ==
'0') ? 0 : ~(
word)0;
855 if ( pString[0] ==
'5' || pString[0] ==
'A' )
868 for ( k = 0; k < nDigits; k++ )
871 assert( Digit >= 0 && Digit < 16 );
881 int k, Digit, nDigits = 0;
886 for ( k = 0; k < nDigits; k++ )
889 assert( Digit >= 0 && Digit < 16 );
910 int k, Limit =
Abc_MinInt( 64, (1 << nVars) );
912 for ( pThis = pTruth; pThis < pLimit; pThis++ )
913 for ( k = 0; k < Limit; k++ )
933 for ( i = 0; i < 32; i++ )
934 if ( Supp & (1 << i) )
942 return (Supp & (Supp-1)) == 0;
947 return (Supp & (Supp+1)) == 0;
960 int i, Shift = (1 << iVar);
962 for ( i = 0; i <
nWords; i++ )
969 int i, Step = (1 << (iVar - 6));
971 for ( ; t < tLimit; t += 2*Step )
972 for ( i = 0; i < Step; i++ )
973 if ( t[i] != t[Step+i] )
981 for ( v = 0; v < nVars; v++ )
989 for ( v = 0; v < nVars; v++ )
998 for ( v = 0; v < nVars; v++ )
1000 Supp |= (1 << v), (*pSuppSize)++;
1008 for ( v = 0; v < nVars; v++ )
1010 Supp |= (1 << v), (*pSuppSize)++;
1028 if ( nVars <= nSuppLim + 1 )
1030 for ( v = 0; v < nVars; v++ )
1032 int nDep0 = 0, nDep1 = 0;
1033 for ( d = 0; d < nVars; d++ )
1047 if ( nDep0 > nSuppLim || nDep1 > nSuppLim )
1058 word Cof0[128], Cof1[128];
1060 assert( nVars <= nVarsMax );
1061 if ( nVars <= nSuppLim + 1 )
1063 for ( v = 0; v < nVars; v++ )
1065 int nDep0 = 0, nDep1 = 0;
1068 for ( d = 0; d < nVars; d++ )
1074 if ( nDep0 > nSuppLim || nDep1 > nSuppLim )
1099 return (t & (t-1)) == 0;
1128 return Truth = ((Truth << (1 << iVar)) & s_Truths6[iVar]) | ((Truth & s_Truths6[iVar]) >> (1 << iVar));
1133 pTruth[0] = ((pTruth[0] << (1 << iVar)) &
s_Truths6[iVar]) | ((pTruth[0] &
s_Truths6[iVar]) >> (1 << iVar));
1134 else if ( iVar <= 5 )
1136 int w, shift = (1 << iVar);
1137 for ( w = 0; w <
nWords; w++ )
1138 pTruth[w] = ((pTruth[w] << shift) &
s_Truths6[iVar]) | ((pTruth[w] &
s_Truths6[iVar]) >> shift);
1144 for ( ; pTruth < pLimit; pTruth += 2*iStep )
1145 for ( i = 0; i < iStep; i++ )
1164 if ( t == 0 )
return 0;
1165 if ( ~t == 0 )
return ~(
word)0;
1166 for ( Var = nVars-1; Var >= 0; Var-- )
1188 return (Truth &
s_PMasks[iVar][0]) | ((Truth &
s_PMasks[iVar][1]) << (1 << iVar)) | ((Truth &
s_PMasks[iVar][2]) >> (1 << iVar));
1201 int i, Shift = (1 << iVar);
1202 for ( i = 0; i <
nWords; i++ )
1203 pTruth[i] = (pTruth[i] & s_PMasks[iVar][0]) | ((pTruth[i] & s_PMasks[iVar][1]) << Shift) | ((pTruth[i] & s_PMasks[iVar][2]) >> Shift);
1205 else if ( iVar == 5 )
1207 unsigned * pTruthU = (
unsigned *)pTruth;
1208 unsigned * pLimitU = (
unsigned *)(pTruth + nWords);
1209 for ( ; pTruthU < pLimitU; pTruthU += 4 )
1210 ABC_SWAP(
unsigned, pTruthU[1], pTruthU[2] );
1216 for ( ; pTruth < pLimit; pTruth += 4*iStep )
1217 for ( i = 0; i < iStep; i++ )
1218 ABC_SWAP(
word, pTruth[i + iStep], pTruth[i + 2*iStep] );
1224 int shift = (1 << jVar) - (1 << iVar);
1226 return (t & s_PMasks[0]) | ((t & s_PMasks[1]) << shift) | ((t & s_PMasks[2]) >> shift);
1234 assert( iVar < jVar && jVar < nVars );
1244 int w, shift = (1 << jVar) - (1 << iVar);
1245 for ( w = 0; w <
nWords; w++ )
1246 pTruth[w] = (pTruth[w] & s_PMasks[0]) | ((pTruth[w] & s_PMasks[1]) << shift) | ((pTruth[w] & s_PMasks[2]) >> shift);
1249 if ( iVar <= 5 && jVar > 5 )
1251 word low2High, high2Low;
1254 int shift = 1 << iVar;
1255 for ( ; pTruth < pLimit; pTruth += 2*jStep )
1256 for ( j = 0; j < jStep; j++ )
1258 low2High = (pTruth[j] &
s_Truths6[iVar]) >> shift;
1259 high2Low = (pTruth[j+jStep] << shift) &
s_Truths6[iVar];
1260 pTruth[j] = (pTruth[j] & ~
s_Truths6[iVar]) | high2Low;
1261 pTruth[j+jStep] = (pTruth[j+jStep] &
s_Truths6[iVar]) | low2High;
1269 for ( ; pTruth < pLimit; pTruth += 2*jStep )
1270 for ( i = 0; i < jStep; i += 2*iStep )
1271 for ( j = 0; j < iStep; j++ )
1272 ABC_SWAP(
word, pTruth[iStep + i + j], pTruth[jStep + i + j] );
1279 int iVar = V2P[v], jVar =
p;
1283 V2P[P2V[iVar]] = jVar;
1284 V2P[P2V[jVar]] = iVar;
1285 P2V[iVar] ^= P2V[jVar];
1286 P2V[jVar] ^= P2V[iVar];
1287 P2V[iVar] ^= P2V[jVar];
1304 assert( nVarsAll <= 16 );
1305 for ( i = 0; i < nVarsAll; i++ )
1306 if ( Phase & (1 << i) )
1308 for ( k = i-1; k >=
Var; k-- )
1316 int v, iVar = 0, uSupp = 0;
1317 assert( nVarsAll <= 16 );
1318 for ( v = 0; v < nVarsAll; v++ )
1323 pSupp[iVar] = pSupp[v];
1348 for ( i = nCutSize - 1, k = nCutSize0 - 1; i >= 0 && k >= 0; i-- )
1350 if ( pCut[i] > pCut0[k] )
1352 assert( pCut[i] == pCut0[k] );
1360 static inline void Abc_TtExpand(
word * pTruth0,
int nVars,
int * pCut0,
int nCutSize0,
int * pCut,
int nCutSize )
1363 for ( i = nCutSize - 1, k = nCutSize0 - 1; i >= 0 && k >= 0; i-- )
1365 if ( pCut[i] > pCut0[k] )
1367 assert( pCut[i] == pCut0[k] );
1378 for ( i = k = 0; i < nVars; i++ )
1384 if ( pVars ) pVars[k] = pVars[i];
1398 assert( nVars <= nVarsAll );
1399 for ( i = k = 0; i < nVars; i++ )
1405 if ( pVars ) pVars[k] = pVars[i];
1431 if ( (uCanonPhase >> nVars) & 1 )
1433 for ( i = 0; i < nVars; i++ )
1434 if ( (uCanonPhase >> i) & 1 )
1437 for ( i = 0; i < nVars; i++ )
1439 for ( k = i; k < nVars; k++ )
1440 if ( pCanonPerm[k] == i )
1446 ABC_SWAP(
int, pCanonPerm[i], pCanonPerm[k] );
1468 return (t &
ABC_CONST(0x00000000FFFFFFFF)) + (t>>32);
1472 x = x - ((x >> 1) &
ABC_CONST(0x5555555555555555));
1473 x = (x &
ABC_CONST(0x3333333333333333)) + ((x >> 2) &
ABC_CONST(0x3333333333333333));
1474 x = (x + (x >> 4)) &
ABC_CONST(0x0F0F0F0F0F0F0F0F);
1478 return (
int)(x & 0xFF);
1495 if ( t == 0 )
return -1;
1496 if ( (t &
ABC_CONST(0x00000000FFFFFFFF)) == 0 ) { n += 32; t >>= 32; }
1497 if ( (t &
ABC_CONST(0x000000000000FFFF)) == 0 ) { n += 16; t >>= 16; }
1498 if ( (t &
ABC_CONST(0x00000000000000FF)) == 0 ) { n += 8; t >>= 8; }
1499 if ( (t &
ABC_CONST(0x000000000000000F)) == 0 ) { n += 4; t >>= 4; }
1500 if ( (t &
ABC_CONST(0x0000000000000003)) == 0 ) { n += 2; t >>= 2; }
1501 if ( (t &
ABC_CONST(0x0000000000000001)) == 0 ) { n++; }
1507 if ( t == 0 )
return -1;
1508 if ( (t &
ABC_CONST(0xFFFFFFFF00000000)) == 0 ) { n += 32; t <<= 32; }
1509 if ( (t &
ABC_CONST(0xFFFF000000000000)) == 0 ) { n += 16; t <<= 16; }
1510 if ( (t &
ABC_CONST(0xFF00000000000000)) == 0 ) { n += 8; t <<= 8; }
1511 if ( (t &
ABC_CONST(0xF000000000000000)) == 0 ) { n += 4; t <<= 4; }
1512 if ( (t &
ABC_CONST(0xC000000000000000)) == 0 ) { n += 2; t <<= 2; }
1513 if ( (t &
ABC_CONST(0x8000000000000000)) == 0 ) { n++; }
1519 for ( w = 0; w <
nWords; w++ )
1527 for ( w = 0; w <
nWords; w++ )
1535 for ( w = nWords - 1; w >= 0; w-- )
1543 for ( w = nWords - 1; w >= 0; w-- )
1564 for ( k = 0; k < nVars/2 ; k++ )
1569 static unsigned char pMirror[256] = {
1570 0, 128, 64, 192, 32, 160, 96, 224, 16, 144, 80, 208, 48, 176, 112, 240,
1571 8, 136, 72, 200, 40, 168, 104, 232, 24, 152, 88, 216, 56, 184, 120, 248,
1572 4, 132, 68, 196, 36, 164, 100, 228, 20, 148, 84, 212, 52, 180, 116, 244,
1573 12, 140, 76, 204, 44, 172, 108, 236, 28, 156, 92, 220, 60, 188, 124, 252,
1574 2, 130, 66, 194, 34, 162, 98, 226, 18, 146, 82, 210, 50, 178, 114, 242,
1575 10, 138, 74, 202, 42, 170, 106, 234, 26, 154, 90, 218, 58, 186, 122, 250,
1576 6, 134, 70, 198, 38, 166, 102, 230, 22, 150, 86, 214, 54, 182, 118, 246,
1577 14, 142, 78, 206, 46, 174, 110, 238, 30, 158, 94, 222, 62, 190, 126, 254,
1578 1, 129, 65, 193, 33, 161, 97, 225, 17, 145, 81, 209, 49, 177, 113, 241,
1579 9, 137, 73, 201, 41, 169, 105, 233, 25, 153, 89, 217, 57, 185, 121, 249,
1580 5, 133, 69, 197, 37, 165, 101, 229, 21, 149, 85, 213, 53, 181, 117, 245,
1581 13, 141, 77, 205, 45, 173, 109, 237, 29, 157, 93, 221, 61, 189, 125, 253,
1582 3, 131, 67, 195, 35, 163, 99, 227, 19, 147, 83, 211, 51, 179, 115, 243,
1583 11, 139, 75, 203, 43, 171, 107, 235, 27, 155, 91, 219, 59, 187, 123, 251,
1584 7, 135, 71, 199, 39, 167, 103, 231, 23, 151, 87, 215, 55, 183, 119, 247,
1585 15, 143, 79, 207, 47, 175, 111, 239, 31, 159, 95, 223, 63, 191, 127, 255
1587 unsigned char Temp, * pTruthC = (
unsigned char *)pTruth;
1588 int i, nBytes = (nVars > 6) ? (1 << (nVars - 3)) : 8;
1589 for ( i = 0; i < nBytes/2; i++ )
1591 Temp = pMirror[pTruthC[i]];
1592 pTruthC[i] = pMirror[pTruthC[nBytes-1-i]];
1593 pTruthC[nBytes-1-i] = Temp;
1624 int i, Shift = (1 << iVar);
1626 for ( i = 0; i <
nWords; i++ )
1633 int i, Step = (1 << (iVar - 6));
1635 for ( ; t < tLimit; t += 2*Step )
1636 for ( i = 0; i < Step; i++ )
1637 if ( t[i] != (t[i] & t[Step+i]) )
1649 int i, Shift = (1 << iVar);
1651 for ( i = 0; i <
nWords; i++ )
1658 int i, Step = (1 << (iVar - 6));
1660 for ( ; t < tLimit; t += 2*Step )
1661 for ( i = 0; i < Step; i++ )
1662 if ( (t[i] & t[Step+i]) != t[Step+i] )
1670 for ( i = 0; i < nVars; i++ )
1678 for ( i = 0; i < nVars; i++ )
1686 for ( i = 0; i < nVars; i++ )
1706 word uOn0, uOn1, uOnDc0, uOnDc1, uRes0, uRes1, uRes2;
1709 assert( (uOn & ~uOnDc) == 0 );
1712 if ( uOnDc == ~(
word)0 )
1719 for ( Var = nVars-1; Var >= 0; Var-- )
1729 uRes0 =
Abc_Tt6Isop( uOn0 & ~uOnDc1, uOnDc0, Var, pnCubes );
1730 uRes1 =
Abc_Tt6Isop( uOn1 & ~uOnDc0, uOnDc1, Var, pnCubes );
1731 uRes2 =
Abc_Tt6Isop( (uOn0 & ~uRes0) | (uOn1 & ~uRes1), uOnDc0 & uOnDc1, Var, pnCubes );
1734 assert( (uOn & ~uRes2) == 0 );
1735 assert( (uRes2 & ~uOnDc) == 0 );
1741 if ( nVars <= 6 || (uOn[0] == uOn[1] && uOnDc[0] == uOnDc[1]) )
1745 word uRes0, uRes1, uRes2;
1748 uRes0 =
Abc_Tt6Isop( uOn[0] & ~uOnDc[1], uOnDc[0], 6, &nCubes );
1749 uRes1 =
Abc_Tt6Isop( uOn[1] & ~uOnDc[0], uOnDc[1], 6, &nCubes );
1750 uRes2 =
Abc_Tt6Isop( (uOn[0] & ~uRes0) | (uOn[1] & ~uRes1), uOnDc[0] & uOnDc[1], 6, &nCubes );
1752 uRes[0] = uRes2 | uRes0;
1753 uRes[1] = uRes2 | uRes1;
1754 assert( (uOn[0] & ~uRes[0]) == 0 && (uOn[1] & ~uRes[1]) == 0 );
1755 assert( (uRes[0] & ~uOnDc[0])==0 && (uRes[1] & ~uOnDc[1])==0 );
1763 uRes[0] = uRes[1] = uRes[2] = uRes[3] =
Abc_Tt6Isop( uOn[0], uOnDc[0], nVars, &nCubes );
1764 else if ( nVars == 7 || (uOn[0] == uOn[2] && uOn[1] == uOn[3] && uOnDc[0] == uOnDc[2] && uOnDc[1] == uOnDc[3]) )
1772 word uOn0[2], uOn1[2], uOn2[2], uOnDc2[2], uRes0[2], uRes1[2], uRes2[2];
1775 uOn0[0] = uOn[0] & ~uOnDc[2];
1776 uOn0[1] = uOn[1] & ~uOnDc[3];
1777 uOn1[0] = uOn[2] & ~uOnDc[0];
1778 uOn1[1] = uOn[3] & ~uOnDc[1];
1779 uOnDc2[0] = uOnDc[0] & uOnDc[2];
1780 uOnDc2[1] = uOnDc[1] & uOnDc[3];
1784 uOn2[0] = (uOn[0] & ~uRes0[0]) | (uOn[2] & ~uRes1[0]);
1785 uOn2[1] = (uOn[1] & ~uRes0[1]) | (uOn[3] & ~uRes1[1]);
1788 uRes[0] = uRes2[0] | uRes0[0];
1789 uRes[1] = uRes2[1] | uRes0[1];
1790 uRes[2] = uRes2[0] | uRes1[0];
1791 uRes[3] = uRes2[1] | uRes1[1];
1792 assert( (uOn[0] & ~uRes[0]) == 0 && (uOn[1] & ~uRes[1]) == 0 && (uOn[2] & ~uRes[2]) == 0 && (uOn[3] & ~uRes[3]) == 0 );
1793 assert( (uRes[0] & ~uOnDc[0])==0 && (uRes[1] & ~uOnDc[1])==0 && (uRes[2] & ~uOnDc[2])==0 && (uRes[3] & ~uOnDc[3])==0 );
1819 word uRes[4], tc[4] = {~t[0], ~t[1], ~t[2], ~t[3]};
1840 word uOn0, uOn1, uOnDc0, uOnDc1, uRes0, uRes1, uRes2;
1841 int c,
Var, nBeg0, nEnd0, nEnd1;
1843 assert( (uOn & ~uOnDc) == 0 );
1846 if ( uOnDc == ~(
word)0 )
1848 pCover[(*pnCubes)++] = 0;
1853 for ( Var = nVars-1; Var >= 0; Var-- )
1868 uRes2 =
Abc_Tt6IsopCover( (uOn0 & ~uRes0) | (uOn1 & ~uRes1), uOnDc0 & uOnDc1, Var, pCover, pnCubes );
1871 for ( c = nBeg0; c < nEnd0; c++ )
1872 pCover[c] |= (1 << (2*Var+0));
1873 for ( c = nEnd0; c < nEnd1; c++ )
1874 pCover[c] |= (1 << (2*Var+1));
1875 assert( (uOn & ~uRes2) == 0 );
1876 assert( (uRes2 & ~uOnDc) == 0 );
1881 if ( nVars <= 6 || (uOn[0] == uOn[1] && uOnDc[0] == uOnDc[1]) )
1885 word uRes0, uRes1, uRes2;
1886 int c, nBeg0, nEnd0, nEnd1;
1890 uRes0 =
Abc_Tt6IsopCover( uOn[0] & ~uOnDc[1], uOnDc[0], 6, pCover, pnCubes );
1892 uRes1 =
Abc_Tt6IsopCover( uOn[1] & ~uOnDc[0], uOnDc[1], 6, pCover, pnCubes );
1894 uRes2 =
Abc_Tt6IsopCover( (uOn[0] & ~uRes0) | (uOn[1] & ~uRes1), uOnDc[0] & uOnDc[1], 6, pCover, pnCubes );
1896 uRes[0] = uRes2 | uRes0;
1897 uRes[1] = uRes2 | uRes1;
1898 for ( c = nBeg0; c < nEnd0; c++ )
1899 pCover[c] |= (1 << (2*6+0));
1900 for ( c = nEnd0; c < nEnd1; c++ )
1901 pCover[c] |= (1 << (2*6+1));
1902 assert( (uOn[0] & ~uRes[0]) == 0 && (uOn[1] & ~uRes[1]) == 0 );
1903 assert( (uRes[0] & ~uOnDc[0])==0 && (uRes[1] & ~uOnDc[1])==0 );
1909 uRes[0] = uRes[1] = uRes[2] = uRes[3] =
Abc_Tt6IsopCover( uOn[0], uOnDc[0], nVars, pCover, pnCubes );
1910 else if ( nVars == 7 || (uOn[0] == uOn[2] && uOn[1] == uOn[3] && uOnDc[0] == uOnDc[2] && uOnDc[1] == uOnDc[3]) )
1918 word uOn0[2], uOn1[2], uOn2[2], uOnDc2[2], uRes0[2], uRes1[2], uRes2[2];
1919 int c, nBeg0, nEnd0, nEnd1;
1922 uOn0[0] = uOn[0] & ~uOnDc[2];
1923 uOn0[1] = uOn[1] & ~uOnDc[3];
1924 uOn1[0] = uOn[2] & ~uOnDc[0];
1925 uOn1[1] = uOn[3] & ~uOnDc[1];
1926 uOnDc2[0] = uOnDc[0] & uOnDc[2];
1927 uOnDc2[1] = uOnDc[1] & uOnDc[3];
1934 uOn2[0] = (uOn[0] & ~uRes0[0]) | (uOn[2] & ~uRes1[0]);
1935 uOn2[1] = (uOn[1] & ~uRes0[1]) | (uOn[3] & ~uRes1[1]);
1938 uRes[0] = uRes2[0] | uRes0[0];
1939 uRes[1] = uRes2[1] | uRes0[1];
1940 uRes[2] = uRes2[0] | uRes1[0];
1941 uRes[3] = uRes2[1] | uRes1[1];
1942 for ( c = nBeg0; c < nEnd0; c++ )
1943 pCover[c] |= (1 << (2*7+0));
1944 for ( c = nEnd0; c < nEnd1; c++ )
1945 pCover[c] |= (1 << (2*7+1));
1946 assert( (uOn[0] & ~uRes[0]) == 0 && (uOn[1] & ~uRes[1]) == 0 && (uOn[2] & ~uRes[2]) == 0 && (uOn[3] & ~uRes[3]) == 0 );
1947 assert( (uRes[0] & ~uOnDc[0])==0 && (uRes[1] & ~uOnDc[1])==0 && (uRes[2] & ~uOnDc[2])==0 && (uRes[3] & ~uOnDc[3])==0 );
1966 for ( c = 0; c < nCubes; c++ )
1967 pCover[c] |= (1 << (2*nVars+0));
1969 for ( ; c < nCubes; c++ )
1970 pCover[c] |= (1 << (2*nVars+1));
1976 word uRes[4], tc[4] = {~t[0], ~t[1], ~t[2], ~t[3]};
1979 for ( c = 0; c < nCubes; c++ )
1980 pCover[c] |= (1 << (2*nVars+0));
1982 for ( ; c < nCubes; c++ )
1983 pCover[c] |= (1 << (2*nVars+1));
2003 int Var, r0, r1, r2, Max, i;
2007 if ( t == ~(
word)0 )
2009 if ( pCover ) *pCover = 0;
2014 for ( Var = nVars-1; Var >= 0; Var-- )
2022 r0 =
Abc_Tt6Esop( c0, Var, pCover ? pCover : NULL );
2023 r1 =
Abc_Tt6Esop( c1, Var, pCover ? pCover + r0 : NULL );
2024 r2 =
Abc_Tt6Esop( c0 ^ c1, Var, pCover ? pCover + r0 + r1 : NULL );
2031 for ( i = 0; i < r1; i++ )
2032 pCover[i] = pCover[r0+i];
2033 for ( i = 0; i < r2; i++ )
2034 pCover[r1+i] = pCover[r0+r1+i] | (1 << (2*Var+0));
2036 else if ( Max == r1 )
2038 for ( i = 0; i < r2; i++ )
2039 pCover[r0+i] = pCover[r0+r1+i] | (1 << (2*Var+1));
2043 for ( i = 0; i < r0; i++ )
2044 pCover[i] |= (1 << (2*Var+0));
2045 for ( i = 0; i < r1; i++ )
2046 pCover[r0+i] |= (1 << (2*Var+1));
2049 return r0 + r1 + r2 - Max;
2053 word p, t = 0;
int c, v;
2054 for ( c = 0; c < nCubes; c++ )
2057 for ( v = 0; v < nVars; v++ )
2058 if ( ((pCover[c] >> (v << 1)) & 3) == 1 )
2060 else if ( ((pCover[c] >> (v << 1)) & 3) == 2 )
2072 printf(
"Verification failed.\n" );
2095 if ( c00 == c01 && c00 == c10 )
2100 if ( c11 == c00 && c11 == c10 )
2105 if ( c11 == c00 && c11 == c01 )
2110 if ( c11 == c01 && c11 == c10 )
2115 if ( c00 == c11 && c01 == c10 )
2126 word c00, c01, c10, c11;
2127 int k, fPres0, fPres1, iVar0 = -1, iVar1 = -1;
2128 for ( k = 0; k < 6; k++ )
2130 if ( k == i )
continue;
2133 if ( fPres0 && !fPres1 )
2139 if ( !fPres0 && fPres1 )
2146 if ( iVar0 == -1 || iVar1 == -1 )
2152 if ( c00 == c10 && c01 == c11 )
2157 if ( c00 == ~c10 && c01 == ~c11 )
2166 word t, t1, Out, Var0, Var1, Var0_, Var1_;
2167 int iVar0, iVar1, i, Res;
2168 for ( iVar0 = 0; iVar0 < 6; iVar0++ )
2169 for ( iVar1 = 0; iVar1 < 6; iVar1++ )
2171 if ( iVar0 == iVar1 )
2175 for ( i = 0; i < 5; i++ )
2177 Var0_ = ((i >> 0) & 1) ? ~Var0 : Var0;
2178 Var1_ = ((i >> 1) & 1) ? ~Var1 : Var1;
2182 t = ~(Var0_ ^ Var1_);
2189 printf(
"No decomposition\n" );
2194 Var0_ = ((Res >> 0) & 1) ? ~Var0_ : Var0_;
2197 Var1_ = ((Res >> 1) & 1) ? ~Var1_ : Var1_;
2208 printf(
"Verification failed.\n" );
2210 printf(
"Verification succeeded.\n" );
2216 word t, t1, Out, Ctrl, Var0, Var1, Ctrl_, Var0_, Var1_;
2217 int iVar0, iVar1, iCtrl, i, Res;
2218 for ( iCtrl = 0; iCtrl < 6; iCtrl++ )
2219 for ( iVar0 = 0; iVar0 < 6; iVar0++ )
2220 for ( iVar1 = 0; iVar1 < 6; iVar1++ )
2222 if ( iCtrl == iVar0 || iCtrl == iVar1 || iVar0 == iVar1 )
2227 for ( i = 0; i < 8; i++ )
2229 Ctrl_ = ((i >> 0) & 1) ? ~Ctrl : Ctrl;
2230 Var0_ = ((i >> 1) & 1) ? ~Var0 : Var0;
2231 Var1_ = ((i >> 2) & 1) ? ~Var1 : Var1;
2233 t = (~Ctrl_ & Var0_) | (Ctrl_ & Var1_);
2240 printf(
"No decomposition\n" );
2254 t1 = (~Ctrl_ & Var0_) | (Ctrl_ & Var1_);
2264 printf(
"Verification failed.\n" );
2266 printf(
"Verification succeeded.\n" );
2286 word Cof0[64], Cof1[64];
2287 word Cof00[64], Cof01[64], Cof10[64], Cof11[64];
2288 word CofXor, CofAndTest;
2290 pGraph[v] |= (1 << v);
2291 if ( v == nVars - 1 )
2296 for ( i = v + 1; i < nVars; i++ )
2302 for ( w = 0; w <
nWords; w++ )
2304 CofXor = Cof00[w] ^ Cof01[w] ^ Cof10[w] ^ Cof11[w];
2305 CofAndTest = (Cof00[w] & Cof01[w]) | (Cof10[w] & Cof11[w]);
2306 if ( CofXor & CofAndTest )
2308 pGraph[v] |= (1 << i);
2309 pGraph[i] |= (1 << v);
2311 else if ( CofXor & ~CofAndTest )
2313 pGraph[v] |= (1 << (16+i));
2314 pGraph[i] |= (1 << (16+v));
2322 for ( i = 0; i < nVars; i++ )
2323 if ( (Mask >> i) & 1 )
2330 int v, pGraph[12] = {0};
2332 for ( v = 0; v < nVars; v++ )
2343 int pVarsThis[12], pVarsThat[12], pVarsAll[12];
2347 word pThis[64] = {wThis}, pThat[64] = {wThat};
2349 for ( i = 0; i < nVars; i++ )
2351 for ( i = k = 0; i < nVars; i++ )
2352 if ( (This >> i) & 1 )
2355 for ( i = k = 0; i < nVars; i++ )
2356 if ( (That >> i) & 1 )
2361 Abc_TtExpand( pThis, nVars, pVarsThis, nThis, pVarsAll, nVars );
2362 Abc_TtExpand( pThat, nVars, pVarsThat, nThat, pVarsAll, nVars );
2363 for ( k = 0; k <
nWords; k++ )
2364 if ( pTruth[k] != (pThis[k] & pThat[k]) )
2370 word Cof0[64], Cof1[64];
2373 Abc_TtOr( pTruth, Cof0, Cof1, nWords );
2377 int VarMask[2] = {This & ~That, That & ~This};
2380 for ( c = 0; c < 2; c++ )
2383 for ( v = 0; v < nVars; v++ )
2384 if ( ((VarMask[c] >> v) & 1) )
2387 for ( v = 0; v <
nWords; v++ )
2388 if ( ~pTruth[v] & pTempR[0][v] & pTempR[1][v] )
2398 for ( v = 0; v < nVars; v++ )
2399 if ( !((This >> v) & 1) )
2410 if ( !
Abc_TtVerifyBiDec(pTruth, nVars, This, That, nSuppLim, pThis[0], pThat[0] ) )
2411 printf(
"Bi-decomposition verification failed.\n" );
2416 word Cof0[64], Cof1[64];
2418 for ( v = 0; v < nVars; v++ )
2426 if ( nDecVars >= nVars - nSuppLim )
2427 return ((Res ^ (
int)
Abc_Tt6Mask(nVars)) << 16) | Res;
2433 int i, v, Res, nSupp, CountShared = 0, pGraph[12] = {0};
2434 assert( nSuppLim < nVars && nVars <= 12 );
2435 assert( 2 <= nSuppLim && nSuppLim <= 6 );
2439 for ( v = 0; v < nVars; v++ )
2443 if ( nSupp > nSuppLim )
2446 if ( ++CountShared > 2*nSuppLim - nVars )
2449 else if ( nVars - nSupp <= nSuppLim )
2451 int This = pGraph[v] & 0xFFFF;
2455 for ( i = 0; i < nVars; i++ )
2456 if ( (That >> i) & 1 )
2457 Graph |= pGraph[i] & 0xFFFF;
2463 return (Graph << 16) | This;
2482 word This, That, pTemp[64];
2483 int Res, resThis, resThat, nThis, nThat;
2494 resThis = Res & 0xFFFF;
2495 resThat = Res >> 16;
2508 printf(
"Variable sets: " );
2522 int Res, resThis, resThat;
2530 resThis = Res & 0xFFFF;
2531 resThat = Res >> 16;
static word Abc_Tt6IsopCover(word uOn, word uOnDc, int nVars, int *pCover, int *pnCubes)
static int Abc_Tt8Isop(word uOn[4], word uOnDc[4], int nVars, word uRes[4])
static void Abc_TtSharp(word *pOut, word *pIn1, word *pIn2, int nWords)
static void Abc_TtReverseVars(word *pTruth, int nVars)
static char Abc_TtPrintDigit(int Digit)
static int Abc_TtCheckEqualCofs(word *pTruth, int nWords, int iVar, int jVar, int Num1, int Num2)
static word Abc_Tt6Expand(word t, int *pCut0, int nCutSize0, int *pCut, int nCutSize)
static void Abc_TtStretch5(unsigned *pInOut, int nVarS, int nVarB)
static int Abc_TtReadHexNumber(word *pTruth, char *pString)
static int Abc_Tt6Cof1IsConst0(word t, int iVar)
static int Abc_TtMinimumBase(word *t, int *pSupp, int nVarsAll, int *pnVars)
static int Abc_TtSuppFindFirst(int Supp)
static int Abc_TtMinBase(word *pTruth, int *pVars, int nVars, int nVarsAll)
static int Abc_TtSupport(word *t, int nVars)
static word Abc_Tt6Permute_rec(word t, int *pPerm, int nVars)
static void Abc_TtCofactor1p(word *pOut, word *pIn, int nWords, int iVar)
static int Abc_TtFindLastZero(word *pIn, int nVars)
static int Abc_Tt6CnfSize(word t, int nVars)
static int Abc_TtTruthIsConst0(word *p, int nWords)
static int Abc_TtBitCount8[256]
static int Abc_InfoHasBit(unsigned *p, int i)
static int Gia_ManTtIsOrType(word t, int nVars)
static int Abc_Tt6HasVar(word t, int iVar)
static int Abc_TtSuppIsMinBase(int Supp)
static int Abc_Truth6WordNum(int nVars)
static void Abc_TtPrintHexRev(FILE *pFile, word *pTruth, int nVars)
static void Abc_TtPrintHexArrayRev(FILE *pFile, word *pTruth, int nDigits)
static int Abc_Tt6Cof0IsConst1(word t, int iVar)
static void Abc_TtClear(word *pOut, int nWords)
static int Abc_TtCof0IsConst0(word *t, int nWords, int iVar)
static int Abc_TtIsConst0(word *pIn1, int nWords)
static int Abc_Var2Lit(int Var, int fCompl)
static int Abc_TtFindFirstBit(word *pIn, int nVars)
static void Abc_TtUnit(word *pOut, int nWords)
static word Abc_Tt6EsopBuild(int nVars, int *pCover, int nCubes)
static int Abc_TtFindFirstZero(word *pIn, int nVars)
static int Abc_Tt6PosVar(word t, int iVar)
static int Abc_TtReadHexDigit(char HexChar)
static void Abc_TtExist(word *pTruth, int iVar, int nWords)
static int Abc_Tt6FirstBit(word t)
static void Abc_TtOr(word *pOut, word *pIn1, word *pIn2, int nWords)
static void Abc_TtSetBit(word *p, int i)
static int Abc_TtProcessBiDec(word *pTruth, int nVars, int nSuppLim)
static int Abc_TruthWordNum(int nVars)
static void Unm_ManCheckTest2()
static int Abc_TtCountOnes(word x)
static int Gia_ManTtIsAndType(word t, int nVars)
static word Abc_Tt6Cofactor0(word t, int iVar)
static int Abc_TtCheckBiDec(word *pTruth, int nVars, int This, int That)
static int Abc_TtGetBit(word *p, int i)
MACRO DEFINITIONS ///.
static int Abc_MaxInt(int a, int b)
static int Abc_TtCheckDsdAnd(word t, int i, int j, word *pOut)
static int Abc_TtGetHex(word *p, int k)
static void Abc_TtConst1(word *pIn1, int nWords)
static int Abc_TtCheckCondDep2(word *pTruth, int nVars, int nSuppLim)
static int Abc_TtIsConst1(word *pIn1, int nWords)
static int Abc_TtByteNum(int nVars)
#define ABC_SWAP(Type, a, b)
static int Abc_Tt6MinBase(word *pTruth, int *pVars, int nVars)
static int Abc_TtReadHex(word *pTruth, char *pString)
static void Unm_ManCheckTest()
static int Abc_TtCof1IsConst1(word *t, int nWords, int iVar)
static int Abc_TtBitCount16(int i)
static int Abc_TtWriteHexRev(char *pStr, word *pTruth, int nVars)
static int Abc_MinInt(int a, int b)
static word Abc_Tt6SwapAdjacent(word Truth, int iVar)
static void Abc_TtXorBit(word *p, int i)
static int Abc_LitIsCompl(int Lit)
static void Abc_TtFill(word *pOut, int nWords)
static int Abc_TtIsPosUnate(word *t, int nVars)
static int Abc_TtHexDigitNum(int nVars)
static void Abc_TtCopy(word *pOut, word *pIn, int nWords, int fCompl)
static word Abc_Tt6Cofactor1(word t, int iVar)
static int Abc_TtCof0IsConst1(word *t, int nWords, int iVar)
static int Abc_Tt6LastBit(word t)
static void Abc_TtCofactor0p(word *pOut, word *pIn, int nWords, int iVar)
static int Abc_Tt6Cof0IsConst0(word t, int iVar)
static word Ps_PMasks[5][6][3]
static int Abc_TtCountOnesSlow(word t)
static word Abc_TtDeriveBiDecOne(word *pTruth, int nVars, int This)
static void Abc_TtPrintBinary(word *pTruth, int nVars)
unsigned __int64 word
DECLARATIONS ///.
static void Abc_TtMakePosUnate(word *t, int nVars)
static word Abc_Tt6Stretch(word t, int nVars)
static int Abc_Tt6Cof1IsConst1(word t, int iVar)
static void Abc_TtDeriveBiDec(word *pTruth, int nVars, int This, int That, int nSuppLim, word *pThis, word *pThat)
static int Abc_Tt6EsopVerify(word t, int nVars)
static void Abc_TtStretch6(word *pInOut, int nVarS, int nVarB)
static int Abc_TtVerifyBiDec(word *pTruth, int nVars, int This, int That, int nSuppLim, word wThis, word wThat)
static int Abc_TtCheckBiDecSimple(word *pTruth, int nVars, int nSuppLim)
static void Abc_TtPrintBiDec(word *pTruth, int nVars)
static word Abc_Tt6Isop(word uOn, word uOnDc, int nVars, int *pnCubes)
static int Abc_Tt7Isop(word uOn[2], word uOnDc[2], int nVars, word uRes[2])
static int Abc_TtSupportAndSize(word *t, int nVars, int *pSuppSize)
static int Abc_Tt8CnfSize(word t[4], int nVars)
static int Gia_ManTtIsXorType(word t, int nVars)
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.
static void Abc_TtXorHex(word *p, int k, int d)
static void Abc_TtImplementNpnConfig(word *pTruth, int nVars, char *pCanonPerm, unsigned uCanonPhase)
static int Abc_TtOnlyOneOne(word t)
static int Abc_TtHasVar(word *t, int nVars, int iVar)
static word s_PMasks[5][3]
static word s_Truths6Neg[6]
static word Abc_Tt6Flip(word Truth, int iVar)
static int Abc_Tt8Cnf(word t[4], int nVars, int *pCover)
static void Abc_Tt7IsopCover(word uOn[2], word uOnDc[2], int nVars, word uRes[2], int *pCover, int *pnCubes)
static void Abc_TtCofactor0(word *pTruth, int nWords, int iVar)
#define ABC_NAMESPACE_HEADER_END
static int Abc_Tt6SupportAndSize(word t, int nVars, int *pSuppSize)
static int Abc_Tt6NegVar(word t, int iVar)
static void Abc_TtProcessBiDecTest(word *pTruth, int nVars, int nSuppLim)
static void Abc_TtFlip(word *pTruth, int nWords, int iVar)
static word Abc_Tt6Mask(int nBits)
static void Abc_TtPrintHex(word *pTruth, int nVars)
static ABC_NAMESPACE_IMPL_START word Truth[8]
DECLARATIONS ///.
static int Abc_Tt6CofsOpposite(word t, int iVar)
static void Abc_TtShrink(word *pF, int nVars, int nVarsAll, unsigned Phase)
static int Abc_TtPosVar(word *t, int nVars, int iVar)
static void Abc_TtExpand(word *pTruth0, int nVars, int *pCut0, int nCutSize0, int *pCut, int nCutSize)
static int Abc_TtWordNum(int nVars)
static void Abc_TtSetHex(word *p, int k, int d)
static int Abc_Tt6Cnf(word t, int nVars, int *pCover)
static void Abc_TtComputeGraph(word *pTruth, int v, int nVars, int *pGraph)
#define ABC_CONST(number)
PARAMETERS ///.
static int Abc_TtCheckDsdMux(word t, int i, word *pOut)
static int Abc_TtCheckCondDep(word *pTruth, int nVars, int nSuppLim)
static void Abc_TtMux(word *pOut, word *pCtrl, word *pIn1, word *pIn0, int nWords)
static int Abc_Base2Log(unsigned n)
static int Abc_TtIsHexDigit(char HexChar)
static void Abc_TtCofactor1(word *pTruth, int nWords, int iVar)
static int Abc_TtCompare(word *pIn1, word *pIn2, int nWords)
static word s_TruthXors[6]
static int Abc_TtEqual(word *pIn1, word *pIn2, int nWords)
static void Abc_TtConst0(word *pIn1, int nWords)
static int Abc_TtCofsOpposite(word *t, int nWords, int iVar)
static void Abc_TtElemInit2(word *pTtElems, int nVars)
static int Abc_Lit2Var(int Lit)
static int Abc_TtSupportSize(word *t, int nVars)
static int Abc_TtNegVar(word *t, int nVars, int iVar)
static word Abc_Tt6SwapVars(word t, int iVar, int jVar)
static int Abc_TtSuppOnlyOne(int Supp)
static void Abc_TtPrintVarSet(int Mask, int nVars)
static int Abc_Tt6Cof0EqualCof0(word t1, word t2, int iVar)
static void Abc_Tt8IsopCover(word uOn[4], word uOnDc[4], int nVars, word uRes[4], int *pCover, int *pnCubes)
static int Abc_TtIsUnate(word *t, int nVars)
static void Abc_TtProcessBiDecExperiment()
static int Abc_TtCof1IsConst0(word *t, int nWords, int iVar)
static int Abc_TtFindLastBit(word *pIn, int nVars)
static void Abc_TtPrintHexSpecial(word *pTruth, int nVars)
static int Abc_Tt6Cof0EqualCof1(word t1, word t2, int iVar)
static void Abc_TtSwapVars(word *pTruth, int nVars, int iVar, int jVar)
static void Abc_TtAnd(word *pOut, word *pIn1, word *pIn2, int nWords, int fCompl)
static ABC_NAMESPACE_HEADER_START word s_Truths6[6]
INCLUDES ///.
static int Abc_Tt6Cof1EqualCof1(word t1, word t2, int iVar)
static void Abc_TtXor(word *pOut, word *pIn1, word *pIn2, int nWords, int fCompl)
static void Abc_TtElemInit(word **pTtElems, int nVars)
static void Abc_TtNot(word *pOut, int nWords)
static void Abc_TtReverseBits(word *pTruth, int nVars)
static void Abc_TtSwapAdjacent(word *pTruth, int nWords, int iVar)
static void Abc_TtMoveVar(word *pF, int nVars, int *V2P, int *P2V, int v, int p)
static int Abc_TtTruthIsConst1(word *p, int nWords)
static char Abc_TtPrintDigitLower(int Digit)
static int Abc_TtCompareRev(word *pIn1, word *pIn2, int nWords)
static int Abc_Tt6Esop(word t, int nVars, int *pCover)