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

  Synopsis    [Performs two-way disjunctive decomposition of a BDD.]

  Description [Performs two-way disjunctive decomposition of a BDD
  according to a variable. If <code>f</code> is the function of the
  BDD and <code>x</code> is the variable, the decomposition is
  <code>f*x + f*x'</code>.  The variable is chosen so as to balance
  the sizes of the two disjuncts and to keep them small.  Returns the
  number of disjuncts produced, that is, 2 if successful; 1 if no
  meaningful decomposition was found; 0 otherwise.]

  SideEffects [The two disjuncts are returned in an array as side effects.
  The array is allocated by this function. It is the caller's responsibility
  to free it. On successful completion, the disjuncts are already
  referenced. If the function returns 0, the array for the disjuncts is
  not allocated. If the function returns 1, the only factor equals the
  function to be decomposed.]

  SeeAlso     [Cudd_bddVarConjDecomp Cudd_bddApproxDisjDecomp
  Cudd_bddIterDisjDecomp Cudd_bddGenDisjDecomp]

******************************************************************************/
Function
Synopsis    [Performs two-way disjunctive decomposition of a BDD.]

Description [Performs two-way disjunctive decomposition of a BDD
according to a variable. If f is the function of the
BDD and x is the variable, the decomposition is
f*x + f*x'.  The variable is chosen so as to balance
the sizes of the two disjuncts and to keep them small.  Returns the
number of disjuncts produced, that is, 2 if successful; 1 if no
meaningful decomposition was found; 0 otherwise.]

SideEffects [The two disjuncts are returned in an array as side effects.
The array is allocated by this function. It is the caller's responsibility
to free it. On successful completion, the disjuncts are already
referenced. If the function returns 0, the array for the disjuncts is
not allocated. If the function returns 1, the only factor equals the
function to be decomposed.]


Function Synopsis [ Performs two - way disjunctive decomposition of a BDD . ] Description [ Performs two - way disjunctive decomposition of a BDD according to a variable . If f is the function of the BDD and x is the variable the decomposition is f * x + f * x ' . The variable is chosen so as to balance the sizes of the two disjuncts and to keep them small . Returns the number of disjuncts produced that is 2 if successful ; 1 if no meaningful decomposition was found ; 0 otherwise . ] SideEffects [ The two disjuncts are returned in an array as side effects . The array is allocated by this function . It is the caller ' s responsibility to free it . On successful completion the disjuncts are already referenced . If the function returns 0 the array for the disjuncts is not allocated . If the function returns 1 the only factor equals the function to be decomposed . ]
int
Cudd_bddVarDisjDecomp(
  DdManager * dd ,
  DdNode * f ,
  DdNode *** disjuncts )
{
    int result, i;
    result = Cudd_bddVarConjDecomp(dd,Cudd_Not(f),disjuncts);
    for (i = 0; i < result; i++) {
        (*disjuncts)[i] = Cudd_Not((*disjuncts)[i]);
    }
    return(result);
}
int Cudd_bddVarDisjDecomp ( DdManager * dd , DdNode * f , DdNode * * * disjuncts ) { int result , i ; result = Cudd_bddVarConjDecomp ( dd , Cudd_Not ( f ) , disjuncts ) ; for ( i = 0 ; i < result ; i ++ ) { ( * disjuncts ) [ i ] = Cudd_Not ( ( * disjuncts ) [ i ] ) ; } return ( result ) ; }
Function
Synopsis    [Performs two-way disjunctive decomposition of a BDD.]
Function Synopsis [ Performs two - way disjunctive decomposition of a BDD . ]
/* manager */ /* function to be decomposed */ /* address of the array of the disjuncts */