abc/src/opt/dau/dauDsd.c
// look for MUX-decomposable variable on top or at the bottom
look for MUX-decomposable variable on top or at the bottom
look for MUX - decomposable variable on top or at the bottom
static inline int Dau_DsdDecomposeTripleVarsOuter( Dau_Dsd_t * p, word  * pTruth, int * pVars, int nVars, int v )
{
    extern int Dau_DsdDecomposeInt( Dau_Dsd_t * p, word * pTruth, int nVarsInit );
    Dau_Dsd_t P1, * p1 = &P1;
    word pTtCof[2][DAU_MAX_WORD];
    int nWords = Abc_TtWordNum(nVars);
    p1->fSplitPrime = 0;
    p1->fWriteTruth = p->fWriteTruth;
    ABC_SWAP( int, pVars[v], pVars[nVars-1] );
    Abc_TtSwapVars( pTruth, nVars, v, nVars-1 );
    Abc_TtCofactor0p( pTtCof[0], pTruth, nWords, nVars - 1 );
    Abc_TtCofactor1p( pTtCof[1], pTruth, nWords, nVars - 1 );
    Dau_DsdWriteString( p, "<" );
    Dau_DsdWriteVar( p, pVars[nVars - 1], 0 );
    Dau_DsdDecomposeInt( p1, pTtCof[1], nVars - 1 );
    Dau_DsdTranslate( p, pVars, nVars - 1, p1->pOutput );
    p->nSizeNonDec = p1->nSizeNonDec;
    if ( p1->nSizeNonDec )
        Abc_TtCopy( pTruth, pTtCof[1], Abc_TtWordNum(p1->nSizeNonDec), 0 );
    Dau_DsdDecomposeInt( p1, pTtCof[0], nVars - 1 );
    Dau_DsdTranslate( p, pVars, nVars - 1, p1->pOutput );
    Dau_DsdWriteString( p, ">" );
    p->nSizeNonDec = Abc_MaxInt( p->nSizeNonDec, p1->nSizeNonDec );
    if ( p1->nSizeNonDec )
        Abc_TtCopy( pTruth, pTtCof[0], Abc_TtWordNum(p1->nSizeNonDec), 0 );
    return 0;
}
static inline int Dau_DsdDecomposeTripleVarsOuter ( Dau_Dsd_t * p , word * pTruth , int * pVars , int nVars , int v ) { extern int Dau_DsdDecomposeInt ( Dau_Dsd_t * p , word * pTruth , int nVarsInit ) ; Dau_Dsd_t P1 , * p1 = & P1 ; word pTtCof [ 2 ] [ DAU_MAX_WORD ] ; int nWords = Abc_TtWordNum ( nVars ) ; p1 -> fSplitPrime = 0 ; p1 -> fWriteTruth = p -> fWriteTruth ; ABC_SWAP ( int , pVars [ v ] , pVars [ nVars - 1 ] ) ; Abc_TtSwapVars ( pTruth , nVars , v , nVars - 1 ) ; Abc_TtCofactor0p ( pTtCof [ 0 ] , pTruth , nWords , nVars - 1 ) ; Abc_TtCofactor1p ( pTtCof [ 1 ] , pTruth , nWords , nVars - 1 ) ; Dau_DsdWriteString ( p , " " ) ; Dau_DsdWriteVar ( p , pVars [ nVars - 1 ] , 0 ) ; Dau_DsdDecomposeInt ( p1 , pTtCof [ 1 ] , nVars - 1 ) ; Dau_DsdTranslate ( p , pVars , nVars - 1 , p1 -> pOutput ) ; p -> nSizeNonDec = p1 -> nSizeNonDec ; if ( p1 -> nSizeNonDec ) Abc_TtCopy ( pTruth , pTtCof [ 1 ] , Abc_TtWordNum ( p1 -> nSizeNonDec ) , 0 ) ; Dau_DsdDecomposeInt ( p1 , pTtCof [ 0 ] , nVars - 1 ) ; Dau_DsdTranslate ( p , pVars , nVars - 1 , p1 -> pOutput ) ; Dau_DsdWriteString ( p , " " ) ; p -> nSizeNonDec = Abc_MaxInt ( p -> nSizeNonDec , p1 -> nSizeNonDec ) ; if ( p1 -> nSizeNonDec ) Abc_TtCopy ( pTruth , pTtCof [ 0 ] , Abc_TtWordNum ( p1 -> nSizeNonDec ) , 0 ) ; return 0 ; }
look for MUX-decomposable variable on top or at the bottom
look for MUX - decomposable variable on top or at the bottom
// move this variable to the top // cofactor w.r.t the last variable //    tCof0 = Abc_Tt6Cofactor0( pTruth[0], nVars - 1 ); //    tCof1 = Abc_Tt6Cofactor1( pTruth[0], nVars - 1 ); // compose the result // split decomposition // split decomposition