0% found this document useful (0 votes)
3 views11 pages

Lecture 13

The document discusses concepts in the Theory of Computation, focusing on formal logic and modal logic. It covers induction measures on data structures, the height of binary trees, and the syntax and semantics of classical modal logic. Key topics include the satisfaction relation, validity, and satisfiability in modal logic, along with examples and proofs.

Uploaded by

Scott Chen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views11 pages

Lecture 13

The document discusses concepts in the Theory of Computation, focusing on formal logic and modal logic. It covers induction measures on data structures, the height of binary trees, and the syntax and semantics of classical modal logic. Key topics include the satisfaction relation, validity, and satisfiability in modal logic, along with examples and proofs.

Uploaded by

Scott Chen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

COMP0003 Theory of Computation

(Part I: Formal Logic)


Lecture 13

James Brotherston

Dept. of Computer Science, University College London

1/ 12
Induction measures on data structures

• Infinite descent / complete induction for N depend on the


well-founded order < on N.
• For general inductively defined data structures (lists,
trees), we can obtain such an order: x v y, meaning “x is a
substructure of y”.
• However, it is more common to define a numeric measure
over data structures and do induction on that.
• Examples of measures on data structures:
• length of a list;
• height of a tree;
• number of connectives in a formula.

2/ 12
Height of a binary tree

height(Lf ) = 0 (1)
height(Br(x, t1 , t2 )) = 1 + max(height(t1 ), height(t2 )) (2)

Lemma. Any binary tree t of height h has at most 2h leaves.


Proof. Complete induction on h.
0
Ind. hyp.: All binary trees of height k 0 < k have ≤ 2k leaves.
Step case: Let t be a tree of height k. If t = Lf then the result
is trivial. Otherwise t = Br(x, t1 , t2 ) and k = 1 + max(h1 , h2 ),
where hi = height(ti ). So h1 , h2 < k. Hence t1 and t2 have at
most 2h1 resp. 2h2 leaves by IH. No. leaves in t is:

2h1 + 2h2 ≤ 2k−1 + 2k−1 = 2k


3/ 12
Classical modal logic

4/ 12
Introduction

• Modal logic extends propositional logic with new


connectives called modalities. It is still much less
expressive than first-order logic though.
• There are many different modal logics, based on the choice
of modalities and interpretations for them.
• We will examine just the most common one (although we
will allow some variations).
• Here, the modalities capture possibility and necessity.

5/ 12
Syntax of classical modal logic

• As usual, we define the syntax of formulas before doing


anything else.
• As for propositional logic, we assume an infinite set V of
proposition letters.
• Formulas are given by the grammar:

A ::= P (proposition)
| ¬A (negation)
| (A ∧ A) (conjunction)
..
.
| ♦A (“possibly”)
| A (“necessarily”)

6/ 12
Translating English to modal logic

• “It might rain later, and then again it might not”

♦R ∧ ♦¬R

• “If you’re in the pub then you must have skipped class”

P → C

• “It must be possible for me to solve this problem”

♦S

• “Maybe my death is inevitable”

♦D
7/ 12
Semantics of modal logic — frames and valuations

• To give a semantics, we need to explain how to account for


possibility and necessity.
• A frame (or Kripke model) is a pair

M = (W, R)

where W is a nonempty set (of “worlds”), and R ⊆ W × W


is a binary relation on W .
• A valuation for M is a map from proposition letters to sets
of worlds:
ρ : V → P ow(W )
• Intuitively, ρ(P ) is the set of worlds at which P is true.
8/ 12
Satisfaction relation
Let M = (W, R) be a frame, let ρ be a valuation for M , let A
be a formula and let w ∈ W .
We write M, w |=ρ A to mean “A is true at world w (in frame
M and valuation ρ” (and M, w 6|=ρ A otherwise).

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

• Very similar to first-order logic!

• A is valid in M , written M |= A, if M, w |=ρ A for all


possible valuations ρ for M and all w ∈ W .
• A is valid, written |= A, if it is valid in all frames.

• A formula A is satisfiable in (frame) M if there is a


valuation ρ and w ∈ W such that M, w |=ρ A.
• A is satisfiable if it is satisfiable in some frame.

• Validity ⇒ validity in M ⇒ satisfiability in M ⇒


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:

M, w |=ρ (A ∧ (A → B)) → B

So assume M, w |=ρ A (1) and M, w |=ρ (A → B) (2). RTP


M, w |=ρ B. This means, assuming Rww0 , showing that
M, w0 |=ρ B.
Now by (1) and Rww0 we have M, w0 |=ρ A, and by (2) and
Rww0 we have M, w0 |=ρ A → B. Hence M, w0 |=ρ B as
required.
11/ 12

You might also like