abc/src/bdd/cudd/cuddBddIte.c
/**Function********************************************************************

  Synopsis [Picks unique member from equiv expressions.]

  Description [Makes sure the first two pointers are regular.  This
  mat require the complementation of the result, which is signaled by
  returning 1 instead of 0.  This function is simpler than the general
  case because it assumes that no two arguments are the same or
  complementary, and no argument is constant.]

  SideEffects [None]

  SeeAlso     [bddVarToConst bddVarToCanonical]

******************************************************************************/
Function
Synopsis [Picks unique member from equiv expressions.]

Description [Makes sure the first two pointers are regular.  This
mat require the complementation of the result, which is signaled by
returning 1 instead of 0.  This function is simpler than the general
case because it assumes that no two arguments are the same or
complementary, and no argument is constant.]




Function Synopsis [ Picks unique member from equiv expressions . ] Description [ Makes sure the first two pointers are regular . This mat require the complementation of the result which is signaled by returning 1 instead of 0 . This function is simpler than the general case because it assumes that no two arguments are the same or complementary and no argument is constant . ]
static int
bddVarToCanonicalSimple(
  DdManager * dd,
  DdNode ** fp,
  DdNode ** gp,
  DdNode ** hp,
  unsigned int * topfp,
  unsigned int * topgp,
  unsigned int * tophp)
{
    register DdNode             *r, *f, *g, *h;
    int                         comple, change;
    f = *fp;
    g = *gp;
    h = *hp;
    change = 0;
    if (Cudd_IsComplement(f)) { 
        f = Cudd_Not(f);
        r = g;
        g = h;
        h = r;
        change = 1;
    }
    comple = 0;
    if (Cudd_IsComplement(g)) { 
        g = Cudd_Not(g);
        h = Cudd_Not(h);
        change = 1;
        comple = 1;
    }
    if (change) {
        *fp = f;
        *gp = g;
        *hp = h;
    }
    *topfp = dd->perm[f->index];
    *topgp = dd->perm[g->index];
    *tophp = dd->perm[Cudd_Regular(h)->index];
    return(comple);
}
static int bddVarToCanonicalSimple ( DdManager * dd , DdNode * * fp , DdNode * * gp , DdNode * * hp , unsigned int * topfp , unsigned int * topgp , unsigned int * tophp ) { register DdNode * r , * f , * g , * h ; int comple , change ; f = * fp ; g = * gp ; h = * hp ; change = 0 ; if ( Cudd_IsComplement ( f ) ) { f = Cudd_Not ( f ) ; r = g ; g = h ; h = r ; change = 1 ; } comple = 0 ; if ( Cudd_IsComplement ( g ) ) { g = Cudd_Not ( g ) ; h = Cudd_Not ( h ) ; change = 1 ; comple = 1 ; } if ( change ) { * fp = f ; * gp = g ; * hp = h ; } * topfp = dd -> perm [ f -> index ] ; * topgp = dd -> perm [ g -> index ] ; * tophp = dd -> perm [ Cudd_Regular ( h ) -> index ] ; return ( comple ) ; }
Function
Synopsis [Picks unique member from equiv expressions.]
Function Synopsis [ Picks unique member from equiv expressions . ]
/* adjust pointers so that the first 2 arguments to ITE are regular */ /* ITE(!F,G,H) = ITE(F,H,G) */ /* ITE(F,!G,H) = !ITE(F,G,!H) */ /* Here we can skip the use of cuddI, because the operands are known
    ** to be non-constant.
    */