Keywords: cuddIntro

Next: Basic BDD Manipulation Up: User's Manual Previous: Constant Functions

## Creating Variables

Decision diagrams are typically created by combining simpler decision diagrams. The simplest decision diagrams, of course, cannot be created in that way. Constant functions have been discussed in Section 3.5. In this section we discuss the simple variable functions, also known as projection functions.

### New BDD and ADD Variables

The projection functions are distinct for BDDs and ADDs. A projection function for BDDs consists of an internal node with both outgoing arcs pointing to the constant 1. The else arc is complemented.

An ADD projection function, on the other hand, has the else pointer directed to the arithmetic zero function. One should never mix the two types of variables. BDD variables should be used when manipulating BDDs, and ADD variables should be used when manipulating ADDs. Three functions are provided to create BDD variables:

- Cudd_bddIthVar : Returns the projection function with index i. If the function does not exist, it is created.
- Cudd_bddNewVar : Returns a new projection function, whose index is the largest index in use at the time of the call, plus 1.
- Cudd_bddNewVarAtLevel : Similar to Cudd_bddNewVar . In addition it allows to specify the position in the variable order at which the new variable should be inserted. By contrast, Cudd_bddNewVar adds the new variable at the end of the order.

The analogous functions for ADDs are Cudd_addIthVar , Cudd_addNewVar , and Cudd_addNewVarAtLevel .

### New ZDD Variables

Unlike the projection functions of BDDs and ADDs, the projection functions of ZDDs have diagrams with n+1 nodes, where n is the number of variables. Therefore the ZDDs of the projection functions change when new variables are added. This will be discussed in Section 3.9. Here we assume that the number of variables is fixed. The ZDD of the i-th projection function is returned by Cudd_zddIthVar .

Next: Basic BDD Manipulation Up: User's Manual Previous: Constant Functions