55 for ( v = 0; v < p->
nVars; v++ )
57 if ( (pIsf->
uSupp & (1 << v)) == 0 )
70 pIsf->
uSupp &= ~(1 << v);
95 for ( v = 0; v < p->
nVars; v++ )
106 pIsf->
uSupp |= (1 << v);
125 unsigned * puTruth = p->
puTemp1;
191 if ( nLeftVars >= nRightVars )
211 int v, nVars, Beg, End;
218 for ( v = 0; v < p->
nVars; v++ )
219 if ( pIsf->
uSupp & (1 << v) )
223 for ( Beg = 0; Beg < nVars; Beg++ )
226 for ( End = nVars - 1; End > Beg; End-- )
231 pIsfL->
uUniq = (1 << pVars[Beg]);
232 pIsfR->
uUniq = (1 << pVars[End]);
255 int Cost, VarCostBest = 0;
257 for ( v = 0; v < p->
nVars; v++ )
259 if ( (pIsf->
uSupp & (1 << v)) == 0 )
278 if ( VarCostBest < VarCost )
280 VarCostBest = VarCost;
300 pIsfL->
uUniq = (1 << VarBest);
330 unsigned uSupportRem;
331 int v, nLeftVars = 1, nRightVars = 1;
346 for ( v = 0; v < p->
nVars; v++ )
348 if ( (uSupportRem & (1 << v)) == 0 )
353 if ( nLeftVars < nRightVars )
360 pIsfL->
uUniq |= (1 << v);
368 pIsfR->
uUniq |= (1 << v);
379 pIsfR->
uUniq |= (1 << v);
387 pIsfL->
uUniq |= (1 << v);
446 int WeightOr, WeightAnd, WeightOrL, WeightOrR, WeightAndL, WeightAndR;
464 if ( WeightOr == 0 && WeightAnd == 0 )
471 assert( WeightOr || WeightAnd );
472 WeightOrL = WeightOrR = 0;
486 WeightAndL = WeightAndR = 0;
502 if ( WeightOrL + WeightOrR > WeightAndL + WeightAndR )
510 if ( WeightOrL + WeightOrR < WeightAndL + WeightAndR )
520 if ( WeightOr > WeightAnd )
550 int Var, VarMin, nSuppMin, nSuppCur;
551 unsigned uSupp0, uSupp1;
557 for ( Var = 0; Var < p->
nVars; Var++ )
559 if ( (pIsf->
uSupp & (1 << Var)) == 0 )
568 if ( nSuppMin > nSuppCur )
602 unsigned * puTruth = p->
puTemp1;
628 pFunc->pFan0 = pFunc0;
629 pFunc->pFan1 = pFunc1;
651 pFunc->pFan0 =
Bdc_Not(pFunc->pFan0);
652 pFunc->pFan1 =
Bdc_Not(pFunc->pFan1);
715 if ( pFunc0 == NULL || pFunc1 == NULL )
720 if ( pFunc0 == NULL || pFunc1 == NULL )
727 if ( pFunc0 == NULL )
737 if ( pFunc1 == NULL )
#define BDC_SCALE
INCLUDES ///.
int Bdc_DecomposeStepMux(Bdc_Man_t *p, Bdc_Isf_t *pIsf, Bdc_Isf_t *pIsfL, Bdc_Isf_t *pIsfR)
int Bdc_DecomposeOr(Bdc_Man_t *p, Bdc_Isf_t *pIsf, Bdc_Isf_t *pIsfL, Bdc_Isf_t *pIsfR)
void Kit_TruthExistSet(unsigned *pRes, unsigned *pTruth, int nVars, unsigned uMask)
static int Kit_TruthIsDisjoint3(unsigned *pIn1, unsigned *pIn2, unsigned *pIn3, int nVars)
void Bdc_TableAdd(Bdc_Man_t *p, Bdc_Fun_t *pFunc)
Bdc_Type_t
BASIC TYPES ///.
static int Kit_TruthIsImply(unsigned *pIn1, unsigned *pIn2, int nVars)
static int Bdc_DecomposeGetCost(Bdc_Man_t *p, int nLeftVars, int nRightVars)
int Kit_TruthVarIsVacuous(unsigned *pOnset, unsigned *pOffset, int nVars, int iVar)
Bdc_Fun_t * Bdc_ManCreateGate(Bdc_Man_t *p, Bdc_Fun_t *pFunc0, Bdc_Fun_t *pFunc1, Bdc_Type_t Type)
static int Kit_TruthIsConst0(unsigned *pIn, int nVars)
static abctime Abc_Clock()
static unsigned * Vec_IntFetch(Vec_Int_t *p, int nWords)
int Bdc_TableCheckContainment(Bdc_Man_t *p, Bdc_Isf_t *pIsf, unsigned *puTruth)
DECLARATIONS ///.
void Kit_TruthExist(unsigned *pTruth, int nVars, int iVar)
Bdc_Fun_t * Bdc_ManDecompose_rec(Bdc_Man_t *p, Bdc_Isf_t *pIsf)
MACRO DEFINITIONS ///.
static void Kit_TruthAnd(unsigned *pOut, unsigned *pIn0, unsigned *pIn1, int nVars)
void Kit_TruthCofactor0New(unsigned *pOut, unsigned *pIn, int nVars, int iVar)
typedefABC_NAMESPACE_HEADER_START struct Bdc_Fun_t_ Bdc_Fun_t
INCLUDES ///.
static void Bdc_IsfClean(Bdc_Isf_t *p)
#define ABC_NAMESPACE_IMPL_END
static int Kit_TruthCountOnes(unsigned *pIn, int nVars)
void Kit_TruthCofactor1New(unsigned *pOut, unsigned *pIn, int nVars, int iVar)
void Bdc_SuppMinimize(Bdc_Man_t *p, Bdc_Isf_t *pIsf)
static void Kit_TruthNot(unsigned *pOut, unsigned *pIn, int nVars)
static int Kit_TruthIsDisjoint(unsigned *pIn1, unsigned *pIn2, int nVars)
#define ABC_NAMESPACE_IMPL_START
static void Kit_TruthSharp(unsigned *pOut, unsigned *pIn0, unsigned *pIn1, int nVars)
static int Bdc_IsComplement(Bdc_Fun_t *p)
static Bdc_Fun_t * Bdc_FunNew(Bdc_Man_t *p)
int Bdc_DecomposeUpdateRight(Bdc_Man_t *p, Bdc_Isf_t *pIsf, Bdc_Isf_t *pIsfL, Bdc_Isf_t *pIsfR, Bdc_Fun_t *pFunc0, Bdc_Type_t Type)
void Kit_TruthExistNew(unsigned *pRes, unsigned *pTruth, int nVars, int iVar)
unsigned Kit_TruthSupport(unsigned *pTruth, int nVars)
static void Kit_TruthCopy(unsigned *pOut, unsigned *pIn, int nVars)
static Bdc_Fun_t * Bdc_FunWithId(Bdc_Man_t *p, int Id)
int Bdc_DecomposeFindInitialVarSet(Bdc_Man_t *p, Bdc_Isf_t *pIsf, Bdc_Isf_t *pIsfL, Bdc_Isf_t *pIsfR)
int Kit_TruthVarInSupport(unsigned *pTruth, int nVars, int iVar)
static Bdc_Fun_t * Bdc_Not(Bdc_Fun_t *p)
void Kit_TruthForallNew(unsigned *pRes, unsigned *pTruth, int nVars, int iVar)
static int Kit_WordCountOnes(unsigned uWord)
Bdc_Fun_t * Bdc_TableLookup(Bdc_Man_t *p, Bdc_Isf_t *pIsf)
ABC_NAMESPACE_IMPL_START void Bdc_SuppMinimize2(Bdc_Man_t *p, Bdc_Isf_t *pIsf)
DECLARATIONS ///.
static void Bdc_IsfNot(Bdc_Isf_t *p)
static void Bdc_IsfCopy(Bdc_Isf_t *p, Bdc_Isf_t *q)
static Bdc_Fun_t * Bdc_Regular(Bdc_Fun_t *p)
int Bdc_ManNodeVerify(Bdc_Man_t *p, Bdc_Isf_t *pIsf, Bdc_Fun_t *pFunc)
int Bdc_DecomposeWeakOr(Bdc_Man_t *p, Bdc_Isf_t *pIsf, Bdc_Isf_t *pIsfL, Bdc_Isf_t *pIsfR)
static void Kit_TruthOr(unsigned *pOut, unsigned *pIn0, unsigned *pIn1, int nVars)
Bdc_Type_t Bdc_DecomposeStep(Bdc_Man_t *p, Bdc_Isf_t *pIsf, Bdc_Isf_t *pIsfL, Bdc_Isf_t *pIsfR)
static void Bdc_IsfStart(Bdc_Man_t *p, Bdc_Isf_t *pF)