15.08.2013 Views

General Computer Science 320201 GenCS I & II Lecture ... - Kwarc

General Computer Science 320201 GenCS I & II Lecture ... - Kwarc

General Computer Science 320201 GenCS I & II Lecture ... - Kwarc

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

the disjunctive normal form, and then replace partners by resolvents, until that is impossible.<br />

The algorithm QMC1, for determining Prime Implicants<br />

Definition 284 Let M be a set of monomials, then<br />

R(M) := {m | (m x) ∈ M ∧ (m x) ∈ M} is called the set of resolvents of M<br />

R(M) := {m ∈ M | m has a partner in M} (n xi and n xi are partners)<br />

Definition 285 (Algorithm) Given f : B n → B<br />

let M0 := DNF(f) and for all j > 0 compute (DNF as set of monomials)<br />

Mj := R(Mj−1) (resolve to get sub-monomials)<br />

Pj := Mj−1\ R(Mj−1) (get rid of redundant resolution partners)<br />

terminate when Mj = ∅, return Pprime := n<br />

j=1 Pj<br />

c○: Michael Kohlhase 159<br />

We will look at a simple example to fortify our intuition.<br />

Example for QMC1<br />

x1 x2 x3 f monomials<br />

F F F T x1 0 x2 0 x3 0<br />

F F T T x1 0 x2 0 x3 1<br />

F T F F<br />

F T T F<br />

T F F T x1 1 x2 0 x3 0<br />

T F T T x1 1 x2 0 x3 1<br />

T T F F<br />

T T T T x1 1 x2 1 x3 1<br />

Pprime =<br />

3<br />

Pj = {x1 x3, x2}<br />

j=1<br />

M0 = {x1 x2 x3,<br />

x1 x2 x3,<br />

x1 x2 x3,<br />

x1 x2 x3,<br />

x1 x2 x3}<br />

<br />

= : e 0 1<br />

M 1 = { x1 x2<br />

<br />

P 1 = ∅<br />

R(e 0 1 ,e0 2 )<br />

= : e 1 1<br />

M 2 = { x2<br />

<br />

P 2 = {x1 x3}<br />

M 3 = ∅<br />

P 3 = {x2}<br />

= : e 0 2<br />

, x2 x3<br />

<br />

R(e 0 1 ,e0 3 )<br />

= : e 1 2<br />

, x2<br />

<br />

R(e1 1 ,e1 4 ) R(e1 2 ,e1 3 )<br />

= : e 0 3<br />

}<br />

, x2 x3<br />

<br />

= : e 0 4<br />

R(e 0 2 ,e0 4 )<br />

= : e 1 3<br />

= : e 0 5<br />

, x1 x2<br />

<br />

R(e 0 3 ,e0 4 )<br />

= : e 1 4<br />

, x1 x3<br />

<br />

R(e 0 4 ,e0 5 )<br />

But: even though the minimal polynomial only consists of prime implicants, it need not<br />

contain all of them<br />

c○: Michael Kohlhase 160<br />

We now verify that the algorithm really computes what we want: all prime implicants of the<br />

Boolean function we have given it. This involves a somewhat technical proof of the assertion<br />

below. But we are mainly interested in the direct consequences here.<br />

Properties of QMC1<br />

Lemma 286 (proof by simple (mutual) induction)<br />

1. all monomials in Mj have exactly n − j literals.<br />

2. Mj contains the implicants of f with n − j literals.<br />

3. Pj contains the prime implicants of f with n − j + 1 for j > 0 . literals<br />

84<br />

= : e 1 5<br />

}

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

Saved successfully!

Ooh no, something went wrong!