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.

What a mess!<br />

Iϕ((x1 + x2) + (x1 ∗ x2 + x3 ∗ x4))<br />

= Iϕ(x1 + x2) ∨ Iϕ(x1 ∗ x2 + x3 ∗ x4)<br />

= Iϕ(x1) ∨ Iϕ(x2) ∨ Iϕ(x1 ∗ x2) ∨ Iϕ(x3 ∗ x4)<br />

= ϕ(x1) ∨ ϕ(x2) ∨ ¬(Iϕ(x1 ∗ x2)) ∨ Iϕ(x3 ∗ x4)<br />

= (T ∨ F) ∨ (¬(Iϕ(x1) ∧ Iϕ(x2)) ∨ (Iϕ(x3) ∧ Iϕ(x4)))<br />

= T ∨ ¬(¬(Iϕ(x1)) ∧ ϕ(x2)) ∨ (ϕ(x3) ∧ ϕ(x4))<br />

= T ∨ ¬(¬(ϕ(x1)) ∧ F) ∨ (T ∧ F)<br />

= T ∨ ¬(¬(T) ∧ F) ∨ F<br />

= T ∨ ¬(F ∧ F) ∨ F<br />

= T ∨ ¬(F) ∨ F = T ∨ T ∨ F = T<br />

c○: Michael Kohlhase 136<br />

A better mouse-trap: Truth Tables<br />

Truth tables to visualize truth functions:<br />

·<br />

T F<br />

F T<br />

∗ T F<br />

T T F<br />

F F F<br />

+ T F<br />

T T T<br />

F T F<br />

If we are interested in values for all assignments (e.g. of x123 ∗ x4 + x123 ∗ x72)<br />

Boolean Algebra<br />

assignments intermediate results full<br />

x4 x72 x123 e1 := x123 ∗ x72 e2 := e1 e3 := x123 ∗ x4 e3 + e2<br />

F F F F T F T<br />

F F T F T F T<br />

F T F F T F T<br />

F T T T F F F<br />

T F F F T F T<br />

T F T F T T T<br />

T T F F T F T<br />

T T T T F T T<br />

c○: Michael Kohlhase 137<br />

Definition 242 A Boolean algebra is Ebool together with the models<br />

〈{T, F}, {0 ↦→ F, 1 ↦→ T, + ↦→ ∨, ∗ ↦→ ∧, − ↦→ ¬}〉.<br />

〈{0, 1}, {0 ↦→ 0, 1 ↦→ 1, + ↦→ max, ∗ ↦→ min, − ↦→ λx.1 − x}〉.<br />

BTW, the models are equivalent (0 ˆ=F, 1 ˆ=T)<br />

Definition 243 We will use B for the universe, which can be either {0, 1} or {T, F}<br />

Definition 244 We call two expressions e1, e2 ∈ Ebool equivalent (write e1 ≡ e2), iff<br />

Iϕ(e1) = Iϕ(e2) for all ϕ.<br />

Theorem 245 e1 ≡ e2, iff (e1 + e2) ∗ (e1 + e2) is a theorem of Boolean Algebra.<br />

c○: Michael Kohlhase 138<br />

As we are mainly interested in the interplay between form and meaning in Boolean Algebra, we<br />

will often identify Boolean expressions, if they have the same values in all situations (as specified<br />

74

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

Saved successfully!

Ooh no, something went wrong!