• Aucun résultat trouvé

Algorithme de model-checking pour CTL

N/A
N/A
Protected

Academic year: 2022

Partager "Algorithme de model-checking pour CTL"

Copied!
3
0
0

Texte intégral

(1)

Algorithme de model-checking pour CTL

Model-checking:

input: un modèle (une structure de Kripke) 𝐒=(Q,→,q0

,ℓ) et une formule φ

output: oui ssi 𝐒 ⊨ φ.

Idée de l’algorithme:

Indiquer pour chaque sous-formule de φ les états où elle est vraie.

Algorithme de model-checking pour CTL

ℓ( ) = {a}

) = {b}

) = { } ℓ(

ℓ(

s0

s1

s2

s3

s4

s5

s6

a b EX a

a ∨ EX a

φ

s0 ⊨ φ !

φ = E (a v EX a) U b

Algorithme de model-checking pour CTL

q

⊤ \ ⊥

q.φ1

q.φ2

q.φ3

q.φ

34

= ⊤ ⟺ q ⊨ φ

34

Objectif: un algorithme de marquage pour décider si q.𝜓 = ⊤ ou ⊥ pour toute sous-formule 𝜓 et tout état q.

(2)

Algorithme de model-checking pour CTL

Procédure Marquage(𝜓):

cas 1: 𝜓 = P Pour tout q ∈ Q:

Si P ∈ ℓ(q) Alors q.𝜓 := ⊤ Sinon: q.𝜓 := ⊥

𝐒 = (Q, →, q

init

, ℓ)

cas 2: 𝜓 = ¬ 𝜓1 Marquage(𝜓1) Pour tout q ∈ Q:

q.𝜓 := ¬ q.𝜓1

cas 3: 𝜓 = 𝜓1 ∧ 𝜓2

Marquage(𝜓1), Marquage(𝜓2) Pour tout q ∈ Q:

q.𝜓 := q.𝜓1 ∧ q.𝜓2

Algorithme de model-checking pour CTL

Procédure Marquage(𝜓):

cas 4: 𝜓 = EX 𝜓1 Marquage(𝜓1) Pour tout q ∈ Q:

q.𝜓 := ⊥ Pour tout q→q’ ∈ Q:

Si q’.𝜓1 = ⊤ Alors q.𝜓 := ⊤

𝐒 = (Q, →, q

init

, ℓ)

cas 3: 𝜓 = 𝜓1 ∧ 𝜓2

Marquage(𝜓1), Marquage(𝜓2) Pour tout q ∈ Q:

q.𝜓 := q.𝜓1 ∧ q.𝜓2

Algorithme de model-checking pour CTL

Procédure Marquage(𝜓):

cas 4: 𝜓 = EX 𝜓1 Marquage(𝜓1) Pour tout q ∈ Q:

q.𝜓 := ⊥

Pour tout q→q’ dans 𝐒 : Si q’.𝜓1 = ⊤ Alors q.𝜓 := ⊤

𝐒 = (Q, →, q

init

, ℓ)

Algorithme de model-checking pour CTL

Procédure Marquage(𝜓):

cas 5: 𝜓 = E 𝜓1 U 𝜓2

Marquage(𝜓1) Marquage(𝜓2) Pour tout q ∈ Q:

q.𝜓 := ⊥ , q.déjàvu := ⊥ L = { }  // liste vide

Pour tout q ∈ Q:

Si q.𝜓2 Alors L := L + {q} , q.déjàvu := ⊤ Tant que L ≠ ∅ :

Piocher q dans L q.𝜓 := ⊤ Pour tout q’ →q :

Si ¬ q’.déjàvu Alors q’.déjàvu := ⊤

Si q’.𝜓1 Alors L := L + {q’}

𝐒 = (Q, →, q

init

, ℓ)

(3)

Algorithme de model-checking pour CTL

Procédure Marquage(𝜓):

cas 6: 𝜓 = A 𝜓1 U 𝜓2

Marquage(𝜓1) Marquage(𝜓2) Pour tout q ∈ Q:

q.𝜓 := ⊥ , q.nb := degré(q) L = { } 

Pour tout q ∈ Q:

Si q.𝜓2 Alors L := L + {q}

Tant que L ≠ ∅ : Piocher q dans L q.𝜓 := ⊤ Pour tout q’ →q : q’.nb := q’.nb -1

Si q’.nb ==0 ∧ q’.𝜓1 ∧ ¬ q’.𝜓 Alors L := L + {q’}

𝐒 = (Q, →, q

init

, ℓ)

Algorithme de model-checking pour CTL

Complexité:

→ Algorithme en O(|φ| . |𝐒|)

[le model-checking de CTL est un problème P-complet.]

|𝐒| = |Q|+|→|

cas 5: 𝜓 = E 𝜓1 U 𝜓2

Marquage(𝜓1) Marquage(𝜓2) Pour tout q ∈ Q:

q.𝜓 := ⊥ , q.déjàvu := ⊥ L = { }  // liste vide

Pour tout q ∈ Q:

Si q.𝜓2 Alors L := L + {q} , q.déjàvu := ⊤ Tant que L ≠ ∅ :

Piocher q dans L q.𝜓 := ⊤ Pour tout q’ →q :

Si ¬ q’.déjàvu Alors q’.déjàvu := ⊤

Si q’.𝜓1 Alors L := L + {q’}

cas 6: 𝜓 = A 𝜓1 U 𝜓2

Marquage(𝜓1) Marquage(𝜓2) Pour tout q ∈ Q:

q.𝜓 := ⊥ , q.nb := degré(q) L = { } 

Pour tout q ∈ Q:

Si q.𝜓2 Alors L := L + {q}

Tant que L ≠ ∅ : Piocher q dans L q.𝜓 := ⊤ Pour tout q’ →q : q’.nb := q’.nb -1

Si q’.nb ==0 ∧ q’.𝜓1 ∧ ¬ q’.𝜓 Alors L := L + {q’}

Références

Documents relatifs

Both versions are based on two elementary phases: (1) a forward constrained exploration of the state graph using the state space construction discussed in Sect 2; followed by (2)

5 ) f est une fonction deux fois dérivable

It is thus the combination of our two contributions, a CTL-based extension of OCL, whose formal syntax and semantics extend the OCL standard without modifying existing definitions,

We realize our approach by performing the following steps: (i) representing the model in the assertion box (ABox) of the description-logic based knowledge base, (ii) defining

In this paper we show how to use Description Logic reasoning to perform explicit state model checking of the basic modalities of CTL on a synchronous model of computation, with the

On reviendra sur les relations de similarité et de divisibilité entre les sous-résultants (elles sont déjà bien connues, voir les ouvrages précités ci-dessus) grâce à de

[r]

Various approaches on trust modeling have developed modal logics that capture the important elements of the cognitive theory of trust as proposed in [5]. In these approaches, trust