49 int nCubesInit, nCubesOld, nIter;
53 nCubesInit = p->nCubes;
55 nCubesOld = p->nCubes;
60 while ( 100.0*(nCubesOld - p->nCubes)/nCubesOld > 3.0 );
81 int v00, v01, v10, v11, Var0, Var1, Index, fCont0, fCont1, nCubesOld;
94 p->pBubble->
pNext = p->ppStore[0];
95 p->ppStore[0] = p->pBubble;
96 p->pBubble->
nLits = 0;
102 Index = p->pBubble->nLits;
106 if ( pCube == p->pBubble )
108 assert( pCube == p->pBubble );
111 *ppPrev = p->pBubble->
pNext;
112 pCube = p->pBubble->
pNext;
114 for ( Index++; Index <= p->nVars; Index++ )
115 if ( p->ppStore[Index] )
117 ppPrev = &(p->ppStore[Index]);
118 pCube = p->ppStore[Index];
129 if ( pThis == NULL && Index < p->nVars )
137 p->pBubble->pNext = pCube->
pNext;
138 pCube->
pNext = p->pBubble;
149 *ppPrevT = pThis->
pNext;
150 *ppPrev = p->pBubble;
155 assert( pCube != p->pBubble && pThis != p->pBubble );
163 assert( v00 != v10 && v01 != v11 );
164 assert( v00 != 3 || v01 != 3 );
165 assert( v10 != 3 || v11 != 3 );
176 if ( v00 != 3 && v01 != 3 && v10 != 3 && v11 != 3 )
178 assert( v00 == (v10 ^ 3) );
179 assert( v01 == (v11 ^ 3) );
196 if ( fCont0 && fCont1 )
236 if ( v00 != 3 && v01 != 3 )
238 assert( v10 == 3 || v11 == 3 );
239 pTemp = pCube; pCube = pThis; pThis = pTemp;
240 Index = v00; v00 = v10; v10 = Index;
241 Index = v01; v01 = v11; v11 = Index;
248 Index = Var0; Var0 = Var1; Var1 = Index;
249 Index = v00; v00 = v01; v01 = Index;
250 Index = v10; v10 = v11; v11 = Index;
254 if ( v00 == 3 && v11 == 3 )
256 assert( v01 != 3 && v10 != 3 );
284 nCubesOld = p->nCubes;
287 if ( p->nCubes < nCubesOld + 1 )
313 assert( v01 != 3 && v10 != 3 && v11 != 3 );
375 for ( i = 0; i < (int)pCube->
nLits; i++ )
389 *ppPrev = pThis->
pNext;
399 for ( i = pCube->
nLits + 1; i <= (
int)pCube->
nVars; i++ )
401 ppPrev = &p->ppStore[i];
406 *ppPrev = pThis->
pNext;
411 ppPrev = &pThis->
pNext;
417 p->ppStore[pCube->
nLits] = pCube;
436 assert( pCube != p->pBubble );
460 for ( i = 0; i <= p->nVars; i++ )
467 *ppPrev = pCube2->
pNext;
471 for ( k = i + 1; k <= p->nVars; k++ )
476 *ppPrev = pCube2->
pNext;
498 for ( i = p->nVars; i >= 0; i-- )
508 pCubeNew->
pNext = p->ppStore[pCubeNew->
nLits];
509 p->ppStore[pCubeNew->
nLits] = pCubeNew;
529 Min_Cube_t * pCover, * pCube, * pNext, * pReady, * pThis, ** ppPrev;
543 pNext = pThis->
pNext;
560 ppPrev = &pReady->
pNext;
563 pThis->
pNext = pNext;
603 for ( i = 0; i <= p->nVars; i++ )
static void Min_CubeRecycle(Min_Man_t *p, Min_Cube_t *pCube)
static void Min_CubeXorVar(Min_Cube_t *p, int Var, int Value)
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
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)
#define Vec_IntForEachEntryReverse(vVec, pEntry, i)
static int Min_CubesDisjoint(Min_Cube_t *pCube0, Min_Cube_t *pCube1)
#define Min_CoverForEachCubeSafe(pCover, pCube, pCube2)
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 int Min_CubeIsContained(Min_Cube_t *pCube0, Min_Cube_t *pCube1)
void Min_SopAddCube(Min_Man_t *p, Min_Cube_t *pCube)
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
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)
#define ABC_NAMESPACE_IMPL_END
void Min_SopDist1Merge(Min_Man_t *p)
static int Min_CoverContainsCube(Min_Man_t *p, Min_Cube_t *pCube)
static Min_Cube_t * Min_CubesXor(Min_Man_t *p, Min_Cube_t *pCube0, Min_Cube_t *pCube1)
int Min_SopAddCubeInt(Min_Man_t *p, Min_Cube_t *pCube)
#define ABC_NAMESPACE_IMPL_START
#define Min_CoverForEachCubePrev(pCover, pCube, ppPrev)
static int Min_CubesAreEqual(Min_Cube_t *pCube0, Min_Cube_t *pCube1)
int Min_SopCheck(Min_Man_t *p)
#define Min_CoverForEachCube(pCover, pCube)
Min_Cube_t * Min_SopComplement(Min_Man_t *p, Min_Cube_t *pSharp)
static void Min_CubeXorBit(Min_Cube_t *p, int i)
static Min_Cube_t * Min_CubeAlloc(Min_Man_t *p)
FUNCTION DEFINITIONS ///.
void Min_SopMinimize(Min_Man_t *p)
FUNCTION DEFINITIONS ///.
static void Min_CubesTransformOr(Min_Cube_t *pCube, Min_Cube_t *pDist)
void Min_SopContain(Min_Man_t *p)
static void Vec_IntFree(Vec_Int_t *p)
static ABC_NAMESPACE_IMPL_START void Min_SopRewrite(Min_Man_t *p)
DECLARATIONS ///.
typedefABC_NAMESPACE_HEADER_START struct Min_Man_t_ Min_Man_t
DECLARATIONS ///.