47 int i, iBestVar, nSuppSizeCur0, nSuppSizeCur1, nSuppSizeCur, nSuppSizeMin;
51 for ( i = 0; i < nVars; i++ )
58 nSuppSizeCur = nSuppSizeCur0 + nSuppSizeCur1;
60 if ( nSuppSizeCur0 > p->
pPars->nLutSize || nSuppSizeCur1 > p->
pPars->nLutSize )
63 if ( nSuppSizeMin > nSuppSizeCur )
65 nSuppSizeMin = nSuppSizeCur;
100 if ( iBestVar == -1 )
105 if ( p->
pPars->fVeryVerbose )
107 printf(
"Cofactoring w.r.t. var %c (%d -> %d+%d supp vars):\n",
113 pObj0 =
Lpk_MapTree_rec( p, ppNtks[0], ppLeaves, ppNtks[0]->Root, NULL );
114 pObj1 =
Lpk_MapTree_rec( p, ppNtks[1], ppLeaves, ppNtks[1]->Root, NULL );
135 Kit_DsdNtk_t * pNtkDec, * pNtkComp, * ppNtks[2], * pTemp;
149 int TrueMint0, TrueMint1, FalseMint0, FalseMint1;
150 int uSubsets, uSubset0, uSubset1, iVar, iVarReused, i;
163 uSubset0 = uSubsets & 0xFFFF;
164 uSubset1 = uSubsets >> 16;
185 assert( TrueMint0 >= 0 && TrueMint1 >= 0 );
189 assert( FalseMint0 >= 0 && FalseMint1 >= 0 );
194 for ( i = 0; i < nVars; i++ )
195 if ( uSubset0 & (1 << i) )
197 if ( FalseMint0 & (1 << i) )
201 if ( TrueMint0 & (1 << i) )
208 for ( i = 0; i < nVars; i++ )
209 if ( uSubset1 & (1 << i) )
211 if ( FalseMint1 & (1 << i) )
215 if ( TrueMint1 & (1 << i) )
static int Kit_TruthFindFirstZero(unsigned *pIn, int nVars)
void Kit_TruthCofactor0(unsigned *pTruth, int nVars, int iVar)
If_Obj_t * Lpk_MapTree_rec(Lpk_Man_t *p, Kit_DsdNtk_t *pNtk, If_Obj_t **ppLeaves, int iLit, If_Obj_t *pResult)
void Kit_TruthMuxVar(unsigned *pOut, unsigned *pCof0, unsigned *pCof1, int nVars, int iVar)
void Kit_DsdTruthPartial(Kit_DsdMan_t *p, Kit_DsdNtk_t *pNtk, unsigned *pTruthRes, unsigned uSupp)
Kit_DsdNtk_t * Kit_DsdDecompose(unsigned *pTruth, int nVars)
If_Obj_t * If_ManCreateMux(If_Man_t *p, If_Obj_t *pFan0, If_Obj_t *pFan1, If_Obj_t *pCtrl)
void Kit_TruthCofactor0New(unsigned *pOut, unsigned *pIn, int nVars, int iVar)
void Kit_TruthCofactor1(unsigned *pTruth, int nVars, int iVar)
ABC_NAMESPACE_IMPL_START int Lpk_MapTreeBestCofVar(Lpk_Man_t *p, unsigned *pTruth, int nVars, unsigned *pCof0, unsigned *pCof1)
DECLARATIONS ///.
#define ABC_NAMESPACE_IMPL_END
void Kit_TruthCofactor1New(unsigned *pOut, unsigned *pIn, int nVars, int iVar)
#define ABC_NAMESPACE_IMPL_START
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
static int Kit_TruthFindFirstBit(unsigned *pIn, int nVars)
If_Obj_t * Lpk_MapTreeMux_rec(Lpk_Man_t *p, unsigned *pTruth, int nVars, If_Obj_t **ppLeaves)
static void Kit_TruthCopy(unsigned *pOut, unsigned *pIn, int nVars)
If_Obj_t * Lpk_MapSuppRedDec_rec(Lpk_Man_t *p, unsigned *pTruth, int nVars, If_Obj_t **ppLeaves)
unsigned Lpk_MapSuppRedDecSelect(Lpk_Man_t *p, unsigned *pTruth, int nVars, int *piVar, int *piVarReused)
void Kit_DsdNtkFree(Kit_DsdNtk_t *pNtk)
Kit_DsdNtk_t * Kit_DsdExpand(Kit_DsdNtk_t *p)
void Kit_DsdPrintExpanded(Kit_DsdNtk_t *pNtk)
int Kit_TruthSupportSize(unsigned *pTruth, int nVars)