+ All Categories
Home > Documents > Regular Expressions for PCTL Counterexamplesgloban08/content/katoen-qest08.pdf · Regular...

Regular Expressions for PCTL Counterexamplesgloban08/content/katoen-qest08.pdf · Regular...

Date post: 14-Mar-2020
Category:
Upload: others
View: 1 times
Download: 0 times
Share this document with a friend
50
Regular Expressions for PCTL Counterexamples Berteun Damman, Tingting Han, and Joost-Pieter Katoen Software Modeling and Verification, RWTH Aachen University and Formal Methods and Tools, University of Twente QEST’08, September 16, Saint Malo c JPK
Transcript
Page 1: Regular Expressions for PCTL Counterexamplesgloban08/content/katoen-qest08.pdf · Regular Expressions for PCTL Counterexamples Berteun Damman, Tingting Han, and Joost-Pieter Katoen

Regular Expressionsfor PCTL Counterexamples

Berteun Damman, Tingting Han, and Joost-Pieter Katoen

Software Modeling and Verification, RWTH Aachen Universityand Formal Methods and Tools, University of Twente

QEST’08, September 16, Saint Malo

c© JPK

Page 2: Regular Expressions for PCTL Counterexamplesgloban08/content/katoen-qest08.pdf · Regular Expressions for PCTL Counterexamples Berteun Damman, Tingting Han, and Joost-Pieter Katoen

Probabilistic model checking

?

0.80.2

0.4

0.6

Modeling

propertyspecification

Formalizing

insufficientmemory

satisfied

up to 107 states

P�0.01(�deadlock)

inaccuracy system

Model Checking

requirements

system model

c© JPK 1

Page 3: Regular Expressions for PCTL Counterexamplesgloban08/content/katoen-qest08.pdf · Regular Expressions for PCTL Counterexamples Berteun Damman, Tingting Han, and Joost-Pieter Katoen

Counterexamples

• Are of utmost importance:

– diagnostic feedback, key to abstraction-refinement, schedule synthesis . . .

– fit to paradigm “model checking = bug hunting”

c© JPK 2

Page 4: Regular Expressions for PCTL Counterexamplesgloban08/content/katoen-qest08.pdf · Regular Expressions for PCTL Counterexamples Berteun Damman, Tingting Han, and Joost-Pieter Katoen

Counterexamples

• Are of utmost importance:

– diagnostic feedback, key to abstraction-refinement, schedule synthesis . . .

– fit to paradigm “model checking = bug hunting”

• LTL counterexamples are finite paths

– �Φ: a path ending in a ¬Φ-state– � Φ: a ¬Φ-path leading to a ¬Φ cycle– BFS yields shortest counterexamples

c© JPK 3

Page 5: Regular Expressions for PCTL Counterexamplesgloban08/content/katoen-qest08.pdf · Regular Expressions for PCTL Counterexamples Berteun Damman, Tingting Han, and Joost-Pieter Katoen

Counterexamples

• Are of utmost importance:

– diagnostic feedback, key to abstraction-refinement, schedule synthesis . . .

– fit to paradigm “model checking = bug hunting”

• LTL counterexamples are finite paths

– �Φ: a path ending in a ¬Φ-state– � Φ: a ¬Φ-path leading to a ¬Φ cycle– BFS yields shortest counterexamples

• CTL counterexamples are (mostly) finite trees

– universal CTL\LTL: trees or proof-like counterexample– existential CTL: witnesses, annotated counterexample

c© JPK 4

Page 6: Regular Expressions for PCTL Counterexamplesgloban08/content/katoen-qest08.pdf · Regular Expressions for PCTL Counterexamples Berteun Damman, Tingting Han, and Joost-Pieter Katoen

Counterexamples

• Are of utmost importance:

– diagnostic feedback, key to abstraction-refinement, schedule synthesis . . .

– fit to paradigm “model checking = bug hunting”

• LTL counterexamples are finite paths

– �Φ: a path ending in a ¬Φ-state– � Φ: a ¬Φ-path leading to a ¬Φ cycle– BFS yields shortest counterexamples

• CTL counterexamples are (mostly) finite trees

– universal CTL\LTL: trees or proof-like counterexample– existential CTL: witnesses, annotated counterexample

• This talk: PCTL counterexamples for DTMCs

c© JPK 5

Page 7: Regular Expressions for PCTL Counterexamplesgloban08/content/katoen-qest08.pdf · Regular Expressions for PCTL Counterexamples Berteun Damman, Tingting Han, and Joost-Pieter Katoen

Discrete-time Markov Chain

0.8

0.1

1

0.3 0.667

0.333

0.3

0.1

0.2

s0 s1

s2

t10.6

u t2

0.5

0.9

0.2

a DTMC is a triple (S, P, L) with state space S and state-labelling L

and P a stochastic matrix with P(s, s′) = one-step probability to jump from s to s′

c© JPK 6

Page 8: Regular Expressions for PCTL Counterexamplesgloban08/content/katoen-qest08.pdf · Regular Expressions for PCTL Counterexamples Berteun Damman, Tingting Han, and Joost-Pieter Katoen

Probabilistic CTL (Hansson & Jonsson, 1994)

• For a ∈ AP, J ⊆ [0, 1] an interval with rational bounds, and h ∈ N:

Φ ::= a∣∣ Φ ∧ Φ

∣∣ ¬Φ∣∣ PJ(ϕ)

ϕ ::= ΦUΦ∣∣ Φ U�h Φ

• s0s1s2 . . . |= Φ U�h Ψ if Φ holds until Ψ holds within h steps

• s |= PJ(ϕ) if probability of set of ϕ-paths starting in s lies in J

abbreviate P[0,0.5](ϕ) by P�0.5(ϕ) and P]0,1](ϕ) by P>0(ϕ) and so on

c© JPK 7

Page 9: Regular Expressions for PCTL Counterexamplesgloban08/content/katoen-qest08.pdf · Regular Expressions for PCTL Counterexamples Berteun Damman, Tingting Han, and Joost-Pieter Katoen

This talk

• What is a PCTL counterexample?

– a set of paths with sufficient probability mass

• How to determine smallest counterexamples?

– exploit k-shortest path algorithms

• How about the size of counterexamples?

– well, they may be excessively large and incomprehensible

• Can we do better?

– yes, represent counterexamples by regular expressions!

• How to obtain (short) regular expressions?

– use automata theory and some heuristics

c© JPK 8

Page 10: Regular Expressions for PCTL Counterexamplesgloban08/content/katoen-qest08.pdf · Regular Expressions for PCTL Counterexamples Berteun Damman, Tingting Han, and Joost-Pieter Katoen

This talk

• What is a PCTL counterexample? [Han & Katoen, TACAS’07]]

– a set of paths with sufficient probability mass

• How to determine smallest counterexamples?

– exploit k-shortest path algorithms

• How about the size of counterexamples?

– well, they may be excessively large and incomprehensible

• Can we do better?

– yes, represent counterexamples by regular expressions!

• How to obtain (short) regular expressions?

– use automata theory and some heuristics

c© JPK 9

Page 11: Regular Expressions for PCTL Counterexamplesgloban08/content/katoen-qest08.pdf · Regular Expressions for PCTL Counterexamples Berteun Damman, Tingting Han, and Joost-Pieter Katoen

This talk

• What is a PCTL counterexample?

– a set of paths with sufficient probability mass

• How to determine smallest counterexamples?

– exploit k-shortest path algorithms

• How about the size of counterexamples? [This QEST’08 paper]

– well, they may be excessively large and incomprehensible

• Can we do better?

– yes, represent counterexamples by regular expressions!

• How to obtain (short) regular expressions?

– use automata theory and some heuristics

c© JPK 10

Page 12: Regular Expressions for PCTL Counterexamplesgloban08/content/katoen-qest08.pdf · Regular Expressions for PCTL Counterexamples Berteun Damman, Tingting Han, and Joost-Pieter Katoen

PCTL counterexamples for s �|= P�p(ϕ)

• A counterexample C is a set of finite paths︸ ︷︷ ︸evidences

satisfying

– σ ∈ C implies σ starts in s and σ |= ϕ

– Pr(C) =P

σ∈C P(σ) exceeds p

c© JPK 11

Page 13: Regular Expressions for PCTL Counterexamplesgloban08/content/katoen-qest08.pdf · Regular Expressions for PCTL Counterexamples Berteun Damman, Tingting Han, and Joost-Pieter Katoen

PCTL counterexamples for s �|= P�p(ϕ)

• A counterexample C is a set of finite paths︸ ︷︷ ︸evidences

satisfying

– σ ∈ C implies σ starts in s and σ |= ϕ

– Pr(C) =P

σ∈C P(σ) exceeds p

• Property: counterexamples for non-strict bounds � p are finite

s12

1

12

{a}∅

A DTMC with infinite counterexample for s �|= P<1(� a)

c© JPK 12

Page 14: Regular Expressions for PCTL Counterexamplesgloban08/content/katoen-qest08.pdf · Regular Expressions for PCTL Counterexamples Berteun Damman, Tingting Han, and Joost-Pieter Katoen

PCTL counterexamples for s �|= P�p(ϕ)

• A counterexample C is a set of finite paths︸ ︷︷ ︸evidences

satisfying

– σ ∈ C implies σ starts in s and σ |= ϕ

– Pr(C) =P

σ∈C P(σ) exceeds p

• Property: counterexamples for non-strict bounds � p are finite

• C is minimal if |C| � |C′| for any counterexample C ′

• C is smallest if:

C is minimal, and Pr(C) � Pr(C ′) for any minimal counterexample C ′

c© JPK 13

Page 15: Regular Expressions for PCTL Counterexamplesgloban08/content/katoen-qest08.pdf · Regular Expressions for PCTL Counterexamples Berteun Damman, Tingting Han, and Joost-Pieter Katoen

Evidences for s0 �|= P�12(a U b)

0.8

0.1

1

0.3 0.667

0.333

0.3

0.1

0.2

s0 s1

s2

t10.6

u t2

0.5

0.9

0.2

evidences prob.σ1 = s0 s1 t1 0.2

σ2 = s0 s1 s2 t1 0.2

σ3 = s0 s2 t1 0.15

σ4 = s0 s1 s2 t2 0.12

σ5 = s0 s2 t2 0.09

. . . . . .

c© JPK 14

Page 16: Regular Expressions for PCTL Counterexamplesgloban08/content/katoen-qest08.pdf · Regular Expressions for PCTL Counterexamples Berteun Damman, Tingting Han, and Joost-Pieter Katoen

Strongest evidences (SEs)

0.8

0.1

1

0.3 0.667

0.333

0.3

0.1

0.2

s0 s1

s2

t10.6

u t2

0.5

0.9

0.2

evidences prob.σ1 = s0 s1 t1 0.2

σ2 = s0 s1 s2 t1 0.2

σ3 = s0 s2 t1 0.15

σ4 = s0 s1 s2 t2 0.12

σ5 = s0 s2 t2 0.09

. . . . . .

c© JPK 15

Page 17: Regular Expressions for PCTL Counterexamplesgloban08/content/katoen-qest08.pdf · Regular Expressions for PCTL Counterexamples Berteun Damman, Tingting Han, and Joost-Pieter Katoen

Counterexamples for s0 �|= P�12(a U b)

0.8

0.1

1

0.3 0.667

0.333

0.3

0.1

0.2

s0 s1

s2

t10.6

u t2

0.5

0.9

0.2

evidences prob.σ1 = s0 s1 t1 0.2

σ2 = s0 s1 s2 t1 0.2

σ3 = s0 s2 t1 0.15

σ4 = s0 s1 s2 t2 0.12

σ5 = s0 s2 t2 0.09

counterexample card. prob.{σ1, . . . , σ5 } 5 0.76

{σ1 or σ2, . . . , σ5 } 4 0.56

{σ1, σ2, σ4 } 3 0.52

{σ1, σ2, σ3 } 3 0.55

c© JPK 16

Page 18: Regular Expressions for PCTL Counterexamplesgloban08/content/katoen-qest08.pdf · Regular Expressions for PCTL Counterexamples Berteun Damman, Tingting Han, and Joost-Pieter Katoen

Counterexamples for s0 �|= P�12(a U b)

0.8

0.1

1

0.3 0.667

0.333

0.3

0.1

0.2

s0 s1

s2

t10.6

u t2

0.5

0.9

0.2

evidences prob.σ1 = s0 s1 t1 0.2

σ2 = s0 s1 s2 t1 0.2

σ3 = s0 s2 t1 0.15

σ4 = s0 s1 s2 t2 0.12

σ5 = s0 s2 t2 0.09

counterexample card. prob.{σ1, . . . , σ5 } 5 0.76

{σ1 or σ2, . . . , σ5 } 4 0.56

minimal −→ {σ1, σ2, σ4 } 3 0.52

minimal −→ {σ1, σ2, σ3 } 3 0.55

c© JPK 17

Page 19: Regular Expressions for PCTL Counterexamplesgloban08/content/katoen-qest08.pdf · Regular Expressions for PCTL Counterexamples Berteun Damman, Tingting Han, and Joost-Pieter Katoen

Counterexamples for s0 �|= P�12(a U b)

0.8

0.1

1

0.3 0.667

0.333

0.3

0.1

0.2

s0 s1

s2

t10.6

u t2

0.5

0.9

0.2

evidences prob.σ1 = s0 s1 t1 0.2

σ2 = s0 s1 s2 t1 0.2

σ3 = s0 s2 t1 0.15

σ4 = s0 s1 s2 t2 0.12

σ5 = s0 s2 t2 0.09

counterexample card. prob.{σ1, . . . , σ5 } 5 0.76

{σ1 or σ2, . . . , σ5 } 4 0.56

{σ1, σ2, σ4 } 3 0.52

smallest −→ {σ1, σ2, σ3 } 3 0.55

c© JPK 18

Page 20: Regular Expressions for PCTL Counterexamplesgloban08/content/katoen-qest08.pdf · Regular Expressions for PCTL Counterexamples Berteun Damman, Tingting Han, and Joost-Pieter Katoen

Obtaining smallest counterexamples

1

0.1

11

0.3 0.667

0.333

0.3

0.2

s0 s1

s2

t10.6

u t2

0.5

Step 1: make all Ψ-states and all ¬Φ ∧ ¬Ψ-states absorbing

c© JPK 19

Page 21: Regular Expressions for PCTL Counterexamplesgloban08/content/katoen-qest08.pdf · Regular Expressions for PCTL Counterexamples Berteun Damman, Tingting Han, and Joost-Pieter Katoen

Adapting a bit more

1

0.1

1

0.3 0.667

0.333

0.3

0.2

s0 s1

s2

t10.6

u

0.5

t2

1

1

Step 2: insert a sink state and redirect all outgoing edges of Ψ-states to it

c© JPK 20

Page 22: Regular Expressions for PCTL Counterexamplesgloban08/content/katoen-qest08.pdf · Regular Expressions for PCTL Counterexamples Berteun Damman, Tingting Han, and Joost-Pieter Katoen

A weighted digraph

log 5

log 10

0

log 32

s0 s1

s2

t1

u

t2

0

log 53 log 3

0

0

log 2

103

log 103

Step 3: turn it into a weighted digraph with w(s, s′) = log

„1

P(s, s′)

«

c© JPK 21

Page 23: Regular Expressions for PCTL Counterexamplesgloban08/content/katoen-qest08.pdf · Regular Expressions for PCTL Counterexamples Berteun Damman, Tingting Han, and Joost-Pieter Katoen

A simple derivation

For finite path σ = s0 s1 s2 . . . sn:

w(σ) = w(s0, s1) + w(s1, s2) + . . . + w(sn−1, sn)

= log 1P(s0,s1)

+ log 1P(s1,s2)

+ . . . + log 1P(sn−1,sn)

= log 1P(s0,s1)·P(s1,s2)·...·P(sn−1,sn)

= log 1Pr(σ)

Pr(σ) � Pr(σ)︸ ︷︷ ︸in DTMC D

if and only if w(σ) � w(σ)︸ ︷︷ ︸in digraph G(D)

c© JPK 22

Page 24: Regular Expressions for PCTL Counterexamplesgloban08/content/katoen-qest08.pdf · Regular Expressions for PCTL Counterexamples Berteun Damman, Tingting Han, and Joost-Pieter Katoen

What does this mean?

• Finding a strongest evidence is a shortest path (SP) problem

– apply standard SP algorithms, or Viterbi’s algorithm ⇒ linear time complexity

c© JPK 23

Page 25: Regular Expressions for PCTL Counterexamplesgloban08/content/katoen-qest08.pdf · Regular Expressions for PCTL Counterexamples Berteun Damman, Tingting Han, and Joost-Pieter Katoen

What does this mean?

• Finding a strongest evidence is a shortest path (SP) problem

– apply standard SP algorithms, or Viterbi’s algorithm ⇒ linear time complexity

• Finding a shortest counterex is a k-shortest path (KSP) problem

– dynamically determine k: generate C incrementally and halt when Pr(C) > p

c© JPK 24

Page 26: Regular Expressions for PCTL Counterexamplesgloban08/content/katoen-qest08.pdf · Regular Expressions for PCTL Counterexamples Berteun Damman, Tingting Han, and Joost-Pieter Katoen

What does this mean?

• Finding a strongest evidence is a shortest path (SP) problem

– apply standard SP algorithms, or Viterbi’s algorithm ⇒ linear time complexity

• Finding a shortest counterex is a k-shortest path (KSP) problem

– dynamically determine k: generate C incrementally and halt when Pr(C) > p

• This also applies to P�p(ϕ) properties, as

P�p(Φ U Ψ) ≡ P�1−p((Φ ∧ ¬Ψ)| {z }Φ∗

W (¬Φ ∧ ¬Ψ)| {z }Ψ∗

)

≡ P�1−p(Φ∗ U (Ψ∗ ∨ atbscc(Φ∗)))

c© JPK 25

Page 27: Regular Expressions for PCTL Counterexamplesgloban08/content/katoen-qest08.pdf · Regular Expressions for PCTL Counterexamples Berteun Damman, Tingting Han, and Joost-Pieter Katoen

Time complexity

counterexample shortest path algorithm time complexityproblem problem

unbounded SE SP Dijkstra O(M + N · log N)

bounded h SE HSP Bellman-Ford / Viterbi O(h·M)

unbounded SC KSP Eppstein O(M + N · log N + k)

bounded h SC HKSP adapted REA O (h·M + h·k· log N)

N = |S|, M = # transitions, h = hop count, k = # shortest paths

including costs yields an instance of the NP-complete RSP problem

c© JPK 26

Page 28: Regular Expressions for PCTL Counterexamplesgloban08/content/katoen-qest08.pdf · Regular Expressions for PCTL Counterexamples Berteun Damman, Tingting Han, and Joost-Pieter Katoen

On the size of counterexamples

s u t0.01

1

0.99 {a}1

A smallest counterexample for s �|= P�0.9999(� a) contains paths

s u t, s u s u t, s u s u s u t, . . . . . . , s u|{z}k times

t

where k is the smallest integer such that 1 − 0.99k−1 > 0.9999

The smallest counterexample has k = 689 evidences

c© JPK 27

Page 29: Regular Expressions for PCTL Counterexamplesgloban08/content/katoen-qest08.pdf · Regular Expressions for PCTL Counterexamples Berteun Damman, Tingting Han, and Joost-Pieter Katoen

Synchronous leader election P�0.99(� leader)

0.0

1.0

100 102 104 106

−→P

roba

bilit

y

−→ #evidences

K=2 K=4 K=8 K=12

size of counterexample is double exponential in problem size (see paper)

c© JPK 28

Page 30: Regular Expressions for PCTL Counterexamplesgloban08/content/katoen-qest08.pdf · Regular Expressions for PCTL Counterexamples Berteun Damman, Tingting Han, and Joost-Pieter Katoen

Use regular expressions!

• Size of counterexamples is mainly influenced by loops

– each loop-traversal yields another path in counterexample

• Idea: represent sets of “similar” finite paths by a regular expression

• How?

– DTMC (rooted at s) −→ DFA– DFA −→ most probable paths −→ regular expression r

• Such that:

– probability of regular expression r exceeds p (= r is a counterexample)– r is “minimal”: deletion of some “branch” of r yields no counterexample

c© JPK 29

Page 31: Regular Expressions for PCTL Counterexamplesgloban08/content/katoen-qest08.pdf · Regular Expressions for PCTL Counterexamples Berteun Damman, Tingting Han, and Joost-Pieter Katoen

From DTMCs to DFAs

s

u

v

t

w

s

u

v

t

w

.3 .3

1

.7

.2

(.3, v) (.3, t)

(.2, u)(.7, u)

(1, w)

(.5, v).51

1

(1, v)s

(1, s)

alphabet Σ consist of symbols of the form (p, s)

c© JPK 30

Page 32: Regular Expressions for PCTL Counterexamplesgloban08/content/katoen-qest08.pdf · Regular Expressions for PCTL Counterexamples Berteun Damman, Tingting Han, and Joost-Pieter Katoen

From DTMCs to DFA

For DTMC D = (S, P, L), state s, and property P(��h t), DFA AD = (S′, Σ, s, δ, t)

DTMC DFA

state space S S ∪ {s}initial state s s /∈ S

goal/accepting state t t

alphabet – Σ ⊂ [0, 1] × S

transitions s1p−→ s2 s1

(p, s2)

−−−−−−→ s2

– s(1,s)−−−→ s

c© JPK 31

Page 33: Regular Expressions for PCTL Counterexamplesgloban08/content/katoen-qest08.pdf · Regular Expressions for PCTL Counterexamples Berteun Damman, Tingting Han, and Joost-Pieter Katoen

Regular expressions [Daws’04]

The set of regular expressions R(Σ):

r, r′ ::= ε empty

| (p, s) letter

| r|r′ choice

| r.r′ catenation

| r∗ repetition

c© JPK 32

Page 34: Regular Expressions for PCTL Counterexamplesgloban08/content/katoen-qest08.pdf · Regular Expressions for PCTL Counterexamples Berteun Damman, Tingting Han, and Joost-Pieter Katoen

Regular expressions [Daws’04]

The set of regular expressions R(Σ):

r, r′ ::= ε empty

| (p, s) letter

| r|r′ choice

| r.r′ catenation

| r∗ repetition

Evaluation val : R(Σ) → [0, 1]:

val(ε) = 1

val((p, s)) = p

val(r|r′) = val(r) + val(r′)

val(r.r′) = val(r) · val(r′)

val(r∗) =

(1 if val(r) = 1

11−val(r) otherwise

c© JPK 33

Page 35: Regular Expressions for PCTL Counterexamplesgloban08/content/katoen-qest08.pdf · Regular Expressions for PCTL Counterexamples Berteun Damman, Tingting Han, and Joost-Pieter Katoen

Regular expressions [Daws’04]

The set of regular expressions R(Σ):

r, r′ ::= ε empty

| (p, s) letter

| r|r′ choice

| r.r′ catenation

| r∗ repetition

Evaluation val : R(Σ) → [0, 1]:

val(ε) = 1

val((p, s)) = p

val(r|r′) = val(r) + val(r′)

val(r.r′) = val(r) · val(r′)

val(r∗) =

(1 if val(r) = 1

11−val(r) otherwise

For regular expression r of DFA AD with accept state t:

val(r) = PrD {σ ∈ Paths(s) | σ |= � t}

c© JPK 34

Page 36: Regular Expressions for PCTL Counterexamplesgloban08/content/katoen-qest08.pdf · Regular Expressions for PCTL Counterexamples Berteun Damman, Tingting Han, and Joost-Pieter Katoen

State elimination [Brzozowski & McCluskey jr., 1962]

a a

b

b

b a

a

aa.a∗.b

b

b a

a a.a∗.b|a.b

a.b

a.(a.b)∗.(a.a∗.b|a.b)

c© JPK 35

Page 37: Regular Expressions for PCTL Counterexamplesgloban08/content/katoen-qest08.pdf · Regular Expressions for PCTL Counterexamples Berteun Damman, Tingting Han, and Joost-Pieter Katoen

Ordering matters

s t ua a d

c

b

b d

a

Ordering s < u < t yields (aa|b)(a|cb)∗(cd|d)

Ordering s < t < u yields (aa|b)a∗c(ba∗c)∗(ba∗d|d)|(aa|b)a∗d

c© JPK 36

Page 38: Regular Expressions for PCTL Counterexamplesgloban08/content/katoen-qest08.pdf · Regular Expressions for PCTL Counterexamples Berteun Damman, Tingting Han, and Joost-Pieter Katoen

Ordering matters

s t ua a d

c

b

b d

a

Finding the optimal removal ordering takes time O(N !) where |S| = N

c© JPK 37

Page 39: Regular Expressions for PCTL Counterexamplesgloban08/content/katoen-qest08.pdf · Regular Expressions for PCTL Counterexamples Berteun Damman, Tingting Han, and Joost-Pieter Katoen

Heuristic [Han & Wood’07]

“eliminate all non-bridge states before bridge states”

1. Find all bridge states q1 through qn−1

• the path of every word w ∈ L(A) goes through qi

• once this path visits qi it will not visit states visited prior to qi

2. Perform vertical chopping

• A = A1 · A2 · . . . · An where Ai is “connected” to Ai via bridge qi

3. For each Ai perform horizontal chopping

• Ai = Ai,1|Ai,2| . . . |Ai,k

4. For each automaton Ai, j goto step 1.

c© JPK 38

Page 40: Regular Expressions for PCTL Counterexamplesgloban08/content/katoen-qest08.pdf · Regular Expressions for PCTL Counterexamples Berteun Damman, Tingting Han, and Joost-Pieter Katoen

Time complexity

“eliminate all non-bridge states before bridge states”

1. Find all bridge states q1 through qn−1 in linear time

• the path of every word w ∈ L(A) goes through qi

• once this path visits qi it will not visit states visited prior to qi

2. Perform vertical chopping in linear time

• A = A1 · A2 · . . . · An where Ai is “connected” to Ai via bridge qi

3. For each Ai perform horizontal chopping in linear time

• Ai = Ai,1 | Ai,2 | . . . | Ai,k

4. For each automaton Ai,j goto step 1.

c© JPK 39

Page 41: Regular Expressions for PCTL Counterexamplesgloban08/content/katoen-qest08.pdf · Regular Expressions for PCTL Counterexamples Berteun Damman, Tingting Han, and Joost-Pieter Katoen

Vertical chopping

ab

ba a

b

a b

a a

ba

b

b

a

ab

ba a

b

b

a

b

a a

ba

a

b

c© JPK 40

Page 42: Regular Expressions for PCTL Counterexamplesgloban08/content/katoen-qest08.pdf · Regular Expressions for PCTL Counterexamples Berteun Damman, Tingting Han, and Joost-Pieter Katoen

Horizontal chopping

b

ba a

b

b

a

a

b

a a

bbb

b

b

a

a

c© JPK 41

Page 43: Regular Expressions for PCTL Counterexamplesgloban08/content/katoen-qest08.pdf · Regular Expressions for PCTL Counterexamples Berteun Damman, Tingting Han, and Joost-Pieter Katoen

Maximal union subexpressions

r1 is a maximal union subexpression (MUS) of regular expression r if:

r = r1 | r2 modulo the congruence (R1)-(R3)

where for some r2 ∈ R(Σ):

(R1) r ≡ r | ε

(R2) r1 | r2 ≡ r2 | r1

(R3) r1 | (r2 | r3) ≡ (r1 | r2) | r3

a MUS can be regarded as a main path from the initial state to a accept state

c© JPK 42

Page 44: Regular Expressions for PCTL Counterexamplesgloban08/content/katoen-qest08.pdf · Regular Expressions for PCTL Counterexamples Berteun Damman, Tingting Han, and Joost-Pieter Katoen

Algorithm for regular expressionsRequire: DFA AD = (S, Σ, s, δ, {t}), and p ∈ [0, 1]

Ensure: regular expression r ∈ R(Σ) with val(r) > p

A := AD, pr := 0; priority queue pq := ∅; k := 1;while pr � p do

σ := the strongest evidence in A;forall s′ ∈ σ \ {s, s, t} do pq.enqueue(s′); end;while pq �= ∅ doA :=eliminate(pq.dequeue()); rk := the created MUS;pr := pr + val(rk); A :=eliminate(rk);if (pr > p) then break else k := k + 1;

endwhile;endwhile;return r1 | . . . | rk.

this approach works for strict and non-strict bounds

c© JPK 43

Page 45: Regular Expressions for PCTL Counterexamplesgloban08/content/katoen-qest08.pdf · Regular Expressions for PCTL Counterexamples Berteun Damman, Tingting Han, and Joost-Pieter Katoen

Leader election revisited

start

u1 uiW (N,K)...... NK−W (N,K)......s1 sj

next leader

1NK 1

NK

1NK

1NK

11

11

1

Regular expression for the counterexample:

r(N, K) = start. [(u1| · · · |ui) .next. start ]∗. (s1| · · · |sj). leader

c© JPK 44

Page 46: Regular Expressions for PCTL Counterexamplesgloban08/content/katoen-qest08.pdf · Regular Expressions for PCTL Counterexamples Berteun Damman, Tingting Han, and Joost-Pieter Katoen

Model reductionThe size of a counterexample is determined by

• traversing the same loop for different times

=⇒ using Kleene stars in regular expressions

• large number of states

=⇒ model reduction

1. bisimulation minimization2. SCC minimization

Model reduction is done prior to counterexample generation

c© JPK 45

Page 47: Regular Expressions for PCTL Counterexamplesgloban08/content/katoen-qest08.pdf · Regular Expressions for PCTL Counterexamples Berteun Damman, Tingting Han, and Joost-Pieter Katoen

Leader election re-revisitedBisimulation quotient:

starts

leaderu

next

NK−W (N,K)

NK 1W (N,K)

NK1

1

r∼(N, K) = start. (u.next.start)∗.s. leader

After aggregating SCCs:

start

s1

... NK−W (N,K)

NK

sjleader

1NK

1NK

1

1W (N,K)

NK

rscc(N, K) = start.start∗.(s1| · · · |sj).leader

SCC aggregation of bisimulation quotient:

starts

leader

NK−W (N,K)

NK 1W (N,K)

NK

rscc∼ (N, K) = start.start∗.s.leader

c© JPK 46

Page 48: Regular Expressions for PCTL Counterexamplesgloban08/content/katoen-qest08.pdf · Regular Expressions for PCTL Counterexamples Berteun Damman, Tingting Han, and Joost-Pieter Katoen

Counterexamples are en vogue

• Heuristic search algorithms for CTMCs (Aljazzar et al. FORMATS 2005, 2006)

• Counterexamples for CTMCs (Han & Katoen ATVA 2007)

• Counterexamples for conditional PCTL (Andres & van Rossum TACAS 2008)

• Proof refutations for probabilistic programs (McIver et al. FM 2008)

• Counterexample-guided abstraction refinement (Hermanns et al. CAV 2008)

(Chadha & Viswamanathan TR 2008)

• Counterexamples for MDPs (Andres et al., HVC 2008, Aljazzar & Leue TR 2007)

• Bounded model checking for DTMC counterexamples (Becker et al. TR 2008)

c© JPK 47

Page 49: Regular Expressions for PCTL Counterexamplesgloban08/content/katoen-qest08.pdf · Regular Expressions for PCTL Counterexamples Berteun Damman, Tingting Han, and Joost-Pieter Katoen

Epilogue

• What is a PCTL (or quantitative LTL) counterexample?

– a set of paths with sufficient probability mass

• How to determine smallest counterexamples?

– exploit k-shortest path algorithms

• How about the size of counterexamples?

– well, they may be excessively large and incomprehensible

• Can we do better?

– yes, represent counterexamples by regular expressions!

• How to obtain (short) regular expressions?

– use automata theory and some heuristics

c© JPK 48

Page 50: Regular Expressions for PCTL Counterexamplesgloban08/content/katoen-qest08.pdf · Regular Expressions for PCTL Counterexamples Berteun Damman, Tingting Han, and Joost-Pieter Katoen

c© JPK 49


Recommended