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

  Synopsis [Substitutes a variable with its complement in a ZDD.]

  Description [Substitutes a variable with its complement in a ZDD.
  returns a pointer to the result if successful; NULL
  otherwise. cuddZddChange performs the same function as
  Cudd_zddChange, but does not restart if reordering has taken
  place. Therefore it can be called from within a recursive
  procedure.]

  SideEffects [None]

  SeeAlso     [Cudd_zddChange]

******************************************************************************/
Function
Synopsis [Substitutes a variable with its complement in a ZDD.]

Description [Substitutes a variable with its complement in a ZDD.
returns a pointer to the result if successful; NULL
otherwise. cuddZddChange performs the same function as
Cudd_zddChange, but does not restart if reordering has taken
place. Therefore it can be called from within a recursive
procedure.]




Function Synopsis [ Substitutes a variable with its complement in a ZDD . ] Description [ Substitutes a variable with its complement in a ZDD . returns a pointer to the result if successful ; NULL otherwise . cuddZddChange performs the same function as Cudd_zddChange but does not restart if reordering has taken place . Therefore it can be called from within a recursive procedure . ]
DdNode *
cuddZddChange(
  DdManager * dd,
  DdNode * P,
  int  var)
{
    DdNode      *zvar, *res;
    zvar = cuddUniqueInterZdd(dd, var, DD_ONE(dd), DD_ZERO(dd));
    if (zvar == NULL) return(NULL);
    cuddRef(zvar);
    res = cuddZddChangeAux(dd, P, zvar);
    if (res == NULL) {
        Cudd_RecursiveDerefZdd(dd,zvar);
        return(NULL);
    }
    cuddRef(res);
    Cudd_RecursiveDerefZdd(dd,zvar);
    cuddDeref(res);
    return(res);
}
DdNode * cuddZddChange ( DdManager * dd , DdNode * P , int var ) { DdNode * zvar , * res ; zvar = cuddUniqueInterZdd ( dd , var , DD_ONE ( dd ) , DD_ZERO ( dd ) ) ; if ( zvar == NULL ) return ( NULL ) ; cuddRef ( zvar ) ; res = cuddZddChangeAux ( dd , P , zvar ) ; if ( res == NULL ) { Cudd_RecursiveDerefZdd ( dd , zvar ) ; return ( NULL ) ; } cuddRef ( res ) ; Cudd_RecursiveDerefZdd ( dd , zvar ) ; cuddDeref ( res ) ; return ( res ) ; }
Function
Synopsis [Substitutes a variable with its complement in a ZDD.]
Function Synopsis [ Substitutes a variable with its complement in a ZDD . ]