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

  Synopsis [Replaces variables with constants if possible.]

  Description [This function performs part of the transformation to
  standard form by replacing variables with constants if possible.]

  SideEffects [None]

  SeeAlso     [bddVarToCanonical bddVarToCanonicalSimple]

******************************************************************************/
Function
Synopsis [Replaces variables with constants if possible.]

Description [This function performs part of the transformation to
standard form by replacing variables with constants if possible.]




Function Synopsis [ Replaces variables with constants if possible . ] Description [ This function performs part of the transformation to standard form by replacing variables with constants if possible . ]
static void
bddVarToConst(
  DdNode * f,
  DdNode ** gp,
  DdNode ** hp,
  DdNode * one)
{
    DdNode *g = *gp;
    DdNode *h = *hp;
    if (f == g) {    
        *gp = one;
    } else if (f == Cudd_Not(g)) {    
        *gp = Cudd_Not(one);
    }
    if (f == h) {    
        *hp = Cudd_Not(one);
    } else if (f == Cudd_Not(h)) {    
        *hp = one;
    }
}
static void bddVarToConst ( DdNode * f , DdNode * * gp , DdNode * * hp , DdNode * one ) { DdNode * g = * gp ; DdNode * h = * hp ; if ( f == g ) { * gp = one ; } else if ( f == Cudd_Not ( g ) ) { * gp = Cudd_Not ( one ) ; } if ( f == h ) { * hp = Cudd_Not ( one ) ; } else if ( f == Cudd_Not ( h ) ) { * hp = one ; } }
Function
Synopsis [Replaces variables with constants if possible.]
Function Synopsis [ Replaces variables with constants if possible . ]
/* ITE(F,F,H) = ITE(F,1,H) = F + H */ /* ITE(F,!F,H) = ITE(F,0,H) = !F * H */ /* ITE(F,G,F) = ITE(F,G,0) = F * G */ /* ITE(F,G,!F) = ITE(F,G,1) = !F + G */