21 #ifndef ABC__map__cov__covInt_h
22 #define ABC__map__cov__covInt_h
65 #define Min_CoverForEachCube( pCover, pCube ) \
66 for ( pCube = pCover; \
68 pCube = pCube->pNext )
69 #define Min_CoverForEachCubeSafe( pCover, pCube, pCube2 ) \
70 for ( pCube = pCover, \
71 pCube2 = pCube? pCube->pNext: NULL; \
74 pCube2 = pCube? pCube->pNext: NULL )
75 #define Min_CoverForEachCubePrev( pCover, pCube, ppPrev ) \
76 for ( pCube = pCover, \
79 ppPrev = &pCube->pNext, \
80 pCube = pCube->pNext )
131 pCube->
nVars = p->nVars;
132 pCube->
nWords = p->nWords;
134 memset( pCube->
uData, 0xff,
sizeof(
unsigned) * p->nWords );
228 for ( w = 0; w < (int)pCube->
nWords; w++ )
230 uData = pCube->
uData[w] ^ (pCube->
uData[w] >> 1);
231 for ( i = 0; i < 32; i += 2 )
232 if ( uData & (1 << i) )
254 for ( w = 0; w < (int)pCube->
nWords; w++ )
256 uData = pCube->
uData[w] ^ (pCube->
uData[w] >> 1);
257 for ( i = 0; i < 32; i += 2 )
258 if ( uData & (1 << i) )
300 for ( i = 0; i < (int)pCube0->
nWords; i++ )
303 uData = (uData | (uData >> 1)) & 0x55555555;
304 if ( uData != 0x55555555 )
326 for ( w = 0; w < (int)pCube->
nWords; w++ )
328 uData = pThis->
uData[w] & (pThis->
uData[w] >> 1) & 0x55555555;
329 uData &= (pCube->
uData[w] ^ (pCube->
uData[w] >> 1));
332 for ( i = 0; i < 32; i += 2 )
333 if ( uData & (1 << i) )
353 for ( i = 0; i < (int)pCube0->
nWords; i++ )
358 if ( pTemp ) pTemp->
uData[i] = 0;
363 uData = (uData | (uData >> 1)) & 0x55555555;
364 if ( (uData & (uData-1)) > 0 )
366 if ( pTemp ) pTemp->
uData[i] = uData | (uData << 1);
374 printf(
"Error: Min_CubesDistOne() looks at two equal cubes!\n" );
393 int i, k, Var0 = -1, Var1 = -1;
394 for ( i = 0; i < (int)pCube0->
nWords; i++ )
399 if ( Var0 >= 0 && Var1 >= 0 )
401 uData = (uData | (uData >> 1)) & 0x55555555;
402 if ( (Var0 >= 0 || Var1 >= 0) && (uData & (uData-1)) > 0 )
404 for ( k = 0; k < 32; k += 2 )
405 if ( uData & (1 << k) )
409 else if ( Var1 == -1 )
429 if ( Var0 >= 0 && Var1 >= 0 )
435 if ( Var0 == -1 || Var1 == -1 )
440 printf(
"Error: Min_CubesDistTwo() looks at two equal cubes or dist1 cubes!\n" );
462 for ( i = 0; i < p->nWords; i++ )
485 for ( i = 0; i < p->nWords; i++ )
505 for ( i = 0; i < (int)pCube0->
nWords; i++ )
525 for ( i = 0; i < (int)pCube0->
nWords; i++ )
545 for ( w = 0; w < (int)pCube->
nWords; w++ )
566 for ( w = 0; w < (int)pCube->
nWords; w++ )
586 if ( pCover == NULL )
604 p->ppStore[pCube->
nLits] = pCube;
636 for ( i = 0; i <= (int)pCube->
nLits; i++ )
void Min_CoverCheck(Min_Man_t *p)
static void Min_CubeRecycle(Min_Man_t *p, Min_Cube_t *pCube)
static void Min_CubeXorVar(Min_Cube_t *p, int Var, int Value)
void Min_CubeWrite(FILE *pFile, Min_Cube_t *pCube)
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
static Min_Cube_t * Min_CubeAllocVar(Min_Man_t *p, int iVar, int fCompl)
static void Min_CoverExpandRemoveEqual(Min_Man_t *p, Min_Cube_t *pCover)
static int Min_CubeCountLits(Min_Cube_t *pCube)
static Min_Cube_t * Min_CubeDup(Min_Man_t *p, Min_Cube_t *pCopy)
static int Min_CubesDisjoint(Min_Cube_t *pCube0, Min_Cube_t *pCube1)
void Min_CoverWriteFile(Min_Cube_t *pCover, char *pName, int fEsop)
void Min_CoverCreate(Vec_Str_t *vCover, Min_Cube_t *pCover, char Type)
#define Min_CoverForEachCubeSafe(pCover, pCube, pCube2)
Min_Man_t * Min_ManAlloc(int nVars)
DECLARATIONS ///.
static int Min_CubesDistOne(Min_Cube_t *pCube0, Min_Cube_t *pCube1, Min_Cube_t *pTemp)
static int Min_CubesDistTwo(Min_Cube_t *pCube0, Min_Cube_t *pCube1, int *pVar0, int *pVar1)
static Min_Cube_t * Min_CubesProduct(Min_Man_t *p, Min_Cube_t *pCube0, Min_Cube_t *pCube1)
static int Min_CubeIsContained(Min_Cube_t *pCube0, Min_Cube_t *pCube1)
void Min_CoverExpand(Min_Man_t *p, Min_Cube_t *pCover)
Min_Cube_t * Min_CoverCollect(Min_Man_t *p, int nSuppSize)
static void Min_CoverGetDisjVars(Min_Cube_t *pThis, Min_Cube_t *pCube, Vec_Int_t *vVars)
static int Min_CubeGetVar(Min_Cube_t *p, int Var)
int Min_CubeCheck(Min_Cube_t *pCube)
void Min_EsopAddCube(Min_Man_t *p, Min_Cube_t *pCube)
static void Min_CubeSetBit(Min_Cube_t *p, int i)
static void Min_CubesTransform(Min_Cube_t *pCube, Min_Cube_t *pDist, Min_Cube_t *pMask)
static int Min_CoverCountCubes(Min_Cube_t *pCover)
static int Min_CoverContainsCube(Min_Man_t *p, Min_Cube_t *pCube)
static void Vec_IntPush(Vec_Int_t *p, int Entry)
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.
static Min_Cube_t * Min_CubesXor(Min_Man_t *p, Min_Cube_t *pCube0, Min_Cube_t *pCube1)
#define ABC_NAMESPACE_HEADER_END
void Min_CoverWriteStore(FILE *pFile, Min_Man_t *p)
static int Min_CubesAreEqual(Min_Cube_t *pCube0, Min_Cube_t *pCube1)
static void Min_CubeGetLits(Min_Cube_t *pCube, Vec_Int_t *vLits)
Extra_MmFixed_t * pMemMan
#define Min_CoverForEachCube(pCover, pCube)
static void Min_CubeXorBit(Min_Cube_t *p, int i)
static Min_Cube_t * Min_CubeAlloc(Min_Man_t *p)
FUNCTION DEFINITIONS ///.
static void Min_CubesTransformOr(Min_Cube_t *pCube, Min_Cube_t *pDist)
static void Min_CoverRecycle(Min_Man_t *p, Min_Cube_t *pCover)
int Min_CoverSuppVarNum(Min_Man_t *p, Min_Cube_t *pCover)
static int Min_CubeHasBit(Min_Cube_t *p, int i)
void Min_SopAddCube(Min_Man_t *p, Min_Cube_t *pCube)
static void Vec_IntClear(Vec_Int_t *p)
void Min_CoverWrite(FILE *pFile, Min_Cube_t *pCover)
void Min_EsopMinimize(Min_Man_t *p)
FUNCTION DEFINITIONS ///.
void Min_SopMinimize(Min_Man_t *p)
FUNCTION DEFINITIONS ///.
void Min_ManClean(Min_Man_t *p, int nSupp)
typedefABC_NAMESPACE_HEADER_START struct Min_Man_t_ Min_Man_t
DECLARATIONS ///.
void Min_ManFree(Min_Man_t *p)