35 #define ABC_ISOP_MAX_VAR 16
36 #define ABC_ISOP_MAX_WORD (ABC_ISOP_MAX_VAR > 6 ? (1 << (ABC_ISOP_MAX_VAR-6)) : 1)
37 #define ABC_ISOP_MAX_CUBE 0xFFFF
99 int c, nCubes0, nCubes1;
102 for ( c = 0; c < nCubes0; c++ )
104 for ( c = 0; c < nCubes1; c++ )
110 word uOn0, uOn1, uOnDc0, uOnDc1, uRes0, uRes1, uRes2;
111 word Cost0, Cost1, Cost2;
int Var;
113 assert( (uOn & ~uOnDc) == 0 );
119 if ( uOnDc == ~(
word)0 )
122 if ( pCover ) pCover[0] = 0;
127 for ( Var = nVars-1; Var >= 0; Var-- )
137 Cost0 =
Abc_Isop6Cover( uOn0 & ~uOnDc1, uOnDc0, &uRes0, Var, CostLim, pCover );
138 if ( Cost0 >= CostLim )
return CostLim;
140 if ( Cost0 + Cost1 >= CostLim )
return CostLim;
142 if ( Cost0 + Cost1 + Cost2 >= CostLim )
return CostLim;
145 assert( (uOn & ~*pRes) == 0 && (*pRes & ~uOnDc) == 0 );
151 word uOn0, uOn1, uOn2, uOnDc2, uRes0, uRes1, uRes2;
152 word Cost0, Cost1, Cost2;
int nVars = 6;
153 assert( (pOn[0] & ~pOnDc[0]) == 0 );
154 assert( (pOn[1] & ~pOnDc[1]) == 0 );
156 uOn0 = pOn[0] & ~pOnDc[1];
157 uOn1 = pOn[1] & ~pOnDc[0];
159 Cost0 =
Abc_IsopCheck( &uOn0, pOnDc, &uRes0, nVars, CostLim, pCover );
160 if ( Cost0 >= CostLim )
return CostLim;
162 if ( Cost0 + Cost1 >= CostLim )
return CostLim;
163 uOn2 = (pOn[0] & ~uRes0) | (pOn[1] & ~uRes1);
164 uOnDc2 = pOnDc[0] & pOnDc[1];
166 if ( Cost0 + Cost1 + Cost2 >= CostLim )
return CostLim;
168 pRes[0] = uRes2 | uRes0;
169 pRes[1] = uRes2 | uRes1;
170 assert( (pOn[0] & ~pRes[0]) == 0 && (pRes[0] & ~pOnDc[0]) == 0 );
171 assert( (pOn[1] & ~pRes[1]) == 0 && (pRes[1] & ~pOnDc[1]) == 0 );
177 word uOn2[2], uOnDc2[2], uRes0[2], uRes1[2], uRes2[2];
178 word Cost0, Cost1, Cost2;
int nVars = 7;
180 uOn2[0] = pOn[0] & ~pOnDc[2];
181 uOn2[1] = pOn[1] & ~pOnDc[3];
182 Cost0 =
Abc_IsopCheck( uOn2, pOnDc, uRes0, nVars, CostLim, pCover );
183 if ( Cost0 >= CostLim )
return CostLim;
185 uOn2[0] = pOn[2] & ~pOnDc[0];
186 uOn2[1] = pOn[3] & ~pOnDc[1];
188 if ( Cost0 + Cost1 >= CostLim )
return CostLim;
190 uOn2[0] = (pOn[0] & ~uRes0[0]) | (pOn[2] & ~uRes1[0]); uOnDc2[0] = pOnDc[0] & pOnDc[2];
191 uOn2[1] = (pOn[1] & ~uRes0[1]) | (pOn[3] & ~uRes1[1]); uOnDc2[1] = pOnDc[1] & pOnDc[3];
193 if ( Cost0 + Cost1 + Cost2 >= CostLim )
return CostLim;
195 pRes[0] = uRes2[0] | uRes0[0];
196 pRes[1] = uRes2[1] | uRes0[1];
197 pRes[2] = uRes2[0] | uRes1[0];
198 pRes[3] = uRes2[1] | uRes1[1];
199 assert( (pOn[0] & ~pRes[0]) == 0 && (pOn[1] & ~pRes[1]) == 0 && (pOn[2] & ~pRes[2]) == 0 && (pOn[3] & ~pRes[3]) == 0 );
200 assert( (pRes[0] & ~pOnDc[0])==0 && (pRes[1] & ~pOnDc[1])==0 && (pRes[2] & ~pOnDc[2])==0 && (pRes[3] & ~pOnDc[3])==0 );
206 word uOn2[4], uOnDc2[4], uRes0[4], uRes1[4], uRes2[4];
207 word Cost0, Cost1, Cost2;
int c, nVars = 8,
nWords = 4;
209 for ( c = 0; c <
nWords; c++ )
210 uOn2[c] = pOn[c] & ~pOnDc[c+nWords];
211 Cost0 =
Abc_IsopCheck( uOn2, pOnDc, uRes0, nVars, CostLim, pCover );
212 if ( Cost0 >= CostLim )
return CostLim;
214 for ( c = 0; c <
nWords; c++ )
215 uOn2[c] = pOn[c+nWords] & ~pOnDc[c];
217 if ( Cost0 + Cost1 >= CostLim )
return CostLim;
219 for ( c = 0; c <
nWords; c++ )
220 uOn2[c] = (pOn[c] & ~uRes0[c]) | (pOn[c+
nWords] & ~uRes1[c]), uOnDc2[c] = pOnDc[c] & pOnDc[c+nWords];
222 if ( Cost0 + Cost1 + Cost2 >= CostLim )
return CostLim;
224 for ( c = 0; c <
nWords; c++ )
225 pRes[c] = uRes2[c] | uRes0[c], pRes[c+nWords] = uRes2[c] | uRes1[c];
227 for ( c = 0; c < (nWords<<1); c++ )
228 assert( (pOn[c] & ~pRes[c] ) == 0 && (pRes[c] & ~pOnDc[c]) == 0 );
234 word uOn2[8], uOnDc2[8], uRes0[8], uRes1[8], uRes2[8];
235 word Cost0, Cost1, Cost2;
int c, nVars = 9,
nWords = 8;
237 for ( c = 0; c <
nWords; c++ )
238 uOn2[c] = pOn[c] & ~pOnDc[c+nWords];
239 Cost0 =
Abc_IsopCheck( uOn2, pOnDc, uRes0, nVars, CostLim, pCover );
240 if ( Cost0 >= CostLim )
return CostLim;
242 for ( c = 0; c <
nWords; c++ )
243 uOn2[c] = pOn[c+nWords] & ~pOnDc[c];
245 if ( Cost0 + Cost1 >= CostLim )
return CostLim;
247 for ( c = 0; c <
nWords; c++ )
248 uOn2[c] = (pOn[c] & ~uRes0[c]) | (pOn[c+
nWords] & ~uRes1[c]), uOnDc2[c] = pOnDc[c] & pOnDc[c+nWords];
250 if ( Cost0 + Cost1 + Cost2 >= CostLim )
return CostLim;
252 for ( c = 0; c <
nWords; c++ )
253 pRes[c] = uRes2[c] | uRes0[c], pRes[c+nWords] = uRes2[c] | uRes1[c];
255 for ( c = 0; c < (nWords<<1); c++ )
256 assert( (pOn[c] & ~pRes[c] ) == 0 && (pRes[c] & ~pOnDc[c]) == 0 );
262 word uOn2[16], uOnDc2[16], uRes0[16], uRes1[16], uRes2[16];
263 word Cost0, Cost1, Cost2;
int c, nVars = 10,
nWords = 16;
265 for ( c = 0; c <
nWords; c++ )
266 uOn2[c] = pOn[c] & ~pOnDc[c+nWords];
267 Cost0 =
Abc_IsopCheck( uOn2, pOnDc, uRes0, nVars, CostLim, pCover );
268 if ( Cost0 >= CostLim )
return CostLim;
270 for ( c = 0; c <
nWords; c++ )
271 uOn2[c] = pOn[c+nWords] & ~pOnDc[c];
273 if ( Cost0 + Cost1 >= CostLim )
return CostLim;
275 for ( c = 0; c <
nWords; c++ )
276 uOn2[c] = (pOn[c] & ~uRes0[c]) | (pOn[c+
nWords] & ~uRes1[c]), uOnDc2[c] = pOnDc[c] & pOnDc[c+nWords];
278 if ( Cost0 + Cost1 + Cost2 >= CostLim )
return CostLim;
280 for ( c = 0; c <
nWords; c++ )
281 pRes[c] = uRes2[c] | uRes0[c], pRes[c+nWords] = uRes2[c] | uRes1[c];
283 for ( c = 0; c < (nWords<<1); c++ )
284 assert( (pOn[c] & ~pRes[c] ) == 0 && (pRes[c] & ~pOnDc[c]) == 0 );
290 word uOn2[32], uOnDc2[32], uRes0[32], uRes1[32], uRes2[32];
291 word Cost0, Cost1, Cost2;
int c, nVars = 11,
nWords = 32;
293 for ( c = 0; c <
nWords; c++ )
294 uOn2[c] = pOn[c] & ~pOnDc[c+nWords];
295 Cost0 =
Abc_IsopCheck( uOn2, pOnDc, uRes0, nVars, CostLim, pCover );
296 if ( Cost0 >= CostLim )
return CostLim;
298 for ( c = 0; c <
nWords; c++ )
299 uOn2[c] = pOn[c+nWords] & ~pOnDc[c];
301 if ( Cost0 + Cost1 >= CostLim )
return CostLim;
303 for ( c = 0; c <
nWords; c++ )
304 uOn2[c] = (pOn[c] & ~uRes0[c]) | (pOn[c+
nWords] & ~uRes1[c]), uOnDc2[c] = pOnDc[c] & pOnDc[c+nWords];
306 if ( Cost0 + Cost1 + Cost2 >= CostLim )
return CostLim;
308 for ( c = 0; c <
nWords; c++ )
309 pRes[c] = uRes2[c] | uRes0[c], pRes[c+nWords] = uRes2[c] | uRes1[c];
311 for ( c = 0; c < (nWords<<1); c++ )
312 assert( (pOn[c] & ~pRes[c] ) == 0 && (pRes[c] & ~pOnDc[c]) == 0 );
318 word uOn2[64], uOnDc2[64], uRes0[64], uRes1[64], uRes2[64];
319 word Cost0, Cost1, Cost2;
int c, nVars = 12,
nWords = 64;
321 for ( c = 0; c <
nWords; c++ )
322 uOn2[c] = pOn[c] & ~pOnDc[c+nWords];
323 Cost0 =
Abc_IsopCheck( uOn2, pOnDc, uRes0, nVars, CostLim, pCover );
324 if ( Cost0 >= CostLim )
return CostLim;
326 for ( c = 0; c <
nWords; c++ )
327 uOn2[c] = pOn[c+nWords] & ~pOnDc[c];
329 if ( Cost0 + Cost1 >= CostLim )
return CostLim;
331 for ( c = 0; c <
nWords; c++ )
332 uOn2[c] = (pOn[c] & ~uRes0[c]) | (pOn[c+
nWords] & ~uRes1[c]), uOnDc2[c] = pOnDc[c] & pOnDc[c+nWords];
334 if ( Cost0 + Cost1 + Cost2 >= CostLim )
return CostLim;
336 for ( c = 0; c <
nWords; c++ )
337 pRes[c] = uRes2[c] | uRes0[c], pRes[c+nWords] = uRes2[c] | uRes1[c];
339 for ( c = 0; c < (nWords<<1); c++ )
340 assert( (pOn[c] & ~pRes[c] ) == 0 && (pRes[c] & ~pOnDc[c]) == 0 );
346 word uOn2[128], uOnDc2[128], uRes0[128], uRes1[128], uRes2[128];
347 word Cost0, Cost1, Cost2;
int c, nVars = 13,
nWords = 128;
349 for ( c = 0; c <
nWords; c++ )
350 uOn2[c] = pOn[c] & ~pOnDc[c+nWords];
351 Cost0 =
Abc_IsopCheck( uOn2, pOnDc, uRes0, nVars, CostLim, pCover );
352 if ( Cost0 >= CostLim )
return CostLim;
354 for ( c = 0; c <
nWords; c++ )
355 uOn2[c] = pOn[c+nWords] & ~pOnDc[c];
357 if ( Cost0 + Cost1 >= CostLim )
return CostLim;
359 for ( c = 0; c <
nWords; c++ )
360 uOn2[c] = (pOn[c] & ~uRes0[c]) | (pOn[c+
nWords] & ~uRes1[c]), uOnDc2[c] = pOnDc[c] & pOnDc[c+nWords];
362 if ( Cost0 + Cost1 + Cost2 >= CostLim )
return CostLim;
364 for ( c = 0; c <
nWords; c++ )
365 pRes[c] = uRes2[c] | uRes0[c], pRes[c+nWords] = uRes2[c] | uRes1[c];
367 for ( c = 0; c < (nWords<<1); c++ )
368 assert( (pOn[c] & ~pRes[c] ) == 0 && (pRes[c] & ~pOnDc[c]) == 0 );
374 word uOn2[256], uOnDc2[256], uRes0[256], uRes1[256], uRes2[256];
375 word Cost0, Cost1, Cost2;
int c, nVars = 14,
nWords = 256;
377 for ( c = 0; c <
nWords; c++ )
378 uOn2[c] = pOn[c] & ~pOnDc[c+nWords];
379 Cost0 =
Abc_IsopCheck( uOn2, pOnDc, uRes0, nVars, CostLim, pCover );
380 if ( Cost0 >= CostLim )
return CostLim;
382 for ( c = 0; c <
nWords; c++ )
383 uOn2[c] = pOn[c+nWords] & ~pOnDc[c];
385 if ( Cost0 + Cost1 >= CostLim )
return CostLim;
387 for ( c = 0; c <
nWords; c++ )
388 uOn2[c] = (pOn[c] & ~uRes0[c]) | (pOn[c+
nWords] & ~uRes1[c]), uOnDc2[c] = pOnDc[c] & pOnDc[c+nWords];
390 if ( Cost0 + Cost1 + Cost2 >= CostLim )
return CostLim;
392 for ( c = 0; c <
nWords; c++ )
393 pRes[c] = uRes2[c] | uRes0[c], pRes[c+nWords] = uRes2[c] | uRes1[c];
395 for ( c = 0; c < (nWords<<1); c++ )
396 assert( (pOn[c] & ~pRes[c] ) == 0 && (pRes[c] & ~pOnDc[c]) == 0 );
402 word uOn2[512], uOnDc2[512], uRes0[512], uRes1[512], uRes2[512];
403 word Cost0, Cost1, Cost2;
int c, nVars = 15,
nWords = 512;
405 for ( c = 0; c <
nWords; c++ )
406 uOn2[c] = pOn[c] & ~pOnDc[c+nWords];
407 Cost0 =
Abc_IsopCheck( uOn2, pOnDc, uRes0, nVars, CostLim, pCover );
408 if ( Cost0 >= CostLim )
return CostLim;
410 for ( c = 0; c <
nWords; c++ )
411 uOn2[c] = pOn[c+nWords] & ~pOnDc[c];
413 if ( Cost0 + Cost1 >= CostLim )
return CostLim;
415 for ( c = 0; c <
nWords; c++ )
416 uOn2[c] = (pOn[c] & ~uRes0[c]) | (pOn[c+
nWords] & ~uRes1[c]), uOnDc2[c] = pOnDc[c] & pOnDc[c+nWords];
418 if ( Cost0 + Cost1 + Cost2 >= CostLim )
return CostLim;
420 for ( c = 0; c <
nWords; c++ )
421 pRes[c] = uRes2[c] | uRes0[c], pRes[c+nWords] = uRes2[c] | uRes1[c];
423 for ( c = 0; c < (nWords<<1); c++ )
424 assert( (pOn[c] & ~pRes[c] ) == 0 && (pRes[c] & ~pOnDc[c]) == 0 );
430 int nVarsNew;
word Cost;
432 return Abc_Isop6Cover( *pOn, *pOnDc, pRes, nVars, CostLim, pCover );
433 for ( nVarsNew = nVars; nVarsNew > 6; nVarsNew-- )
437 Cost =
Abc_Isop6Cover( *pOn, *pOnDc, pRes, nVarsNew, CostLim, pCover );
458 if ( pTtElems[0] == NULL )
462 pTtElems[v] = TtElems[v];
478 for ( v = 0; v < nVars; v++ )
479 if ( ((Cube >> (v << 1)) & 3) == 1 )
481 else if ( ((Cube >> (v << 1)) & 3) == 2 )
482 Abc_TtAnd( pCube, pCube, pTtElems[v], nWords, 0 );
484 Abc_TtXor( pRes, pRes, pCube, nWords, 0 );
486 Abc_TtOr( pRes, pRes, pCube, nWords );
495 printf(
"Verification failed.\n" );
519 Cost0 =
Abc_IsopCheck( pFunc, pFunc, pRes, nVars, CostInit, NULL );
521 Cost1 =
Abc_IsopCheck( pFunc, pFunc, pRes, nVars, Cost0, NULL );
523 if ( Cost == CostInit )
542 if ( Cost == CostInit )
546 assert( vCover->nSize <= vCover->nCap );
548 return Cost != Cost0;
566 int c, nCubes0, nCubes1;
572 Cost0 =
Abc_Isop6Cover( *pFunc, *pFunc, pRes, nVars, CostInit, pCover );
573 if ( Cost0 >= CostInit )
581 if ( Cost0 + Cost1 >= CostInit )
587 for ( c = 0; c < nCubes0; c++ )
589 for ( c = 0; c < nCubes1; c++ )
592 return nCubes0 + nCubes1;
609 int i, k, Entry, Literal, nLits = 0;
614 for ( k = 0; k < nVars; k++ )
616 Literal = 3 & (Entry >> (k << 1));
619 else if ( Literal == 2 )
621 else if ( Literal != 0 )
629 int i, k, Entry, Literal;
637 for ( k = 0; k < nVars; k++ )
639 Literal = 3 & (Entry >> (k << 1));
642 else if ( Literal == 2 )
644 else if ( Literal == 0 )
648 printf(
" %d\n", !fCompl );
679 for ( i = 0; i < c1; i++ )
680 pCover[i] = pCover[c0+i];
681 for ( i = 0; i < c2; i++ )
682 pCover[c1+i] = pCover[c0+c1+i] | (1 <<
Abc_Var2Lit(Var,0));
686 else if ( Max == r1 )
693 for ( i = 0; i < c2; i++ )
694 pCover[c0+i] = pCover[c0+c1+i] | (1 <<
Abc_Var2Lit(Var,1));
705 for ( i = 0; i < c0; i++ )
707 for ( i = 0; i < c1; i++ )
716 word r0, r1, r2, Max;
723 if ( pCover ) *pCover = 0;
728 for ( Var = nVars-1; Var >= 0; Var-- )
737 if ( r0 >= CostLim )
return CostLim;
739 if ( r1 >= CostLim )
return CostLim;
741 if ( r2 >= CostLim )
return CostLim;
743 if ( r0 + r1 + r2 - Max >= CostLim )
return CostLim;
744 return r0 + r1 + r2 - Max +
Abc_EsopAddLits( pCover, r0, r1, r2, Max, Var );
748 word r0, r1, r2, Max;
749 int c,
nWords = (1 << (nVars - 7));
753 if ( r0 >= CostLim )
return CostLim;
755 if ( r1 >= CostLim )
return CostLim;
756 for ( c = 0; c <
nWords; c++ )
757 pOn[c] ^= pOn[nWords+c];
759 for ( c = 0; c <
nWords; c++ )
760 pOn[c] ^= pOn[nWords+c];
761 if ( r2 >= CostLim )
return CostLim;
763 if ( r0 + r1 + r2 - Max >= CostLim )
return CostLim;
764 return r0 + r1 + r2 - Max +
Abc_EsopAddLits( pCover, r0, r1, r2, Max, nVars-1 );
768 int nVarsNew;
word Cost;
771 for ( nVarsNew = nVars; nVarsNew > 6; nVarsNew-- )
796 for ( w = 0; w <
nWords; w++ )
797 if ( pIn1[w] & pIn2[w] )
805 int i, Shift = (1 << iVar);
806 for ( i = 0; i <
nWords; i++ )
807 if ( t[i] & (c[i] >> Shift) )
813 int i, Step = (1 << (iVar - 6));
815 for ( ; t < tLimit; t += 2*Step )
816 for ( i = 0; i < Step; i++ )
817 if ( t[Step+i] & c[i] )
826 int i, Shift = (1 << iVar);
827 for ( i = 0; i <
nWords; i++ )
828 if ( t[i] & (c[i] << Shift) )
834 int i, Step = (1 << (iVar - 6));
836 for ( ; t < tLimit; t += 2*Step )
837 for ( i = 0; i < Step; i++ )
838 if ( t[i] & c[Step+i] )
847 int i, Shift = (1 << iVar);
848 for ( i = 0; i <
nWords; i++ )
849 t[i] |= (t[i] >> Shift);
853 int i, Step = (1 << (iVar - 6));
855 for ( ; t < tLimit; t += 2*Step )
856 for ( i = 0; i < Step; i++ )
864 int i, Shift = (1 << iVar);
865 for ( i = 0; i <
nWords; i++ )
866 t[i] |= (t[i] << Shift);
870 int i, Step = (1 << (iVar - 6));
872 for ( ; t < tLimit; t += 2*Step )
873 for ( i = 0; i < Step; i++ )
882 int pBlocks[16], nBlocks, vTwo, uTwo;
884 int c, v, u, iMint, Cube, nLits = 0;
890 pOnset[0] >>= (64 - (1 << nVars));
895 for ( Cube = v = 0; v < nVars; v++ )
899 for ( v = 0; v < nVars; v++ )
900 if ( (pBlocks[v] =
Abc_TtGetBit(pOffset, iMint ^ (1 << v))) )
903 if ( nBlocks == nVars )
913 if ( nBlocks < nVars - 1 )
915 for ( v = 0; v < nVars && vTwo == -1; v++ )
917 for ( u = v + 1; u < nVars; u++ )
920 if (
Abc_TtGetBit( pOffset, iMint ^ (1 << v) ^ (1 << u) ) )
930 for ( v = 0; v < nVars; v++ )
942 if ( nBlocks == nVars - 2 && vTwo >= 0 )
947 Abc_TtSetBit( pRes, iMint ^ (1 << vTwo) ^ (1 << uTwo) );
953 if (
Abc_TtGetBit(pOnset, iMint ^ (1 << vTwo) ^ (1 << uTwo)) )
954 Abc_TtXorBit( pOnset, iMint ^ (1 << vTwo) ^ (1 << uTwo) );
964 Abc_TtSetBit( pCube, iMint ^ (1 << vTwo) ^ (1 << uTwo) );
968 for ( v = 0; v < nVars; v++ )
969 if ( v != vTwo && v != uTwo )
975 Cube &= ~(3 << Shift);
980 Cube &= ~(3 << Shift);
986 Abc_TtOr( pRes, pRes, pCube, nWords );
1004 assert( vCover->nSize <= vCover->nCap );
1025 static word TotalCost[6] = {0};
1026 static abctime TotalTime[6] = {0};
1032 if ( Counter == 9999 )
1048 assert( vCover->nSize <= vCover->nCap );
1061 assert( vCover->nSize <= vCover->nCap );
1125 printf(
" | %8d %8d %8d %8d %8d %8d", (
int)TotalCost[0], (
int)TotalCost[1], (
int)TotalCost[2], (
int)TotalCost[3], (
int)TotalCost[4], (
int)TotalCost[5] );
static FUNC_ISOP Abc_Isop9Cover
static void Abc_TtSharp(word *pOut, word *pIn1, word *pIn2, int nWords)
static int * Vec_IntArray(Vec_Int_t *p)
static FUNC_ISOP Abc_Isop11Cover
static FUNC_ISOP Abc_Isop15Cover
static void copy(const T &from, T &to)
static FUNC_ISOP Abc_Isop14Cover
void Abc_IsopPrint(word *t, int nVars, Vec_Int_t *vCover, int fTryBoth)
static word Abc_MinWord(word a, word b)
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
static int Abc_Tt6HasVar(word t, int iVar)
static int Abc_TtCheckWithCubeNeg2Pos(word *t, word *c, int nWords, int iVar)
static word ** Abc_IsopTtElems()
static void Abc_TtClear(word *pOut, int nWords)
static int Abc_TtIsConst0(word *pIn1, int nWords)
static int Abc_Var2Lit(int Var, int fCompl)
static int Abc_TtFindFirstBit(word *pIn, int nVars)
word Abc_EsopCover(word *pOn, int nVars, word CostLim, int *pCover)
static FUNC_ISOP Abc_Isop7Cover
word Abc_Isop6Cover(word uOn, word uOnDc, word *pRes, int nVars, word CostLim, int *pCover)
static void Abc_TtOr(word *pOut, word *pIn1, word *pIn2, int nWords)
static void Abc_TtSetBit(word *p, int i)
static abctime Abc_Clock()
static word Abc_Tt6Cofactor0(word t, int iVar)
static int Abc_EsopAddLits(int *pCover, word r0, word r1, word r2, word Max, int Var)
static int Abc_TtGetBit(word *p, int i)
MACRO DEFINITIONS ///.
static void Abc_IsopVerify(word *pFunc, int nVars, word *pRes, Vec_Int_t *vCover, int fXor, int fCompl)
static FUNC_ISOP * s_pFuncIsopCover[17]
static FUNC_ISOP Abc_Isop8Cover
static FUNC_ISOP Abc_Isop13Cover
static void Vec_IntGrow(Vec_Int_t *p, int nCapMin)
static void Abc_PrintTime(int level, const char *pStr, abctime time)
static void Abc_TtXorBit(word *p, int i)
static void Abc_TtFill(word *pOut, int nWords)
word Abc_EsopCheck(word *pOn, int nVars, word CostLim, int *pCover)
static void Abc_TtCopy(word *pOut, word *pIn, int nWords, int fCompl)
static word Abc_Tt6Cofactor1(word t, int iVar)
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
static FUNC_ISOP Abc_Isop12Cover
#define ABC_ISOP_MAX_WORD
static void Abc_IsopAddLits(int *pCover, word Cost0, word Cost1, int Var)
FUNCTION DEFINITIONS ///.
static int Vec_IntEntry(Vec_Int_t *p, int i)
unsigned __int64 word
DECLARATIONS ///.
#define ABC_NAMESPACE_IMPL_END
void Abc_IsopPrintCover(Vec_Int_t *vCover, int nVars, int fCompl)
static int Abc_CostCubes(word Cost)
static word Abc_Tt6Stretch(word t, int nVars)
static void Abc_TtStretch6(word *pInOut, int nVarS, int nVarB)
static int Abc_CostLits(word Cost)
int Abc_IsopCnf(word *pFunc, int nVars, int nCubeLim, int *pCover)
static int Abc_TtHasVar(word *t, int nVars, int iVar)
static word s_Truths6Neg[6]
static int Abc_TtIntersect(word *pIn1, word *pIn2, int nWords)
#define ABC_NAMESPACE_IMPL_START
word Abc_Esop6Cover(word t, int nVars, word CostLim, int *pCover)
static FUNC_ISOP Abc_Isop16Cover
int Abc_IsopCountLits(Vec_Int_t *vCover, int nVars)
word FUNC_ISOP(word *, word *, word *, word, int *)
static int Vec_IntSize(Vec_Int_t *p)
static int Abc_TtWordNum(int nVars)
static int Abc_TtEqual(word *pIn1, word *pIn2, int nWords)
static word Abc_Cube2Cost(int nCubes)
word Abc_IsopNew(word *pOn, word *pOnDc, word *pRes, int nVars, word CostLim, int *pCover)
static void Abc_TtExpandCubePos2Neg(word *t, int nWords, int iVar)
static void Abc_TtExpandCubeNeg2Pos(word *t, int nWords, int iVar)
void Abc_IsopBuildTruth(Vec_Int_t *vCover, int nVars, word *pRes, int fXor, int fCompl)
#define ABC_ISOP_MAX_VAR
DECLARATIONS ///.
static FUNC_ISOP Abc_Isop10Cover
word Abc_IsopCheck(word *pOn, word *pOnDc, word *pRes, int nVars, word CostLim, int *pCover)
static void Abc_TtAnd(word *pOut, word *pIn1, word *pIn2, int nWords, int fCompl)
static void Vec_IntFree(Vec_Int_t *p)
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
int Abc_IsopTest(word *pFunc, int nVars, Vec_Int_t *vCover)
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)
#define ABC_ISOP_MAX_CUBE
static int Abc_TtCheckWithCubePos2Neg(word *t, word *c, int nWords, int iVar)
int Abc_Isop(word *pFunc, int nVars, int nCubeLim, Vec_Int_t *vCover, int fTryBoth)
static word Abc_MaxWord(word a, word b)