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

  Synopsis [Computes the positive cofactor of a ZDD w.r.t. a variable.]

  Description [Computes the positive cofactor of a ZDD w.r.t. a
  variable. In terms of combinations, the result is the set of all
  combinations in which the variable is asserted. Returns a pointer to
  the result if successful; NULL otherwise. cuddZddSubset1 performs
  the same function as Cudd_zddSubset1, but does not restart if
  reordering has taken place. Therefore it can be called from within a
  recursive procedure.]

  SideEffects [None]

  SeeAlso     [cuddZddSubset0 Cudd_zddSubset1]

******************************************************************************/
Function
Synopsis [Computes the positive cofactor of a ZDD w.r.t. a variable.]

Description [Computes the positive cofactor of a ZDD w.r.t. a
variable. In terms of combinations, the result is the set of all
combinations in which the variable is asserted. Returns a pointer to
the result if successful; NULL otherwise. cuddZddSubset1 performs
the same function as Cudd_zddSubset1, but does not restart if
reordering has taken place. Therefore it can be called from within a
recursive procedure.]




Function Synopsis [ Computes the positive cofactor of a ZDD w . r . t . a variable . ] Description [ Computes the positive cofactor of a ZDD w . r . t . a variable . In terms of combinations the result is the set of all combinations in which the variable is asserted . Returns a pointer to the result if successful ; NULL otherwise . cuddZddSubset1 performs the same function as Cudd_zddSubset1 but does not restart if reordering has taken place . Therefore it can be called from within a recursive procedure . ]
DdNode *
cuddZddSubset1(
  DdManager * dd,
  DdNode * P,
  int  var)
{
    DdNode      *zvar, *r;
    DdNode      *base, *empty;
    base = DD_ONE(dd);
    empty = DD_ZERO(dd);
    zvar = cuddUniqueInterZdd(dd, var, base, empty);
    if (zvar == NULL) {
        return(NULL);
    } else {
        cuddRef(zvar);
        r = zdd_subset1_aux(dd, P, zvar);
        if (r == NULL) {
            Cudd_RecursiveDerefZdd(dd, zvar);
            return(NULL);
        }
        cuddRef(r);
        Cudd_RecursiveDerefZdd(dd, zvar);
    }
    cuddDeref(r);
    return(r);
}
DdNode * cuddZddSubset1 ( DdManager * dd , DdNode * P , int var ) { DdNode * zvar , * r ; DdNode * base , * empty ; base = DD_ONE ( dd ) ; empty = DD_ZERO ( dd ) ; zvar = cuddUniqueInterZdd ( dd , var , base , empty ) ; if ( zvar == NULL ) { return ( NULL ) ; } else { cuddRef ( zvar ) ; r = zdd_subset1_aux ( dd , P , zvar ) ; if ( r == NULL ) { Cudd_RecursiveDerefZdd ( dd , zvar ) ; return ( NULL ) ; } cuddRef ( r ) ; Cudd_RecursiveDerefZdd ( dd , zvar ) ; } cuddDeref ( r ) ; return ( r ) ; }
Function
Synopsis [Computes the positive cofactor of a ZDD w.r.t.
Function Synopsis [ Computes the positive cofactor of a ZDD w . r . t .