53 for ( i = 0; i < nVars; i++ )
54 printf(
"%d ", pChow[i] );
55 printf(
" %d\n", Chow0 );
59 int i, k, Chow0 = 0, nMints = (1 << nVars);
60 memset( pChow, 0,
sizeof(
int) * nVars );
62 for ( i = 0; i < nMints; i++ )
64 for ( Chow0++, k = 0; k < nVars; k++ )
68 for ( k = 0; k < nVars; k++ )
69 pChow[k] = 2 * pChow[k] - Chow0;
70 return Chow0 - (1 << (nVars-1));
78 for ( i = 0; i < nVars - 1; i++ )
80 if ( pChow[i] >= pChow[i+1] )
82 ABC_SWAP(
int, pChow[i], pChow[i+1] );
93 for ( i = 0; i < nVars; i++ )
100 int m, Lmin, Lmax, nMints = (1 << nVars);
102 for ( pW[2] = 1; pW[2] <= nVars; pW[2]++ )
103 for ( pW[1] = pW[2]; pW[1] <= nVars; pW[1]++ )
104 for ( pW[0] = pW[1]; pW[0] <= nVars; pW[0]++ )
106 Lmin = 10000; Lmax = 0;
107 for ( m = 0; m < nMints; m++ )
127 int m, Lmin, Lmax, nMints = (1 << nVars);
129 for ( pW[3] = 1; pW[3] <= nVars; pW[3]++ )
130 for ( pW[2] = pW[3]; pW[2] <= nVars; pW[2]++ )
131 for ( pW[1] = pW[2]; pW[1] <= nVars; pW[1]++ )
132 for ( pW[0] = pW[1]; pW[0] <= nVars; pW[0]++ )
134 Lmin = 10000; Lmax = 0;
135 for ( m = 0; m < nMints; m++ )
153 int m, Lmin, Lmax, nMints = (1 << nVars), Limit = nVars + 0;
155 for ( pW[4] = 1; pW[4] <= Limit; pW[4]++ )
156 for ( pW[3] = pW[4]; pW[3] <= Limit; pW[3]++ )
157 for ( pW[2] = pW[3]; pW[2] <= Limit; pW[2]++ )
158 for ( pW[1] = pW[2]; pW[1] <= Limit; pW[1]++ )
159 for ( pW[0] = pW[1]; pW[0] <= Limit; pW[0]++ )
161 Lmin = 10000; Lmax = 0;
162 for ( m = 0; m < nMints; m++ )
180 int m, Lmin, Lmax, nMints = (1 << nVars), Limit = nVars + 3;
182 for ( pW[5] = 1; pW[5] <= Limit; pW[5]++ )
183 for ( pW[4] = pW[5]; pW[4] <= Limit; pW[4]++ )
184 for ( pW[3] = pW[4]; pW[3] <= Limit; pW[3]++ )
185 for ( pW[2] = pW[3]; pW[2] <= Limit; pW[2]++ )
186 for ( pW[1] = pW[2]; pW[1] <= Limit; pW[1]++ )
187 for ( pW[0] = pW[1]; pW[0] <= Limit; pW[0]++ )
189 Lmin = 10000; Lmax = 0;
190 for ( m = 0; m < nMints; m++ )
208 int m, Lmin, Lmax, nMints = (1 << nVars), Limit = nVars + 6;
210 for ( pW[6] = 1; pW[6] <= Limit; pW[6]++ )
211 for ( pW[5] = pW[6]; pW[5] <= Limit; pW[5]++ )
212 for ( pW[4] = pW[5]; pW[4] <= Limit; pW[4]++ )
213 for ( pW[3] = pW[4]; pW[3] <= Limit; pW[3]++ )
214 for ( pW[2] = pW[3]; pW[2] <= Limit; pW[2]++ )
215 for ( pW[1] = pW[2]; pW[1] <= Limit; pW[1]++ )
216 for ( pW[0] = pW[1]; pW[0] <= Limit; pW[0]++ )
218 Lmin = 10000; Lmax = 0;
219 for ( m = 0; m < nMints; m++ )
237 int m, Lmin, Lmax, nMints = (1 << nVars), Limit = nVars + 1;
239 for ( pW[7] = 1; pW[7] <= Limit; pW[7]++ )
240 for ( pW[6] = pW[7]; pW[6] <= Limit; pW[6]++ )
241 for ( pW[5] = pW[6]; pW[5] <= Limit; pW[5]++ )
242 for ( pW[4] = pW[5]; pW[4] <= Limit; pW[4]++ )
243 for ( pW[3] = pW[4]; pW[3] <= Limit; pW[3]++ )
244 for ( pW[2] = pW[3]; pW[2] <= Limit; pW[2]++ )
245 for ( pW[1] = pW[2]; pW[1] <= Limit; pW[1]++ )
246 for ( pW[0] = pW[1]; pW[0] <= Limit; pW[0]++ )
248 Lmin = 10000; Lmax = 0;
249 for ( m = 0; m < nMints; m++ )
268 return (t[0] & 0xF) != 6 && (t[0] & 0xF) != 9;
308 int T, Chow0, Chow[16], Weights[16];
317 for ( i = 0; i < nVars; i++ )
324 printf(
"No threshold\n" );
static int Abc_TtGetBit(word *p, int i)
MACRO DEFINITIONS ///.
static int Abc_MaxInt(int a, int b)
#define ABC_SWAP(Type, a, b)
static int Abc_MinInt(int a, int b)
unsigned __int64 word
DECLARATIONS ///.
static void Abc_TtMakePosUnate(word *t, int nVars)
#define ABC_NAMESPACE_IMPL_END
#define ABC_NAMESPACE_IMPL_START
static int Abc_TtPosVar(word *t, int nVars, int iVar)
static int Abc_TtWordNum(int nVars)
static int Abc_TtNegVar(word *t, int nVars, int iVar)
static int Abc_TtIsUnate(word *t, int nVars)
static void Abc_TtSwapAdjacent(word *pTruth, int nWords, int iVar)