Introduction To Modal Logic
Introduction To Modal Logic
Modal Predicate
logic
Modal
Propositional logic
Boolean Logic
= Propositional logic
First-Order Logic =
Predicate logic
1. p
3. p/\q
4. p
5. q p
6. p (q p)
2. q
7. q
8. p q
9. q(p q)
p q;
where of course the propositional variables can vary with
personal choice.
Aristotle
St. Anselm
C.I. Lewis
Saul Kripke
Modern
Engineering
Temporal Logic
and Model
Checking
Troubles with
material
conditional
(material implication)
pq
According to Lewis
the implication
p q requires that
or
it is necessary that p q
Just one
example
Dorothy
Edgingtons Proof
of the Existence of
God
Material
implication
I do not pray
So God exists
G (P A)
De Morgan
So God exists.
pq
Material
implication
possible
( p q)
Strict Implication
Modal
Logic
ab\cd
00 01 11 10
ab\cd
00 01 11 10
00 1
00 0
01 0
01 0
11 0
11 0
10 0
10 0
ab\cd
00 01 11 10
00 1
01 1
11 1
10 1
ab\cd
Tautology is true in
every world
00 0
01 0
11 0
10 0
00 0
01 0
11 0
10 0
ab\cd
00 01 11 10
00 01 11 10
00 01 11 10
00 1
01 1
11 1
10 1
not
Not satisfied is
false in every
world
1. So we can use only one of the two operators,
for instance necessary
2. But it is more convenient to use two operators.
3. Next we will be using even more than two
operators, but the understanding of these two
is crucial.
Modal
processing
certain values
1
?
?
1
0
0
TYPES
OF
MODAL
LOGIC
It is necessary that p,
It is possible that p,
etc.
I know that p,
I believe that p,
etc.
It is compulsory that p,
It is forbidden that p,
It is good that p,
It is bad that p
Syntax of
Modal Logic
Remember that
Modal Logic:
,
and ( )
and
circuits
necessary
possible
Is equivalent to
( )
Is equivalent to
De Morgan
Is equivalent to
Is equivalent to
2. Monotonicity of
AB
AB
3. Monotonicity of
AB
A B
(A (B C)) (A B) (A C)
A (B A)
(( A false ) false ) A
Modus Ponens
A, A -> B
B
Generalization
A
x A(x)
(false) (false)
( A) (B) (A B )
2.
nuSMV, Molog, X.
3.
In step 5, z is used as an
arbitrary name.
Step 13 discharges 5 since 12
depends on 5, but on no
assumption in which z is free.
In step 12, assumptions 7 and
9, corresponding to the
disjuncts of 6, are discharged
by \/ elimination.
Step 11 the principle that, in
classical logic, everything
follows from a contradiction.
a likes himself
Example of
Knowledge Base and
reasoning in FOL
Knowledge Base:
1.
2.
3.
West, is an American. . .
7.
Missile(x) Weapon(x)
6.
5.
4.
American(West)
Enemy(Nono, America)
Resolution: example
Muddy
Children
Problem
Multiple Worlds
and
The Partition Model
of Knowledge
w1: p q
w2: p q
w3: p q
w4: p q
w2
w1
w4
w3
Intuition:
if the actual world is w, then Ii(w) is the set of worlds that agent i cannot
distinguish from w
i.e. all worlds in Ii(w), all possible as far as i knows
w1
w2
w3
w4
The Knowledge
Operator
1. By Ki we will denote that:
entails
w2
w3
w1
Agent I cannot
distinguish these
worlds
w1
w2
w3
Muddy
Children
Revisited
Now we have all background to illustrate solution to
Muddy Children
Note: in w1 we have:
K1 muddy2
K2 muddy1
K1 K2 muddy2
1.
2.
3.
4.
1.
2.
3.
4.
1. Child 1 knows he is
muddy
2. Child 2 knows he is
muddy
3. Both children know they
are muddy
Muddy Children
Revisited
Again
with 3 children
In our model, we will not only draw states of logic variables in each world,
but also some relations between the worlds, as related to knowledge of each agent
(child). These are non-distinguishability relations for each agent A, B, C
An arrow labeled A (B, C resp.) linking two states indicates that A (B, C
resp.) cannot distinguish between the states (reflexive arrows indicate
that every agent considers the actual state possible).
Initial situation:
State of C
State of B
State of A
This is a situation before
any announcement of
father
An arrow labeled A
linking two states
indicates that A cannot
distinguish between
the states
Note that at every state, each agent cannot distinguish between two states
ccc eliminated
K1 muddy1
Child 1 shouts
I am muddy
Muddy 1
K2 muddy2
Muddy 2
Child 2 shouts
I am muddy
Muddy 3
K3 muddy3
Karnaugh Map
Before father tells that at
least one child is muddy
ab\c
00
If none
If one
01
If one
If two
11
If two
If
three
10
If one
If two
No single
Child shouted
Child 3 shouts
I am muddy
exor
Child 1 shouts
I am muddy
exor
Child 2 shouts
I am muddy
exor
Child 3 shouts
I am muddy
No two Children
shouted
Three Children
shouted
Kripke and
Semantics of
Modal Logic
Saul Kripke
He was called the
greatest philosopher of
the 20st century
W4
W1
W2
W3
W4
W1
If W3 and W4 satisfy X.
Notation:
W1 |= X if and only if
W2
W3
W3 |= X and W4 |= X
W1 satisfies X if X is
satisfied in at least one
world accessible from W1.
Notation:
W1 |= X if and only if
W3 |= X or W4 |= X
Modal Logic:
Axiomatics of
system K
system K
K for Kripke
Theorem:
System K is sound and complete for the class of all
Kripke models.
Axiomatic
theory of the
knowledge logic
(epistemic logic)
Remember,
we introduced
the rule K
This defines
some logic
y
R
y
R
y
R
Axiom (5) Ki Ki Ki
Called the negative introspection axiom
Corresponds to assuming that Ri is Euclidian
Some modal logic systems take only a subset of this set. All general , problem independent
theorems can be derived from only these axioms and some additional, problem specific axioms
describing the given puzzle, game or research problem.
Logics of
knowledge and
belief
Properties of knowledge
(A1) Distribution axiom
(A2) Knowledge axiom
- satisfied if R is transitive
We are back to
Muddy Children
1. We will formulate now a completely formal
modal (knowledge) logic, language based
formulation of Muddy Children
(1b)
(2a)
(3)
4. muddy(A) KB(muddy(A))
5. KB(muddy(A) muddy(B))
1, A2
2, A2
A2: K(a, )
6. KB(muddy(A)) KB(muddy(B))
7. muddy(A) KB(muddy(B))
5, A1
4, 6
8. KB(muddy(B)) muddy(A)
9. KA(muddy(A))
contrapositive of 7
3, 8, R2
(1b)
A2: K(a, )
4. muddy(A) KB(muddy(A))
2. KA(KB(muddy(A) muddy(B)))
(2a)
5. KB(muddy(A) muddy(B))
A1: K(a, ) K(a, ) K(a, )
6. KB(muddy(A)) KB(muddy(B))
7. muddy(A) KB(muddy(B))
8. KB(muddy(B)) muddy(A)
3. KA(KB(muddy(B))) (3)
9. KA(muddy(A))
1.
2.
3.
4.
5.
6.
LANGUAGE
Muddy(x) = agent X has a mud on his forehead, a1, a2, a3
Speak(x,t) = X states the color on time T
t+1 = successor of time T
0 = starting time
Know(x, p, t) = agent X knows P at time T
Know-whether(x, p, t) = agent X knows at time T whether P
holds
Axioms
Lemma 1A.
muddy(a2) muddy(a3) speak (a1, 0)
Proof.
1.
2.
3.
4.
Analogously
Lemma 1.B. muddy(a1) muddy(a3) speak(a2,0)
Lemma 1.C. muddy(a1) muddy(a2) speak(a3,0)
Example of proving
in Modal Logic
1. Given is system BK of modal logic with all its axioms,
theorems, and proof methods
2. Given are two axioms:
A axiom
L axiom
3. Prove that Ge
Ge
Do not look to the next slide with the
solution!!!
X Necessarily(X)
1
X = Ge Necessarily (Ge)
2
Possible(Ge) Possible (Necessarily(Ge))
Thesis specific to BK system of modal logic:
Possible( Necessarily (p) ) p
p = Ge
4
Possible(Ge) Ge
Ge
Ge or God Exists?
Amazingly, when I showed the proof from last
slide to some people, they told me OK.
When I showed them the next slide, and I
claimed that the proof proves Gods existence,
they protested.
Can you explain me why?
X Necessarily(X)
1
q= Necessarily(God_exists)
p=God_exists
2
Possible(God_exists) Possible (Necessarily(God_exists))
Thesis specific to BK system of modal logic:
Possible( Necessarily (p) ) p
p = God_exists
4
Possible(God_exists) God_exists
5
This is the same proof, the same
axioms. We only give the historical
assumptions. Axiom A is from Saint
Anselm it is like if Pythagoras invents
his theorem in his head then the
theorem is true in any World. Axiom L
comes from Leibniz we can create a
consistent model of God in our head.
1. Games:
1.
2. Law:
1.
3. Morality stories:
1.
2.
Narrow Bridge
Robot theatre Paradise Lost Adam,
Eve and Satan in Modal Logic
4. Robot morality
1.
2.
Military robots
Old lady helper robot
Research areas
and Problems in
nuSMV
1. Software verification
2. Mathematics
3. Theology:
1.
2.
3.
4.
5.
6.
7.
Analytic Philosophy
Logic Puzzles
Logic Paradoxes
Planning of experiments
Research areas
and Problems in
nuSMV
Temporal Logic
Computational Tree
Logic
Explosion as a
result of
interaction of
several
systems
G1
M
S
G
G0
G1
G2
[a] model
G
G0
G1
S
M
G2
G1
G
G0
G1
CTL Notation
AG p
p
p
p
...
possible
p
...
...
necessary
...
p
...
p
...
...
...
EF p
p
p
...
...
...
...
...
...
...
...
Robot world
Digital system
Computer game
Law system
Moral System
Example of
robot problemsolving
walls
0000
Gets a
gun
South
00 01 11 10
Energy
level
Knowledge level
Gets a
key to
the safe
0100
00
south
01
1100
11
10
1101
east
south
1001
0001
East
Dead end
Needs a gun
to go east
Needs to drop a key,
being searched by police
Robot in Labirynth to
reach safe in bank
south
0011
1111
0010
1011
west
South
1010
1111
Safe in bank
reached with key to
lock present
South
0110
Safe in bank
reached
0111
East
East
North
east
North
1000
A = has a gun for self-protection
B = power (energy)
C = knowledge
D = has a key to the safe
0101
North
South
1110
1.
2.
3.
4.
Games
Computer action
games
Robot path planning
Robot in real
environment
Example of
human life
metaphor
for robot theatre
constraints
Human is born
ab\cd
0000
goodness
power
Power+
00 01 11 10
knowledge
beauty
0100
00
Goodness +
01
1100
11
10
Beauty +
1101
Goodness-
Power-
Power-
1000
A = goodness
B = power
C = knowledge
D = beauty
1001
0101
0001
Beauty +
Knowledge+
Dead end
Beauty -
0010
Power+
Illumination
1111
Goodness+
1011
Beauty +
1010
1111
Illumination
0110
Power+
0111
Goodness+
0011
Knowledge+
Power-
1110
1. Robot
morality
2. Robot
theatre
EXAMPLE:
The Narrow Bridge
Universe
What is the best strategy that will save the maximum of human lives?
Example of
solution
Four Meaties
in North
Mutual kill
start
Four Vegies
in South
Mutual kill
Meaties
undrestand
to not
attack
start
Vegie
undrestands
to not attack
start
Self-Sacrifice
Observe that one of strategies to have the
minimum death is the general sacrifice at the
very beginning three of his soldiers.
He gives hint to the enemy that he is not
willing to fight for the sake of fighting, just to
fight as a necessity for survival.
Four Meaties
in North
Self-sacrifice
Self-sacrifice
start
Four Vegies
in South
Self-sacrifice
start
With maximum
sacrifice of Meaties a
total of five lives were
saved
1.
2.
3.
How much trust you need to be in arms of a strong big robot like this?
How to build this trust?
What kind morality you would expect from this robot?
135
Temporal logic
We inserted statutes and case law into our model to dictate the
behaviors of the actors, in the process developing a formal method of
translating laws into operational predicate modal logic clauses.
Finally, we run a process to check through the computation tree to find
contradictions.
Conclusions
1. Superintelligent Agent-based systems will dramatically
change the world we live in:
1.
2.
3.
4.
5.
War
Social services
Police and Law
Industry
Entertainment
2. These systems will require all kinds of new logics that are all
derived from the Modal Logic of Aristotle, St. Anselm, Lewis
and Kripke.
appendices
Main
Concepts of
MODAL
LOGIC
that is
it is not possible that both p and q are true
Reciprocal definitions
Both operators, that of necessity and that of possibility , can be
reciprocally defined.
Taking as primitive
Analogously, if we take as primitive, we have:
p := p
that is
it is possible that p means
it is not necessary that non-p
And again, from the definition of strict implication
and the above definition, we can conclude that
p q := (p q)
Square of
Opposition
Square of opposition
Following Theophrastus (IV century BC), but with
modern logic operators, we can think of a square of
opposition in modal terms:
necessary
impossible
p
p
p
p
contradictory
statements
possible
contingent
p
p
p
p
if the deduction is correct and the premises are true, the conclusion
is true.
purely possible
the contradictory of impossible: p
purely contingent
the contradictory of necessary: p
necessary
impossible
p
p
p
p
contradictory
statements
possible
contingent
p
p
p
p
purely possible
the contradictory of impossible: p
purely contingent
the contradictory of necessary: p
p p
or p p
necessary
impossible
p
p
p
p
possible
contingent
Types of
modalities
Whereas by (p q)
we mean that it is logically impossible
Modality DE DICTO
Whenever we wish to modally characterize the
quality of a statement (dictum), we speak of
modality de dicto.
EXAMPLE: It is necessary that Socrates is rational
It is possible that Socrates is bald
Rational (Socrates)
Statement
Bald (Socrates)
Statement
Modality DE RE
By contrast, when we wish to modally characterize
the way in which a property belongs to something
(res), we speak of modality de re.
EXAMPLE: Socrates is necessarily rational
Meaning of
Entailment
Meaning of Entailment
Entailment says what we
can deduce about state of
world, what is true in
them.
state w
formula
Kripke
Structure
A world
M,w |= if is true in w
M,w |= if M,w |= and M,w |=
M,w |= if and only if we do not have M,w |=
M,w |= if and only if w W such that
R(w,w) we have M,w |=
It is true in every word that
is accessible from world w
P,s
W1
P,s
W4
which it is true.
W2
W3
s, r
Predicate Modal
Logic System and
examples of
axiomatics
2.
3.
4.
5.
Figure demonstrates
Gentzen-style
introduction
p |-PC (p \/ q) q,
that is, it illustrates a proof of ( p \/ q) q from
the premise p.
Example of proof in
propositional logic
2.
3.
The proof shown therein also demonstrates the use of rules based on
machine reasoning systems that act as oracles for certain proof
systems.
4.
For instance,
1.
2.
3.