next up previous index
Next: Basic ADD Manipulation Up: User's Manual Previous: Creating Variables

Basic BDD Manipulation

  

Common manipulations of BDDs can be accomplished by calling Cudd_bddIte. This function takes three BDDs, f, g, and h, as arguments and computes tex2html_wrap_inline2286. Like all the functions that create new BDDs or ADDs, Cudd_bddIte  returns a result that must be explicitly referenced by the caller. Cudd_bddIte can be used to implement all two-argument boolean functions. However, the package also provides Cudd_bddAnd  as well as the other two-operand boolean functions, which are slightly more efficient when a two-operand function is called for. The following fragment of code illustrates how to build the BDD for the function tex2html_wrap_inline2288.

        DdManager *manager;
        DdNode *f, *var, *tmp;
        int i;

        ...

        f = Cudd_ReadOne(manager);
        Cudd_Ref(f);
        for (i = 3; i >= 0; i--) {
            var = Cudd_bddIthVar(manager,i);
            tmp = Cudd_bddAnd(manager,Cudd_Not(var),f);
            Cudd_Ref(tmp);
            Cudd_RecursiveDeref(manager,f);
            f = tmp;
        }
This example illustrates the following points:
next up previous index
Next: Basic ADD Manipulation Up: User's Manual Previous: Creating Variables

Fabio Somenzi
Tue May 12 18:47:58 MDT 1998