67
SF - M2 SAR - 2017/2018 Rappels LTL et CTL Nathalie Sznajder UniversitƩ Pierre et Marie Curie, LIP6

Rappels LTL et CTL

  • Upload
    others

  • View
    15

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Rappels LTL et CTL

SF - M2 SAR - 2017/2018

Rappels LTL et CTLNathalie Sznajder

UniversitƩ Pierre et Marie Curie, LIP6

Page 2: Rappels LTL et CTL

SF - M2 SAR - 2017/2018

Les mƩthodes formelles

ā€¢ Preuve assistĆ©e par ordinateur

ā€¢ Test

ā€¢ Model-Checking

Page 3: Rappels LTL et CTL

SF - M2 SAR - 2017/2018

Model-CheckingIntroduction

Principles of model checking

Does

system

satisfy

specification

?

model

'

formula

?|=model-checker

Nathalie Bertrand Model checking VTS ā€“ M2RI ā€“ 2011 3/86

systĆØme

Introduction

Principles of model checking

Does

system

satisfy

specification

?

model

'

formula

?|=model-checker

Nathalie Bertrand Model checking VTS ā€“ M2RI ā€“ 2011 3/86

spƩcification

Page 4: Rappels LTL et CTL

SF - M2 SAR - 2017/2018

Est-ce que le

Model-CheckingIntroduction

Principles of model checking

Does

system

satisfy

specification

?

model

'

formula

?|=model-checker

Nathalie Bertrand Model checking VTS ā€“ M2RI ā€“ 2011 3/86

systĆØme

Introduction

Principles of model checking

Does

system

satisfy

specification

?

model

'

formula

?|=model-checker

Nathalie Bertrand Model checking VTS ā€“ M2RI ā€“ 2011 3/86

spƩcification

satisfait ?

Page 5: Rappels LTL et CTL

SF - M2 SAR - 2017/2018

Est-ce que le

Model-Checking

Figure 1: essai

blablabla

1

Introduction

Principles of model checking

Does

system

satisfy

specification

?

model

'

formula

?|=model-checker

Nathalie Bertrand Model checking VTS ā€“ M2RI ā€“ 2011 3/86

systĆØme

Introduction

Principles of model checking

Does

system

satisfy

specification

?

model

'

formula

?|=model-checker

Nathalie Bertrand Model checking VTS ā€“ M2RI ā€“ 2011 3/86

spƩcification

satisfait ?

modĆØle

Introduction

Principles of model checking

Does

system

satisfy

specification

?

model

'

formula

?|=model-checker

Nathalie Bertrand Model checking VTS ā€“ M2RI ā€“ 2011 3/86

Page 6: Rappels LTL et CTL

SF - M2 SAR - 2017/2018

Est-ce que le

Model-Checking

Figure 1: essai

blablabla

1

Introduction

Principles of model checking

Does

system

satisfy

specification

?

model

'

formula

?|=model-checker

Nathalie Bertrand Model checking VTS ā€“ M2RI ā€“ 2011 3/86

systĆØme

Introduction

Principles of model checking

Does

system

satisfy

specification

?

model

'

formula

?|=model-checker

Nathalie Bertrand Model checking VTS ā€“ M2RI ā€“ 2011 3/86

spƩcification

satisfait ?

modĆØle

Figure 1: essai

blablabla'

1

formule

Introduction

Principles of model checking

Does

system

satisfy

specification

?

model

'

formula

?|=model-checker

Nathalie Bertrand Model checking VTS ā€“ M2RI ā€“ 2011 3/86

Introduction

Principles of model checking

Does

system

satisfy

specification

?

model

'

formula

?|=model-checker

Nathalie Bertrand Model checking VTS ā€“ M2RI ā€“ 2011 3/86

Page 7: Rappels LTL et CTL

SF - M2 SAR - 2017/2018

Est-ce que le

Model-Checking

Figure 1: essai

blablabla

1

Introduction

Principles of model checking

Does

system

satisfy

specification

?

model

'

formula

?|=model-checker

Nathalie Bertrand Model checking VTS ā€“ M2RI ā€“ 2011 3/86

systĆØme

Introduction

Principles of model checking

Does

system

satisfy

specification

?

model

'

formula

?|=model-checker

Nathalie Bertrand Model checking VTS ā€“ M2RI ā€“ 2011 3/86

spƩcification

satisfait ?

modĆØle

Figure 1: essai

blablabla'

1

formule

āŠ§ ?algorithme de Model Checking

Introduction

Principles of model checking

Does

system

satisfy

specification

?

model

'

formula

?|=model-checker

Nathalie Bertrand Model checking VTS ā€“ M2RI ā€“ 2011 3/86

Introduction

Principles of model checking

Does

system

satisfy

specification

?

model

'

formula

?|=model-checker

Nathalie Bertrand Model checking VTS ā€“ M2RI ā€“ 2011 3/86

Introduction

Principles of model checking

Does

system

satisfy

specification

?

model

'

formula

?|=model-checker

Nathalie Bertrand Model checking VTS ā€“ M2RI ā€“ 2011 3/86

Page 8: Rappels LTL et CTL

SF - M2 SAR - 2017/2018

ā€¢ Soit M= (Q,T, A, q0, AP, l).

ā€¢ On supposera que T est totale, i.e., chaque Ć©tat a au moins un successeur.

ā€¢ On peut complĆ©ter une structure de Kripke : on rajoute un Ć©tat puits successeur des Ć©tats dead-lock.

Structure de Kripke

Page 9: Rappels LTL et CTL

SF - M2 SAR - 2017/2018

ExƩcutions et traces

ā€¢ Soit M=(Q,T, A, q0, AP, l). Une exĆ©cution de M est une sĆ©quence infinie r=q0a0q1a1q2a2... telle que (qi,ai,qi+1)āˆˆT, pour tout iā‰„0.

ā€¢ On peut omettre lā€™Ć©tiquetage des transitions : r=q0q1q2...

ā€¢ Une trace dā€™exĆ©cution de M est lā€™Ć©tiquetage dā€™une exĆ©cution: l(r)=l(q0)l(q1)l(q2)...

Page 10: Rappels LTL et CTL

SF - M2 SAR - 2017/2018

Arbre dā€™exĆ©cutions dā€™une structure de Kripke

s0

s1 s2

s3

Figure 1: essai

blablablaĻ•

āˆ€t Ā·(

requete ā†’ āˆƒtā€² ā‰„ t Ā· (reponse))

Ļ‰

1

s0, 0

s1, 1 s2, 1

s3, 2 s3, 2

s1, 3 s3, 3 s1, 3 s3, 3

......

. . .. .. . . .. .

.

2

Page 11: Rappels LTL et CTL

SF - M2 SAR - 2017/2018

Arbre dā€™exĆ©cutions dā€™une structure de Kripke

ā€¢ Correspond au Ā«dĆ©pliageĀ» de la structure de Kripke

ā€¢ Sa racine est lā€™Ć©tat initial de la structure de Kripke

ā€¢ Au niveau i, les fils dā€™un noeud sont les Ć©tats successeurs au niveau i+1

ā€¢ La relation de transition est totale : lā€™arbre est infini

Page 12: Rappels LTL et CTL

VFSR - M2 SAR - 2013/2014

1.SpƩcifications

Page 13: Rappels LTL et CTL

SF - M2 SAR - 2017/2018

PropriĆ©tĆ©s sur les systĆØmes de transition (I)

ā€¢ Invariance : tous les Ć©tats du systĆØme vĆ©rifient une certaine propriĆ©tĆ©

ā€¢ SĆ»retĆ© : quelque chose de mauvais nā€™arrive jamais

ā€¢ AccessibilitĆ© : un Ć©tat donnĆ© est accessible depuis lā€™Ć©tat initial

Page 14: Rappels LTL et CTL

SF - M2 SAR - 2017/2018

PropriĆ©tĆ©s sur les systĆØmes de transition (II)

ā€¢ VivacitĆ© : Quelque chose de Ā«bonĀ» finira par arriver

ā€¢ EquitĆ© : Quelque chose se produira infiniment souvent

Page 15: Rappels LTL et CTL

SF - M2 SAR - 2017/2018

Logiques temporelles

ā€¢ Permettent dā€™exprimer propriĆ©tĆ©s sur sĆ©quences dā€™observations

ā€¢ Utilisation de connecteurs temporels et de quantificateurs sur les chemins

Page 16: Rappels LTL et CTL

SF - M2 SAR - 2017/2018

Logiques temporelles : pourquoi?

ā€¢ On pourrait utiliser logique du premier ordre.

ā€¢ Exemple : Ā«toute requĆŖte sera un jour satisfaiteĀ»

Figure 1: essai

blablabla'

8t Ā·ļæ½requete ! 9t0 ļæ½ t Ā· (reponse)

ļæ½

1

Page 17: Rappels LTL et CTL

SF - M2 SAR - 2017/2018

Logiques temporelles : pourquoi?

ā€¢ On pourrait utiliser logique du premier ordre.

ā€¢ Exemple : Ā«toute requĆŖte sera un jour satisfaiteĀ»Difficile Ć  Ć©crire

/comprendre

VĆ©rification peu efficace

Figure 1: essai

blablabla'

8t Ā·ļæ½requete ! 9t0 ļæ½ t Ā· (reponse)

ļæ½

1

Page 18: Rappels LTL et CTL

SF - M2 SAR - 2017/2018

Logiques temporelles

ā€¢ Pas de variable (instants implicites), mais modalitĆ©s.

ā€¢ Temporel ā‰  temporisĆ© : logiques temporelles ne quantifient pas Ć©coulement du temps.

Page 19: Rappels LTL et CTL

SF - M2 SAR - 2017/2018

Logiques temporelles linƩaires ou arborescentes

ā€¢ 2 approches :

ā€¢ temps linĆ©aire : propriĆ©tĆ©s des sĆ©quences dā€™exĆ©cutions (futur dĆ©terminĆ©)

ā€¢ temps arborescent : propriĆ©tĆ©s de lā€™ arbre dā€™exĆ©cutions (tous les futurs possibles)

Page 20: Rappels LTL et CTL

VFSR - M2 SAR - 2013/2014

2. La logique LTL

Page 21: Rappels LTL et CTL

SF - M2 SAR - 2017/2018

Logique temporelle linƩaire : LTL

ā€¢ ModĆØle des formules : une trace dā€™exĆ©cution infinie.

ā€¢ t, i āŠ§ Ļ† ssi la formule Ļ† est vĆ©rifiĆ©e Ć  la position i de la trace.

ā€¢ DĆ©fini inductivement sur la formule

[Pnueli 77]

Page 22: Rappels LTL et CTL

SF - M2 SAR - 2017/2018

ā€¢ Rappel : une trace dā€™exĆ©cution ā‰£ exĆ©cution dans laquelle seul lā€™Ć©tiquetage des Ć©tats est visible

ā€¢ ā†’ cā€™est un mot (infini) sur lā€™alphabet 2AP.

ā€¢ Soit t une trace, on note t(i) la Ā«lettreĀ» Ć  la position iā‰„0, i.e. lā€™ensemble des propositions atomiques vraies.

Logique temporelle linƩaire : LTL

Page 23: Rappels LTL et CTL

SF - M2 SAR - 2017/2018

Logique temporelle linƩaire : LTL

p p,q q,rq p,rp :

p pp

...

t,i āŠ§ p ssi pāˆˆt(i)

Page 24: Rappels LTL et CTL

SF - M2 SAR - 2017/2018

Logique temporelle linƩaire : LTL

XĻ† : ...

XĻ†

q,r p,q q,rp p,r ...Exemples : Xp

Xp p

q p q,rq,r p,r ...X(Xp)

Ļ†

Page 25: Rappels LTL et CTL

SF - M2 SAR - 2017/2018

Logique temporelle linƩaire : LTL

XĻ† : ...

XĻ†

q,r p,q q,rp p,r ...Exemples : Xp

Xp p

q p q,rq,r p,r ...

p

X(Xp) p

Ļ†

Page 26: Rappels LTL et CTL

SF - M2 SAR - 2017/2018

Logique temporelle linƩaire : LTL

XĻ† : ...

XĻ†

q,r p,q q,rp p,r ...Exemples : Xp

Xp p

q p q,rq,r p,r ...

Xp p

X(Xp) q,r p

Ļ†

Page 27: Rappels LTL et CTL

SF - M2 SAR - 2017/2018

Logique temporelle linƩaire : LTL

XĻ† : ...

XĻ†

q,r p,q q,rp p,r ...Exemples : Xp

Xp p

q p q,rq,r p,r ...

X(Xp) Xp p

X(Xp) q,rq p

Ļ†

Page 28: Rappels LTL et CTL

SF - M2 SAR - 2017/2018

Logique temporelle linƩaire : LTL

XĻ† : ...

XĻ†

t,i āŠ§ XĻ† ssi t,i+1āŠ§Ļ†

Ļ†

Page 29: Rappels LTL et CTL

SF - M2 SAR - 2017/2018

Logique temporelle linƩaire : LTL

FĻ† : ...

Ļ†

Page 30: Rappels LTL et CTL

SF - M2 SAR - 2017/2018

Logique temporelle linƩaire : LTL

FĻ† : ...

FĻ†

FĻ†

Ļ†

Page 31: Rappels LTL et CTL

SF - M2 SAR - 2017/2018

Logique temporelle linƩaire : LTL

FĻ† : ...

FĻ† FĻ†

FĻ†

Ļ†

Page 32: Rappels LTL et CTL

SF - M2 SAR - 2017/2018

Logique temporelle linƩaire : LTL

FĻ† : ...

FĻ† FĻ† FĻ†

FĻ†

Ļ†

Page 33: Rappels LTL et CTL

SF - M2 SAR - 2017/2018

Logique temporelle linƩaire : LTL

FĻ† : ...

FĻ† FĻ† FĻ†

FĻ†

t,i āŠ§ FĻ† ssi il existe jā‰„i tel que t,jāŠ§Ļ†

Ļ†

Page 34: Rappels LTL et CTL

SF - M2 SAR - 2017/2018

Logique temporelle linƩaire : LTL

GĻ† : ...

Ļ† Ļ† Ļ†

Page 35: Rappels LTL et CTL

SF - M2 SAR - 2017/2018

Logique temporelle linƩaire : LTL

GĻ† : ...

GĻ† Ļ† Ļ† Ļ†

Page 36: Rappels LTL et CTL

SF - M2 SAR - 2017/2018

Logique temporelle linƩaire : LTL

GĻ† : ...

GĻ†

t,i āŠ§ GĻ† ssi pour tout jā‰„i, t,jāŠ§Ļ†

Ļ† Ļ† Ļ†

Page 37: Rappels LTL et CTL

SF - M2 SAR - 2017/2018

Logique temporelle linƩaire : LTL

GĻ† : ...

GĻ†

t,i āŠ§ GĻ† ssi pour tout jā‰„i, t,jāŠ§Ļ†

Ļ† Ļ† Ļ†GĻ†

Page 38: Rappels LTL et CTL

SF - M2 SAR - 2017/2018

Logique temporelle linƩaire : LTL

GĻ† : ...

GĻ†

t,i āŠ§ GĻ† ssi pour tout jā‰„i, t,jāŠ§Ļ†

Ļ† Ļ† Ļ†GĻ† GĻ†

Page 39: Rappels LTL et CTL

SF - M2 SAR - 2017/2018

Logique temporelle linƩaire : LTL

Ļ†1UĻ†2: ...

Ļ†1 Ļ†1 Ļ†2Ļ†1Ļ†1

Page 40: Rappels LTL et CTL

SF - M2 SAR - 2017/2018

Logique temporelle linƩaire : LTL

Ļ†1UĻ†2: ...

Ļ†1 Ļ†1 Ļ†2

Ļ†1UĻ†2

Ļ†1Ļ†1

Page 41: Rappels LTL et CTL

SF - M2 SAR - 2017/2018

Logique temporelle linƩaire : LTL

Ļ†1UĻ†2: ...

t,i āŠ§ Ļ†1UĻ†2 ssi il existe jā‰„i, t,j āŠ§Ļ†2 et, pour tout iā‰¤k<j, t,k āŠ§ Ļ†1

Ļ†1 Ļ†1 Ļ†2

Ļ†1UĻ†2

Ļ†1Ļ†1

Page 42: Rappels LTL et CTL

SF - M2 SAR - 2017/2018

Logique temporelle linƩaire : LTL

Ļ†::= pāˆˆAP | Ā¬Ļ† | Ļ†āˆØĻ†|XĻ†| FĻ†| GĻ†| Ļ†UĻ†

t,i āŠ§ p ssi pāˆˆt(i)t,i āŠ§ Ā¬Ļ† ssi t,i āŠ­ Ļ†t,i āŠ§ Ļ†1āˆØĻ†2 ssi t,i āŠ§ Ļ†1 ou t,i āŠ§ Ļ†2

t,i āŠ§ XĻ† ssi t,i+1āŠ§Ļ†t,i āŠ§ FĻ† ssi il existe jā‰„i tel que t,jāŠ§Ļ†t,i āŠ§ GĻ† ssi pour tout jā‰„i, t,jāŠ§Ļ†t,i āŠ§ Ļ†1UĻ†2 ssi il existe jā‰„i, t,j āŠ§Ļ†2 et, pour tout iā‰¤k<j, t,k āŠ§ Ļ†1

Page 43: Rappels LTL et CTL

SF - M2 SAR - 2017/2018

Logique temporelle linƩaire : LTL

Ļ†::= pāˆˆAP | Ā¬Ļ† | Ļ†āˆØĻ†|XĻ†| FĻ†| GĻ†| Ļ†UĻ†

āŠ¤ā‰£pāˆØĀ¬p, pour pāˆˆAP quelconqueāŠ„ā‰£Ā¬āŠ¤Ļ†1āˆ§Ļ†2 ā‰£Ā¬(Ā¬Ļ†1āˆØĀ¬Ļ†2)

Ļ†1ā†’Ļ†2 ā‰£ Ā¬Ļ†1āˆØĻ†2

Page 44: Rappels LTL et CTL

SF - M2 SAR - 2017/2018

Logique temporelle linƩaire : LTL

En fait, FĻ† et GĻ† macros aussi : ā€¢ FĻ†ā‰£āŠ¤UĻ†ā€¢ GĻ†ā‰£ Ā¬F(Ā¬Ļ†)

Exercice : vƩrifier.

Page 45: Rappels LTL et CTL

SF - M2 SAR - 2017/2018

ā€¢ Autres macros utiles :

ā€¢ (Weak until) Ļ†1WĻ†2 ā‰£ GĻ†1 āˆØ Ļ†1UĻ†2

ā€¢ (Release) Ļ†1RĻ†2 ā‰£ Ļ†2 W (Ļ†1āˆ§Ļ†2) ā‰£ GĻ†2 āˆØ Ļ†2U (Ļ†1āˆ§Ļ†2)

Logique temporelle linƩaire : LTL

Ļ†::= pāˆˆAP | Ā¬Ļ† | Ļ†āˆØĻ†|XĻ†| Ļ†UĻ†

Page 46: Rappels LTL et CTL

SF - M2 SAR - 2017/2018

ā€¢ AccessibilitĆ© : F (x=0)

ā€¢ Invariance : G Ā¬(x=0)

ā€¢ VivacitĆ© : G(request ā†’ F response)

ā€¢ EquitĆ© forte : GF enabled ā†’ GF scheduled

ā€¢ EquitĆ© faible : FG enabled ā†’ GF scheduled

ā€¢ RelĆ¢chement de contrainte : reset R alarm

LTL : Exemples

Page 47: Rappels LTL et CTL

VFSR - M2 SAR - 2013/2014

3. La logique CTL

Page 48: Rappels LTL et CTL

SF - M2 SAR - 2017/2018

Exprimer la possibilitĆ©ā€¢ La propriĆ©tĆ© Ā«Ć  chaque fois que paid est

vĆ©rifiĆ©, il est possible dā€™obtenir une biĆØreĀ» nā€™est pas exprimable en LTL!

Transition Systems 21

the likelihood with which a certain transition is selected. Similarly, when the set of initialstates consists of more than one state, the start state is selected nondeterministically.

The labeling function L relates a set L(s) āˆˆ 2AP of atomic propositions to any state s.1

L(s) intuitively stands for exactly those atomic propositions a āˆˆ AP which are satisfiedby state s. Given that Ī¦ is a propositional logic formula, then s satisfies the formula Ī¦ ifthe evaluation induced by L(s) makes the formula Ī¦ true; that is:

s |= Ī¦ iff L(s) |= Ī¦.

(Basic principles of propositional logic are explained in Appendix A.3, see page 915 ff.)

Example 2.2. Beverage Vending Machine

We consider an (somewhat foolish) example, which has been established as standard in thefield of process calculi. The transition system in Figure 2.1 models a preliminary designof a beverage vending machine. The machine can either deliver beer or soda. States arerepresented by ovals and transitions by labeled edges. State names are depicted inside theovals. Initial states are indicated by having an incoming arrow without source.

pay

selectsoda beer

insert coin

Ļ„Ļ„

get soda get beer

Figure 2.1: A transition system of a simple beverage vending machine.

The state space is S = { pay , select , soda , beer }. The set of initial states consists ofonly one state, i.e., I = { pay }. The (user) action insert coin denotes the insertion of acoin, while the (machine) actions get soda and get beer denote the delivery of soda andbeer, respectively. Transitions of which the action label is not of further interest here,e.g., as it denotes some internal activity of the beverage machine, are all denoted by thedistinguished action symbol Ļ„ . We have:

Act = { insert coin , get soda , get beer , Ļ„ }.

Some example transitions are:

pay insert coināˆ’āˆ’āˆ’āˆ’āˆ’āˆ’āˆ’āˆ’ā†’ select and beer get beerāˆ’āˆ’āˆ’āˆ’āˆ’āˆ’ā†’ pay .

1Recall that 2AP denotes the power set of AP.

{paid, soda}

{paid, beer}

{paid}

n2 w2 c2request2

release

pay

select selectā€™

soda beer

insert coin

insert coin

Ļ„ Ļ„

get soda get beer

3

{paid, beer}

{paid} {paid}

{paid, soda}

Les deux systĆØmes vĆ©rifient les mĆŖmes propriĆ©tĆ©s LTL!!

Page 49: Rappels LTL et CTL

SF - M2 SAR - 2017/2018

Computational Tree Logic : CTL

ā€¢ ModĆØle des formules : Ć©tat de lā€™arbre dā€™exĆ©cutions infini.

ā€¢ M,s āŠ§ Ļ† ssi la formule Ļ† est vĆ©rifiĆ©e Ć  lā€™Ć©tat s de la structure de Kripke M.

ā€¢ On note S(Ļ†) lā€™ensemble des Ć©tats s t.q. M,s āŠ§ Ļ†

ā€¢ Ajout de quantificateurs sur les chemins dans lā€™arbre : E et A.

ā€¢ DĆ©fini inductivement sur la formule.

[Clarke, Emerson 81]

Page 50: Rappels LTL et CTL

SF - M2 SAR - 2017/2018

CTL: syntaxe et sƩmantique

p

q,r p

r,s p,q q s

s āŠ§ p ssi pāˆˆl(s)

Page 51: Rappels LTL et CTL

SF - M2 SAR - 2017/2018

CTL: syntaxe et sƩmantique

s āŠ§ EXĻ† ssi il existe sā€™, successeur de s t.q. sā€™ āŠ§Ļ†

EXĻ†

Ļ†

Page 52: Rappels LTL et CTL

SF - M2 SAR - 2017/2018

CTL: syntaxe et sƩmantique

s āŠ§ AXĻ† ssi pour tout sā€™, successeur de s, sā€™ āŠ§Ļ†

AXĻ†

Ļ†Ļ†

Page 53: Rappels LTL et CTL

SF - M2 SAR - 2017/2018

CTL: syntaxe et sƩmantique

s āŠ§ EĻ†UĻ†ā€™ ssi il existe une exĆ©cution s0s1...sk telle que s0=s, sk āŠ§Ļ†ā€™ et pour tout 0ā‰¤i<k, si āŠ§Ļ†.

EĻ†UĻ†ā€™

Ļ†

Ļ†

Ļ†ā€™

Page 54: Rappels LTL et CTL

SF - M2 SAR - 2017/2018

CTL: syntaxe et sƩmantique

s āŠ§ AĻ†UĻ†ā€™ ssi pour toute exĆ©cution s0s1... telle que s0=s, āˆƒ k t.q. sk

āŠ§Ļ†ā€™ et pour tout 0ā‰¤i<k, si āŠ§Ļ†.

AĻ†UĻ†ā€™

Ļ†

Ļ†

Ļ†ā€™

Ļ†ā€™

Ļ†ā€™

Ļ†ā€™

Ļ†

Page 55: Rappels LTL et CTL

SF - M2 SAR - 2017/2018

CTL: syntaxe et sƩmantique

Ļ†::= pāˆˆAP | Ā¬Ļ† | Ļ†āˆØĻ†|EXĻ†| AXĻ†| EĻ†UĻ† | AĻ†UĻ†

s āŠ§ p ssi pāˆˆl(s)s āŠ§ Ā¬Ļ† ssi s āŠ­ Ļ†s āŠ§ Ļ†1āˆØĻ†2 ssi s āŠ§ Ļ†1 ou s āŠ§ Ļ†2

s āŠ§ EXĻ† ssi il existe sā€™, successeur de s, t.q. sā€™āŠ§Ļ† s āŠ§ AXĻ† ssi sā€™, pour tout sā€™, successeur de s, sā€™āŠ§Ļ†s āŠ§ EĻ†1UĻ†2 ssi il existe une exĆ©cution s0s1...sk tel que s0=s, sk āŠ§Ļ†2 et pour tout 0ā‰¤iā‰¤k, si āŠ§Ļ†1.s āŠ§ AĻ†1UĻ†2 ssi pour toute exĆ©cution s0s1... telle que s0=s, il existe k t.q. sk āŠ§Ļ†2 et pour tout 0ā‰¤iā‰¤k, si āŠ§Ļ†1.

Page 56: Rappels LTL et CTL

SF - M2 SAR - 2017/2018

CTL : macros

ā€¢ EFĻ† ā‰£ EāŠ¤UĻ†

ā€¢ AFĻ†ā‰£AāŠ¤UĻ†

ā€¢ EGĻ†ā‰£Ā¬AFĀ¬Ļ†

ā€¢ AGĻ†ā‰£Ā¬EFĀ¬Ļ†

Page 57: Rappels LTL et CTL

SF - M2 SAR - 2017/2018

CTL : Equivalences de formules

ā€¢ AXĻ†=Ā¬EXĀ¬Ļ†

ā€¢ AĻ†UĻ†ā€™=Ā¬EĀ¬(Ļ†UĻ†ā€™)=Ā¬E(GĀ¬Ļ†ā€™āˆØĀ¬Ļ†ā€™U(Ā¬Ļ†āˆ§Ā¬Ļ†ā€™))=Ā¬EGĀ¬Ļ†ā€™āˆ§Ā¬E(Ā¬Ļ†ā€™U(Ā¬Ļ†āˆ§Ā¬Ļ†ā€™))

Page 58: Rappels LTL et CTL

SF - M2 SAR - 2017/2018

CTL : Lois dā€™expansionā€¢ AĻ†UĻ†ā€™=Ļ†ā€™āˆØ(Ļ†āˆ§AX(AĻ†UĻ†ā€™))

ā€¢ AFĻ†=Ļ†āˆØ(AXAFĻ†)

ā€¢ AGĻ†=Ļ†āˆ§AXAGĻ†

ā€¢ EĻ†UĻ†ā€™=Ļ†ā€™āˆØ(Ļ†āˆ§EXE(Ļ†UĻ†ā€™))

ā€¢ EFĻ†=Ļ†āˆØEXEFĻ†

ā€¢ EGĻ†=Ļ†āˆ§EXEGĻ†

Page 59: Rappels LTL et CTL

SF - M2 SAR - 2017/2018

CTL : lois distributives

ā€¢ AG(Ļ†āˆ§Ļ†ā€™)=AGĻ†āˆ§AGĻ†ā€™

ā€¢ EF(Ļ†āˆØĻ†ā€™)=EFĻ†āˆØEFĻ†ā€™

Page 60: Rappels LTL et CTL

SF - M2 SAR - 2017/2018

Exemples

ā€¢ AccessibilitĆ© : EF(x=0)

ā€¢ Invariance : AGĀ¬(x=0)

ā€¢ VivacitĆ© : AGAF(active)

Page 61: Rappels LTL et CTL

SF - M2 SAR - 2017/2018

Exercice

61/71

CTL (Clarke & Emerson 81)

Example

1 2 3 4

5 6 7 8

q p, q q r

p, r p, r p, q

Compute

S(EX p) = {1, 2, 3, 5, 6}

S(AX p) = {3, 6}

S(EF p) = {1, 2, 3, 4, 5, 6, 7, 8}

S(AF p) = {2, 3, 5, 6, 7}

S(E q U r) =

S(A q U r) =

S(EXp)? S(AXp)?S(EFp)? S(AFp)?S(EqUr)?S(AqUr)?

Page 62: Rappels LTL et CTL

SF - M2 SAR - 2017/2018

Exercice

Exercises 433

6.11 Exercises

Exercise 6.1. Consider the following transition system over AP = { b, g, r, y }:

4

{ r }

{ y }{ g }

{ b }

1 2 3

The following atomic propositions are used: r (red), y (yellow), g (green), and b (black). Themodel is intended to describe a traffic light that is able to blink yellow. You are requested toindicate for each of the following CTL formulae the set of states for which these formulae hold:

(a) āˆ€ā™¦ y (g) āˆƒ" Ā¬ g

(b) āˆ€" y (h) āˆ€(b U Ā¬ b)

(c) āˆ€" āˆ€ā™¦ y (i) āˆƒ(b U Ā¬ b)

(d) āˆ€ā™¦ g (j) āˆ€(Ā¬ b Uāˆƒā™¦ b)

(e) āˆƒā™¦ g (k) āˆ€(g U āˆ€(y U r))

(f) āˆƒ" g (l) āˆ€(Ā¬ b U b)

Exercise 6.2. Consider the following CTL formulae and the transition system TS outlined onthe right:

Ī¦1 = āˆ€(a U b) āˆØ āˆƒāƒ (āˆ€" b)

Ī¦2 = āˆ€" āˆ€(a U b)

Ī¦3 = (a āˆ§ b) ā†’ āˆƒ" āˆƒāƒ āˆ€(b W a)

Ī¦4 = (āˆ€" āˆƒā™¦Ī¦3)

s0

āˆ…s4

{ b }

s1

{ a }s2

{ a, b }s3

{ b }Determine the satisfaction sets Sat(Ī¦i) and decide whether TS |= Ī¦i (1 # i # 4).

Exercise 6.3. Which of the following assertions are correct? Provide a proof or a counterexample.

(a) If s |= āˆƒ" a, then s |= āˆ€" a.

(b) If s |= āˆ€" a, then s |= āˆƒ" a.

(c) If s |= āˆ€ā™¦ a āˆØ āˆ€ā™¦ b, then s |= āˆ€ā™¦ (a āˆØ b).

(d) If s |= āˆ€ā™¦ (a āˆØ b), then s |= āˆ€ā™¦ a āˆØ āˆ€ā™¦ b.

Ļ† = A(aUb)āˆØEXEGb

Ļ†=AG(A(aUb))

MāŠ§Ļ†?

Page 63: Rappels LTL et CTL

SF - M2 SAR - 2017/2018

Comparaison LTL/CTL

ā€¢ La formule CTL AF(aāˆ§EXa) nā€™est pas exprimable en LTL

ā€¢ La formule LTL FG request ā†’GF response nā€™est pas exprimable en CTL

ā€¢ LTL et CTL incomparables!

ā€¢ LTL et CTL inclus dans CTL*

Page 64: Rappels LTL et CTL

SPECIF - M1 SAR - 2016/2017

Comparaison LTL/CTL

Soit Ļ† une formule CTL et Ļ• une formule LTL Alors Ļ† est Ć©quivalent Ć  Ļ• si, pour toute

structure de Kripke M, M āŠ§ Ļ† si et seulement si M āŠ§ Éø. On note Ļ† ā‰£Éø.

Page 65: Rappels LTL et CTL

SPECIF - M1 SAR - 2016/2017

Comparaison LTL/CTL

ā€¢ CTL ne sait pas exprimer FGp:

ExpressivitƩ : LTL vs. CTL

Pouvoir expressif incomparable de LTL et CTLI impossibilitĆ© dā€™exprimer les propriĆ©tĆ©s existentielles en LTLI CTL ne sait pas exprimer F G p

q0

p ~p p

q1 q2

K:

K |= F G p K 6|= AF AG pI problĆØme similaire : Ć©quitĆ© forte

Choix de la logiqueI en fonction des besoins du problĆØme . . .I . . . et des outils qui conviennent

Logiques plus expressives : CTLā‡¤, Āµ-calcul

Stephan Merz (LORIA) Tutoriel Model Checking ETR 05 23 / 37

Ce nā€™est pas une preuveā€¦

Page 66: Rappels LTL et CTL

SPECIF - M1 SAR - 2016/2017

Comparaison LTL/CTL

ā€¢ F(Ļ†1āˆØĻ†2) = FĻ†1 āˆØ FĻ†2

ā€¢ EF(Ļ†1āˆØĻ†2) = EFĻ†1 āˆØ EFĻ†2

ā€¢ MAIS : AF(Ļ†1āˆØĻ†2) ā‰ AFĻ†1 āˆØ AFĻ†2

Page 67: Rappels LTL et CTL

SPECIF - M1 SAR - 2016/2017

Comparaison LTL/CTL332 Computation Tree Logic

{ a } { b }

sā€²ā€² sā€²

s

For each path that starts in state s we have that ā™¦ (a āˆØ b) holds, so s |= āˆ€ā™¦ (a āˆØ b). Thisfollows directly from the fact that each path visits either state sā€² or state sā€²ā€² eventually,and sā€² |= a āˆØ b and the same applies to sā€²ā€². However, state s does not satisfy āˆ€ā™¦ a āˆØ āˆ€ā™¦ b.For instance, path s (sā€²ā€²)Ļ‰ |= ā™¦ a but s (sā€²ā€²)Ļ‰ Ģø|= ā™¦ b. Thus, s Ģø|= āˆ€ā™¦ b. By a similar reasoningapplied to path s (sā€²)Ļ‰ it follows that s Ģø|= āˆ€ā™¦ a. Thus, s Ģø|= āˆ€ā™¦ a āˆØ āˆ€ā™¦ b. Stated in words,not all computations that start in state s eventually reach an a-state nor do they alleventually reach a b-state.

6.2.4 Normal Forms for CTL

The duality law for āˆ€āƒĪ¦ shows that āˆ€āƒ can be treated as a derived operator of āˆƒāƒ .That is to say, the basic operators āˆƒāƒ , āˆƒU, and āˆ€U would have been sufficient to define thesyntax of CTL. The following theorem demonstrates that we can even omit the universalpath quantifier and define all temporal modalities in CTL using the basic operators āˆƒāƒ ,āˆƒU, and āˆƒ" .

Definition 6.13. Existential Normal Form (for CTL)

For a āˆˆ AP, the set of CTL state formulae in existential normal form (ENF, for short) isgiven by

Ī¦ ::= trueāˆ£āˆ£āˆ£ a

āˆ£āˆ£āˆ£ Ī¦1 āˆ§Ī¦2

āˆ£āˆ£āˆ£ Ā¬Ī¦āˆ£āˆ£āˆ£ āˆƒāƒĪ¦

āˆ£āˆ£āˆ£ āˆƒ(Ī¦1 UĪ¦2)āˆ£āˆ£āˆ£ āˆƒ" Ī¦.

Theorem 6.14. Existential Normal Form for CTL

For each CTL formula there exists an equivalent CTL formula in ENF.

M,sāŠ§ AF(aāˆØb) M,sāŠ­ AF aāˆØ AF b