29 0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,
30 1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,
31 1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,
32 2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,
33 1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,
34 2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,
35 2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,
36 3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,4,5,5,6,5,6,6,7,5,6,6,7,6,7,7,8
107 Counter = pCover->
nBits/2;
108 for ( i = 0; i < pCover->
nBits/2; i++ )
133 int RetValue, v0, v1;
139 RetValue = (int)( !v0 || !v1 );
275 unsigned char * pByte, * pByteStart, * pByteStop;
279 nBytes = pCover->
nBits / (8 *
sizeof(
unsigned char)) + (int)(pCover->
nBits % (8 *
sizeof(
unsigned char)) > 0);
286 pByteStart = (
unsigned char *)pCube->
pData;
287 pByteStop = pByteStart + nBytes;
289 for ( pByte = pByteStart; pByte < pByteStop; pByte++ )
310 unsigned char * pByte, * pByteStart, * pByteStop;
311 int nOnes, nBytes, nBits;
314 nBytes = nBits / (8 *
sizeof(
unsigned char)) + (int)(nBits % (8 *
sizeof(
unsigned char)) > 0);
318 pByteStart = (
unsigned char *)pCube->
pData;
319 pByteStop = pByteStart + nBytes;
321 for ( pByte = pByteStart; pByte < pByteStop; pByte++ )
347 unsigned char * pByte, * pByteStart, * pByteStop;
354 nBytes = pCover->
nBits / (8 *
sizeof(
unsigned char)) + (int)(pCover->
nBits % (8 *
sizeof(
unsigned char)) > 0);
364 pByteStart = (
unsigned char *)pMask->
pData;
365 pByteStop = pByteStart + nBytes;
369 for ( pByte = pByteStart; pByte < pByteStop; pByte++ )
372 pDiffs[nCubePairs++] = nOnes;
416 for ( i = 0; i < nVarsRem; i++ )
420 assert( pVarsRem[i] >= 0 && pVarsRem[i] < p->
nBits );
441 int iColOld,
int iColNew )
444 int iWordOld, iWordNew, iBitOld, iBitNew;
458 if ( pCubeOld->
pData[iWordOld] & (1<<iBitOld) )
459 pCubeNew->
pData[iWordNew] |= (1<<iBitNew);
461 pCubeNew->
pData[iWordNew] &= ~(1<<iBitNew);
550 int Value0, Value1, Temp;
552 assert( iValue0 + 1 == iValue1 );
567 if ( Value0 && Value1 )
570 assert( Value0 || Value1 );
607 int iValueA0,
int iValueA1,
int iValueB0,
int iValueB1 )
611 int ValueA0, ValueA1, ValueB0, ValueB1;
625 assert( ValueA0 || ValueA1 );
626 assert( ValueB0 || ValueB1 );
629 if ( ValueA0 != ValueB0 && ValueA1 != ValueB1 )
637 if ( ValueA0 && ValueB0 )
642 if ( ValueA1 && ValueB1 )
672 int i, nValues, iValueFirst, Res;
675 iValueFirst = Vm_VarMapReadValuesFirst(pData->pVm, iVar);
676 nValues = Vm_VarMapReadValues(pData->pVm, iVar);
678 for ( i = 0; i <= nValues; i++ )
694 for ( i = 0; i < nValues; i++ )
725 iValueFirst = Vm_VarMapReadValuesFirst( pData->pVm, iVar );
757 int i, iLast, iLastNew;
765 for ( i = pCover->
nBits; i < pCoverNew->nBits; i++ )
808 int nWord, nBit, i, iCube;
811 for ( i = 0; i < pCover->
nBits; i++ )
822 if ( pCube->
pData[nWord] & (1<<nBit) )
858 printf(
"Cube %2d out of %2d contains dirty bits.\n", nCubes,
#define Mvc_CoverAddCubeTail(pCover, pCube)
#define Mvc_CubeBitEqualUnderMask(Res, Cube1, Cube2, Mask)
void Mvc_CoverCommonCube(Mvc_Cover_t *pCover, Mvc_Cube_t *pComCube)
Mvc_Cover_t * Mvc_CoverTranspose(Mvc_Cover_t *pCover)
void Mvc_CoverMakeCubeFree(Mvc_Cover_t *pCover)
Mvc_Cube_t * Mvc_CubeDup(Mvc_Cover_t *pCover, Mvc_Cube_t *pCube)
#define Mvc_CubeWhichWord(Bit)
int Mvc_CoverSetCubeSizes(Mvc_Cover_t *pCover)
#define Mvc_CubeReadNext(Cube)
MACRO DEFINITIONS ///.
unsigned int Mvc_CubeWord_t
STRUCTURE DEFINITIONS ///.
void Mvc_CoverSupportAnd(Mvc_Cover_t *pCover, Mvc_Cube_t *pSupp)
#define Mvc_CubeSetLast(Cube, Last)
Mvc_Cover_t ** Mvc_CoverCofactors(Mvc_Data_t *pData, Mvc_Cover_t *pCover, int iVar)
#define Mvc_CubeBitNotImpl(Res, Cube1, Cube2)
#define Mvc_CubeBitOr(CubeR, Cube1, Cube2)
int Mvc_CoverGetCubeSize(Mvc_Cube_t *pCube)
#define ABC_ALLOC(type, num)
for(p=first;p->value< newval;p=p->next)
#define Mvc_CubeSetSize(Cube, Size)
Mvc_Cube_t * Mvc_CubeAlloc(Mvc_Cover_t *pCover)
DECLARATIONS ///.
int Mvr_CoverCountLitsWithValue(Mvc_Data_t *pData, Mvc_Cover_t *pCover, int iVar, int iValue)
#define Mvc_CubeBitAnd(CubeR, Cube1, Cube2)
Mvc_Cover_t * Mvc_CoverUnivQuantify(Mvc_Cover_t *p, int iValueA0, int iValueA1, int iValueB0, int iValueB1)
#define Mvc_CubeWhichBit(Bit)
Mvc_Cover_t * Mvc_CoverRemap(Mvc_Cover_t *p, int *pVarsRem, int nVarsRem)
int Mvc_CoverReadCubeNum(Mvc_Cover_t *pCover)
Mvc_Cover_t * Mvc_CoverCofactor(Mvc_Cover_t *p, int iValue, int iValueOther)
#define Mvc_CubeBitRemove(Cube, Bit)
#define Mvc_CubeBitFill(Cube)
#define Mvc_CubeBitExor(CubeR, Cube1, Cube2)
#define ABC_NAMESPACE_IMPL_END
Mvc_Cover_t * Mvc_CoverClone(Mvc_Cover_t *pCover)
void Mvc_CoverInverse(Mvc_Cover_t *pCover)
Mvc_Cover_t * Mvc_CoverCommonCubeCover(Mvc_Cover_t *pCover)
#define Mvc_CubeBitSharp(CubeR, Cube1, Cube2)
#define Mvc_CubeBitEmpty(Res, Cube)
void Mvc_CoverSupport(Mvc_Cover_t *pCover, Mvc_Cube_t *pSupp)
FUNCTION DEFINITIONS ///.
#define Mvc_CoverForEachCube(Cover, Cube)
#define Mvc_CubeBitCopy(Cube1, Cube2)
Mvc_Cover_t * Mvc_CoverFlipVar(Mvc_Cover_t *p, int iValue0, int iValue1)
#define ABC_NAMESPACE_IMPL_START
#define Mvc_CubeBitValue(Cube, Bit)
int Mvc_CoverSupportVarBelongs(Mvc_Cover_t *pCover, int iVar)
int Mvc_CoverCheckSuppContainment(Mvc_Cover_t *pCover1, Mvc_Cover_t *pCover2)
int Mvc_CoverCountCubePairDiffs(Mvc_Cover_t *pCover, unsigned char pDiffs[])
static void Mvc_CoverCopyColumn(Mvc_Cover_t *pCoverOld, Mvc_Cover_t *pCoverNew, int iColOld, int iColNew)
static ABC_NAMESPACE_IMPL_START int bit_count[256]
DECLARATIONS ///.
int Mvc_CoverSupportSizeBinary(Mvc_Cover_t *pCover)
int Mvc_CoverIsCubeFree(Mvc_Cover_t *pCover)
Mvc_Cover_t * Mvc_CoverRemoveDontCareLits(Mvc_Cover_t *pCover)
void Mvc_CubeBitRemoveDcs(Mvc_Cube_t *pCube)
void Mvc_CubeFree(Mvc_Cover_t *pCover, Mvc_Cube_t *pCube)
#define Mvc_CubeBitNot(Cube)
Mvc_Cover_t * Mvc_CoverAlloc(Mvc_Manager_t *pMem, int nBits)
DECLARATIONS ///.
Mvc_Cover_t * Mvc_CoverDup(Mvc_Cover_t *pCover)
Mvc_Cube_t * Mvc_CoverReadCubeHead(Mvc_Cover_t *pCover)
void Mvc_CoverAllocateMask(Mvc_Cover_t *pCover)
int Mvc_UtilsCheckUnusedZeros(Mvc_Cover_t *pCover)
#define Mvc_CubeBitInsert(Cube, Bit)
#define Mvc_CoverForEachCubeStart(Start, Cube)
#define Mvc_CubeBitClean(Cube)