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

  Synopsis    [Checks whether g is the BDD of a cube.]

  Description [Checks whether g is the BDD of a cube. Returns 1 in case
  of success; 0 otherwise. The constant 1 is a valid cube, but all other
  constant functions cause cuddCheckCube to return 0.]

  SideEffects [None]

  SeeAlso     []

******************************************************************************/
Function
Synopsis    [Checks whether g is the BDD of a cube.]

Description [Checks whether g is the BDD of a cube. Returns 1 in case
of success; 0 otherwise. The constant 1 is a valid cube, but all other
constant functions cause cuddCheckCube to return 0.]




Function Synopsis [ Checks whether g is the BDD of a cube . ] Description [ Checks whether g is the BDD of a cube . Returns 1 in case of success ; 0 otherwise . The constant 1 is a valid cube but all other constant functions cause cuddCheckCube to return 0 . ]
int
cuddCheckCube(
  DdManager * dd,
  DdNode * g)
{
    DdNode *g1,*g0,*one,*zero;
    one = DD_ONE(dd);
    if (g == one) return(1);
    if (Cudd_IsConstant(g)) return(0);
    zero = Cudd_Not(one);
    cuddGetBranches(g,&g1,&g0);
    if (g0 == zero) {
        return(cuddCheckCube(dd, g1));
    }
    if (g1 == zero) {
        return(cuddCheckCube(dd, g0));
    }
    return(0);
}
int cuddCheckCube ( DdManager * dd , DdNode * g ) { DdNode * g1 , * g0 , * one , * zero ; one = DD_ONE ( dd ) ; if ( g == one ) return ( 1 ) ; if ( Cudd_IsConstant ( g ) ) return ( 0 ) ; zero = Cudd_Not ( one ) ; cuddGetBranches ( g , & g1 , & g0 ) ; if ( g0 == zero ) { return ( cuddCheckCube ( dd , g1 ) ) ; } if ( g1 == zero ) { return ( cuddCheckCube ( dd , g0 ) ) ; } return ( 0 ) ; }
Function
Synopsis    [Checks whether g is the BDD of a cube.]
Function Synopsis [ Checks whether g is the BDD of a cube . ]