Escolar Documentos
Profissional Documentos
Cultura Documentos
Knowledge
Representation
and Reasoning
University "Politehnica" of
Bucharest
Department of Computer
Science
Fall 2015
Adina Magda Florea
Lecture 3
Modal Logic
Lecture outline
Introduction
Modal logic in CS
Syntax of modal logic
Semantics of modal logic
Logics of knowledge and belief
Temporal logics
2
1. Introduction
In first order logic a formula is either true or false
in any model
In natural language, we distinguish between
various modes of truth, e.g, known to be true,
believed to be true, necessarily true, true in
the future
History
Classical logic is truth-functional = truth value of
a formula is determined by the truth value(s) of
its subformula(e) via truth tables for
,, , and
Initially modal logic tried to capture a non truthfunctional notion of A Necessarily Implies B (A
B) or it is necessary that A B
Modal operators
P - possibly true
N - necessarily true
Modal logics - modes of truth:
Modal operators
In a narrower sense the term modal logic refers to the
logic dealing with the notions of necessity and
possibility - - necessary, and - possible
In a broader sense:
deontic logic dealing with the notions of obligation and
permissibility - - it is obligatory that, and - it is
permissible that
temporal logic dealing with the logic of expressions like
It will be the case that, It will always be the case that
F eventually, G always
epistemic logic dealing with the notions of knowledge
and belief - knowledge - what an agent knows / believes
6
2 x <y 99
3. Modal logic
Saul Aaron Kripke born 1940 is
an American philosopher and logician,
currently Professor of
Philosophy, Emeritus, at Princeton
University
Kripke has made influential and
original contributions to logic,
especially modal logic Kripke
semantics
He proposed his semantics when he
was 19 years old, student at Harvard
11
Formulae: A ::= p | A | A | A | A B | A B | A B
where A and B are a wffs in PL
Examples:
pq,
p q
12
P ~~P
P = it will rain
It is possible that it will rain today if and only if it
is not necessary that it will not rain today
It is necessary that it will rain today if and only if
it is not possible that it will not rain today.
13
A1. A (B A)
A2. (A (B C)) ((A B) (A C))
A3. ((A) (B)) (B A)
A4. (A B) ( A
B)
Distribution of modality
14
Inference rules
Substitution (uniform)
Modus Ponens A, (A B) B
A A
15
Nonlinear model
The semantics of modal logic is known as the Kripke
Semantics, also called the Possible World approach
16
17
M |=W A B iff
M |=W A B iff
M |=W A or M |=W B
M |=W A B iff
M |=W A or M |=W B
(A B is true in W)
M |=W A iff
M |=W
A iff
18
Examples
p I am rich
q I am president of Romania
r I am holding a PhD in CS
W1
I(W1,p) = f
I(W1,q) = f
I(W1,r) = t
W0
I(W0,p) = f
I(W0,q) = f
I(W0,r) = f
W2
I(W2,p) = f
I(W2,q) = f
I(W2,r) = t
I(W0, p) = ?
I(W0, p) = ?
I(W0, r) = ?
I(W0, r) = ?
19
Examples
w1
p, q, r
w0
p, q, r
w2
p, q, r
w3
p, q, r
I(W0, p) = ?
I(W0, p) = ?
I(W0, q) = ?
I(W0, q) = ?
I(W0, r) = ?
I(W0, r) = ?
I(W1, p) = ?
I(W1, p) = ?
20
A1. A (B A)
A2. (A (B C)) ((A B) (A C))
A3. ((A) (B)) (B A)
A4. (A B) ( A B)
X X
is false in K
A iff
23
26
27
S5
symmetric
transitive
S4
transitive
reflexive
symmetric
reflexive
serial
K
28
29
Properties of knowledge
(A1) Distribution axiom:
K(a, A) K(a, A B) K(a, B)
"The agent ought to be able to reason with its
knowledge"
(A B) ( A B) (Axiom of distribution of modality)
K(a,A B) ( K(a,A) K(a,B) )
Properties of knowledge
(A3) Positive introspection axiom
K(a, A) K(a, K(a, A))
X X (S4) - satisfied if R is transitive
K(a, A) K(a, K(a, A))
Properties of belief
Distribution axiom: B(a, A) B(a, A B) B(a, B)
YES
Knowledge axiom: B(a, A) A
NO
Positive introspection axiom
B(a, A) B(a, B(a, A))
YES
Negative introspection axiom
B(a, A) B(a, B(a, A))
problematic
36
(1b)
(2a)
(3)
Proof
4. WA KB(WA)
5. KB(WA W B)
1, A2
2, A2
A2: K(a, A) A
6. KB(WA) KB(W B)
7. WA KB(W B)
5, A1
4, 6
8. KB(W B) WA
9. KA(WA)
contrapositive of 7
3, 8, R2
R2: A B and K(a, A) infer K(a, B)
38
6. Temporal logic
The time may be linear or branching; the branching can be
in the past, in the future of both
Time is viewed as a set of moments with a strict partial
order, <, which denotes temporal precedence.
Every moment is associated with a possible state S of the
world, identified by the propositions that hold at that
moment
39
Temporal logic
Modal operators of temporal logic (linear)
- Xp - p is true in the next moment next ()
M |=s,t X p iff M |=s,t+1 p
Xp
Pp
pUq
40
Temporal logic
Fp - p will eventually be true in the future - eventually
Fp
Gp - p will always be true in the future always
Gp
F one time point
Gp F p
43
44
45
r
s
r
s
p
s
q
r
s
q
F - eventually
G - always
AGs
A - inevitable
EGr
E - optional
EFp
AFq
r - Alice is in Italy
s Paris is the capital of France
s
q
pie
cake
pie
cake
G - always
apple
cake pie
E cake pie
A cake pie
apple
E apple
A apple
apple
apple
F - eventually
E
E
apple
apple
A
A
A - inevitable
E - optional
apple
apple
47