50 for ( i = (
int)pCut->
nLeaves - 1, k = (
int)pCut0->
nLeaves - 1; i >= 0 && k >= 0; i-- )
56 Abc_TtSwapVars( pTruth, nLimit, k, i );
77 word t = *Mpm_CutTruth(
p, Abc_Lit2Var(pCut->
iFunc) );
78 uSupport = Abc_Tt6SupportAndSize( t, Mpm_CutLeafNum(pCut), &nSuppSize );
79 if ( nSuppSize == Mpm_CutLeafNum(pCut) )
81 p->nSmallSupp += (int)(nSuppSize < 2);
83 for ( i = k = 0; i < Mpm_CutLeafNum(pCut); i++ )
85 if ( ((uSupport >> i) & 1) )
90 Abc_TtSwapVars( &t,
p->nLutSize, k, i );
97 assert( nSuppSize == Abc_TtSupportSize(&t, 6) );
99 pCut->
iFunc = Abc_Var2Lit( Vec_MemHashInsert(
p->vTtMem, &t), Abc_LitIsCompl(pCut->
iFunc) );
107 word * pTruth = Mpm_CutTruth(
p, Abc_Lit2Var(pCut->
iFunc) );
108 uSupport = Abc_TtSupportAndSize( pTruth, Mpm_CutLeafNum(pCut), &nSuppSize );
109 if ( nSuppSize == Mpm_CutLeafNum(pCut) )
111 p->nSmallSupp += (int)(nSuppSize < 2);
113 Abc_TtCopy(
p->Truth, pTruth,
p->nTruWords, 0 );
114 for ( i = k = 0; i < Mpm_CutLeafNum(pCut); i++ )
116 if ( ((uSupport >> i) & 1) )
121 Abc_TtSwapVars(
p->Truth,
p->nLutSize, k, i );
127 assert( nSuppSize == Abc_TtSupportSize(
p->Truth, Mpm_CutLeafNum(pCut)) );
130 pCut->
iFunc = Abc_Var2Lit( Vec_MemHashInsert(
p->vTtMem,
p->Truth), Abc_LitIsCompl(pCut->
iFunc) );
147 word * pTruth0 = Mpm_CutTruth(
p, Abc_Lit2Var(pCut0->
iFunc) );
148 word * pTruth1 = Mpm_CutTruth(
p, Abc_Lit2Var(pCut1->
iFunc) );
149 word * pTruthC = NULL;
150 word t0 = (fCompl0 ^ pCut0->
fCompl ^ Abc_LitIsCompl(pCut0->
iFunc)) ? ~*pTruth0 : *pTruth0;
151 word t1 = (fCompl1 ^ pCut1->
fCompl ^ Abc_LitIsCompl(pCut1->
iFunc)) ? ~*pTruth1 : *pTruth1;
153 Mpm_TruthStretch( &t0, pCut, pCut0,
p->nLutSize );
154 Mpm_TruthStretch( &t1, pCut, pCut1,
p->nLutSize );
157 pTruthC = Mpm_CutTruth(
p, Abc_Lit2Var(pCutC->
iFunc) );
158 tC = (fComplC ^ pCutC->
fCompl ^ Abc_LitIsCompl(pCutC->
iFunc)) ? ~*pTruthC : *pTruthC;
159 Mpm_TruthStretch( &tC, pCut, pCutC,
p->nLutSize );
164 else if ( Type == 2 )
166 else if ( Type == 3 )
167 t = (tC & t1) | (~tC & t0);
173 pCut->
iFunc = Abc_Var2Lit( Vec_MemHashInsert(
p->vTtMem, &t ), 1 );
176 pCut->
iFunc = Abc_Var2Lit( Vec_MemHashInsert(
p->vTtMem, &t ), 0 );
177 if (
p->pPars->fCutMin )
178 return Mpm_CutTruthMinimize6(
p, pCut );
183 word * pTruth0 = Mpm_CutTruth(
p, Abc_Lit2Var(pCut0->
iFunc) );
184 word * pTruth1 = Mpm_CutTruth(
p, Abc_Lit2Var(pCut1->
iFunc) );
185 word * pTruthC = NULL;
186 Abc_TtCopy(
p->Truth0, pTruth0,
p->nTruWords, fCompl0 ^ pCut0->
fCompl ^ Abc_LitIsCompl(pCut0->
iFunc) );
187 Abc_TtCopy(
p->Truth1, pTruth1,
p->nTruWords, fCompl1 ^ pCut1->
fCompl ^ Abc_LitIsCompl(pCut1->
iFunc) );
188 Mpm_TruthStretch(
p->Truth0, pCut, pCut0,
p->nLutSize );
189 Mpm_TruthStretch(
p->Truth1, pCut, pCut1,
p->nLutSize );
192 pTruthC = Mpm_CutTruth(
p, Abc_Lit2Var(pCutC->
iFunc) );
193 Abc_TtCopy(
p->TruthC, pTruthC,
p->nTruWords, fComplC ^ pCutC->
fCompl ^ Abc_LitIsCompl(pCutC->
iFunc) );
194 Mpm_TruthStretch(
p->TruthC, pCut, pCutC,
p->nLutSize );
197 Abc_TtAnd(
p->Truth,
p->Truth0,
p->Truth1,
p->nTruWords, 0 );
198 else if ( Type == 2 )
199 Abc_TtXor(
p->Truth,
p->Truth0,
p->Truth1,
p->nTruWords, 0 );
200 else if ( Type == 3 )
201 Abc_TtMux(
p->Truth,
p->TruthC,
p->Truth1,
p->Truth0,
p->nTruWords );
204 if (
p->Truth[0] & 1 )
206 Abc_TtNot(
p->Truth,
p->nTruWords );
207 pCut->
iFunc = Abc_Var2Lit( Vec_MemHashInsert(
p->vTtMem,
p->Truth ), 1 );
210 pCut->
iFunc = Abc_Var2Lit( Vec_MemHashInsert(
p->vTtMem,
p->Truth ), 0 );
211 if (
p->pPars->fCutMin )
212 return Mpm_CutTruthMinimize7(
p, pCut );
218 if (
p->nLutSize <= 6 )
219 RetValue = Mpm_CutComputeTruth6(
p, pCut, pCut0, pCut1, pCutC, fCompl0, fCompl1, fComplC, Type );
221 RetValue = Mpm_CutComputeTruth7(
p, pCut, pCut0, pCut1, pCutC, fCompl0, fCompl1, fComplC, Type );
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
unsigned Abc_TtCanonicize(word *pTruth, int nVars, char *pCanonPerm)
FUNCTION DECLARATIONS ///.
unsigned __int64 word
DECLARATIONS ///.
struct Mpm_Man_t_ Mpm_Man_t
struct Mpm_Cut_t_ Mpm_Cut_t
BASIC TYPES ///.
int Mpm_CutComputeTruth(Mpm_Man_t *p, Mpm_Cut_t *pCut, Mpm_Cut_t *pCut0, Mpm_Cut_t *pCut1, Mpm_Cut_t *pCutC, int fCompl0, int fCompl1, int fComplC, int Type)