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.

x3<br />

y3<br />

x2<br />

y2<br />

x1<br />

y1<br />

0 1 0<br />

1<br />

Figure 2.2: Two ROBDDs representing <strong>the</strong> <strong>Boolean</strong> function (x1 ∧y1)∨(x2 ∧y2)∨(x3 ∧y3)<br />

using different variable orderings.<br />

2.3 Operations on ROBDDs<br />

2.3.1 Implementation <strong>of</strong> algebraic operators<br />

The basic idea<br />

We will now show how it is possible to use ROBDDs <strong>for</strong> implementing operations on<br />

<strong>Boolean</strong> <strong>functions</strong>, taking <strong>the</strong> application <strong>of</strong> a generic binary operator as an example.<br />

The fundamental trick consists in exploiting Equation 1.2, combined with <strong>the</strong> fact that<br />

<strong>for</strong> each ROBDD (r, N) representing <strong>the</strong> <strong>Boolean</strong> function f = (r)D, <strong>for</strong> each variable v<br />

such that v rvar and <strong>for</strong> each b ∈ {0, 1} we have:<br />

⎧<br />

⎪⎨ f, if v ≺ rvar<br />

f[b/v] = (rfalse)<br />

⎪⎩<br />

D, if v = rvar and b = 0<br />

(2.1)<br />

(rtrue)D, if v = rvar and b = 1<br />

Given <strong>the</strong>se results, we can implement a binary operator • with a recursive procedure<br />

starting from <strong>the</strong> roots <strong>of</strong> <strong>the</strong> two arguments, using an algorithm that has been presented<br />

in [Bry86] and improved in [Bry92]. Each recursive call considers one node <strong>for</strong> each <strong>of</strong><br />

<strong>the</strong> two ROBDD arguments and generates one node <strong>of</strong> <strong>the</strong> resulting ROBDD. The base<br />

case is encountered when both nodes are terminal nodes: <strong>the</strong> result is a terminal node<br />

obtained by applying • on <strong>the</strong> truth values represented by <strong>the</strong> two terminal nodes. If <strong>the</strong><br />

2.3 Operations on ROBDDs 8<br />

y2<br />

y1<br />

x3<br />

x2<br />

x3<br />

y3<br />

x1<br />

x2<br />

x3<br />

y1<br />

y2<br />

x3<br />

y1<br />

y1

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

Saved successfully!

Ooh no, something went wrong!