US 20020078431 A1 Abstract CFLOBDDs are a new compressed representation of functions over Boolean-valued arguments. They provide an alternative to the now-standard representation provided by Ordered Binary Decision Diagrams (OBDDs) and Multi-Terminal Binary Decision Diagrams (MTBDDs) (also known as Algebraic Decision Diagrams (ADDs)). CFLOBDDs share many of the good properties of OBDDs and MTBDDs, but can lead to data structures of drastically smaller size—exponentially smaller than OBDDs and MTBDDs, in fact. That is, OBDDs and MTBDDs are data structures that—in the best case—yield an exponential reduction in the size of the representation of a function (i.e., compared with the size of the decision tree for the function). In contrast, a CFLOBDD—again, in the best case—yields a doubly exponential reduction in the size of the representation of a function. Obviously, not every function has such a highly compressed representation, but the potential advantage of CFLOBDDs over OBDDs and MTBDDs is that they can allow data (e.g., functions, matrices, graphs, relations, circuits, signals, etc.) to be stored in a much more compressed fashion. Application areas include, but are not limited to:
analysis, synthesis, optimization, simulation, test generation, timing analysis, and verification of hardware systems
analysis and verification of software systems use as a runtime data structure in software application programs
data compression and transmission of data in compressed form
spectral analysis and signal processing
use as a runtime data structure in solvers for integer-programming, network-flow, and genetic-programming problems In such applications, CFLOBDDs have the potential to
permit problems to be solved much faster, and
allow much larger problems to be attacked than has previously been possible.
Claims(3) 1 A method of organizing blocks of memory in a digital computer so as implement an associative memory that, for a given set of Boolean variables, maps Boolean-variable-to-Boolean-value assignments to values stored in the computer memory. Blocks of memory represent instances of class CFLOBDD (CFLOBDDs) and instances of class Grouping (proto-CFLOBDDs) according to the class definitions given in FIG. 12 and Structural Invariants 1-5. The method comprises the following steps:
a. The blocks of memory are connected to form a structure that represents a hierarchically structured graph in which each matched path through the structure (i) corresponds to a unique Boolean-variable-to-Boolean-value assignment, and (ii) leads to an element of the computer memory in which is stored the piece of information associated with that Boolean-variable-to-Boolean-value assignment.
2 The method of a. Create a decision tree that represents the information to be stored in the associative memory, and whose height is an integral power of 2
b. Apply Algorithm
1 to form a multi-terminal CFLOBDD representation in memory. 3 A method for representing groupings and proto-CFLOBDDs in the memory of a computer so that equality of proto-CFLOBDDs can be tested in constant time, comprising the following steps:
a. Allocate a table in which to store the unique representatives of valles of type Grouping.
b. Use the table to perform memoization during operations that construct values of type Grouping in the computer memory, so that only a single representative is ever constructed for each value of type Grouping.
c. Determine whether two values of type Grouping are equal (and hence whether two proto-CFLOBDDs are equal) by testing whether their addresses in the computer memory are equal.
Description [0001] The present invention relates to the creation and manipulation of structures that can be used to represent and store certain kinds of information in a highly compressed fashion in the memory of a computer. [0002] analysis, synthesis, optimization, simulation, test generation, timing analysis, and verification of hardware systems [0003] analysis and verification of software systems [0004] use as a runtime data structure in software application programs [0005] data compression and transmission of data in compressed form [0006] spectral analysis and signal processing [0007] use as a runtime data structure in solvers for integer-programming, network-flow, and genetic-programming problems [0008] A great many tasks that are performed during the design, creation, analysis, validation, and verification of hardware and software systems—as well as in many other application areas—either directly involve operations on functions over Boolean arguments, or can be cast as operations on functions of that form that, encode the actual structures of interest. Examples of tasks in which such operations prove useful include: analysis, synthesis, optimization, simulation, test generation, timing analysis as part of computer-aided design of logic circuits; spectral analysis and signal processing; verification of digital hardware and/or software (using a variety of different approaches); and static analysis of computer programs. [0009] To take just one example, consider one of the success stories of the last fifteen years in the detection of logical errors in hardware and software systems, namely, the development of the verification method called temporal logic model checking [CGP99], which was first formulated independently by Clarke and Emerson [CE81] and Quielle and Sifakis [QS81]. Model checking involves the use of logic to verify that such systems behave as they are supposed to, or, alternatively, to identify errors in such systems. In this approach, specifications of desired properties are expressed using a propositional temporal logic (e.g., LTL, CTL, CTL [0010] The great innovation in model checking (due to Ken McMillan, c. 1990 [McM93]) was the recognition that the necessary Boolean operations could be done indirectly (i.e., symbolically) using Ordered Binary Decision Diagrams (OBDDs) [Bry86, BRB90, Weg00] to represent the structures that arise in the fixed-point-finding computation. That is, transition relations, sets of states, etc. are all encoded as Boolean functions; the Boolean functions are represented in compressed form as OBDD data structures; and all necessary manipulations of these Boolean functions are carried out using algorithms that operate on OBDDs. [0011] Whereas methods based on explicit enumeration of states are limited to systems with at most 10 [0012] OBDDS [0013] Roughly speaking, an OBDD is a data structure that—in the best case—yields an exponential reduction in the size of the representation of a Boolean function (i.e., compared with the size of the decision tree for the function). FIG. 1( _{1} T]), one works down from the root of the tree. Each ply of the tree handles the next variable in the ordering: The convention that we will follow in all of our diagrams is that one proceeds to the left if the variable has the value F; one proceeds to the right if the variable has the value T. The pointer at the leaf takes you to the value of the function on this assignment of input values.
[0014] An OBDD is a folded version of the binary decision tree in which substructures are shared as much as possible, which turns the tree into a directed acyclic graph (DAG). Evaluation of an OBDD is carried out in the same fashion as in the binary decision tree, but now one follows a path in the DAG. [0015] When people speak of “BDDs” or “OBDDs” they often mean “Reduced OBDDs” (ROBDDs) [Bry86, BRB90]. In ROBDDs, an additional reduction transformation is performed, in which “don't-care” vertices are removed. For instance, the OBDD shown in FIG. 1( [0016] MTBDDS [0017] Multi-Terminal Binary Decision Diagrams (MTBDDs) [CMZ [0018] OBDDs and MTBDDs will be collectively referred to as BDDs when the distinction is unimportant. [0019] REPRESENTING MATRICES WITH BDDS [0020] Boolean matrices can be represented using OBDDs [Bry92]; non-Boolean matrices can be represented using MTBDDs [CMZ [0021] Note that the indices of elements of matrices represented in this way start at 0; for example, the upper-left corner element of a matrix M is M(0, 0): When n=2, M(0, 0) corresponds to the value associated with the assignment [x _{1} F, y_{0} F, y_{1} F].
[0022] It is often convenient to use either the interleaved ordering for the plies of the BDD—i.e., the order of the Boolean variables is chosen to be x [0023] One nice property of the interleaved variable ordering is that, as we work through each pair of variables in an assignment, we arrive at a node of the OBDD that represents a sub-block of the full matrix. For instance, suppose that we have a Boolean matrix whose entries are defined by the function λx _{0 })V(x_{1} y_{1}), as shown below:
[0024] Under the interleaved variable ordering—x _{0} T] corresponds to the upper right-hand block.
[0025] If we were to evaluate the 16 possible assignments in lexicographic order, i.e., in the order
[0026] then we would step through the array elements in the order shown below:
[0027] LIMITATIONS [0028] While there have been numerous successes obtained by means of BDDs (and BDD variants [SF96]) on a wide class of problems, there are limitations. For instance, the use of BDDs for problems such as model checking, equivalence checking for combinational circuits, and tautology checking seems to be limited to problems where the functions involve at most a few hundred Booleanl-valued arguments. [0029] The present invention concerns a new structure—and associated algorithms—for creating, storing, organizing, and manipulating certain kinds of information in a computer memory. In particular, this invention provides new ways for representing and manipulating functions over Boolean-valued arguments (as well as other related kinds of information, such as matrices, graphs, relations, circuits, signals, etc.), and serves as an alternative to BDDs. Wve call these structures CFLOBDDs. As with BDDs, there are Boolean-valued and multi-terminal variants of CFLOBDDs. We will use “CFLOBDD” to refer to both kinds of structures generically, “Boolean-valued CFLOBDDs” when we wish to stress that the structure under discussion represents a Boolean-valued function, and “multi-terminal CFLOBDDs” when we wish to stress the possibly non-Boolean nature of the values stored in the structure under discussion. [0030] CFLOBDDs share many of the same good properties that BDDs possess, for instance, [0031] One can perform many kinds of interesting operations directly on the data structure, without having to build the full decision tree. [0032] Like BDDs, CFLOBDDs provide a canonical form for functions over Boolean-valued arguments, which means that standard techniques can be used to enforce the invariant that only a single representative is ever constructed for each different CFLOBDD value. This allows a test of whether two CFLOBDDs represent equal functions to be performed by comparing two pointers. [0033] However, CFLOBDDs can lead to data structures of drastically smaller size than BDDs—exponentially smaller than BDDs, in fact. Among the objects that can be encoded in doubly-exponential compressed form using CFLOBDDs are projection functions, step functions, and integer matrices for some of the recursively defined spectral transforms, such as the Reed-Muller transform, the inverse Reed-Muller transform, the Walsh transform, and the Boolean Haar Wavelet transform [HMM85]. [0034] The bottom line is that this invention has the potential to [0035] permit data (e.g., functions, matrices, graphs, relations, circuits, signals, etc.) to be stored in a much more compressed fashion, [0036] permit applications to be performed much faster, and [0037] allow much larger problems to be attacked than has previously been possible. [0038] Moreover, CFLOBDDs are a plug-compatible replacement for BDDs: A set of subroutines that program a digital computer to implement these techniques can serve as a replacement component for the analogous components that, using different and less efficient methods, serve the same purpose in present-day systems. Thus, BDD-based applications should be able to exploit the advantages of CFLOBDDs with minimal reprogramming effort. Consequently, some of the possible application areas for CFLOBDDs include the ones in which BDDs have been previously applied with some success, which include [0039] analysis, synthesis, optimization, simulation, test generation, timing analysis, and verification of hardware systems [0040] analysis and verification of software systems [0041] use as a runtime data structure in software application programs [0042] data compression and transmission of data in compressed form [0043] spectral analysis and signal processing [0044] use as a runtime data structure in solvers for integer-programming, network-flow, and genetic-programming [0045] However, the present invention provides a generally useful method for creating, storing, organizing, and manipulating certain kinds of information in a computer memory, and its use is not limited to just the applications listed above. [0046] FIG. I compares the OBDD and CFLOBDD for the two-input function λx _{1} T] is shown in bold.
[0047]FIG. 2 illustrates matched paths in a CFLOBDD. [0048]FIG. 3 shows an OBDD and a CFLOBDD for the two-input function λx _{1}. In each of
[0049] FIGS. _{1} T] is shown in bold.
[0050]FIG. 4 shows fully expanded and folded CFLOBDDs for the four-input Boolean function λx _{1})V(x_{2} x_{3}).
[0051]FIG. 5 shows a multi-terminal CFLOBDD that represents a function that maps Boolean arguments to the set {a, b, c}. [0052]FIG. 6 illustrates how a CFLOBDD relates to the corresponding decision tree for a more complicated example. FIG. 6( [0053]FIG. 7 shows the unique single-entry/single-exit (or “no-distinction”) proto-CFLOBDDs of levels 0, 1, and 2, and also illustrates the structure of a no-distinction proto-CFLOBDD for arbitrary level k. [0054]FIG. 8 illustrates an invariant on the representation that must be maintained for CFLOBDDs to provide a canonical representation of functions over Boolean-valued arguments. [0055]FIG. 9 illustrates the four cases that arise in the proof of Proposition 1. [0056]FIGS. 10 and 11 illustrate the steps taken when folding a decision tree into a CFLOBDD, and when unfolding a CFLOBDD to create the corresponding decision tree. [0057]FIG. 12 defines the classes used for representing CFLOBDDs in a computer's memory. [0058]FIG. 13 explains the SETL-based notation [Dew79, SDDS87] used for expressing the CFLOBDD algorithms [0059]FIG. 14 shows how the CFLOBDD from FIG. 4( [0060]FIG. 15 presents pseudo-code for constructing no-distinction proto-CFLOBDDs. [0061]FIG. 16 illustrates the structure of the CFLOBDDs that represent projection functions of the form λx [0062]FIG. 18 illustrates the structure of decision trees that represent step functions of the form
[0063] where i ranges from 0 to 2 [0064]FIG. 20 presents an algorithm that applies in the special situation in which a CFLOBDD maps Boolean-variable-to-Boolean-value assignments to just two possible values; the algorithm flips the two values. In the case of Boolean-valued CFLOBDDs, this operation can be used to implement the Not operation in an efficient manner. [0065]FIG. 21 presents an algorithm that applies to any CFLOBDD that maps Boolean-variable-to-Boolean-value assignments to values on which multiplication by a scalar value is defined. [0066]FIGS. 22, 23, [0067]FIG. 28 shows how to use the ternary ITE operation to implement all 16 of the binary Boolean-valued operations. [0068]FIG. 29 illustrates how the Kronecker product of two matrices can be represented using CFLOBDDs. [0069]FIGS. 30, 32, and [0070]FIGS. 36, 37, [0071]FIG. 42 presents pseudo-code for an efficient way to uncompress a multi-terminal CFLOBDD to recover the sequence of values that would label, in left-to-right order, the leaves of the corresponding decision tree. [0072] CFLOBDDs can be considered to be a variant of BDDs in which further folding is performed on the graph. The folding principle is somewhat subtle, because BDDs are DAGs, and folding a DAG leads to cyclic graphs—and hence an infinite number of paths. (This phenomenon does not occur in FIG. 1, but we will start to see CFLOBDDs that contain cycles when we discuss FIGS. 3 and 4.) [0073] The circles and ovals show groupings of vertices into levels: In FIGS. [0074] At this point, it is convenient to introduce some terminology to refer to the individual components of CFLOBDDs and groupings within CFLOBDDs (see FIG. 1( [0075] The vertex positioned at the top of each grouping is called the grouping's entry vertex. [0076] The collection of vertices positioned at the middle of each grouping at level 1 or higher is called the grouping's middle vertices. We assume that a grouping's middle vertices are arranged in some fixed known order (e.g., they can be stored in an array). [0077] The collection of vertices positioned at the bottom of each grouping is called the grouping's exit vertices. We assume that a grouping's exit vertices are arranged in some fixed known order (e.g., they can be stored in an array). [0078] The edge that emanates from the entry vertex of a level-i grouping g and leads to a level i-1 grouping is called g's A-connection. [0079] An edge that emanates from a middle vertex of a level-i grouping g and leads to a level i-1 grouping is called a B-connection of g. [0080] The edges that emanate from the exit vertices of a level i-1 grouping and lead back to a level i grouping are called return edges. [0081] The edges that emanate from the exit vertices of the highest-level grouping and lead to a value are called value edges. In the case of a Boolean-valued CFLOBDD, the highest-level grouping has at most two exit vertices, and these are mapped uniquely to {F,T} (cf. FIGS. [0082] In all cases, it is the entry vertex of a level-0 grouping that corresponds to a decision point in the corresponding decision tree. There are only two possible types of level-0 groupings: [0083] A level-0 grouping like the one reached via the A-connection in FIG. 1( [0084] A level-0 grouping like the one reached via the B-connections in FIG. 1( [0085]FIG. 1( _{1} T]. FIG. 1(d) shows the fully expanded form of the CFLOBDD from FIG. 1(e). For the CFLOBDD of FIG. 1(e), FIG. 1(d) is the analog of the binary decision tree shown in FIG. 1(a) for the OBDD of FIG. 1(b). (As with BDDs and their decision trees, the fully expanded form of a CFLOBDD need never be materialized. It is shown here for illustrative purposes only.)
[0086] The don't-care grouping in the lower right-hand corner of FIG. 1( _{1} T]enters the level-0 grouping for x_{1 }(a don't-care grouping) via the B-connection depicted as a dotted edge; the path leaves the level-0 grouping for x_{1 }via the dotted return edge (as opposed to the dashed return edge). We say that a pair of incoming and outgoing edges such as the two dotted edges in this path are matched, and that the path in FIG. 1(f) is a matched path.
[0087] This example illustrates the following principle: [0088] Matched Path Principle. When a path follows a return edge from level i -1 to level i, it must follow a return edge that matches the closest preceding connection edge from level i to level i- [0089] One way to formalize the condition is to label each connection edge from level i to level i-1 with an open-parenthesis symbol of the form “(b”, where b is all index that distinguishes the edge from all other edges to any entry vertex of any grouping of the CFLOBDD. (In particular, suppose that there are Num Connections such edges, and that the value of b runs from 1 to Num connections.) Each return edge that runs from an exit vertex of the level i-1 grouping back to level i, and corresponds to the connection edge labeled “(b”, is labeled “)b”. Each path in a CFLOBDD then generates a string of parenthesis symbols formed by concatenating, in order, the labels of the edges on the path. (Unlabeled edges in the level-0 groupings are ignored in forming this string.) A path in a CFLOBDD is called a Matched-path if the path's word is in the language L(Matched) of balanced-parenthesis strings generated from nonterminal Matched according to the following context-free grammar:
[0090] Only Matched-paths that start at the entry vertex of the CFLOBDD's highest-level grouping and end at one of the final values are considered in interpreting CFLOBDDS. assignment of values for the variables x [0091] The matched-path principle allows a single region of a CFLOBDD to do double duty (and, in general, to perform multiple roles). For example, in FIG. 1( _{1} T]), the distinction between the dotted return edge and the dashed return edge is crucial: The dotted return edge that occurs in the path in FIG. 2(a) takes us to T (the correct answer for the evaluation of λx_{0}x_{1}.x_{0 }under [x_{0} T, x_{1} T]), whereas the dashed return edge would take us to F, which would be incorrect (cf. the unmatched path shown in FIG. 2(e)). The dashed return edge is used only when the lower level-0 grouping is entered via the incoming dashed edge (as happens in FIGS. 2(c) and 2(d) for the assignments [x_{0} F, x_{1} T] and [x_{0} F, x _{1} F], respectively).
[0092] The matched-path principle also lets us handle the cycles that can occur in CFLOBDDs. FIG. 3 shows the OBDD and CFLOBDD for the two-input function λx _{1}. In this case, the “forking” pattern at level 0, which appears in the upper right-hand corner of FIG. 3(e), is used for discriminating on variable x_{0}, and also, in the case when x_{0 }is mapped to T, for discriminating on x_{1}. The double use of this subgraph is illustrated in FIG. 3(f), which shows in bold the path corresponding to the assignment [x_{0} T, x_{1} T]. Again, the matched-path principle allows us to obtain the desired interpretation of the CFLOBDD: In the case of the assignment [x_{0} T, x_{1} T], the first time the path reaches the level-0 fork grouping (labeled “x_{0}, x_{1}”), it enters via the A-connection edge, which is solid, and therefore the path must leave via a solid return edge. In this case, because x_{0 }has the value T in the assignment, the path reaches a middle vertex whose B-connection edge leads back to the level-0 fork grouping, but this time via the dotted edge. (Note that at this point the path has gone once around the cycle that exists in the CFLOBDD.) Because the path enters the level-0 fork grouping via the dotted B-connection edge, it must leave via a dotted return edge—in this case, the one that takes us to T.
[0093] Not only does the matched-path principle allow us to obtain the desired interpretation of a CFLOBDD, but it allows such interpretations to be obtained correctly in the presence of cycles: In the absence of the matched-path principle, a path could cycle endlessly between the level-1 grouping and the level-0 fork grouping. [0094]FIG. 4 depicts fully expanded and folded CFLOBDDs for the four-input function λx _{1})V (x_{2} x_{3}). In the case of the folded CFLOBDD shown in FIG. 4(b), there are exactly seven matched paths from the entry vertex to T. These correspond to the seven paths from entry to T in the fully expanded form. In FIG. 4(c), the path corresponding to the assignment [x_{0} T, x_{1} T, x_{2} T, x_{3} t] is shown in bold. In this path, the upper level-0 grouping is used to handle x_{0 }and x_{1}, while the lower level-0 grouping handles x_{2 }and x_{3}. The correspondence between groupings and variables varies from path to path. For instance, the upper level-0 grouping would handle all four variables for the variable assignment [x_{0} T, x_{1} F, x_{2} T, x_{3} F].
[0095] Comparing FIG. 4( _{1})V . . . V(x_{k-1} x _{k}) with the variable ordering x_{0}, x_{1}, . . . , x_{k}, the sizes of their CFLOBDDs are bounded by O (log_{2 }k). In contrast, the sizes of the OBDDs for this family of functions grows as O (k). (Obviously, the decision trees for this family of functions grow as O(2^{k}).)
[0096]FIG. 1( [0097] In general, as the level of the highest-level grouping increases, a CFLOBDD's characteristics grow as follows:
[0098] Note that the number of paths in a CFLOBDD is squared with each increase in level by 1: In a grouping at level i, each path through the A-connection's level i-1 grouping is routed through some B-connection's level i-1 grouping. Each level i-1 grouping has 2 [0099] Each CFLOBDD of level L represents a decision tree with 2 [0100] It should be noted that no information-theoretic limit is being violated here: Not all decision trees can be represented with CFLOBDDs in which each grouping is of constant size—and thus, not every function over Boolean-valued arguments can be represented in such a compressed fashion (i.e., logarithmic in the number of Boolean variables, or, equivalently, doubly logarithmic in the size of the decision tree). However, the potential benefit of CFLOBDDs is that, just as with BDDs, there may turn out to be enough regularity in problems that arise in practice that CFLOBDDs stay of manageable size. Moreover, doubly-exponential compression (or any kind of super-exponential compression) could allow problems to be completed much faster (due to the smaller-sized structures involved), or allow far larger problems to be addressed than has been possible heretofore. [0101] For example, if you want to tackle a problem with 2 [0102] In the discussion of CFLOBDDs and multi-terminal CFLOBDDs that follows, it is convenient to introduce the term proto-CFLOBDDs to refer to an additional feature of CFLOBDD structures. Proto-CFLOBDDs have already been illustrated in previous examples (albeit not in full generality): Each grouping, together with the lower-level subgroupings that it is connected to, forms a proto-CFLOBDD. Thus, the difference between a proto-CFLOBDD and a CFLOBDD is that the exit vertices of a proto-CFLOBDD have not been associated with specific values. [0103] A level-i Booleani-valued CFLOBDD consists of a level-i proto-CFLOBDD that has at most two exit vertices, which are then associated uniquely with F and T (cf. FIGS. [0104] A level-i multi-terminal CFLOBDD consists of a level-i proto-CFLOBDD that may have an arbitrary number of exit vertices, which are then associated uniquely with values drawn from some value space. For instance, FIG. 5( [0105] Groupings, and proto-CFLOBDDs, that have more than two exit vertices naturally arise in the sub-groupings CFLOBDDs—even in Boolean-valued CFLOBDDs. For instance, the highest-level grouping in a Boolean-valued CFLOBDD (at, say, level k) may contain more than two riddle vertices, and thus the level k- [0106] FIGS. [0107] We call this family of proto-CFLOBDDs the no-distinction proto-CFLOBDDs. FIGS. [0108] Boolcan-valued CFLOBDDs for the constant functions of the form λx [0109] Note that the no-distinction proto-CFLOBDD of level k is of size O(k), and hence the no-distinction proto-CFLOBDDs exhibit doubly exponential compression. Moreover, because the no-distinction proto-CFLOBDD of level k shares all but one constant-sized grouping with the no-distinction proto-CFLOBDD of level k- [0110] It is because the family of no-distinction proto-CFLOBDDs is so compact that in designing CFL-OBDDs we did not feel the need to mimic the “reduction transformation” of Reduced OBDDs (ROB-DDs) [Bry86, BRB90], in which “don't-care” vertices are removed from the representation. [0111] ADDITIONAL STRUCTURAL INVARIANTS [0112] The structures that have been described thus far are too general; in particular, they do not yield a canonical form for functions over Boolean-valued arguments. This is illustrated in FIGS. [0113] Thus, in addition to the basic hierarchical structure that is provided by A-connections, B-connections, and return edges, we impose certain additional structural invariants on CFLOBDDs. As shown below, when these invariants are maintained, the CFLOBDDs are a canonical form for functions over Boolean arguments. [0114] Most of the structural invariants concern the organization of what we shall call return tuples: For a given A-connection or B-connection edge c from grouping g [0115] We can think of return tuples as representing mapping functions that map exit vertices at one level to middle vertices or exit vertices at the next greater level. Similarly, value tuples represent mapping functions that map exit vertices of the highest-level grouping to final values. In both cases, the i [0116] Because the middle vertices and exit vertices of a grouping are each arranged in some fixed known order, and hence can be stored in an array, it is often convenient to assume that each element of a return tuple is simply an index into such an array. For example, in FIG. 5( [0117] The return tuple associated with the first B-connection of the level-1 grouping is the 2-tuple [1, 2]. [0118] The return tuple associated with the second B-connection of the level-1 grouping is 2-tuple [2,3]. [0119] The value tuple associated with the multi-terminal CFLOBDD is the 3-tuple [a, b, c]. [0120] We impose five conditions: [0121] STRUCTURAL INVARIANTS [0122] 1. If c is an A-connection, then rt [0123] 2. If c is the B-connection edge whose source is middle vertex j+1 of g [0124] (a) It must map the exit vertices of g [0125] (b) It must “compactly extend” the set of exit vertices in g [0126] Now consider rt [0127] 3. While a proto-CFLOBDD may be used as a substructure more than once (i.e., a proto-CFLOBDD may be pointed to multiple times), a proto-CFLOBDD never contains two separate instances of equal proto-CFLOBDDs. [0128] 4. For every pair of B-connections c and c [0129] 5. For the highest-level grouping of a CFLOBDD, the value tuple maps each exit vertex to a distinct value. [0130] Structural Invariants [0131]FIG. 8( [0132] In FIG. 6( [0133] In the case of rt [0134] In the case of rt [0135] Also in FIG. 6( [0136] In FIG. 6( [0137] The following proposition demonstrates that matched paths through proto-CFLOBDDs (and hence through CFLOBDDs) reflect a certain ordering property on Boolean-variable-to-Boolean-value assignments. [0138] Proposition 1 Let ex [0139] Proof: We argue by induction [0140] Base case: The proposition follows immediately for level-0 proto-CFLOBDDs. [0141] Induction step: The induction hypothesis is that the proposition holds for every level-k proto-CFLOBDD. [0142] Let C be an arbitrary level k+1 proto-CFLOBDD, with s and ex [0143] We argue by contradiction: Suppose, for the sake of argument, that the proposition does not hold for C, and that j is the leftmost exit vertex in ex [0144] Let α [0145] Let α [0146] There are two cases to consider. [0147] Case 1: α=a [0148] Because α=α [0149] Case 1.A: Suppose that e _{j}→j “cross”. By Structural Invariant 2 b, this can only happen if
[0150] There is a matched path corresponding to some assignment β [0151] There is a matched path from h corresponding to some assignment ,β [0152] There is a return edge from the exit vertex reached by β [0153] In this case, by the induction hypothesis applied to C [0154] Consequently, β [0155] Case 1.B: Suppose that e [0156] Case 2: α [0157] Because α [0158] Case 2.A: Suppose that n<m (see FIG. 9( [0159] Case 2.B: Suppose that m<n (see FIG. 9( [0160] There is a matched path corresponding to some assignment β [0161] There is a matched path from h corresponding to some assignment β [0162] There is a return edge from the exit vertex reached by β [0163] In this case, by the induction hypothesis applied to C [0164] Consequently, β [0165] In each of the cases above, we are able to derive a contradiction to the assumption that α [0166] CANONICALNESS OF CFLOBDDS [0167] We now turn to the issue of showing that CFLOBDDs are a canonical representation of functions over Boolean arguments. We must show three things: [0168] 1. Every level-k CFLOBDD represents a decision tree with 2 [0169] 2. Every decision tree with [0170] 3. No decision tree with 2 [0171] As described earlier, following a matched path (of length O(2 [0172] To show that Obligation [0173] The construction makes use of a set of auxiliary tables, one for each level, in which a unique representative for each class of equal proto-CFLOBDDs that arises is tabulated. We assume that the level-0 table is already seeded with a representative fork grouping and a representative don't-care grouping. [0174] ALGORITHM 1 [DECISION TREE TO MULTI-TERMINAL CFLOBDD [0175] 1. The leaves of the decision tree are partitioned into some number of equivalence classes e according to the values that label the leaves. The equivalence classes are numbered 1 to e according to the relative position of the first occurrence of a value in a left-to-right sweep over the leaves of the decision tree. For Boolean-valued CFLOBDDs, when the procedure is applied at topmost level, there are at most two equivalence classes of leaves, for the values F and T. However, in general, when the procedure is applied recursively, more than two equivalence classes can arise. [0176] For the general case of multi-terminal CFLOBDDs, the number of equivalence classes corresponds to the number of different values that label leaves of the decision tree. [0177] 2. (Base cases) If k=0 and e=1, construct a CFLOBDD consisting of the representative don't-care grouping, with a value tuple that binds the exit vertex to the value that labels both leaves of the decision tree. [0178] If k=0 and e=2, construct a CFLOBDD consisting of the representative fork grouping, with a value tuple that binds the two exit vertices to the first and second values, respectively, that label the leaves of the decision tree. [0179] If either condition applies, return the CFLOBDD so constructed as the result of this invocation; otherwise, continue on to the next step. [0180] 3. Construct—via recursive applications of the procedure— [0181] These are then partitioned into some number e′of equivalence classes of equal multi-terminal CFLOBDDs; a representative of each class is retained, and the others discarded. Each of the [0182] The equivalence-class representatives are also numbered 1 to e′ according to the relative position of their first occurrence in a left-to-right sweep over the leaves of the upper half of the decision tree. [0183] 4. Construct—via a recursive application of the procedure—a level k-1 multi-terminal CFLOBDD for the upper half of the decision tree. [0184] 5. Construct a level-k multi-terminal proto-CFLOBDD from the level k-1 multi-terminal CFLOBDDs created in steps [0185] (a) The A-connection points to the proto-CFLOBDD of the object constructed in step [0186] (b) The middle vertices correspond to the equivalence classes formed in step [0187] (c) The A-connection return tuple is the identity map back to the middle vertices (i.e., the tuple ]l..e′]). [0188] (d) The B-connections point to the proto-CFLOBDDs of the e′ equivalence-class representatives constructed in step [0189] (e) The exit vertices correspond to the initial equivalence classes described in step [0190] (f) The B-connection return tuples connect the exit vertices of the highest-level groupings of the equivalence-class representatives retained from step [0191] (g) Consult a table of all previously constructed level-k groupings to determine whether the grouping constructed by steps [0192] 6. Return a multi-terminal CFLOBDD created from the proto-CFLOBDD constructed in step [0193]FIG. 6( _{1} x_{2}). FIG 6(b) shows the state of things after step 3 of Algorithm 1. Note that even though the level-1 CFLOBDDs for the first three leaves of the top half of the decision tree have equal proto-CFLOBDDs,^{7 }the leftmost proto-CFLOBDD maps its exit vertex to F, whereas the exit vertex is mapped to T in the second and third proto-CFLOBDDs. Thus, in this case, the recursive call for the upper half of the decision tree (step 4) involves three equivalence classes of values.
[0194] It is not hard to see that the structures created by Algorithm [0195] Structural Invariant [0196] Structural Invariant [0197] Structural Invariant [0198] Structural Invariant [0199] Structural Invariant [0200] Moreover, Algorithm [0201] We now come to Obligation _{1} 0 x_{2}) shown in FIG. 6(a).)
[0202] Unfold also preserves interpretation under assignments: Suppose that T [0203] Obligation [0204] A Fold trace records the steps of Algorithm [0205] At step [0206] At the end of step [0207] During step [0208] At the end of step [0209] During step [0210] At the end of step [0211] An Unfold trace records the steps of Unfold(C): [0212] CFLOBDD C is appended to the trace. [0213] If C is a level-0 CFLOBDD, then a binary tree of height-1—with the leaves labeled according to C's value tuple—is appended to the trace (and the Unfold algorithm returns). [0214] The trace is extended according to the actions carried out by Unfold as it is applied recursively to the A-connection of C. [0215] A hybrid decision-tree/CFLOBDD object (à la FIG. 6( [0216] The trace is extended according to the actions carried out by Unfold as it is applied recursively to instances of B-connections of C. (For purposes of settling Obligation [0217] Finally, the decision tree returned by Unfold is appended to the trace. [0218] For instance, FIG. 11 shows the Unfold trace generated by the application of Unfold to the CFLOBDD shown in FIG. 1( [0219] Note how the Unfold trace shown in FIG. 11 is the reversal of the Fold trace shown in FIG. 11. We now argue that this property holds generally. (Technically, the argument given below in Proposition 2 shows that each element of an Unfold trace is structurally equal to the corresponding object in the Fold trace. However. Because Structural Invariant [0220] Proposition 2 Suppose that C is a multi-terminal CFLOBDD, and that Unfold(C) results in Unfold trace UT and decision tree To. Let C′ be the multi-terminal CFLOBDD produced by applying Algorithm [0221] (i) FT is the reversal of UT. [0222] (ii) C=C′, [0223] Proof: Because C′ appears at the end of FT, and C appears at the beginning of UT, clause (i) implies (ii). We show (ii) by the following inductive argument: [0224] Base case: The proposition is trivially true of level-0 CFLOBDDs. Given any pair of values v [0225] Induction step: The induction hypothesis is that that the proposition holds for every level-k multi-terminal CFLOBDD. We need to argue that the proposition extends to level k+1 multi-terminal CFLOBDDs. [0226] First, note that the induction hypothesis implies that each decision tree with 2 [0227] Unfold trace UT can be divided into five segments: [0228] (u1) C itself [0229] (u2) the Unfold trace for C's A-connection [0230] (u3) a hybrid decision-tree/CFLOBDD object (call this object D) [0231] (u4) the Unfold trace for C's B-connections [0232] (u5) T [0233] Fold trace FT can also be divided into five segments: [0234] (f1l) T [0235] (f2) the Fold trace for T [0236] (f3) a hybrid decision-tree/CFLOBDD object (call this object D′) [0237] (f4) the Fold trace for T [0238] (f5) C′. [0239] Clearly, (u1) is equal to (f5); our goal is to show that (u2) is the reversal of (f4); (u3) is equal to (f3); (u4) is the reversal of (f2); and (u5) is equal to (f1). [0240] (u3) is equal to (f3) Consider the hybrid decision-tree/CFLOBDD object D obtained after Unfold has finished unfolding C's A-connection. [0241] As a consequence of Proposition 1, together with the fact that Unfold preserves interpretation under assignments, the relative position of the first occurrence of a label in a left-to-right sweep over the leaves of this decision tree reflects the order of the level k+1 grouping's middle vertices. [0242] Fold trace FT also has a hybrid decision-tree/CFLOBDD object, namely D′. The crucial point is that the action of partitioning T [0243] By the corollary to the induction hypothesis, the 2 [0244] (u2) is the reversal of (f4); (u4) is the reversal of (f2) Given the observation that D=D′, these follow in a straightforward fashion from the inductive hypothesis (applied to the A-connection and the B-connections of C). [0245] (u5) is equal to (f1) Because (u2) is the reversal of (f4) and (u4) is the reversal of (f2), we know that the level-k proto-CFLOBDDs out of which the level k +1 grouping of C′ is constructed are the same as the level-k proto-CFLOBDDs that make up the A-connection and B-connections of C. [0246] We already argued that steps [0247] In summary, we have now shown that Obligations [0248] REPRESENTING MULTI-TERMINAL CFLOBDDS IN A COMPUTER MEMORY [0249] An object-oriented pseudo-code will be used to describe the representations of CFLOBDDs in a computer memory and operations on them. The basic classes that are used for representing multi-terminal CFLOBDDs in a computer memory are defined in FIG. 12, which provides specifications of classes Grouping, InternalGrouping, DontCareGrouping, ForkGrouping, and CFLOBDD. [0250] A few words are in order about the notation used in the pseudo-code: [0251] A Java-like semantics is assumed. For example, an object or field that is declared to be of type InternalGrouping is really a pointer to a piece of heap-allocated storage. A variable of type InternalGrouping is declared and initialized to a new InternalGrouping object of level k by the declaration [0252] InternalGrouping g=new InternalGrouping(k) [0253] Procedures can return multiple objects by returning tuples of objects, where tupling is denoted by square brackets. For instance, if f is a procedure that returns a pair of ints—and, in particular, if f (3) returns a pair consisting of the values 4 and 5—then int variables a and b would be assigned 4 and 5 by the following initialized declaration: [0254] The indices of array elements start at 1. [0255] Arrays are allocated with an initial length (which is allowed to be 0); however, arrays are assumed to lengthen automatically to accommodate assignments at index positions beyond the current length. [0256] We assume that a call on the constructor InternalGrouping(k) returns an InternalGrouping in which the members have been initialized as follows: [0257] level=k [0258] AConnection=NULL [0259] AReturnTuple=NULL [0260] numberOfBConnections=0 [0261] BConnections=new array[0] of Grouping [0262] BReturnTuples=new array[0] of ReturnTuple [0263] numberOfExits=0 [0264] Similarly, we assume that a call on the constructor CFLOBDD(g,vt) returns a CFLOBDD in which the members have been initialized as follows: [0265] grouping=g [0266] valueTuple=vt [0267] To be able to state the algorithms for CFLOBDD operations in a concise manner, a variety of set-valued and tuple-valued expressions will be used, using notation inspired by the SETL language [Dew79, SDDS87]. FIG. 13 lists the set operations and tuple operations that are used to express the algorithms for CFLOBDD operations. An iterator specifies what elements are collected in a set-former expression of the form {exp: iterator} or in a tuple-former expression of the form [exp:iterator] (cf. [Dew79, Sections 1.8 and 5.2]). [0268] An iterator creates a sequence of candidate bindings for one of more identifiers used in the iterator (the iteration variables). [0269] The expression of the iterator is evaluated with respect to each candidate binding. In the case of a tuple former, the resulting value is placed at the right end of the tuple being formed; in the case of a set former, the value is placed in the set being formed, unless it duplicates a value already there. [0270] Compound iterators are formed by writing a list of basic iterators, separated by commas. The effect is to define a kind of loop nest: the last iterator in the sequence generates its candidate values most rapidly; the first iterator generates values least rapidly. [0271] An iterator can also be followed by a qualifier of the form “|condition”, which has the effect of performing a test for each candidate binding of values to the iteration variables. If the value of the condition is false, then the candidate binding is skipped, and the iterator moves on to the next candidate binding, without placing an element into the set or tuple. [0272] Thus, set formers and tuple formers are very similar, except that values are placed into a tuple in a specific order. Tuples may contain duplicate elements; sets may not. For example, { { { [ [ [ [[ [0273] Finally, if T is the tuple [2, 2, 1, 1, 4, 1, 1], then the expression [ [0274] evaluates to the tuple [2, 1, 4]. In essence, expression (1) says to retain the leftmost occurrence of a value in T as the representative of the set of elements in T that have that value. For instance, the 2 in the first position of T contributes the 2 to [2,1,4] because 1=min{j ∈[ [0275] The class definitions of FIG. 12, as well as the algorithms for the core CFLOBDD operations-defined in FIGS. 22, 23, [0276] A ReturnTuple is a finite tuple of positive integers. [0277] A PairTuple is a sequence of ordered pairs. [0278] A TripleTuple is a sequence of ordered triples. [0279] A ValueTuple is a finite tuple of whatever values the multi-terminal CFLOBDD is defined over. [0280]FIG. 14 shows how the CFLOBDD from FIG. 4( [0281] MEMOIZATION OF CFLOBDDS AND GROUPINGS [0282] A memo function for F, where F is either a function (i.e., a procedure with no side-effects) or a construction operation, is an associative-lookup table—typically a hash table—of pairs of the form [x, F(x)], keyed on the value of x. The table is consulted each time F is applied to some argument (say x [0283] In the case where F is a construction operation for a hierarchically structured datatype, memoization can be used to maintain the invariant that only a single representative is ever constructed for each value—or, more precisely, for each equivalence class of data structures that represent a given datatype value. At the cost of maintaining this invariant at construction time (which typically means the cost of a hash lookup), this technique allows equality testing to be performed in constant time, by means of a single operation that compares two pointers. [0284] In the case of Groupings and CFLOBDDs, we will use memoization to enforce such an invariant over all operations that construct objects of these classes. [0285] Operations that create InternalGroupings, such as PairProduct (FIG. 24) and Reduce (FIG. 25), have the following form:
[0286] The operation NoDistinctionProtoCFLOBDD shown in FIG. 15, which constructs the members of the family of no-distinction proto-CFLOBDDs depicted in FIG. 7, also has this form. [0287] The operation ConstantCFLOBDD shown in lines [ [0288] EQUALITY OF CFLOBDDS AND GROUPINGS [0289] Because of the use of memoization, it is possible to test whether two variables of type CFLOBDD are equal by performing a single pointer comparison. Because CFLOBDDs are a canonical representation of functions over Boolean arguments, this means that it is possible to test whether two variables of type CFLOBDD hold the same function by performing a single pointer comparison. [0290] This property is important in user-level applications in which various kinds of data are implemented using class CFLOBDD. In applications structured as fixed-point-finding loops, for example, this property provides a unit-cost test for whether the fixed-point has been found. [0291] Because of the use of memoization, it is also possible to test whether two variables of type Grouping are equal by performing a single pointer comparison. Because each grouping is always the highest-level grouping of some proto-CFLOBDD; the equality test on Groupings is really a test of whether two proto-CFLOBDDs are equal. The property of being able to test two proto-CFLOBDDs for equality quickly is important because proto-CFLOBDD equality tests are necessary for maintaining the structural invariants of CFLOBDDs. [0292] PRIMITIVE OPERATIONS FOR INSTANTIATING MULTI-TERMINAL CFLOBDDS [0293] Algorithm [0294] As is also done with BDDs, one can often avoid the need to instantiate decision trees in these situations: certain primitive operations are invoked to directly create CFLOBDDs that represent certain (usually simple) functions; thereafter, one works only with CFLOBDDs-constructing CFLOBDDs for other functions of interest by applying CFLOBDD-combining operations. The need to instantiate decision trees is sidestepped by using CFLOBDD-combining operations that build their result CFLOBDDs directly from the constituents PairTuple, and ValueTuple. [0295] However, our descriptions of the core algorithms for manipulating Groupings and CFLOBDDs will not go into this level of detail, because the use of such techniques to tune the performance of an implementation can be considered to be part of the standard repertoire of programming techniques, and hence does not represent an innovative activity for a person skilled in the computer arts. of the CFLOBDDs that are the arguments to the operation (and, in particular, without having to instantiate full decision trees for either the argument CFLOBDDs or the result CFLOBDD). [0296] For OBDDs, among the combining operations that have been found to be useful are Boolean operations (e.g., , V, etc.), if-then-else, restriction, composition, satisfy-one, satisfy-all, and satisfy-count [Bry86, BRB90]. For Multi-Terminal BDDs, among the combining operations that have been found to be useful are absolute value, scalar multiplication, addition and other arithmetic operations, sorting a vector of integers, summing a matrix over one dimension, matrix multiplication, and finding the set of assignments that satisfy an arithmetic relation f_{1 ˜f} _{2}, where ˜is one of =, ≠, <, <, >, or >[CMZ^{+}93, CFZ95a ].
[0297] The algorithms for the corresponding CFLOBDD operations (both primitive operations and combining operations) are different from their BDD counterparts [Bry86, BRB90, CMZ [0298] Some of the CFLOBDD-combining operations are discussed later, in the sections titled “Binary Operations on Multi-Terminal CFLOBDDs” and “Ternary Operations on Multi-Terminal CFLOBDDs”. In the remainder of this section, we discuss primitive CFLOBDD-creation operations, which directly create CFLOBDDs that represent certain simple functions. [0299] Examples of useful primitive CFLOBDD-creation operations include [0300] The constant functions of the form λx [0301] The Boolean-valued projection functions of the form λx [0302] The step functions of the form
[0303] where i ranges from 0 to 2 [0304] It is helpful to think of a step function in terms of a decision tree (cf. FIG. 18). In the decision tree, all leaves to the left of some point are labeled with v [0305] The recursive structure of function StepProtoCFLOBDD of FIG. 19 is complicated by the following issue: [0306] When i mod 2 [0307] When i mod 2 [0308] Note that the portion of the decision tree that corresponds to middle is limited in size, compared to the portions that correspond to left and right: for a given level A, which corresponds to a decision tree of height 2 [0309] The further splitting of the part of the decision tree that corresponds to middle is carried out in building the corresponding B-connection (see lines [ [0310] Each of the B-connections that correspond to left and right do not involve any further splitting; hence, these and are connected directly to NoDistinctionProtoCFLOBDDs (see lines [ [0311] The reason for the somewhat complicated structure of the code in lines [ [0312] Several other primitive operations that directly create multi-terminal CFLOBDDs are discussed later, in the section titled “Representing Spectral Transforms with Multi-Terminal CFLOBDDs”. (The operations discussed there create CFLOBDDs that represent certain interesting families of matrices.) [0313] UNARY OPERATIONS ON MULTI-TERMINAL CFLOBDDS [0314] This section discusses how to perform certain unary operations on multi-terminal CFLOBDDs: [0315] Function FlipValueTupleCFLOBDD of FIG. 20 applies in the special situation in which a CFLOBDD maps Boolean-variable-to-Boolean-value assignments to just two possible values; FlipValueTupleCFLOBDD flips the two values in the CFLOBDD's valueTuple field and returns the resulting CFLOBDD. In the case of Boolean-valued CFLOBDDs, this operation can be used to implement the operation ComplementCFLOBDD, which forms the Boolean complement of its argument, in an efficient manner. [0316] Function ScalarMultiplyCFLOBDD of FIG. 21 applies to any CFLOBDD that maps Boolean-variable-to-Boolean-value assignments to values on which multiplication by a scalar value of type Value is defined. When Value argument v of ScalarMultiplyCFLOBDD is the special value zero, a constant-valued CFLOBDD that maps all Boolean-variable-to-Boolean-value assignments to zero is returned. [0317] BINARY OPERATIONS ON MULTI-TERMINAL CFLOBDDS [0318] This section discusses how to perform binary operations on multi-terminal CFLOBDDs. FIG. 22, 23, [0319] The operation BinaryApplyAndReduce given in FIG. 23 starts with a call on PairProduct. (See lines [ [0320] BinaryApplyAndReduce then uses pt, together with op and the value tuples from CFLOBDDs n [0321] However, deducedValueTuple is a tentative value tuple for the constructed CFLOBDD; because of Structural Invariant [0322] BinaryApplyAndReduce obtains two tuples, inducedValueTuple and inducedReductionTuple, which describe the collapsing of duplicate leaf values, by calling the subroutine CollapseClassesLeftmost: [0323] Tuple inducedValueTuple serves as the final value tuple for the CFLOBDD constructed by BinaryApplyAndReduce. In inducedValueTuple, the leftmost occurrence of a value in deducedValueTuple is retained as the representative for that equivalence class of values. For example, if deducedValueTuple is [2, 2, 1, 1, 4, 1, 1], then inducedValueTuple is [2, 1, 4]. The use of leftward folding is dictated by Structural Invariant [0324] Tuple inducedReductionTuple describes the collapsing of duplicate values that took place in creating inducedValueTuple from deducedValueTuple: inducedReductionTuple is the same length as deducedValueTuple, but each entry inducedReductionTuple(i) gives the ordinal position of deducedValueTuple(i) in inducedValueTuple. For example, if deducedValueTuple is [22,1,1,4,1,1] (and thus inducedValueTuple is [2,1,4]), then inducedReductionTuple is [1, 1, 2, 2, 3, 2, 2]—meaning that positions 1 and 2 in deducedValueTuple were folded to position 1 in inducedValueTuple, positions 3, 4, 6, and 7 were folded to position 2 in inducedValueTuple, and position 5 was folded to position 3 in inducedValueTuple. [0325] (See FIG. 23, lines [ [0326] Finally, BinaryApplyAndReduce performs a corresponding reduction on Grouping g, by calling the subroutine Reduce, which creates a new Grouping in which g's exit vertices are folded together with respect to tuple inducedReductionTuple. (See FIG. 23, lines [ [0327] Procedure Reduce, shown in FIG. 25, recursively traverses Grouping g, working in the backwards direction, first processing each of g's B-connections in turn, and then processing g's A-connection. In both cases, the processing is similar to the (leftward) collapsing of duplicate leaf values that is carried out by BinaryApplyAndReduce: [0328] In the case of each B-connection, rather than collapsing with respect to a tuple of duplicate final values, Reduce's actions are controlled by its second argument, reductionTuple, which clients of Reduce—namely, BinaryApplyAndReduce and Reduce itself—use to inform Reduce how g's exit vertices are to be folded together. For instance, the value of reductionTuple could be [1, 1, 2,2, 3, 2, 2]—meaning that exit vertices [0329] In FIG. 25, line [ [0330] Then, by calling the subroutine CollapseClassesLeftmost, Reduce obtains two tuples, inducedReturnTuple and inducedReductionTuple, that describe the collapsing that needs to be carried out on the exit vertices of the B-connection under consideration. (See FIG. 25, lines [ [0331] As the B-connections are processed, Reduce uses the position information returned from InsertBConnection to build up the tuple reductionTupleA. (See FIG. 25, line [ [0332] Finally, via processing similar to what was done for each B-connection, two tuples are obtained that describe the collapsing that needs to be carried out on the exit vertices of the A-connection, and an additional call on Reduce is carried out. (See FIG. 25, lines [ [0333] Recall that a call on RepresentativeGrouping(g) may have the side effect of installing g into the table of memoized Groupings. We do not wish for this table to ever be polluted by non-well-formed proto-CFLOBDDs. Thus, there is a subtle point as to why the grouping g constructed during a call on PairProduct meets Structural Invariant [0334] In particular, suppose that B [ [0335] Let rt and rt′ be the return tuples that the outer call on PairProduct creates for D and D′ in lines [ [0336] The question that we need to answer is whether it is ever possible for both D=D′ and rt=rt′ to hold. This is of concern because it would violate Structural Invariant [0337] Proposition 3 The first entry of the pair returned by PairProduct is always a well-formed proto-CFLOBDD. [0338] Proof: We argue by induction: [0339] Base case: When g [0340] Induction step: The induction hypothesis is that the first entry of the pair returned by PairProduct is a well-formed proto-CFLOBDD whenever the arguments to PairProduct are level-k proto-CFLOBDDs. [0341] Let g [0342] By the inductive hypothesis, we know that D and D′ are each well-formed proto-CFLOBDDs. In particular, we can think of D and rt as corresponding to a decision tree T [0343] Furthermore, because D=D′ and rt=rt′, D′ and rt′ also correspond to decision tree T [0344] When T [0345] By assumption, g [0346] Similarly, in g [0347] Therefore, in g − [0348] while in g − [0349] However, both of these conclusions contradict Structural Invariant [0350] In the case of Boolean-valued CFLOBDDs, there are 16 possible binary operations, corresponding to the 16 possible two-argument truth tables (2×2 matrices with Boolean entries). (See column 1 of the table given in FIG. 28.) All 16 possible binary operations are special cases of BinaryApplyAndReduce; these can be performed by passing BinaryApplyAndReduce an appropriate value for argument op (i.e., some 2 ×2 Boolean matrix). [0351] TERNARY OPERATIONS ON MULTI-TERMINAL CFLOBDDS [0352] This section discusses how to perform ternary operations (i.e., three-argument operations) on multi-terminal CFLOBDDs. FIGS. 26 and 27 present the two new algorithms needed to implement ternary operations on multi-terminal CFLOBDDs. As in the previous section on “Binary Operations on Multi-Terminal CFLOBDDS”, we assume that the CFLOBDD or Grouping arguments of the operations described below are objects whose highest-level groupings are all at the same level. [0353] The operation TernaryApplyAndReduce given in FIG. 26 is very much like the operation BinaryApplyAndReduce of FIG. 23, except that it starts with a call on TripleProduct instead of PairProduct. (See lines [ [0354] The operation TripleProduct, which is given in FIG. 27, is very much like the operation PairProduct of FIG. 24, except that TripleProduct has a third Grouping argument, and performs a three-way—rather than two-way—cross product of the three Grouping arguments: g [0355] (By an argument similar to the one given for PairProduct, it is possible to show that the grouping g constructed during a call on TripleProduct is always a well-formed proto-CFLOBDD—and hence it is permissible to call RepresentativeGrouping(g) in line [ [0356] TernaryApplyAndReduce then uses the triples describing the exit vertices to determine the tuple of leaf values that should be associated with the exit vertices (i.e., a tentative value tuple). (See lines [ [0357] Finally, TernaryApplyAndReduce proceeds in the same manner as BinaryApplyAndReduce: [0358] Two tuples that describe the collapsing of duplicate leaf values—assuming folding to the left—are created via a call to CollapseClassesLeftmost. (See lines [ [0359] The corresponding reduction is performed on Grouping g, by calling Reduce to fold g's exit vertices with respect to variable inducedReductionTuple (one of the tuples returned by the call on CollapseClassesLeftmost). (See lines [ [0360] In the case of Boolean-valued CFLOBDDs, there are 256 possible ternary operations, corresponding to the 256 possible three-argument truth tables (2 ×2 ×2 matrices with Boolean entries). All 256 possible ternary operations are special cases of TernaryApplyAndReduce; these can be performed by passing TernaryApplyAndReduce an appropriate value for argument op (i.e., some 2 ×2 ×2 Boolean matrix. [0361] One of the 256 ternary operations is the operation called ITE [BRB90] (for “If-Then-Else”), which is defined as follows: b)V(ac).
[0362]FIG. 28 shows how the ternary ITE operation can be used to implement all 16 of the binary operations on Boolean-valued CFLOBDDs [BRB90]. [0363] REPRESENTING SPECTRAL TRANSFORMS WITH MULTI-TERMINAL CFLOBDDS [0364] This section describes how multi-terminal CFLOBDDs can be used to encode families of integer matrices that capture some of the recursively defined spectral transforms, in particular, the Reed-Muller transform, the inverse Reed-Muller transform, the Walsh transform, and the Boolean Haar Wavelet transform [HMM85]. [0365] In each case, we will show how to encode a family of matrices M, where the n [0366] These encodings yield doubly exponential reductions in the size of the matrices. As will be shown below, each grouping that occurs in each of the CFLOBDD families is of size O(1); consequently, the level-k member of each family is of size O(k), whereas the corresponding matrix has 2 [0367] REPRESENTING MATRICES AND KRONECKER PRODUCTS [0368] The families of transform matrices that are to be encoded can be specified consisely in terms of an operation called the Kronecker product of two matrices, which is defined as follows:
[0369] Thus, if B is an array of size n′×m′, A{circle over (X)}B is an array of size nn′×mm′. It is easy to see that the Kronecker product is associative, i.e., ( [0370] For matrices that represent spectral transforms, the left-hand argument A of a Kronecker product A{circle over (X)}B often has a special form: typically, either A's elements are drawn from {0, 1}, or from {−1, 0, 1}. [0371] When using CFLOBDDs to represent the result of an application of a Kronecker product, it is especially convenient to use the interleaved variable ordering. The reason for this is illustrated in FIG. 29( [0372] Under the interleaved variable ordering, as we work through the CFLOBDD shown in FIG. 29( [0373] However, path p [0374] In the CFLOBDD shown in FIG. 29( [0375] In the CFLOBDD shown in FIG. 29( [0376] In both cases, this is exactly what is required of the matrix A{circle over (X)}B; hence, by the canonicity property, the multi-terminal CFLOBDD shown in FIG. 29( [0377] Create a level k+1 grouping that has m+1 middle vertices, corresponding to the values [w [ [0..m], j [0..n]].
[0378] For each middle vertex, which corresponds to some value w [0379] If any of the values in the sequence [w [0..m,] j [0..n]]
[0380] are duplicates, make an appropriate call on Reduce to fold together the classes of exit vertices that are associated with the same value, thereby creating a multi-terminal CFLOBDD. [0381] By exactly the same argument given above for the case where A is a {0, 1}-matrix, the resulting multi-terminal CFLOBDD must be the unique representation of the matrix A{circle over (X)}B under the interleaved variable ordering. [0382] REPRESENTING THE REED-MULLER TRANSFORM [0383] The family of matrices for the Reed-Muller transform, denoted by R [0384] where [1] denotes the 1 ×1 matrix whose single entry is the value 1. In terms of the Kronecker product, this family of matrices can be specified as follows:
[0385] An immediate consequence of this definition is that
[0386] from which it follows that [0387] FIGS. [0388] It is instructive to compare FIG. 30( [0389] in particular,
[0390] One difference between FIGS. [0391] REPRESENTING THE INVERSE REED-MULLER TRANSFORM [0392] The family of matrices for the inverse Reed-Muller transform, denoted by S [0393] In terms of the Kronecker product, this family of matrices can be specified as follows:
[0394] FIGS. [0395] REPRESENTING THE WALSH TRANSFORM [0396] The family of matrices for the Walsh transform, denoted by W [0397] In terms of the Kronecker product, this family of matrices can be specified as follows:
[0398] FIGS. [0399] REPRESENTING OTHER TRANSFORM MATRICES [0400] In the context of devising generalized BDD-like representations, Clarke, Fujita, and Zhao [CFZ95b] have studied the transformation matrices produced by performing Kronecker products of various different non-singular 2 ×2 matrices M to define a family of transform matrices, say T [0401] They state that if the entries of M are restricted to {-1,0, I}, there are six interesting matrices:
[0402] The second and third of these define the inverse Reed-Muller transform, and the Reed-Muller transform, and lead to the families of CFLOBDDs illustrated in FIGS. 32 and 30, respectively. [0403] The methods for constructing a family of CFLOBDDs that represent each of the other four families of transform matrices represent only small varations on the constructions that we have spelled out in detail above; a level-k CFLOBDD is used to encode transform matrix T [0404] REPRESENTING THE BOOLEAN HAAR WAVELET TRANSFORM [0405] Hansen and Sekine give a recursive definition for a matrix that can be used to compute the Boolean Haar Wavelet transform [HS97] in the following way: First, they define D [0406] The Boolean Haar Wavelet transform matrix defined by Hansen and Sekine, which we will denote by H′ [0407] where A [0408] For instance, when n=3, this defines the matrix
[0409] Equation (2) can be used as the basis for an algorithm—based on the Kronecker product and addition—to create CFLOBDDs that encode this version of the Boolean Haar Wavelet transform matrix; however, the method for constructing this family of CFLOBDDs directly is rather awkward to state. [0410] Fortunately, we can define a different family of matrices that captures the Boolean Haar Wavelet transform form (in the sense that the rows of the matrices in the new family are permutations of the rows of the matrices defined by Equation (2)). The new definition leads to a straightforward method for constructing the CFLOBDD encodings. First, we define E [0411] The new version of the Boolean Haar Wavelet transform matrix, denoted by H [0412] This can also be expressed as
[0413] For n=3, this definition yields the following matrix:
[0414] The only difference between H [0415] All of the non-zero elements in the (strict) upper triangle are −1. [0416] All of the non-zero elements in the (strict) lower triangle are 1. [0417] All of the diagonal elements are 1. [0418] This property is possessed by all of the matrices in the family H [0419]FIGS. 36, 38, and [0420] The principles behind FIGS. 36, 38, and [0421]FIG. 36( [0422] In FIG. 36( [0423]FIG. 38 introduces a set of auxiliary proto-CFLOBDDs that occur in the encoding of the Boolean Haar Wavelet transform matrices. The purpose of these components is to separate sub-blocks of the matrix into four categories; accordingly, exit vertices and middle vertices in FIGS. [0424] Vertices labeled with H correspond to sub-blocks that are on the diagonal of the matrix; matched paths through these vertices eventually feed into J proto-CFLOBDDs (or, as we shall see in FIG. 40, into H proto-CFLOBDDs), which further separate the on-diagonal sub-blocks into smaller sub-blocks. [0425] Vertices labeled with E and −E correspond to sub-blocks that are off the diagonal of the matrix: vertices labeled E correspond to sub-blocks in the matrix's strict lower triangle; vertices labeled −E correspond to sub-blocks in the matrix's strict upper triangle. Matched paths through both E and −E vertices eventually feed into proto-CFLOBDDs from the E family, which further separate the off-diagonal sub-blocks into smaller sub-blocks. For an A-connection or B-connection emanating from an E vertex, the corresponding return edge leads back to an E vertex (corresponding to the fact that we are still dealing with a sub-block in the matrix's strict lower triangle); for an A-connection or B-connection emanating from a −E vertex, the corresponding return edge leads back to a −E vertex (corresponding to the fact that we are still dealing with a sub-block in the matrix's strict upper triangle). [0426]FIG. 40( [0427] In contrast to groupings of the J family, which for levels 2 and higher all have four exit vertices, groupings of the H family at levels 2 and higher all have three exit vertices. From left to right, these correspond to matrix elements with the values 1,−1, and 0, respectively. In particular, the leftmost exit vertex corresponds not only to the diagonal elements (all of which have the value 1), but also to all of the non-zero elements in the matrix's strict lower triangle. [0428] Pseudo-code for the construction of the objects involved in encoding the Boolean Haar Wavelet transform matrices of the form H [0429] DATA COMPRESSION USING MULTI-TERMINAL CFLOBDDS [0430] Earlier, Algorithm [0431] This method provides a mechanism for using CFLOBDDs for the purpose of data compression (and subsequent storage and/or transmission of the data in compressed form): [0432] The signal to be compressed consists of a sequence of values drawn from some finite value space. The sequence is considered to be the values that label, in left-to-right order, the leaves of a decision tree. If the length of the signal is s, the decision tree used is one whose height is 2 [0433] For purposes of transmission of compressed data, well-known techniques can be used to linearize the CFLOBDD C into a form that can be (i) transmitted across a communication channel, and (ii) converted back into an in-memory linked data structure so as to recover the CFLOBDD on the receiving end. (The linearization process involves no size blow-up; it generates a sequence of bits that represents the CFLOBDD, where the length of the sequence is linear in the size of the CFLOBDD.) [0434] Of course, it is useless to be able to compress data without a method for recovering the original signal from the compressed data. An algorithm for uncompressing CFLOBDDs is presented in FIG. 42. In particular, function UncompressCFLOBDD of FIG. 42 uncompresses a multi-terminal CFLOBDD to create the sequence of values that would label, in left-to-right order, the leaves of the CFLOBDD's corresponding decision tree. [0435] In UncompressCFLOBDD, the sequence-valued variable S is used as a stack that controls a (non-recursive) traversal of CFLOBDD C—mimicking the traveral that would be carried out when interpreting some Boolean-variable-to-Boolean-value assignment. The elements of traversal stack S are instances of class TraverseState, and record which Grouping of C is being visited, as well as VisitState information, which indicates whether the visit is the one before the visit to the A-connection (FirstVisit), after the visit to the A-connection but before the visit to the B-connection (SecondVisit), or after the visit to the B-connection (ThirdVisit). [0436] Function UncompressCFLOBDD uses a backtracking method to process all possible assignments in lexicographic order. Because of the way that backtracking is carried out, UncompressCFLOBDD does not manipulate assignments explicitly; instead, the sequence-valued variable T is used as a stack that records snapshots of traversal-stack S. (That is, T is a sequence whose elements are themselves sequences of TraverseStates.) When UncompressCFLOBDD has finished processing one assignment and proceeds to the next one (line [14] of FIG. 42), the state of S is re-established by recovering the stored state from snapshot-stack T. In particular, this recovers the longest prefix that the next assignment to be processed shares with any previously processed one. UncompressCFLOBDD uses the next entry of T to pick up the traversal in the middle of C, which saves work that would otherwise be necessary to retraverse C in order to reach the same resumption point. [0437] In FIG. 42, it is assumed that sequences are allowed to share common prefixes, and that manipulations of stacks S and T are carried out non-destructively. That is, an operation such as [ [0438] sets S to the prefix of sequence S that consists of all but the last element of S; however, the value of any other variable that was holding onto the original value of S is unchanged by the statement “[S,ts]=SplitOnLast (S)”. It is easy to achieve this effect by implementing S and T using linked-list data structures. [0439] RELATIONSHIP TO PRIOR ART [0440] As stated earlier, a BDD is a data structure that—in the best case—yields an exponential reduction in the size of the representation of a function over Boolean-valued arguments (i.e., compared with the size of the decision tree for the function). In contrast, a CFLOBDD—again, in the best case—yields a doubly exponential reduction in the size of the representation of a function. [0441] In the best case, an RBOBDD also yields a better-than-exponential compression in the size of the decision tree; however, the principle by which this extra compression is achieved is somewhat ad hoc, and its effect tends to dissipate as ROBDDs are combined to build up representations of more complicated functions. For instance, for the family of dot-product functions whose first two members are discussed in FIGS. 3 and 4, ROBDDs provide exponential compression, whereas CFLOBDDs provide doubly exponential compression. [0442] A number of generalizations of OBDDs/ROBDDs have been proposed [SF96], including Multi-Terminal BDDs [CMZ [0443] CFLOBDDs are unlike these structures in that they are all based on acyclic graphs, whereas CFLOBDDs use cyclic graphs. The key innovation behind CFLOBDDs is the combination of cyclic graphs with the matched-path principle. The matched-path principle lets us give the correct interpretation of a certain class of cyclic graphs as representations of functions over Boolean-valued arguments. It also allows us to perform operations on functions represented as CFLOBDDs via algorithms that are not much more complicated than their BDD counterparts. Finally, the matched-path principle is also what allows a CFLOBDD to be, in the best case, exponentially smaller than the corresponding BDD. [0444] There have been three other generalizations of OBDDs that make use of cyclic graphs: Indexed BDDs (IBDDs) [JBA [0445] The aforementioned representations all make use of numeric/arithmetic annotations on the edges of the graphs used to represent functions over Boolean arguments, rather than the matched-path principle that is basis of CFLOBDDs. The latter can be characterized in terms of a context-free language of matched parentheses, rather than in terms of numbers and arithmetic (see footnote 4). [0446] An essential part of the design of LIFs and EIFs is that the BDD-like subgraphs in them are connected up in very restricted ways. In contrast, in CFLOBDDs, different groupings at the same level (or different levels) can have very different kinds of connections in them. [0447] Similarly, CBDDs require that there be some fixed BDD pattern that is repeated over and over in the structure; a given function uses only a few such patterns. With CFLOBDDs, there can be many reused patterns (i.e., in the lower-level groupings in CFLOBDDs). [0448] In CFLOBDDs, as in BDDs, each variable is interpreted exactly once along each matched path; IBDDs permit variables to be interpreted multiple times along a single path. [0449] IBDDs and CBDDs are not canonical representations of Boolean functions, which complicates the algorithms for performing certain operations on them, such as the operation to determine whether two IBDDs (CBDDs, respectively) represent the same function. [0450] The layering in CFLOBDDs serves a different purpose than the layering found in IBDDs, LIFs/EIFs, and CBDDs. In the latter representations, a connection from one layer to another serves as a jump from one BDD-like fragment to another BDD-like fragment; in CFLOBDDs, only the lowest layer (i.e., the collection of level-0 groupings) consists of BDD-like fragments (and just two very simple ones at that). It is only at level 0 that the values of variables are interpreted. As one follows a matched path through a CFLOBDD, the connections between the groupings at levels above level 0 serve to encode which variable is to be interpreted next. [0451] IBDDs, LIFs/EIFs, and CBDDs could all be generalized by replacing the BDD-like subgraphs in them with CFLOBDDs. [0452] Similarly, other variations on BDDs [SF96], such as EVBDDs [LS92], BMDs [BC95], *BMDs [BC95], HDDs [CFZ95c, CFZ95b], which are all based on DAGs, could be generalized to use cyclic data structures and matched paths, along the lines of CFLOBDDs. [0453] While the foregoing specification of the invention has described it with reference to specific embodiments thereof, it will be apparent that various modifications and changes may be made thereof without departing from the broader spirit and scope of the invention. The specification and drawings are, accordingly, to be regarded in an illustrative rather than a restrictive sense. [0454] REFERENCES [0455] [AMU95] A. Anuchitanukul, Z. Manna. and T. E. Uribe. Differential BDDs. In J. van Leeuween, editor, [0456] [BC95] R. E. Bryant and Y. -A. Chen. Verification of arithmetic circuits with binary moment diagrams. In Proc. of the 30th ACM/IEEE [0457] [BFG+93] R. I. Bahar, E. A. Frohm, C. M. Gaona, G. D. Hachtel, E. Macii. A. Pardo, and F. Sonienzi. Algebraic decision diagrams and their applications. In [0458] [BRB90] K. S. Brace, R. L. Rudell, and R. E. Bryant. Efficient implementation of a BDD package. In P7oc. of the 27th ACM/IEEE [0459] [Bry86] R. E. Bryant. Graph-based algorithms for Boolean function manipulation. IEEE [0460] [Bry92] R. E. Bryant. Symbolic boolean manipulation with ordered binary-decision diagrams. ACM [0461] [CE81] E. M. Clarke. Jr. and E. A. Emerson. Synthesis of synchronization skeletons for branching time temporal logic. In LNCS 131, [0462] [CFZ95a] E. M. Clarke, Jr., M. Fujita, and X. Zhao. Applications of multi-terminal binary decision diagrams. [0463] Technical Report CS-95-160, Carnegie Mellon Univ., School of Comp. Sci., April 1995. [0464] [CFZ95b] E. M. Clarke, Jr., M. Fujita, and X. Zhao. Hybrid decision diagrams:Overcoming the limitations of MITBDDs and BMDs. Technical Report CS-95-159, Carnegie Mellon Univ., School of Comp. Sci., April 1995. [0465] [CFZ95c] E. M. Clarke, Jr., M. Fujita, and X. Zhao. Hybrid decision diagrams:Overcoming the limitations of MTBDDs and BMDs. In Proc. of the Int. Conf. on [0466] [CGP99] E. M. Clarke, Jr., 0. Grumberg, and D. A. Peled. [0467] [CMZ [0468] [Dew79] R. B. K. Dewar. The SETL Programmmng Language. 1979. Available at “http://birch.eecs.lehigh.edu/˜bacon/setlprog.ps.gz”. [0469] [GF93] A. Gupta and A. L. Fisher. Representation and symbolic manipulation of linearly inductive Boolean functions. In Proc. of the Int. Conf. on [0470] [Gup94] A. Gupta. [0471] [HMM85] S. L. Hurst, D. M. Miller, and J. C. Muzio. [0472] Inc., 1985. [0473] [HS97] J. P. Hansen and M. Sekine. Decision diagram based techniques for the Haar wavelet transform. [0474] In Proc. of the First Int. Conf. on Systems, [0475] [JBA [0476] [LS92] Y. -T. Lai and S. Sastry. Edge-valued binary decision diagrams for multi-level hierarchical verification. [0477] [McM93] K. L. McMillan. [0478] [QS81] J. P. Quielle and J. Sifakis. Specification and verification of concurrent systems in CESAR.. In [0479] [Ref99] F. Reffel. BDD-nodes can be more expressive. In [0480] [SDDS87] J. T. Schwartz, R. B. K. Dewar, E. Dubinsky, and E. Schoenberg. [0481] [SF96] T. Sasao and M. Fujita, editors. [0482] [Weg00] I. Wegener. [0483] Math. and Appl. Society for Industrial and Applied Mathematics, 2000. Referenced by
Classifications
Legal Events
Rotate |