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.

Step 5 Apply <strong>the</strong> elim_false_vars algorithm on n with D as its argument, thus<br />

eliminating all variables in D from n.<br />

Step 6 Find all entailed variables in n using <strong>the</strong> algorithm entailed_vars and add<br />

<strong>the</strong>m to E.<br />

Step 7 Find all disentailed variables in n using <strong>the</strong> algorithm disentailed_vars and<br />

add <strong>the</strong>m to D.<br />

Step 8 If E ∩ D = ∅, <strong>the</strong> final result <strong>of</strong> <strong>the</strong> algorithm is ⊥.<br />

Step 9 Find all equivalent variables in n by using <strong>the</strong> algorithm equivalent_vars, put<br />

this in<strong>for</strong>mation in an equivalence relation T and do <strong>the</strong> assignment L = L ∧ T .<br />

Step 10 Eliminate all in<strong>for</strong>mations on equivalent variables from n by applying <strong>the</strong><br />

algorithm squeeze_equivalent_vars with T as its argument.<br />

Step 11 Rename each variable in n to its leader in L by applying <strong>the</strong> rename algorithm.<br />

This algorithm respects <strong>the</strong> loop invariant which states that after each iteration <strong>the</strong><br />

semantics given in Equation 4.5 is preserved. Pseudo-code <strong>for</strong> <strong>the</strong> normalization algorithm<br />

can be found in Algorithm 22.<br />

CORAL also implements a simpler, more efficient specialization <strong>of</strong> this algorithm <strong>for</strong><br />

positive <strong>functions</strong>; in this case, <strong>of</strong> course, we must not consider disentailed variables. A<br />

pseudo-code <strong>for</strong> this specialized algorithm is shown in Algorithm 23.<br />

4.2.3 Conjunction<br />

The algorithms <strong>for</strong> conjunction and disjunction are an adaptation <strong>of</strong> <strong>the</strong> ones presented in<br />

[BS98]. Given two (not necessarily normalized) composite representations 〈n1, E1, D1, L1〉<br />

and 〈n2, E2, D2, L2〉, we compute <strong>the</strong>ir conjunction as:<br />

〈n ′ 1, E ′ 1, D ′ 1, L ′ 1〉 = η(〈n1, E1 ∪ E2, D1 ∪ D2, L1 ∧ L2〉)<br />

〈n ′ 2, E ′ 2, D ′ 2, L ′ 2〉 = η(〈n2, E1 ∪ E2, D1 ∪ D2, L1 ∧ L2〉)<br />

〈n1, E1, D1, L1〉 ∧ 〈n2, E2, D2, L2〉 = η(〈n ′ 1 ∧ n ′ 2, E ′ 1 ∪ E ′ 2, D ′ 1 ∪ D ′ 2, L ′ 1 ∧ L ′ 2〉)<br />

Notice that <strong>the</strong> initial collection <strong>of</strong> entailed, disentailed and equivalent variables allows<br />

<strong>for</strong> greater reduction <strong>of</strong> <strong>the</strong> ROBDDs when normalization is called (and recall that <strong>the</strong> ∧<br />

operator on equivalence relations represents <strong>the</strong> transitive closure <strong>of</strong> <strong>the</strong> union).<br />

CORAL also provides a function meet_all_assign (and <strong>the</strong> corresponding<br />

meet_all_up_assign that utilizes upward approximation) that conjuncts more than two<br />

<strong>Boolean</strong> <strong>functions</strong> at <strong>the</strong> same time. In this case we start by collecting <strong>the</strong> entailed, disentailed<br />

and equivalent variables <strong>of</strong> ALL <strong>functions</strong> in order to be able to reduce <strong>the</strong> ROBDDs<br />

4.2 Algorithms with composite representations 38

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

Saved successfully!

Ooh no, something went wrong!