next up previous index
Next: Acknowledgments Up: The C++ Interface Previous: Compiling and Linking

Basic Manipulation

 

The following fragment of code illustrates some simple operations on BDDs using the C++ interface.

        Cudd mgr(0,0);
        BDD x = mgr.bddVar();
        BDD y = mgr.bddVar();
        BDD f = x * y;
        BDD g = y + !x;
        cout << "f is" << (f <= g ? "" : " not")
             << " less than or equal to g\n";
This code creates a manager called mgr and two variables in it. It then defines two functions f and g in terms of the variables. Finally, it prints a message based on the comparison of the two functions. No explicit referencing or dereferencing is required. The operators are overloaded in the intuitive way. BDDs are freed when execution leaves the scope in which they are defined or when the variables referring to them are overwritten.



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