Theoretical Computer Science (Bridging Course)
Dr. G. D. Tipaldi University of Freiburg
F. Boniardi Department of Computer Science
Winter Semester 2014/2015
Exercise Sheet 11
Due: 29th January 2015
Exercise 11.1 (CNF, DNF)
(a) Convert φ := ¬(p → q) ∨ ((r ∨ s) → (q ∨ t)) ∨ (¬p → ¬v) into Conjunctive Normal Form.
Solution:
¬(p → q) ∨ ((r ∧ s) → (q ∨ t)) ∨ (¬p → ¬v) ≡
≡ ¬(¬p ∨ q) ∨ (¬(r ∨ s) ∨ (q ∨ t)) ∨ (p ∨ ¬v) ≡
≡ (p ∧ ¬q) ∨ (¬r ∧ ¬s) ∨ q ∨ t ∨ p ∨ ¬v ≡
≡ (p ∧ ¬q) ∨ ((¬r ∨ q ∨ t ∨ p ∨ ¬v) ∧ (¬s ∨ q ∨ t ∨ p ∨ ¬v)) ≡
≡ (¬r ∨ p ∨ q ∨ t ∨ ¬v) ∧ (¬s ∨ p ∨ q ∨ t ∨ ¬v) ∧ (¬r ∨ p ∨ t ∨ ¬v ∨ >) ∧ (¬s ∨ p ∨ t ∨ ¬v ∨ >) ≡
≡ (¬r ∨ p ∨ q ∨ t ∨ ¬v) ∧ (¬s ∨ p ∨ q ∨ t ∨ ¬v).
Wn
(b) Convert φ := i=1 (pi ↔ qi ) into Disjunctive Normal Form.
Solution:
n
_ n
_
(pi ↔ qi ) ≡ ((pi → qi ) ∧ (qi → pi )) ≡
i=1 i=1
_n
≡ ((¬pi ∨ qi ) ∧ (¬qi ∨ pi )) ≡
i=1
_n
≡ ((¬pi ∧ qi ) ∨ (¬pi ∧ pi ) ∨ (qi ∧ ¬qi ) ∨ (qi ∧ pi )) ≡
i=1
_n
≡ ((¬pi ∧ ¬qi ) ∨ (qi ∧ pi )) ≡
i=1
_n n
_
≡ (¬pi ∧ ¬qi ) ∨ (qi ∧ pi ).
i=1 i=1
Exercise 11.2 (Derivation, 3 marks)
Give a derivation of φ = B ∧ C from the knowledge base
KB = {A, B, A ∨ C, K ∧ E ↔ A ∧ B, ¬C → D, E ∨ F → ¬D},
using the inference rules for propositional logic.
Solution:
1. A (KB)
2. B (KB)
3. A ∧ B (1, 2, and introduction)
4. K ∧ E ↔ A ∧ B (KB)
5. A ∧ B → K ∧ E (4, ↔ elimination)
6. K ∧ E (3, 5, modus ponens)
7. E (6, and elimination)
8. E ∨ F (7, or introduction)
9. E ∨ F → ¬D (KB)
10. ¬D (8, 9, modus ponens)
11. ¬C → D (KB)
12. C (10, 11, modus tolens)
13. B ∧ C (2, 12, and introduction)
Exercise 11.3 (Contradiction Theorem)
Prove the contradiction theorem: KB ∪ {ϕ} is unsatisfiable iff KB |= ¬ϕ.
Hint: Deduction Theorem can be useful here.
Solution:
KB ∪ {ϕ} is unsatisfiable ⇔
⇔ KB ∪ {ϕ} |= ⊥ (immediate) ⇔
⇔ KB |= ϕ → ⊥ (deduction theorem) ⇔
⇔ KB |= (¬ϕ ∨ ⊥) (logical equivalence). ⇔
⇔ KB |= ¬ϕ (logical equivalence).