Lecture 13
Lecture 13
James Brotherston
1/ 12
Induction measures on data structures
2/ 12
Height of a binary tree
height(Lf ) = 0 (1)
height(Br(x, t1 , t2 )) = 1 + max(height(t1 ), height(t2 )) (2)
4/ 12
Introduction
5/ 12
Syntax of classical modal logic
A ::= P (proposition)
| ¬A (negation)
| (A ∧ A) (conjunction)
..
.
| ♦A (“possibly”)
| A (“necessarily”)
6/ 12
Translating English to modal logic
♦R ∧ ♦¬R
• “If you’re in the pub then you must have skipped class”
P → C
♦S
♦D
7/ 12
Semantics of modal logic — frames and valuations
M = (W, R)
M, w |=ρ P ⇔ w ∈ ρ(P )
M, w |=ρ ¬A ⇔ M, w 6|=ρ A
M, w |=ρ A ∧ B ⇔ M, w |=ρ A and M, w |=ρ B
..
.
M, w |=ρ ♦A ⇔ ∃w0 ∈ W. Rww0 and M, w0 |=ρ A
M, w |=ρ A ⇔ ∀w0 ∈ W. if Rww0 then M, w0 |=ρ A
9/ 12
Validity and satisfiability
10/ 12
Validity example (1)
Lemma
(A ∧ (A → B)) → B is valid.
Proof.
Let M = (W, R) be a frame, ρ a valuation, w ∈ W . RTP: