Você está na página 1de 12

CS206 Lecture 29

Home Page

Title Page

Contents

JJ

II

Page 1 of 12

Formal Methods in Computer Science


Supriya Garg
Shishir Kumar Agrawal
Ankur Jain
Vishal Verma
Computer Science Department
IIT Bombay
Thu, Mar 20, 2003

Go Back

Full Screen

Close

Quit

Plan for Lecture 29


Kripke Structures
Kripke Semantics

Examples of Modalities

necessarily true
known to be true
believed to be true
true in the true
i. Bondevik is prime-minister of Norway.
ii.There are 9 planets in the Solar system.
iii.The square root of 81 is 9.
ad(i)true now,will not be true in the future.
ad(ii)true now, may be true forever in the future is not necessarily true.
(it could be a dierent number)
ad(iii)true now, necessarily true and will be in the future.

Home Page

Title Page

Contents

JJ

II

Page 2 of 12

Go Back

Full Screen

Close

Quit

Semantics

Home Page

Title Page

Contents

JJ

II

Page 3 of 12

Go Back

Full Screen

Close

Quit

A Kripke structure has the following components:


A set W whose elements are called worlds.
(Represented by circles in the diagram).
A binary Accessibility Relation R(a,b) connecting the set of worlds.
R(a,b) means that 'world b is accessible from a'.
A function L : W R called Labelling Function which contains all
the propositions that are true in a given world.

Example of Kripke Structure

In the following gure:


Home Page

Title Page

Contents

JJ

II

Page 4 of 12

In the above structure


Go Back

Full Screen

Set of Worlds : (W ,W , W ,W ,W )
Accessibilty relation
: { ( W , W ) , ( W ,W ) ,
(W ,W ),(W ,W )}
Labelling function : W (p, q, r), W (p, q, r)
W (p, q, r), W (p, q, r), W (p, q, r)

Quit

Close

Well Formed Formulae (W)

Home Page

Title Page

Base case: A propositional symbol f is a well formed formula.


Induction: If f1 and f2 are well formed formulae so are:
(f1) (f2)

Contents

(f1) (f2)

JJ

II

Page 5 of 12

(f1) (f2)
f1
[]f1
f1

Go Back

Full Screen

Close

Quit

Closure condition: Nothing else is a well formed formula.

The W ((p []q) ((r) ([](q s)))) can be represented as


Home Page

Title Page

Contents

JJ

II

Page 6 of 12

Go Back

Full Screen

Close

Quit

Example of Semantics
Home Page

Title Page

Contents

JJ

II

Page 7 of 12

Go Back

Full Screen

Close

In the above Kripke structure:


Worlds P []P
W
T T
W
T T
W
T T
W
F F
W
T F
1
2
3

Quit

P []

T
T
T
T
T

T
T
T
F
T

[]

T
T
T
F
F

[][]P

T
T
T
F
F

Home Page

Title Page

Satisfaction Relations for


Kripke Structures

i p L(w)
k |= F i k |= /F
k |= (F G) i k |= F and k |= G
k |= (F G) i k |= G or k |= F
k |= F G i k |= G,whenever we have k |= F
k |= F G i (k |= F i k |= G)
k |= []F i, for each y W with R(x, y) we have y |= F
k |= F i, there is y W such that R(x, y) and y |= F
k |= p i p is true in all worlds of k
k |=w p
w

Contents

JJ

II

Page 8 of 12

w
w
w

Go Back

Full Screen

Close

Quit

Kripke Structure K

Home Page

Title Page

All Kripke structures satisfy the property:


|= [](F G) ([]F []G)
:
Suppose the above is not true.
a world W where [](F G) is true,
but ([]F []G) is not true
[]F is true in W , []G is false in W
a W such that (W , W ) R and F is true
in W but G is false in W
(F G) is false in W
[](F G) is false in W - a
Proof

Contents

JJ

II

Page 9 of 12

Hence proved.
Go Back

Theorems that hold in


Full Screen

Close

Quit

[](p q) ([]p []q)


([]p q) [](p q)
[]p (p)

contradiction.

T Structure

Home Page

Title Page

Contents

T is dened as a reexive Kripke structure


or equivalently as
T = K+ T; T : ([]p p)
: TPT reexivity ([]p p).
Assume ([]p p) is not true in K(reexive).
a world W s.t.([]p p) is not true in W .
in W []p is true and p is false.
But since []p is true in W and (W , W ) R (due to reexivity),
p is true in W .  a Contradiction.
.
The proof of ([]p p) ref lexivity is left as an exercise.
T
Proof

JJ

II

Hence proved

Page 10 of 12

Go Back

Full Screen

Close

Theorems that hold in

p p
(p []p)

Quit

S4 Structure

Home Page

Title Page

S4 is dened as a reexive and transitive Kripke structure


or equivalently as
S4 = T + S4 ; S4 : ([]p [][]p)
: TPT ref lexivity ([]p p)
Assume ([]p [][]p) is not true in K(reexive and transitive).
a world W s.t. ([]p [][]p) is not true in W .
in W []p is true and [][]p is false.
W s.t.(W , W ) R and []p is false in W .
W s.t. (W , W ) R and p is not true in W .
But since (W , W ) R (due to transitivity) and []p is true in W , p is
true in W .  a Contradiction.
Proof

Contents

JJ

II

Page 11 of 12

Go Back

Hence proved.

Full Screen

Close

Quit

Theorems which hold in S4

p p

S5 Structure

Home Page

Title Page

Contents

JJ

II

Page 12 of 12

S5 is dened as a reexive, transitive and symmetric Kripke structure


or equivalently as
S5 = S4+ S5; S5 : ([]p []([]p))
The proof of the above equivalence is left as an exercise.
The above axiom S5 can also be written as:
(p []p)

In S5 every modality is equivalent to one of the following


or their negatives.
, [],

Go Back

Full Screen

Close

Quit

Você também pode gostar