45 0x00000000, 0x01010101, 0x01010101, 0x03030303, 0x01010101, 0x05050505, 0x06060606, 0x07070707,
46 0x01010101, 0x06060606, 0x05050505, 0x07070707, 0x03030303, 0x07070707, 0x07070707, 0x0f0f0f0f,
47 0x01010101, 0x11111111, 0x12121212, 0x13131313, 0x14141414, 0x15151515, 0x16161616, 0x17171717,
48 0x18181818, 0x19191919, 0x1a1a1a1a, 0x1b1b1b1b, 0x1c1c1c1c, 0x1d1d1d1d, 0x1e1e1e1e, 0x1f1f1f1f,
49 0x01010101, 0x12121212, 0x11111111, 0x13131313, 0x18181818, 0x1a1a1a1a, 0x19191919, 0x1b1b1b1b,
50 0x14141414, 0x16161616, 0x15151515, 0x17171717, 0x1c1c1c1c, 0x1e1e1e1e, 0x1d1d1d1d, 0x1f1f1f1f,
51 0x03030303, 0x13131313, 0x13131313, 0x33333333, 0x1c1c1c1c, 0x35353535, 0x36363636, 0x37373737,
52 0x1c1c1c1c, 0x36363636, 0x35353535, 0x37373737, 0x3c3c3c3c, 0x3d3d3d3d, 0x3d3d3d3d, 0x3f3f3f3f,
53 0x01010101, 0x14141414, 0x18181818, 0x1c1c1c1c, 0x11111111, 0x15151515, 0x19191919, 0x1d1d1d1d,
54 0x12121212, 0x16161616, 0x1a1a1a1a, 0x1e1e1e1e, 0x13131313, 0x17171717, 0x1b1b1b1b, 0x1f1f1f1f,
55 0x05050505, 0x15151515, 0x1a1a1a1a, 0x35353535, 0x15151515, 0x55555555, 0x56565656, 0x57575757,
56 0x1a1a1a1a, 0x56565656, 0x5a5a5a5a, 0x5b5b5b5b, 0x35353535, 0x57575757, 0x5b5b5b5b, 0x5f5f5f5f,
57 0x06060606, 0x16161616, 0x19191919, 0x36363636, 0x19191919, 0x56565656, 0x66666666, 0x67676767,
58 0x16161616, 0x69696969, 0x56565656, 0x6b6b6b6b, 0x36363636, 0x6b6b6b6b, 0x67676767, 0x6f6f6f6f,
59 0x07070707, 0x17171717, 0x1b1b1b1b, 0x37373737, 0x1d1d1d1d, 0x57575757, 0x67676767, 0x77777777,
60 0x1e1e1e1e, 0x6b6b6b6b, 0x5b5b5b5b, 0x7b7b7b7b, 0x3d3d3d3d, 0x7d7d7d7d, 0x7e7e7e7e, 0x7f7f7f7f,
61 0x01010101, 0x18181818, 0x14141414, 0x1c1c1c1c, 0x12121212, 0x1a1a1a1a, 0x16161616, 0x1e1e1e1e,
62 0x11111111, 0x19191919, 0x15151515, 0x1d1d1d1d, 0x13131313, 0x1b1b1b1b, 0x17171717, 0x1f1f1f1f,
63 0x06060606, 0x19191919, 0x16161616, 0x36363636, 0x16161616, 0x56565656, 0x69696969, 0x6b6b6b6b,
64 0x19191919, 0x66666666, 0x56565656, 0x67676767, 0x36363636, 0x67676767, 0x6b6b6b6b, 0x6f6f6f6f,
65 0x05050505, 0x1a1a1a1a, 0x15151515, 0x35353535, 0x1a1a1a1a, 0x5a5a5a5a, 0x56565656, 0x5b5b5b5b,
66 0x15151515, 0x56565656, 0x55555555, 0x57575757, 0x35353535, 0x5b5b5b5b, 0x57575757, 0x5f5f5f5f,
67 0x07070707, 0x1b1b1b1b, 0x17171717, 0x37373737, 0x1e1e1e1e, 0x5b5b5b5b, 0x6b6b6b6b, 0x7b7b7b7b,
68 0x1d1d1d1d, 0x67676767, 0x57575757, 0x77777777, 0x3d3d3d3d, 0x7e7e7e7e, 0x7d7d7d7d, 0x7f7f7f7f,
69 0x03030303, 0x1c1c1c1c, 0x1c1c1c1c, 0x3c3c3c3c, 0x13131313, 0x35353535, 0x36363636, 0x3d3d3d3d,
70 0x13131313, 0x36363636, 0x35353535, 0x3d3d3d3d, 0x33333333, 0x37373737, 0x37373737, 0x3f3f3f3f,
71 0x07070707, 0x1d1d1d1d, 0x1e1e1e1e, 0x3d3d3d3d, 0x17171717, 0x57575757, 0x6b6b6b6b, 0x7d7d7d7d,
72 0x1b1b1b1b, 0x67676767, 0x5b5b5b5b, 0x7e7e7e7e, 0x37373737, 0x77777777, 0x7b7b7b7b, 0x7f7f7f7f,
73 0x07070707, 0x1e1e1e1e, 0x1d1d1d1d, 0x3d3d3d3d, 0x1b1b1b1b, 0x5b5b5b5b, 0x67676767, 0x7e7e7e7e,
74 0x17171717, 0x6b6b6b6b, 0x57575757, 0x7d7d7d7d, 0x37373737, 0x7b7b7b7b, 0x77777777, 0x7f7f7f7f,
75 0x0f0f0f0f, 0x1f1f1f1f, 0x1f1f1f1f, 0x3f3f3f3f, 0x1f1f1f1f, 0x5f5f5f5f, 0x6f6f6f6f, 0x7f7f7f7f,
76 0x1f1f1f1f, 0x6f6f6f6f, 0x5f5f5f5f, 0x7f7f7f7f, 0x3f3f3f3f, 0x7f7f7f7f, 0x7f7f7f7f, 0xffffffff
81 { 8, 0, 1, 2, 3, 4, 5, 6, 7 },
336 { 8, 0, 1, 2, 3, 4, 5, 6, 7 }
351 static int Extra_TruthCanonN_rec(
int nVars,
unsigned char * pt,
unsigned ** pptRes,
char ** ppfRes,
int Flag );
376 static unsigned uTruthStore6[2];
379 assert( nVarsReal <= nVarsMax );
380 RetValue =
Extra_TruthCanonN_rec( nVarsReal <= 3? 3: nVarsReal, (
unsigned char *)pt, pptRes, ppfRes, 0 );
381 if ( nVarsMax == 6 && nVarsReal < nVarsMax )
383 uTruthStore6[0] = **pptRes;
384 uTruthStore6[1] = **pptRes;
385 *pptRes = uTruthStore6;
408 static unsigned uTruthStore[7][2][2];
409 static char uPhaseStore[7][2][64];
411 unsigned char * pt0, * pt1;
412 unsigned * ptRes0, * ptRes1, * ptRes;
413 unsigned uInit0, uInit1, uTruth0, uTruth1, uTemp;
414 char * pfRes0, * pfRes1, * pfRes;
415 int nf0, nf1, nfRes, i, nVarsN;
429 pt1 = pt + (1 << nVarsN) / 8;
435 uInit0 = (pt0[0] << 24) | (pt0[0] << 16) | (pt0[0] << 8) | pt0[0];
436 uInit1 = (pt1[0] << 24) | (pt1[0] << 16) | (pt1[0] << 8) | pt1[0];
438 else if ( nVarsN == 4 )
440 uInit0 = (pt0[1] << 24) | (pt0[0] << 16) | (pt0[1] << 8) | pt0[0];
441 uInit1 = (pt1[1] << 24) | (pt1[0] << 16) | (pt1[1] << 8) | pt1[0];
445 uInit0 = (pt0[3] << 24) | (pt0[2] << 16) | (pt0[1] << 8) | pt0[0];
446 uInit1 = (pt1[3] << 24) | (pt1[2] << 16) | (pt1[1] << 8) | pt1[0];
450 ptRes = uTruthStore[nVars][Flag];
451 pfRes = uPhaseStore[nVars][Flag];
460 for ( i = 0; i < nf0; i++ )
461 pfRes[nfRes++] = pfRes0[i];
470 for ( i = 0; i < nf1; i++ )
471 pfRes[nfRes++] = pfRes1[i] | (1<<nVarsN);
475 if ( uInit1 == 0xFFFFFFFF )
481 for ( i = 0; i < nf0; i++ )
482 pfRes[nfRes++] = pfRes0[i] | (1<<nVarsN);
485 if ( uInit0 == 0xFFFFFFFF )
491 for ( i = 0; i < nf1; i++ )
492 pfRes[nfRes++] = pfRes1[i];
501 if ( *ptRes1 < *ptRes0 )
503 uTruth0 = 0xFFFFFFFF;
505 for ( i = 0; i < nf1; i++ )
508 if ( uTruth0 > uTemp )
512 pfRes[nfRes++] = pfRes1[i];
514 else if ( uTruth0 == uTemp )
515 pfRes[nfRes++] = pfRes1[i];
519 else if ( *ptRes1 > *ptRes0 )
521 uTruth0 = 0xFFFFFFFF;
523 for ( i = 0; i < nf0; i++ )
526 if ( uTruth0 > uTemp )
530 pfRes[nfRes++] = pfRes0[i] | (1<<nVarsN);
532 else if ( uTruth0 == uTemp )
533 pfRes[nfRes++] = pfRes0[i] | (1<<nVarsN);
541 for ( i = 0; i < nf1; i++ )
542 pfRes[nfRes++] = pfRes1[i];
543 for ( i = 0; i < nf0; i++ )
544 pfRes[nfRes++] = pfRes0[i] | (1<<nVarsN);
554 uTemp = (uTruth1 << 8) | uTruth0;
555 *ptRes = (uTemp << 16) | uTemp;
557 else if ( nVarsN == 4 )
561 *ptRes = (uTruth1 << 16) | uTruth0;
563 else if ( nVarsN == 5 )
565 *(ptRes+0) = uTruth0;
566 *(ptRes+1) = uTruth1;
587 extern void Extra_Truth3VarN(
unsigned ** puCanons,
char *** puPhases,
char ** ppCounters );
596 for ( i = 0; i < 256; i++ )
605 for ( i = 0; i < 256; i++ )
607 printf(
"%3d */ { %2d, ", i, pCounters[i] );
608 for ( k = 0; k < pCounters[i]; k++ )
609 printf(
"%s%d", k?
", ":
"", uPhases[i][k] );
628 extern void Extra_Truth3VarN(
unsigned ** puCanons,
char *** puPhases,
char ** ppCounters );
641 for ( i = 0; i < 256; i++ )
661 extern void Extra_Truth4VarN(
unsigned short ** puCanons,
char *** puPhases,
char ** ppCounters,
int PhaseMax );
663 unsigned short * uCanons;
674 for ( i = 0; i < 256*256; i++ )
#define ABC_NAMESPACE_IMPL_END
#define ABC_NAMESPACE_IMPL_START