You are on page 1of 2

COMP1215 Foundations of Computer Science

Exercise Sheet 3 - Logic


Syntax & Semantics

NOTE: Tutorials will focus on selected representative exercises and answer questions
about the solutions to the rest of them. Selected exercises: 2b (tautologies), 3b (satisfiabil-
ity), 4a (logical equivalence), 5 (semantic entailment).

1. Draw syntax trees for the following formulas:

(a) p → (q → r);
(b) (¬p → ¬q) → (q → p);
(c) (r → p ∧ q) ∨ (p ∨ q → r).

2. Prove that the following are tautologies:

(a) ⊥ → p;
(b) (p → q) ∨ (q → p);
(c) p ∨ ¬p;
(d) ¬(p ∧ q) → (p → ¬q);
(e) (p → q) ∧ (q → r) → p → r.

3. Which of the following are satisfiable? Justify your answer.

(a) p → ⊥;
(b) (p → q) ∧ p ∧ ¬q;
(c) (¬p ∨ q) ∧ r.

4. Show that the following are logically equivalent:

(a) p ∧ q → r and p → q → r;
(b) p ∨ q → r and (p → r) ∧ (q → r);
(c) p → q and ¬q → ¬p;
5. Prove the following for any formulas ϕ, ψ and χ: {ϕ → (ψ → χ)} |= ϕ ∧ ψ → χ

6. Let σ(p) = F , σ(q) = T and σ(r) = T . Derive J(p ∨ q) → (q ∧ r)Kσ by following the
recursion to the end.

Optional, advanced exercises


1. Show that logical equivalence is an equivalence relation on the set of formulas of
propositional logic. How many logical equivalence classes are there for formulas with
two propositional variables p and q?

You might also like