abc/src/misc/util/utilTruth.h
// detect simple case of decomposition with topmost AND gate
detect simple case of decomposition with topmost AND gate
detect simple case of decomposition with topmost AND gate
static inline int Abc_TtCheckBiDecSimple( word * pTruth, int nVars, int nSuppLim )
{
    word Cof0[64], Cof1[64]; 
    int v, Res = 0, nDecVars = 0, nWords = Abc_TtWordNum(nVars);
    for ( v = 0; v < nVars; v++ )
    {
        Abc_TtCofactor0p( Cof0, pTruth, nWords, v );
        Abc_TtCofactor1p( Cof1, pTruth, nWords, v );
        if ( !Abc_TtIsConst0(Cof0, nWords) && !Abc_TtIsConst0(Cof1, nWords) )
            continue;
        nDecVars++;
        Res |= 1 << v;
        if ( nDecVars >= nVars - nSuppLim )
            return ((Res ^ (int)Abc_Tt6Mask(nVars)) << 16) | Res;
    }
    return 0;
}
static inline int Abc_TtCheckBiDecSimple ( word * pTruth , int nVars , int nSuppLim ) { word Cof0 [ 64 ] , Cof1 [ 64 ] ; int v , Res = 0 , nDecVars = 0 , nWords = Abc_TtWordNum ( nVars ) ; for ( v = 0 ; v < nVars ; v ++ ) { Abc_TtCofactor0p ( Cof0 , pTruth , nWords , v ) ; Abc_TtCofactor1p ( Cof1 , pTruth , nWords , v ) ; if ( ! Abc_TtIsConst0 ( Cof0 , nWords ) && ! Abc_TtIsConst0 ( Cof1 , nWords ) ) continue ; nDecVars ++ ; Res |= 1 << v ; if ( nDecVars >= nVars - nSuppLim ) return ( ( Res ^ ( int ) Abc_Tt6Mask ( nVars ) ) << 16 ) | Res ; } return 0 ; }
detect simple case of decomposition with topmost AND gate
detect simple case of decomposition with topmost AND gate