27.09.2013 Views

a modern C++ library for the manipulation of Boolean functions

a modern C++ library for the manipulation of Boolean functions

a modern C++ library for the manipulation of Boolean functions

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

4.2 Algorithms with composite representations<br />

4.2.1 Normalization<br />

All algorithms in this section will be described only <strong>for</strong> <strong>the</strong> case when entailed, disentailed<br />

and equivalent variables are all represented explicitly.<br />

The first and most important algorithm is <strong>the</strong> normalization algorithm, which allows<br />

us to trans<strong>for</strong>m an internal representation where conditions 4.1, 4.2, 4.3 and 4.4 are not<br />

necessarily met to one where <strong>the</strong>y are all met without changing <strong>the</strong> semantics given by<br />

Equation 4.5. Given this algorithm, all operations on composite representations (with<br />

an arbitrary number <strong>of</strong> arguments) can be implemented, once we have a corresponding<br />

implementation on ROBDDs, by this simple algorithm:<br />

Denormalization Denormalize <strong>the</strong> representation, which means moving, <strong>for</strong> all <strong>the</strong> arguments<br />

<strong>of</strong> <strong>the</strong> operator, all in<strong>for</strong>mations on entailed, disentailed and equivalent<br />

variables that are stored in E, D and L into <strong>the</strong> ROBDD n.<br />

Application Apply <strong>the</strong> corresponding operator on ROBDDs to <strong>the</strong> denormalized ROBDDs<br />

computed in <strong>the</strong> previous step.<br />

Normalization Normalize <strong>the</strong> ROBDD computed in <strong>the</strong> previous step, which means<br />

moving all in<strong>for</strong>mations on entailed, disentailed and equivalent variables that are<br />

stored in <strong>the</strong> ROBDD into three separate components as described previously.<br />

Of course this trivial implementation is unacceptable, as it goes against <strong>the</strong> principle <strong>of</strong><br />

keeping <strong>the</strong> ROBDDs as small as possible when applying an operator on <strong>the</strong>m in order to<br />

improve efficiency. That is why we will present better implementations <strong>for</strong> <strong>the</strong>se operators<br />

right after describing our normalization algorithm.<br />

The result <strong>of</strong> <strong>the</strong> application <strong>of</strong> <strong>the</strong> normalization function on <strong>the</strong> composite representation<br />

〈n, E, D, L〉 will be denoted as η(〈n, E, D, L〉).<br />

4.2.2 Implementing <strong>the</strong> normalization algorithm<br />

CORAL’s generic normalization algorithm is an adaptation <strong>of</strong> an old normalization<br />

algorithm that was a part <strong>of</strong> China and is described in [BS98]. It consists <strong>of</strong> <strong>the</strong>se steps,<br />

which must be applied repeatedly until a fixpoint is reached:<br />

Step 1 If n = 0 <strong>the</strong> final result <strong>of</strong> <strong>the</strong> algorithm is ⊥.<br />

Step 2 Look <strong>for</strong> all <strong>the</strong> equivalence classes in L that contain at least one variable in E<br />

and add all <strong>the</strong>ir variables to E. Do <strong>the</strong> same <strong>for</strong> D.<br />

Step 3 Remove all <strong>the</strong> equivalence classes that were found in <strong>the</strong> previous step from L.<br />

Step 4 Apply <strong>the</strong> elim_true_vars algorithm on n with E as its argument, thus eliminating<br />

all variables in E from n.<br />

4.2 Algorithms with composite representations 37

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!