Analyzing recursive probabilistic Programs - Informatik 2 · PDF file1 Introduction 2...

Preview:

Citation preview

Analyzing recursive probabilisticProgramsJustin Winkens

30. June 2016

Justin Winkens | 29. Juni 2016 0/42Justin Winkens | 30. June 2016 1/42

1 Introduction

2 Preliminaries

3 Translating pGCL to pPDA

4 Analyzing Probabilistic Pushdown Automata

Table of contents

Justin Winkens | 30. June 2016 2/42

1 Introduction

2 Preliminaries

3 Translating pGCL to pPDA

4 Analyzing Probabilistic Pushdown Automata

Introduction

Justin Winkens | 30. June 2016 3/42

Input ProbabilisticProgram

Output

Introduction

Probabilistic Programs

Justin Winkens | 30. June 2016 4/42

Input ProbabilisticProgram

Output

Introduction

Probabilistic Programs

Justin Winkens | 30. June 2016 4/42

Input ProbabilisticProgram

Output

TrueSkillTM

Introduction

Probabilistic Programs

Justin Winkens | 30. June 2016 4/42

Input ProbabilisticProgram

Output

TrueSkillTM self-testing/correcting

Introduction

Probabilistic Programs

Justin Winkens | 30. June 2016 4/42

Input ProbabilisticProgram

Output

TrueSkillTM self-testing/correcting

biology

Introduction

Probabilistic Programs

Justin Winkens | 30. June 2016 4/42

Input ProbabilisticProgram

Output

TrueSkillTM self-testing/correcting

biology networks

Introduction

Probabilistic Programs

Justin Winkens | 30. June 2016 4/42

Input ProbabilisticProgram

Output

TrueSkillTM self-testing/correcting

biology networks Picture

Introduction

Probabilistic Programs

Justin Winkens | 30. June 2016 4/42

1 algorithm quicksort(A) is

2 list less , equal , greater

3 if length(A) <= 1

4 return A

5 pivot := A[length(A)]

6 for x in A

7 if x < pivot then append x to less

8 if x = pivot then append x to equal

9 if x > pivot then append x to greater

10 return concat(quicksort(less), equal ,quicksort(greater ))

Introduction

Recursive Probabilistic Programs

Justin Winkens | 30. June 2016 5/42

1 algorithm quicksort(A) is

2 list less , equal , greater

3 if length(A) <= 1

4 return A

5 pivot := A[length(A)]

6 for x in A

7 if x < pivot then append x to less

8 if x = pivot then append x to equal

9 if x > pivot then append x to greater

10 return concat(quicksort(less), equal ,quicksort(greater ))

) Average case complexity O(n log n)

Introduction

Recursive Probabilistic Programs

Justin Winkens | 30. June 2016 5/42

1 algorithm quicksort(A) is

2 list less , equal , greater

3 if length(A) <= 1

4 return A

5 pivot := A[length(A)]

6 for x in A

7 if x < pivot then append x to less

8 if x = pivot then append x to equal

9 if x > pivot then append x to greater

10 return concat(quicksort(less), equal ,quicksort(greater ))

) Average case complexity O(n log n)) Worst case complexity O(n2

)

Introduction

Recursive Probabilistic Programs

Justin Winkens | 30. June 2016 5/42

1 algorithm quicksort(A) is

2 list less , equal , greater

3 if length(A) <= 1

4 return A

5 pivot := uniformSel(A)

6 for x in A

7 if x < pivot then append x to less

8 if x = pivot then append x to equal

9 if x > pivot then append x to greater

10 return concat(quicksort(less), equal ,quicksort(greater ))

Introduction

Recursive Probabilistic Programs

Justin Winkens | 30. June 2016 5/42

1 algorithm quicksort(A) is

2 list less , equal , greater

3 if length(A) <= 1

4 return A

5 pivot := uniformSel(A)

6 for x in A

7 if x < pivot then append x to less

8 if x = pivot then append x to equal

9 if x > pivot then append x to greater

10 return concat(quicksort(less), equal ,quicksort(greater ))

) Worst case far less likely!

Introduction

Recursive Probabilistic Programs

Justin Winkens | 30. June 2016 5/42

I We wish to...

I ...reason about a programs behaviorI ...estimate expected outcomes and runtimesI ...quantify probabilities

I Recursive programs written in the probabilistic Guarded CommandLanguage

I Analysis by using probabilistic pushdown automata

Introduction

Recursive Probabilistic Programs

Justin Winkens | 30. June 2016 6/42

I We wish to...I ...reason about a programs behavior

I ...estimate expected outcomes and runtimesI ...quantify probabilities

I Recursive programs written in the probabilistic Guarded CommandLanguage

I Analysis by using probabilistic pushdown automata

Introduction

Recursive Probabilistic Programs

Justin Winkens | 30. June 2016 6/42

I We wish to...I ...reason about a programs behaviorI ...estimate expected outcomes and runtimes

I ...quantify probabilitiesI Recursive programs written in the probabilistic Guarded Command

LanguageI Analysis by using probabilistic pushdown automata

Introduction

Recursive Probabilistic Programs

Justin Winkens | 30. June 2016 6/42

I We wish to...I ...reason about a programs behaviorI ...estimate expected outcomes and runtimesI ...quantify probabilities

I Recursive programs written in the probabilistic Guarded CommandLanguage

I Analysis by using probabilistic pushdown automata

Introduction

Recursive Probabilistic Programs

Justin Winkens | 30. June 2016 6/42

I We wish to...I ...reason about a programs behaviorI ...estimate expected outcomes and runtimesI ...quantify probabilities

I Recursive programs written in the probabilistic Guarded CommandLanguage

I Analysis by using probabilistic pushdown automata

Introduction

Recursive Probabilistic Programs

Justin Winkens | 30. June 2016 6/42

I We wish to...I ...reason about a programs behaviorI ...estimate expected outcomes and runtimesI ...quantify probabilities

I Recursive programs written in the probabilistic Guarded CommandLanguage

I Analysis by using probabilistic pushdown automata

Introduction

Recursive Probabilistic Programs

Justin Winkens | 30. June 2016 6/42

1 Introduction

2 Preliminaries

3 Translating pGCL to pPDA

4 Analyzing Probabilistic Pushdown Automata

Preliminaries

Justin Winkens | 30. June 2016 7/42

ControlUnit

p

... a b a d ...

Input tape

c

a

f...

h

a

b

Stack

Preliminaries Probabilistic Pushdown Automata

Pushdown Automata

Justin Winkens | 30. June 2016 8/42

Definition: Probabilistic Pushdown Automaton (pPDA)

A probabilistic pushdown automaton (pPDA) is a tuple � = (Q,�, ,!,P)

defined as

I Q is a finite set of states.I

� is a finite stack alphabet.I ,!✓ (Q⇥ �)⇥ (Q⇥ �

⇤) is a set of transitions such that

I for every pX 2 Q⇥ � there is at least one transition of the formpX ,! q↵

I for every transition pX ,! q↵ we have that |↵| 2.

Preliminaries Probabilistic Pushdown Automata

Probabilistic Pushdown Automata

Justin Winkens | 30. June 2016 9/42

Definition: Probabilistic Pushdown Automaton (pPDA)

A probabilistic pushdown automaton (pPDA) is a tuple � = (Q,�, ,!,P)

defined asI Q is a finite set of states.

I� is a finite stack alphabet.

I ,!✓ (Q⇥ �)⇥ (Q⇥ �

⇤) is a set of transitions such that

I for every pX 2 Q⇥ � there is at least one transition of the formpX ,! q↵

I for every transition pX ,! q↵ we have that |↵| 2.

Preliminaries Probabilistic Pushdown Automata

Probabilistic Pushdown Automata

Justin Winkens | 30. June 2016 9/42

Definition: Probabilistic Pushdown Automaton (pPDA)

A probabilistic pushdown automaton (pPDA) is a tuple � = (Q,�, ,!,P)

defined asI Q is a finite set of states.I

� is a finite stack alphabet.

I ,!✓ (Q⇥ �)⇥ (Q⇥ �

⇤) is a set of transitions such that

I for every pX 2 Q⇥ � there is at least one transition of the formpX ,! q↵

I for every transition pX ,! q↵ we have that |↵| 2.

Preliminaries Probabilistic Pushdown Automata

Probabilistic Pushdown Automata

Justin Winkens | 30. June 2016 9/42

Definition: Probabilistic Pushdown Automaton (pPDA)

A probabilistic pushdown automaton (pPDA) is a tuple � = (Q,�, ,!,P)

defined asI Q is a finite set of states.I

� is a finite stack alphabet.I ,!✓ (Q⇥ �)⇥ (Q⇥ �

⇤) is a set of transitions such that

I for every pX 2 Q⇥ � there is at least one transition of the formpX ,! q↵

I for every transition pX ,! q↵ we have that |↵| 2.

Preliminaries Probabilistic Pushdown Automata

Probabilistic Pushdown Automata

Justin Winkens | 30. June 2016 9/42

Definition: Probabilistic Pushdown Automaton (pPDA)

A probabilistic pushdown automaton (pPDA) is a tuple � = (Q,�, ,!,P)

defined asI Q is a finite set of states.I

� is a finite stack alphabet.I ,!✓ (Q⇥ �)⇥ (Q⇥ �

⇤) is a set of transitions such that

I for every pX 2 Q⇥ � there is at least one transition of the formpX ,! q↵

I for every transition pX ,! q↵ we have that |↵| 2.

Preliminaries Probabilistic Pushdown Automata

Probabilistic Pushdown Automata

Justin Winkens | 30. June 2016 9/42

Definition: Probabilistic Pushdown Automaton (pPDA)

A probabilistic pushdown automaton (pPDA) is a tuple � = (Q,�, ,!,P)

defined asI Q is a finite set of states.I

� is a finite stack alphabet.I ,!✓ (Q⇥ �)⇥ (Q⇥ �

⇤) is a set of transitions such that

I for every pX 2 Q⇥ � there is at least one transition of the formpX ,! q↵

I for every transition pX ,! q↵ we have that |↵| 2.

Preliminaries Probabilistic Pushdown Automata

Probabilistic Pushdown Automata

Justin Winkens | 30. June 2016 9/42

Definition: Probabilistic Pushdown Automaton (pPDA)

A probabilistic pushdown automaton (pPDA) is a tuple � = (Q,�, ,!,P)

defined asI P is a function which assigns probabilities to transitions

I P(pX ,! q↵) 2 [0, 1]

IP

pX,!q↵

P(pX ,! q↵) = 1

I We write pXx

,! q↵ instead of P(pX ,! q↵) = x

Preliminaries Probabilistic Pushdown Automata

Probabilistic Pushdown Automata

Justin Winkens | 30. June 2016 10/42

Definition: Probabilistic Pushdown Automaton (pPDA)

A probabilistic pushdown automaton (pPDA) is a tuple � = (Q,�, ,!,P)

defined asI P is a function which assigns probabilities to transitions

I P(pX ,! q↵) 2 [0, 1]

IP

pX,!q↵

P(pX ,! q↵) = 1

I We write pXx

,! q↵ instead of P(pX ,! q↵) = x

Preliminaries Probabilistic Pushdown Automata

Probabilistic Pushdown Automata

Justin Winkens | 30. June 2016 10/42

Definition: Probabilistic Pushdown Automaton (pPDA)

A probabilistic pushdown automaton (pPDA) is a tuple � = (Q,�, ,!,P)

defined asI P is a function which assigns probabilities to transitions

I P(pX ,! q↵) 2 [0, 1]

IP

pX,!q↵

P(pX ,! q↵) = 1

I We write pXx

,! q↵ instead of P(pX ,! q↵) = x

Preliminaries Probabilistic Pushdown Automata

Probabilistic Pushdown Automata

Justin Winkens | 30. June 2016 10/42

Definition: Probabilistic Pushdown Automaton (pPDA)

A probabilistic pushdown automaton (pPDA) is a tuple � = (Q,�, ,!,P)

defined asI P is a function which assigns probabilities to transitions

I P(pX ,! q↵) 2 [0, 1]

IP

pX,!q↵

P(pX ,! q↵) = 1

I We write pXx

,! q↵ instead of P(pX ,! q↵) = x

Preliminaries Probabilistic Pushdown Automata

Probabilistic Pushdown Automata

Justin Winkens | 30. June 2016 10/42

Example pPDA

A pPDA � is given by:I Q = {q}I

� = {I}I qI

0.5,! qII , qI

0.5,! q✏

Preliminaries Probabilistic Pushdown Automata

Example pPDA

Justin Winkens | 30. June 2016 11/42

Example pPDA

A pPDA � is given by:I Q = {q}I

� = {I}I qI

0.5,! qII , qI

0.5,! q✏

What does this pPDA represent?

Preliminaries Probabilistic Pushdown Automata

Example pPDA

Justin Winkens | 30. June 2016 11/42

Example pPDA

A pPDA � is given by:I Q = {q}I

� = {I}I qI

0.5,! qII , qI

0.5,! q✏

q"

qI

qII qIII qIIII ...

0.5

0.5

0.5

0.5

0.5

0.5

0.5

0.5

0.5

Preliminaries Probabilistic Pushdown Automata

Example pPDA

Justin Winkens | 30. June 2016 11/42

Example pPDA

A pPDA � is given by:I Q = {q}I

� = {I}I qI

0.5,! qII , qI

0.5,! q✏

q" qI qII

qIII qIIII ...

0.5

0.5

0.5

0.5

0.5

0.5

0.5

0.5

0.5

Preliminaries Probabilistic Pushdown Automata

Example pPDA

Justin Winkens | 30. June 2016 11/42

Example pPDA

A pPDA � is given by:I Q = {q}I

� = {I}I qI

0.5,! qII , qI

0.5,! q✏

q" qI qII qIII

qIIII ...

0.5

0.5

0.5

0.5

0.5

0.5

0.5

0.5

0.5

Preliminaries Probabilistic Pushdown Automata

Example pPDA

Justin Winkens | 30. June 2016 11/42

Example pPDA

A pPDA � is given by:I Q = {q}I

� = {I}I qI

0.5,! qII , qI

0.5,! q✏

q" qI qII qIII qIIII ...

0.5

0.5

0.5

0.5

0.5

0.5

0.5

0.5

0.5

Preliminaries Probabilistic Pushdown Automata

Example pPDA

Justin Winkens | 30. June 2016 11/42

Example pPDA

A pPDA � is given by:I Q = {q}I

� = {I}I qI

0.5,! qII , qI

0.5,! q✏

q" qI qII qIII qIIII ...

0.5

0.5

0.5

0.5

0.5

0.5

0.5

0.5

0.5

) Termination on empty stack!

Preliminaries Probabilistic Pushdown Automata

Example pPDA

Justin Winkens | 30. June 2016 11/42

Example pPDA

A pPDA � is given by:I Q = {q}I

� = {I}I qI

0.5,! qII , qI

0.5,! q✏

What could an unbounded random walk look like?

Preliminaries Probabilistic Pushdown Automata

Example pPDA

Justin Winkens | 30. June 2016 11/42

Definition: Regular Configurations

Let � = (Q,�, ,!,P) be a pPDA and C ✓ Q⇥�

⇤ a set of configurations.

We call C regular if p↵ 2 C iff the reversed stack of p↵ is accepted by adeterministic finite-state automaton (DFA) A.

We call C simple if there exists a set H ✓ Q⇥ � such that p↵ 2 C iff↵ 6= " and head(p↵) 2 H.

Preliminaries Probabilistic Pushdown Automata

Probabilistic Pushdown Automata

Justin Winkens | 30. June 2016 12/42

Definition: Regular Configurations

Let � = (Q,�, ,!,P) be a pPDA and C ✓ Q⇥�

⇤ a set of configurations.

We call C regular if p↵ 2 C iff the reversed stack of p↵ is accepted by adeterministic finite-state automaton (DFA) A.

We call C simple if there exists a set H ✓ Q⇥ � such that p↵ 2 C iff↵ 6= " and head(p↵) 2 H.

Preliminaries Probabilistic Pushdown Automata

Probabilistic Pushdown Automata

Justin Winkens | 30. June 2016 12/42

Definition: Regular Configurations

Let � = (Q,�, ,!,P) be a pPDA and C ✓ Q⇥�

⇤ a set of configurations.

We call C regular if p↵ 2 C iff the reversed stack of p↵ is accepted by adeterministic finite-state automaton (DFA) A.

We call C simple if there exists a set H ✓ Q⇥ � such that p↵ 2 C iff↵ 6= " and head(p↵) 2 H.

Preliminaries Probabilistic Pushdown Automata

Probabilistic Pushdown Automata

Justin Winkens | 30. June 2016 12/42

Definition: Paths and RunsLet S be a set of states and !✓ S⇥S a binary and total relation andP = (S,!).

I A path is a word w such that w(i) ! w(i+ 1) for everyi 2 {0, . . . , |w|� 1}

I A state t is reachable from s if there is a finite path w with w(0) = sand w(|w|� 1) = t.

I A run is an infinite path.I Runs(P,w) = set of all runs in P that start with w

Preliminaries Notions

Paths, Runs

Justin Winkens | 30. June 2016 13/42

Definition: Paths and RunsLet S be a set of states and !✓ S⇥S a binary and total relation andP = (S,!).I A path is a word w such that w(i) ! w(i+ 1) for every

i 2 {0, . . . , |w|� 1}

I A state t is reachable from s if there is a finite path w with w(0) = sand w(|w|� 1) = t.

I A run is an infinite path.I Runs(P,w) = set of all runs in P that start with w

Preliminaries Notions

Paths, Runs

Justin Winkens | 30. June 2016 13/42

Definition: Paths and RunsLet S be a set of states and !✓ S⇥S a binary and total relation andP = (S,!).I A path is a word w such that w(i) ! w(i+ 1) for every

i 2 {0, . . . , |w|� 1}I A state t is reachable from s if there is a finite path w with w(0) = s

and w(|w|� 1) = t.

I A run is an infinite path.I Runs(P,w) = set of all runs in P that start with w

Preliminaries Notions

Paths, Runs

Justin Winkens | 30. June 2016 13/42

Definition: Paths and RunsLet S be a set of states and !✓ S⇥S a binary and total relation andP = (S,!).I A path is a word w such that w(i) ! w(i+ 1) for every

i 2 {0, . . . , |w|� 1}I A state t is reachable from s if there is a finite path w with w(0) = s

and w(|w|� 1) = t.I A run is an infinite path.

I Runs(P,w) = set of all runs in P that start with w

Preliminaries Notions

Paths, Runs

Justin Winkens | 30. June 2016 13/42

Definition: Paths and RunsLet S be a set of states and !✓ S⇥S a binary and total relation andP = (S,!).I A path is a word w such that w(i) ! w(i+ 1) for every

i 2 {0, . . . , |w|� 1}I A state t is reachable from s if there is a finite path w with w(0) = s

and w(|w|� 1) = t.I A run is an infinite path.I Runs(P,w) = set of all runs in P that start with w

Preliminaries Notions

Paths, Runs

Justin Winkens | 30. June 2016 13/42

Definition: Reachability

Let � = (Q,�, ,!,P) be a pPDA, pX 2 Q⇥ � an initial configurationand C ✓ Q⇥ �

⇤ a set of target configurations.

I Reach(pX, C) set of all runs r 2 Runs(�, pX) with r(i) 2 C, i 2 N0

I P(Reach(pX, C))

Preliminaries Notions

Reachability

Justin Winkens | 30. June 2016 14/42

Definition: Reachability

Let � = (Q,�, ,!,P) be a pPDA, pX 2 Q⇥ � an initial configurationand C ✓ Q⇥ �

⇤ a set of target configurations.

I Reach(pX, C) set of all runs r 2 Runs(�, pX) with r(i) 2 C, i 2 N0

I P(Reach(pX, C))

Preliminaries Notions

Reachability

Justin Winkens | 30. June 2016 14/42

Definition: Reachability

Let � = (Q,�, ,!,P) be a pPDA, pX 2 Q⇥ � an initial configurationand C ✓ Q⇥ �

⇤ a set of target configurations.

I Reach(pX, C) set of all runs r 2 Runs(�, pX) with r(i) 2 C, i 2 N0

I P(Reach(pX, C))

Preliminaries Notions

Reachability

Justin Winkens | 30. June 2016 14/42

Definition: TerminationLet � = (Q,�, ,!,P) be a pPDA, pX 2 Q⇥ � an initial configurationand q 2 Q a (final) state.

I Reach(pX, {q"}) set of all runs r 2 Runs(�, pX) with r(i) = q",i 2 N0.

I P(Reach(pX, {q"})).

Preliminaries Notions

Termination

Justin Winkens | 30. June 2016 15/42

Definition: TerminationLet � = (Q,�, ,!,P) be a pPDA, pX 2 Q⇥ � an initial configurationand q 2 Q a (final) state.

I Reach(pX, {q"}) set of all runs r 2 Runs(�, pX) with r(i) = q",i 2 N0.

I P(Reach(pX, {q"})).

Preliminaries Notions

Termination

Justin Winkens | 30. June 2016 15/42

Definition: TerminationLet � = (Q,�, ,!,P) be a pPDA, pX 2 Q⇥ � an initial configurationand q 2 Q a (final) state.

I Reach(pX, {q"}) set of all runs r 2 Runs(�, pX) with r(i) = q",i 2 N0.

I P(Reach(pX, {q"})).

Preliminaries Notions

Termination

Justin Winkens | 30. June 2016 15/42

Definition: Qualitative/Quantitative Reachability/Termination

Let � = (Q,�, ,!,P) be a pPDA, pX 2 Q⇥ � an initial configurationand C ✓ Q⇥ �

⇤ a set of target configurations.

I Qualitative reachability/termination: P(Reach(pX,C)) = 1?I Quantitative reachability/termination: P(Reach(pX,C)) d for a

constant d 2 (0, 1)?

Preliminaries Notions

Qualitative/Quantitative Reachability/Termination

Justin Winkens | 30. June 2016 16/42

Definition: Qualitative/Quantitative Reachability/Termination

Let � = (Q,�, ,!,P) be a pPDA, pX 2 Q⇥ � an initial configurationand C ✓ Q⇥ �

⇤ a set of target configurations.I Qualitative reachability/termination: P(Reach(pX,C)) = 1?

I Quantitative reachability/termination: P(Reach(pX,C)) d for aconstant d 2 (0, 1)?

Preliminaries Notions

Qualitative/Quantitative Reachability/Termination

Justin Winkens | 30. June 2016 16/42

Definition: Qualitative/Quantitative Reachability/Termination

Let � = (Q,�, ,!,P) be a pPDA, pX 2 Q⇥ � an initial configurationand C ✓ Q⇥ �

⇤ a set of target configurations.I Qualitative reachability/termination: P(Reach(pX,C)) = 1?I Quantitative reachability/termination: P(Reach(pX,C)) d for a

constant d 2 (0, 1)?

Preliminaries Notions

Qualitative/Quantitative Reachability/Termination

Justin Winkens | 30. June 2016 16/42

skip | abort | var x | x:=E | Q;R | {Q}[ ]{R} | {Q}[p]{R}if(G){Q}else{R} | while(G){Q}

Preliminaries Probabilistic Guarded Command Language

Probabilistic Guarded Command Language

Justin Winkens | 30. June 2016 17/42

skip | abort | var x | x:=E | Q;R | {Q}[ ]{R} | {Q}[p]{R}if(G){Q}else{R} | while(G){Q}

Preliminaries Probabilistic Guarded Command Language

Probabilistic Guarded Command Language

Justin Winkens | 30. June 2016 17/42

skip | abort | var x | x:=E | Q;R | {Q}[ ]{R} | {Q}[p]{R}if(G){Q}else{R} | while(G){Q}

1 var flip := true;

2 flip (){

3 while(flip){

4 {skip ;}[0.5]{ flip = false;}

5 }

6 }

Preliminaries Probabilistic Guarded Command Language

Probabilistic Guarded Command Language

Justin Winkens | 30. June 2016 17/42

skip | abort | var x | x:=E | Q;R | {Q}[ ]{R} | {Q}[p]{R}if(G){Q}else{R} | while(G){Q}

1 var flip := true;

2 flip (){

3 while(flip){

4 {skip ;}[0.5]{ flip = false;}

5 }

6 }

We allow function calls!

Preliminaries Probabilistic Guarded Command Language

Probabilistic Guarded Command Language

Justin Winkens | 30. June 2016 17/42

Preliminaries Probabilistic Guarded Command Language

Dueling Cowboys

Justin Winkens | 30. June 2016 18/42

1 var cowboy := A;

2 var duel:= true;

3

4 {cowboy := A;}[p]{ cowboy := B;}

5

6 while(duel){

7 if(cowboy = A){

8 {duel := false ;}[a]{ cowboy := B;}

9 }else{

10 {duel := false ;}[b]{ cowboy := A;}

11 }

12 }

Preliminaries Probabilistic Guarded Command Language

Dueling Cowboys (Orig.)

Justin Winkens | 30. June 2016 19/42

1 var player := A;

2 duel (){ //d03 {player :=A;}[p]{ player :=B;}

4 shoot (); //d15 }

1 kill (){ //k02

3 }

How do we analyze this?

1 shoot (){ //s02 if(player == A){ //s13 {

4 kill (); //s35 }

6 [s]

7 {

8 player := B;

9 shoot (); //s410 }

11 }

12 else if(player == B){//s213 {

14 kill (); //s515 }

16 [t]

17 {

18 player := A;

19 shoot (); //s620 }

21 }

22 }

Preliminaries Probabilistic Guarded Command Language

Dueling Cowboys (Rec.)

Justin Winkens | 30. June 2016 20/42

1 var player := A;

2 duel (){ //d03 {player :=A;}[p]{ player :=B;}

4 shoot (); //d15 }

1 kill (){ //k02

3 }

How do we analyze this?

1 shoot (){ //s02 if(player == A){ //s13 {

4 kill (); //s35 }

6 [s]

7 {

8 player := B;

9 shoot (); //s410 }

11 }

12 else if(player == B){//s213 {

14 kill (); //s515 }

16 [t]

17 {

18 player := A;

19 shoot (); //s620 }

21 }

22 }

Preliminaries Probabilistic Guarded Command Language

Dueling Cowboys (Rec.)

Justin Winkens | 30. June 2016 20/42

1 var player := A;

2 duel (){ //d03 {player :=A;}[p]{ player :=B;}

4 shoot (); //d15 }

1 kill (){ //k02

3 }

How do we analyze this?

1 shoot (){ //s02 if(player == A){ //s13 {

4 kill (); //s35 }

6 [s]

7 {

8 player := B;

9 shoot (); //s410 }

11 }

12 else if(player == B){//s213 {

14 kill (); //s515 }

16 [t]

17 {

18 player := A;

19 shoot (); //s620 }

21 }

22 }

Preliminaries Probabilistic Guarded Command Language

Dueling Cowboys (Rec.)

Justin Winkens | 30. June 2016 20/42

1 var player := A;

2 duel (){ //d03 {player :=A;}[p]{ player :=B;}

4 shoot (); //d15 }

1 kill (){ //k02

3 }

How do we analyze this?

1 shoot (){ //s02 if(player == A){ //s13 {

4 kill (); //s35 }

6 [s]

7 {

8 player := B;

9 shoot (); //s410 }

11 }

12 else if(player == B){//s213 {

14 kill (); //s515 }

16 [t]

17 {

18 player := A;

19 shoot (); //s620 }

21 }

22 }

Preliminaries Probabilistic Guarded Command Language

Dueling Cowboys (Rec.)

Justin Winkens | 30. June 2016 20/42

1 Introduction

2 Preliminaries

3 Translating pGCL to pPDA

4 Analyzing Probabilistic Pushdown Automata

Translating pGCL to pPDA

Justin Winkens | 30. June 2016 21/42

2 Steps:

1. Translate pGCL program to control flow graph2. Translate control flow graph to pPDA

Translating pGCL to pPDA

Translating pGCL to pPDA

Justin Winkens | 30. June 2016 22/42

2 Steps:1. Translate pGCL program to control flow graph

2. Translate control flow graph to pPDA

Translating pGCL to pPDA

Translating pGCL to pPDA

Justin Winkens | 30. June 2016 22/42

2 Steps:1. Translate pGCL program to control flow graph2. Translate control flow graph to pPDA

Translating pGCL to pPDA

Translating pGCL to pPDA

Justin Winkens | 30. June 2016 22/42

I Pick control points (k0,d0,d1,s0,...,s6) as nodes

I Connect nodes by edges if control flows from one node to the nextI Label edges with statements and transition probability (if 6= 1)

1 var player := A;

2 duel (){ //d03 {player :=A;}[p]{ player :=B;}

4 shoot (); //d15 }

d0

d1

1� pplayer := B

shoot()

pplayer := A

shoot()

Translating pGCL to pPDA

pGCL ! Control Flow Graph

Justin Winkens | 30. June 2016 23/42

I Pick control points (k0,d0,d1,s0,...,s6) as nodesI Connect nodes by edges if control flows from one node to the next

I Label edges with statements and transition probability (if 6= 1)

1 var player := A;

2 duel (){ //d03 {player :=A;}[p]{ player :=B;}

4 shoot (); //d15 }

d0

d1

1� pplayer := B

shoot()

pplayer := A

shoot()

Translating pGCL to pPDA

pGCL ! Control Flow Graph

Justin Winkens | 30. June 2016 23/42

I Pick control points (k0,d0,d1,s0,...,s6) as nodesI Connect nodes by edges if control flows from one node to the nextI Label edges with statements and transition probability (if 6= 1)

1 var player := A;

2 duel (){ //d03 {player :=A;}[p]{ player :=B;}

4 shoot (); //d15 }

d0

d1

1� pplayer := B

shoot()

pplayer := A

shoot()

Translating pGCL to pPDA

pGCL ! Control Flow Graph

Justin Winkens | 30. June 2016 23/42

I Pick control points (k0,d0,d1,s0,...,s6) as nodesI Connect nodes by edges if control flows from one node to the nextI Label edges with statements and transition probability (if 6= 1)

1 var player := A;

2 duel (){ //d03 {player :=A;}[p]{ player :=B;}

4 shoot (); //d15 }

d0

d1

1� pplayer := B

shoot()

pplayer := A

shoot()

Translating pGCL to pPDA

pGCL ! Control Flow Graph

Justin Winkens | 30. June 2016 23/42

I Pick control points (k0,d0,d1,s0,...,s6) as nodesI Connect nodes by edges if control flows from one node to the nextI Label edges with statements and transition probability (if 6= 1)

1 var player := A;

2 duel (){ //d03 {player :=A;}[p]{ player :=B;}

4 shoot (); //d15 }

d0

d1

1� pplayer := B

shoot()

pplayer := A

shoot()

Translating pGCL to pPDA

pGCL ! Control Flow Graph

Justin Winkens | 30. June 2016 23/42

I Pick control points (k0,d0,d1,s0,...,s6) as nodesI Connect nodes by edges if control flows from one node to the nextI Label edges with statements and transition probability (if 6= 1)

1 var player := A;

2 duel (){ //d03 {player :=A;}[p]{ player :=B;}

4 shoot (); //d15 }

d0

d1

1� pplayer := B

shoot()

pplayer := A

shoot()

Translating pGCL to pPDA

pGCL ! Control Flow Graph

Justin Winkens | 30. June 2016 23/42

I Pick control points (k0,d0,d1,s0,...,s6) as nodesI Connect nodes by edges if control flows from one node to the nextI Label edges with statements and transition probability (if 6= 1)

1 var player := A;

2 duel (){ //d03 {player :=A;}[p]{ player :=B;}

4 shoot (); //d15 }

d0

d1

1� pplayer := B

shoot()

pplayer := A

shoot()

Translating pGCL to pPDA

pGCL ! Control Flow Graph

Justin Winkens | 30. June 2016 23/42

I Pick control points (k0,d0,d1,s0,...,s6) as nodesI Connect nodes by edges if control flows from one node to the nextI Label edges with statements and transition probability (if 6= 1)

1 var player := A;

2 duel (){ //d03 {player :=A;}[p]{ player :=B;}

4 shoot (); //d15 }

d0

d1

1� pplayer := B

shoot()

pplayer := A

shoot()

Translating pGCL to pPDA

pGCL ! Control Flow Graph

Justin Winkens | 30. June 2016 23/42

1 shoot (){ //s02 if(player == A){ //s13 {

4 kill (); //s35 }

6 [s]

7 {

8 player := B;

9 shoot (); //s410 }

11 }

12 else if(player == B){//s213 {

14 kill (); //s515 }

16 [t]

17 {

18 player := A;

19 shoot (); //s620 }

21 }

22 }

s0

s1 s2

s3 s4 s5 s6

if else if

skill()

1� splayer := B

shoot()

tkill()

1� tplayer := A

shoot()

Translating pGCL to pPDA

pGCL ! Control Flow Graph

Justin Winkens | 30. June 2016 24/42

1 shoot (){ //s02 if(player == A){ //s13 {

4 kill (); //s35 }

6 [s]

7 {

8 player := B;

9 shoot (); //s410 }

11 }

12 else if(player == B){//s213 {

14 kill (); //s515 }

16 [t]

17 {

18 player := A;

19 shoot (); //s620 }

21 }

22 }

s0

s1 s2

s3 s4 s5 s6

if else if

skill()

1� splayer := B

shoot()

tkill()

1� tplayer := A

shoot()

Translating pGCL to pPDA

pGCL ! Control Flow Graph

Justin Winkens | 30. June 2016 24/42

1 shoot (){ //s02 if(player == A){ //s13 {

4 kill (); //s35 }

6 [s]

7 {

8 player := B;

9 shoot (); //s410 }

11 }

12 else if(player == B){//s213 {

14 kill (); //s515 }

16 [t]

17 {

18 player := A;

19 shoot (); //s620 }

21 }

22 }

s0

s1 s2

s3 s4 s5 s6

if else if

skill()

1� splayer := B

shoot()

tkill()

1� tplayer := A

shoot()

Translating pGCL to pPDA

pGCL ! Control Flow Graph

Justin Winkens | 30. June 2016 24/42

1 shoot (){ //s02 if(player == A){ //s13 {

4 kill (); //s35 }

6 [s]

7 {

8 player := B;

9 shoot (); //s410 }

11 }

12 else if(player == B){//s213 {

14 kill (); //s515 }

16 [t]

17 {

18 player := A;

19 shoot (); //s620 }

21 }

22 }

s0

s1 s2

s3 s4

s5 s6

if else if

skill()

1� splayer := B

shoot()

tkill()

1� tplayer := A

shoot()

Translating pGCL to pPDA

pGCL ! Control Flow Graph

Justin Winkens | 30. June 2016 24/42

1 shoot (){ //s02 if(player == A){ //s13 {

4 kill (); //s35 }

6 [s]

7 {

8 player := B;

9 shoot (); //s410 }

11 }

12 else if(player == B){//s213 {

14 kill (); //s515 }

16 [t]

17 {

18 player := A;

19 shoot (); //s620 }

21 }

22 }

s0

s1 s2

s3 s4 s5 s6

if else if

skill()

1� splayer := B

shoot()

tkill()

1� tplayer := A

shoot()

Translating pGCL to pPDA

pGCL ! Control Flow Graph

Justin Winkens | 30. June 2016 24/42

1 shoot (){ //s02 if(player == A){ //s13 {

4 kill (); //s35 }

6 [s]

7 {

8 player := B;

9 shoot (); //s410 }

11 }

12 else if(player == B){//s213 {

14 kill (); //s515 }

16 [t]

17 {

18 player := A;

19 shoot (); //s620 }

21 }

22 }

s0

s1 s2

s3 s4 s5 s6

if else if

skill()

1� splayer := B

shoot()

tkill()

1� tplayer := A

shoot()

Translating pGCL to pPDA

pGCL ! Control Flow Graph

Justin Winkens | 30. June 2016 24/42

1 kill (){ //k02

3 }

k0

Why do we have this method?I It yields an “easy” head (pk0) for analysisI All configuration with head pk0 terminate) Picking good control points and methods is key!

Translating pGCL to pPDA

pGCL ! Control Flow Graph

Justin Winkens | 30. June 2016 25/42

1 kill (){ //k02

3 }

k0

Why do we have this method?I It yields an “easy” head (pk0) for analysisI All configuration with head pk0 terminate) Picking good control points and methods is key!

Translating pGCL to pPDA

pGCL ! Control Flow Graph

Justin Winkens | 30. June 2016 25/42

1 kill (){ //k02

3 }

k0

Why do we have this method?

I It yields an “easy” head (pk0) for analysisI All configuration with head pk0 terminate) Picking good control points and methods is key!

Translating pGCL to pPDA

pGCL ! Control Flow Graph

Justin Winkens | 30. June 2016 25/42

1 kill (){ //k02

3 }

k0

Why do we have this method?I It yields an “easy” head (pk0) for analysis

I All configuration with head pk0 terminate) Picking good control points and methods is key!

Translating pGCL to pPDA

pGCL ! Control Flow Graph

Justin Winkens | 30. June 2016 25/42

1 kill (){ //k02

3 }

k0

Why do we have this method?I It yields an “easy” head (pk0) for analysisI All configuration with head pk0 terminate

) Picking good control points and methods is key!

Translating pGCL to pPDA

pGCL ! Control Flow Graph

Justin Winkens | 30. June 2016 25/42

1 kill (){ //k02

3 }

k0

Why do we have this method?I It yields an “easy” head (pk0) for analysisI All configuration with head pk0 terminate) Picking good control points and methods is key!

Translating pGCL to pPDA

pGCL ! Control Flow Graph

Justin Winkens | 30. June 2016 25/42

d0

d1

1� pplayer := B

shoot()

pplayer := A

shoot()

k0

s0

s1 s2

s3 s4 s5 s6

if else if

skill()

1� splayer := B

shoot()

tkill()

1� tplayer := A

shoot()

Translating pGCL to pPDA

pGCL ! Control Flow Graph

Justin Winkens | 30. June 2016 26/42

Reminder: pPDA

A probabilistic pushdown automaton (pPDA) is a tuple � = (Q,�, ,!,P)

defined asI Q is a finite set of states.I

� is a finite stack alphabet.I ,!✓ (Q⇥ �)⇥ (Q⇥ �

⇤) is a set of transitions

I P is a function which assigns probabilities to transitions

How does this relate to control flow graphs?

Translating pGCL to pPDA

Control Flow Graph ! pPDA

Justin Winkens | 30. June 2016 27/42

Reminder: pPDA

A probabilistic pushdown automaton (pPDA) is a tuple � = (Q,�, ,!,P)

defined asI Q is a finite set of states.I

� is a finite stack alphabet.I ,!✓ (Q⇥ �)⇥ (Q⇥ �

⇤) is a set of transitions

I P is a function which assigns probabilities to transitions

How does this relate to control flow graphs?

Translating pGCL to pPDA

Control Flow Graph ! pPDA

Justin Winkens | 30. June 2016 27/42

Translating pGCL to pPDA

Control Flow Graph ! pPDA

Justin Winkens | 30. June 2016 28/42

I Q: Variable assignments

I�: Nodes in the graph

I P: Probabilities of the edgesI ,!: ???

Translating pGCL to pPDA

Control Flow Graph ! pPDA

Justin Winkens | 30. June 2016 29/42

I Q: Variable assignmentsI

�: Nodes in the graph

I P: Probabilities of the edgesI ,!: ???

Translating pGCL to pPDA

Control Flow Graph ! pPDA

Justin Winkens | 30. June 2016 29/42

I Q: Variable assignmentsI

�: Nodes in the graphI P: Probabilities of the edges

I ,!: ???

Translating pGCL to pPDA

Control Flow Graph ! pPDA

Justin Winkens | 30. June 2016 29/42

I Q: Variable assignmentsI

�: Nodes in the graphI P: Probabilities of the edgesI ,!: ???

Translating pGCL to pPDA

Control Flow Graph ! pPDA

Justin Winkens | 30. June 2016 29/42

I construct every pair Q⇥ �

I for each pair hq, �i 2 Q⇥ � consider edges of the control flow graph:I hq, �i ,! hq0, �0i if no function call between � and �0

I hq, �i ,! hq0,'�0i if function call between � and �0

I �0 return addressI ' entry point of function call

I hq, �i ,! hq0, "i if function call terminates

Translating pGCL to pPDA

Control Flow Graph ! pPDA

Justin Winkens | 30. June 2016 30/42

I construct every pair Q⇥ �

I for each pair hq, �i 2 Q⇥ � consider edges of the control flow graph:

I hq, �i ,! hq0, �0i if no function call between � and �0

I hq, �i ,! hq0,'�0i if function call between � and �0

I �0 return addressI ' entry point of function call

I hq, �i ,! hq0, "i if function call terminates

Translating pGCL to pPDA

Control Flow Graph ! pPDA

Justin Winkens | 30. June 2016 30/42

I construct every pair Q⇥ �

I for each pair hq, �i 2 Q⇥ � consider edges of the control flow graph:I hq, �i ,! hq0, �0i if no function call between � and �0

I hq, �i ,! hq0,'�0i if function call between � and �0

I �0 return addressI ' entry point of function call

I hq, �i ,! hq0, "i if function call terminates

Translating pGCL to pPDA

Control Flow Graph ! pPDA

Justin Winkens | 30. June 2016 30/42

I construct every pair Q⇥ �

I for each pair hq, �i 2 Q⇥ � consider edges of the control flow graph:I hq, �i ,! hq0, �0i if no function call between � and �0

I hq, �i ,! hq0,'�0i if function call between � and �0

I �0 return addressI ' entry point of function call

I hq, �i ,! hq0, "i if function call terminates

Translating pGCL to pPDA

Control Flow Graph ! pPDA

Justin Winkens | 30. June 2016 30/42

I construct every pair Q⇥ �

I for each pair hq, �i 2 Q⇥ � consider edges of the control flow graph:I hq, �i ,! hq0, �0i if no function call between � and �0

I hq, �i ,! hq0,'�0i if function call between � and �0

I �0 return addressI ' entry point of function call

I hq, �i ,! hq0, "i if function call terminates

Translating pGCL to pPDA

Control Flow Graph ! pPDA

Justin Winkens | 30. June 2016 30/42

I construct every pair Q⇥ �

I for each pair hq, �i 2 Q⇥ � consider edges of the control flow graph:I hq, �i ,! hq0, �0i if no function call between � and �0

I hq, �i ,! hq0,'�0i if function call between � and �0

I �0 return addressI ' entry point of function call

I hq, �i ,! hq0, "i if function call terminates

Translating pGCL to pPDA

Control Flow Graph ! pPDA

Justin Winkens | 30. June 2016 30/42

k0

hAk0i 1,! hA"i

hBk0i 1,! hB"i

Translating pGCL to pPDA

Control Flow Graph ! pPDA

Justin Winkens | 30. June 2016 31/42

k0 hAk0i 1,! hA"i

hBk0i 1,! hB"i

Translating pGCL to pPDA

Control Flow Graph ! pPDA

Justin Winkens | 30. June 2016 31/42

d0

d1

1� pplayer := B

shoot()

pplayer := A

shoot()

hAd0i p,! hAs0d1i

hAd0i 1�p,! hBs0d1i

hAd1i 1,! hA"i

hBd1i 1,! hB"i

Translating pGCL to pPDA

Control Flow Graph ! pPDA

Justin Winkens | 30. June 2016 32/42

d0

d1

1� pplayer := B

shoot()

pplayer := A

shoot()

hAd0i p,! hAs0d1i

hAd0i 1�p,! hBs0d1i

hAd1i 1,! hA"i

hBd1i 1,! hB"i

Translating pGCL to pPDA

Control Flow Graph ! pPDA

Justin Winkens | 30. June 2016 32/42

s0

s1 s2

s3 s4 s5 s6

if else if

skill()

1� splayer := B

shoot()

tkill()

1� tplayer := A

shoot()

hAs0i 1,! hAs1i

hBs0i 1,! hBs2i

hAs1i s,! hAk0s3i

hAs1i 1�s,! hBs0s4i

hAs3i 1,! hA"i

hAs4i 1,! hA"i

hBs4i 1,! hB"i

hBs2i t,! hBk0s5i

hBs2i 1�t,! hAs0s6i

hBs5i 1,! hB"i

hBs6i 1,! hB"i

hAs6i 1,! hA"i

Translating pGCL to pPDA

Control Flow Graph ! pPDA

Justin Winkens | 30. June 2016 33/42

s0

s1 s2

s3 s4 s5 s6

if else if

skill()

1� splayer := B

shoot()

tkill()

1� tplayer := A

shoot()

hAs0i 1,! hAs1i

hBs0i 1,! hBs2i

hAs1i s,! hAk0s3i

hAs1i 1�s,! hBs0s4i

hAs3i 1,! hA"i

hAs4i 1,! hA"i

hBs4i 1,! hB"i

hBs2i t,! hBk0s5i

hBs2i 1�t,! hAs0s6i

hBs5i 1,! hB"i

hBs6i 1,! hB"i

hAs6i 1,! hA"i

Translating pGCL to pPDA

Control Flow Graph ! pPDA

Justin Winkens | 30. June 2016 33/42

hAd0i p,! hAs0d1i

hAd0i 1�p,! hBs0d1i

hAd1i 1,! hA"i

hBd1i 1,! hB"i

hAs0i 1,! hAs1i

hBs0i 1,! hBs2i

hAs1i s,! hAk0s3i

hAs1i 1�s,! hBs0s4i

hAs3i 1,! hA"i

hAs4i 1,! hA"i

hBs4i 1,! hB"i

hBs2i t,! hBk0s5i

hBs2i 1�t,! hAs0s6i

hBs5i 1,! hB"i

hBs6i 1,! hB"i

hAs6i 1,! hA"i

hAk0i 1,! hA"i

hBk0i 1,! hB"i

Translating pGCL to pPDA

Control Flow Graph ! pPDA

Justin Winkens | 30. June 2016 34/42

1 Introduction

2 Preliminaries

3 Translating pGCL to pPDA

4 Analyzing Probabilistic Pushdown Automata

Analyzing Probabilistic Pushdown Automata

Justin Winkens | 30. June 2016 35/42

Properties of pPDA

Let � = (Q,�, ,!,P) be a pPDA, pX 2 Q⇥ � an initial configurationand C ✓ Q⇥ �

⇤ a set of target configurations.I Qualitative reachability/termination: P(Reach(pX,C)) = 1?I Quantitative reachability/termination: P(Reach(pX,C)) d for a

constant d 2 (0, 1)?

Analyzing Probabilistic Pushdown Automata

Reminder: Properties of pPDA

Justin Winkens | 30. June 2016 36/42

We solve this problem for a simple set of target configurations.

) Extensible to regular sets of target configurations

NotationLet � = (Q,�, ,!,P) be a pPDA, C ✓ Q⇥ �

⇤ a simple set of targetconfigurations and H be the associated set of heads.

I[pX•] = P(Reach(pX, C))

I[pXq] = probability of all r 2 Reach(pX, {q"}) that do not visit C

For pX 2 H:I

[pX•] = 1

I[pXq] = 0

Analyzing Probabilistic Pushdown Automata Qualitative Reachability/Termination

Qualitative Reachability/Termination

Justin Winkens | 30. June 2016 37/42

We solve this problem for a simple set of target configurations.) Extensible to regular sets of target configurations

NotationLet � = (Q,�, ,!,P) be a pPDA, C ✓ Q⇥ �

⇤ a simple set of targetconfigurations and H be the associated set of heads.

I[pX•] = P(Reach(pX, C))

I[pXq] = probability of all r 2 Reach(pX, {q"}) that do not visit C

For pX 2 H:I

[pX•] = 1

I[pXq] = 0

Analyzing Probabilistic Pushdown Automata Qualitative Reachability/Termination

Qualitative Reachability/Termination

Justin Winkens | 30. June 2016 37/42

We solve this problem for a simple set of target configurations.) Extensible to regular sets of target configurations

NotationLet � = (Q,�, ,!,P) be a pPDA, C ✓ Q⇥ �

⇤ a simple set of targetconfigurations and H be the associated set of heads.

I[pX•] = P(Reach(pX, C))

I[pXq] = probability of all r 2 Reach(pX, {q"}) that do not visit C

For pX 2 H:I

[pX•] = 1

I[pXq] = 0

Analyzing Probabilistic Pushdown Automata Qualitative Reachability/Termination

Qualitative Reachability/Termination

Justin Winkens | 30. June 2016 37/42

We solve this problem for a simple set of target configurations.) Extensible to regular sets of target configurations

NotationLet � = (Q,�, ,!,P) be a pPDA, C ✓ Q⇥ �

⇤ a simple set of targetconfigurations and H be the associated set of heads.

I[pX•] = P(Reach(pX, C))

I[pXq] = probability of all r 2 Reach(pX, {q"}) that do not visit C

For pX 2 H:I

[pX•] = 1

I[pXq] = 0

Analyzing Probabilistic Pushdown Automata Qualitative Reachability/Termination

Qualitative Reachability/Termination

Justin Winkens | 30. June 2016 37/42

We solve this problem for a simple set of target configurations.) Extensible to regular sets of target configurations

NotationLet � = (Q,�, ,!,P) be a pPDA, C ✓ Q⇥ �

⇤ a simple set of targetconfigurations and H be the associated set of heads.

I[pX•] = P(Reach(pX, C))

I[pXq] = probability of all r 2 Reach(pX, {q"}) that do not visit C

For pX 2 H:I

[pX•] = 1

I[pXq] = 0

Analyzing Probabilistic Pushdown Automata Qualitative Reachability/Termination

Qualitative Reachability/Termination

Justin Winkens | 30. June 2016 37/42

We solve this problem for a simple set of target configurations.) Extensible to regular sets of target configurations

NotationLet � = (Q,�, ,!,P) be a pPDA, C ✓ Q⇥ �

⇤ a simple set of targetconfigurations and H be the associated set of heads.

I[pX•] = P(Reach(pX, C))

I[pXq] = probability of all r 2 Reach(pX, {q"}) that do not visit C

For pX 2 H:

I[pX•] = 1

I[pXq] = 0

Analyzing Probabilistic Pushdown Automata Qualitative Reachability/Termination

Qualitative Reachability/Termination

Justin Winkens | 30. June 2016 37/42

We solve this problem for a simple set of target configurations.) Extensible to regular sets of target configurations

NotationLet � = (Q,�, ,!,P) be a pPDA, C ✓ Q⇥ �

⇤ a simple set of targetconfigurations and H be the associated set of heads.

I[pX•] = P(Reach(pX, C))

I[pXq] = probability of all r 2 Reach(pX, {q"}) that do not visit C

For pX 2 H:I

[pX•] = 1

I[pXq] = 0

Analyzing Probabilistic Pushdown Automata Qualitative Reachability/Termination

Qualitative Reachability/Termination

Justin Winkens | 30. June 2016 37/42

For pX /2 H:

[pX•] =X

pXx

,!rY

x·[rY •]+X

pXx

,!rY Z

x·[rY •]+X

pXx

,!rY Z

X

t2Qx·[rY t]·[tZ•]

[pXq] =X

pXx

,!q"

x+

X

pXx

,!rY

x · [rY q] +X

pXx

,!rY Z

X

t2Qx · [rY t] · [tZq]

1. Construct equations for all [pX•] and [pXq] needed.2. Replace all [pX•] and [pXq] by fresh random variables hpX•i and

hpXqi3. Solve the system of recursive equations for least solution.

Analyzing Probabilistic Pushdown Automata Qualitative Reachability/Termination

Qualitative Reachability/Termination

Justin Winkens | 30. June 2016 38/42

For pX /2 H:

[pX•] =X

pXx

,!rY

x·[rY •]+X

pXx

,!rY Z

x·[rY •]+X

pXx

,!rY Z

X

t2Qx·[rY t]·[tZ•]

[pXq] =X

pXx

,!q"

x+

X

pXx

,!rY

x · [rY q] +X

pXx

,!rY Z

X

t2Qx · [rY t] · [tZq]

1. Construct equations for all [pX•] and [pXq] needed.2. Replace all [pX•] and [pXq] by fresh random variables hpX•i and

hpXqi3. Solve the system of recursive equations for least solution.

Analyzing Probabilistic Pushdown Automata Qualitative Reachability/Termination

Qualitative Reachability/Termination

Justin Winkens | 30. June 2016 38/42

For pX /2 H:

[pX•] =X

pXx

,!rY

x·[rY •]+X

pXx

,!rY Z

x·[rY •]+X

pXx

,!rY Z

X

t2Qx·[rY t]·[tZ•]

[pXq] =X

pXx

,!q"

x+

X

pXx

,!rY

x · [rY q] +X

pXx

,!rY Z

X

t2Qx · [rY t] · [tZq]

1. Construct equations for all [pX•] and [pXq] needed.2. Replace all [pX•] and [pXq] by fresh random variables hpX•i and

hpXqi3. Solve the system of recursive equations for least solution.

Analyzing Probabilistic Pushdown Automata Qualitative Reachability/Termination

Qualitative Reachability/Termination

Justin Winkens | 30. June 2016 38/42

For pX /2 H:

[pX•] =X

pXx

,!rY

x·[rY •]+X

pXx

,!rY Z

x·[rY •]+X

pXx

,!rY Z

X

t2Qx·[rY t]·[tZ•]

[pXq] =X

pXx

,!q"

x+

X

pXx

,!rY

x · [rY q] +X

pXx

,!rY Z

X

t2Qx · [rY t] · [tZq]

1. Construct equations for all [pX•] and [pXq] needed.

2. Replace all [pX•] and [pXq] by fresh random variables hpX•i andhpXqi

3. Solve the system of recursive equations for least solution.

Analyzing Probabilistic Pushdown Automata Qualitative Reachability/Termination

Qualitative Reachability/Termination

Justin Winkens | 30. June 2016 38/42

For pX /2 H:

[pX•] =X

pXx

,!rY

x·[rY •]+X

pXx

,!rY Z

x·[rY •]+X

pXx

,!rY Z

X

t2Qx·[rY t]·[tZ•]

[pXq] =X

pXx

,!q"

x+

X

pXx

,!rY

x · [rY q] +X

pXx

,!rY Z

X

t2Qx · [rY t] · [tZq]

1. Construct equations for all [pX•] and [pXq] needed.2. Replace all [pX•] and [pXq] by fresh random variables hpX•i and

hpXqi

3. Solve the system of recursive equations for least solution.

Analyzing Probabilistic Pushdown Automata Qualitative Reachability/Termination

Qualitative Reachability/Termination

Justin Winkens | 30. June 2016 38/42

For pX /2 H:

[pX•] =X

pXx

,!rY

x·[rY •]+X

pXx

,!rY Z

x·[rY •]+X

pXx

,!rY Z

X

t2Qx·[rY t]·[tZ•]

[pXq] =X

pXx

,!q"

x+

X

pXx

,!rY

x · [rY q] +X

pXx

,!rY Z

X

t2Qx · [rY t] · [tZq]

1. Construct equations for all [pX•] and [pXq] needed.2. Replace all [pX•] and [pXq] by fresh random variables hpX•i and

hpXqi3. Solve the system of recursive equations for least solution.

Analyzing Probabilistic Pushdown Automata Qualitative Reachability/Termination

Qualitative Reachability/Termination

Justin Winkens | 30. June 2016 38/42

Let C be a set of target configurations with H = {Ak0, Bk0}

Analyzing Probabilistic Pushdown Automata Qualitative Reachability/Termination

Qualitative Term./Reach. Dueling Cowboys

Justin Winkens | 30. June 2016 39/42

Let C be a set of target configurations with H = {Ak0, Bk0}) P(Reach(Ad0, C)) = [Ad0•] = 1 means qualitative termination

Analyzing Probabilistic Pushdown Automata Qualitative Reachability/Termination

Qualitative Term./Reach. Dueling Cowboys

Justin Winkens | 30. June 2016 39/42

Let C be a set of target configurations with H = {Ak0, Bk0}) P(Reach(Ad0, C)) = [Ad0•] = 1 means qualitative termination

[Ad0•] =X

Ad0x

,!rY

x·[rY •] +X

Ad0x

,!rY Z

x·[rY •] +X

Ad0x

,!rY Z

X

t2Qx·[rY t]·[tZ•]

Analyzing Probabilistic Pushdown Automata Qualitative Reachability/Termination

Qualitative Term./Reach. Dueling Cowboys

Justin Winkens | 30. June 2016 39/42

Let C be a set of target configurations with H = {Ak0, Bk0}) P(Reach(Ad0, C)) = [Ad0•] = 1 means qualitative termination

[Ad0•] =X

Ad0x

,!rY

x·[rY •] +X

Ad0x

,!rY Z

x·[rY •] +X

Ad0x

,!rY Z

X

t2Qx·[rY t]·[tZ•]

hAd0i p

,! hAs0d1ihAd0i 1�p

,! hBs0d1i

Analyzing Probabilistic Pushdown Automata Qualitative Reachability/Termination

Qualitative Term./Reach. Dueling Cowboys

Justin Winkens | 30. June 2016 39/42

Let C be a set of target configurations with H = {Ak0, Bk0}) P(Reach(Ad0, C)) = [Ad0•] = 1 means qualitative termination

[Ad0•] =X

Ad0x

,!rY

x·[rY •] +X

Ad0x

,!rY Z

x·[rY •] +X

Ad0x

,!rY Z

X

t2Qx·[rY t]·[tZ•]

= p·[As0•]

hAd0i p

,! hAs0d1ihAd0i 1�p

,! hBs0d1i

Analyzing Probabilistic Pushdown Automata Qualitative Reachability/Termination

Qualitative Term./Reach. Dueling Cowboys

Justin Winkens | 30. June 2016 39/42

Let C be a set of target configurations with H = {Ak0, Bk0}) P(Reach(Ad0, C)) = [Ad0•] = 1 means qualitative termination

[Ad0•] =X

Ad0x

,!rY

x·[rY •] +X

Ad0x

,!rY Z

x·[rY •] +X

Ad0x

,!rY Z

X

t2Qx·[rY t]·[tZ•]

= p·[As0•]+(1�p)·[Bs0•]

hAd0i p

,! hAs0d1ihAd0i 1�p

,! hBs0d1i

Analyzing Probabilistic Pushdown Automata Qualitative Reachability/Termination

Qualitative Term./Reach. Dueling Cowboys

Justin Winkens | 30. June 2016 39/42

Let C be a set of target configurations with H = {Ak0, Bk0}) P(Reach(Ad0, C)) = [Ad0•] = 1 means qualitative termination

[Ad0•] =X

Ad0x

,!rY

x·[rY •] +X

Ad0x

,!rY Z

x·[rY •] +X

Ad0x

,!rY Z

X

t2Qx·[rY t]·[tZ•]

= p·[As0•] + (1�p)·[Bs0•]+

X

Ad0x

,!rY Z

(x·[rY A]·[AZ•] + x·[rY B]·[BZ•])

hAd0i p

,! hAs0d1ihAd0i 1�p

,! hBs0d1i

Analyzing Probabilistic Pushdown Automata Qualitative Reachability/Termination

Qualitative Term./Reach. Dueling Cowboys

Justin Winkens | 30. June 2016 39/42

Let C be a set of target configurations with H = {Ak0, Bk0}) P(Reach(Ad0, C)) = [Ad0•] = 1 means qualitative termination

[Ad0•] = p·[As0•] + (1�p)·[Bs0•]+ (p·[As0A]·[Ad1•] + p·[As0B]·[Bd1•])+ ((1�p)·[Bs0A]·[Ad1•] + (1�p)·[Bs0B]·[Bd1•])

hAd0i p

,! hAs0d1ihAd0i 1�p

,! hBs0d1i

Analyzing Probabilistic Pushdown Automata Qualitative Reachability/Termination

Qualitative Term./Reach. Dueling Cowboys

Justin Winkens | 30. June 2016 39/42

Let C be a set of target configurations with H = {Ak0, Bk0}) P(Reach(Ad0, C)) = [Ad0•] = 1 means qualitative termination

[Ad0•] = p·[As0•] + (1�p)·[Bs0•]+ (p·[As0A]·[Ad1•] + p·[As0B]·[Bd1•])+ ((1�p)·[Bs0A]·[Ad1•] + (1�p)·[Bs0B]·[Bd1•])

) Remove zero summands

hAd0i p

,! hAs0d1ihAd0i 1�p

,! hBs0d1i

Analyzing Probabilistic Pushdown Automata Qualitative Reachability/Termination

Qualitative Term./Reach. Dueling Cowboys

Justin Winkens | 30. June 2016 39/42

Let C be a set of target configurations with H = {Ak0, Bk0}) P(Reach(Ad0, C)) = [Ad0•] = 1 means qualitative termination

[Ad0•] = p·[As0•] + (1�p)·[Bs0•]

) We need to calculate [As0•] and [Bs0•]!

Analyzing Probabilistic Pushdown Automata Qualitative Reachability/Termination

Qualitative Term./Reach. Dueling Cowboys

Justin Winkens | 30. June 2016 39/42

[Ad0•] = p·[As0•] + (1�p)·[Bs0•][As0•] = s+ (1�s)·[Bs0•][Bs0•] = t+ (1� t)·[As0•]

Analyzing Probabilistic Pushdown Automata Qualitative Reachability/Termination

Qualitative Term./Reach. Dueling Cowboys

Justin Winkens | 30. June 2016 40/42

[Ad0•] = p·[As0•] + (1�p)·[Bs0•][As0•] = s+ (1�s)·[Bs0•][Bs0•] = t+ (1� t)·[As0•]

hAd0•i = p·hAs0•i+ (1�p)·hBs0•ihAs0•i = s+ (1�s)·hBs0•ihBs0•i = t+ (1� t)·hAs0•i

Analyzing Probabilistic Pushdown Automata Qualitative Reachability/Termination

Qualitative Term./Reach. Dueling Cowboys

Justin Winkens | 30. June 2016 40/42

hAd0•i = p·hAs0•i+ (1�p)·hBs0•ihAs0•i = s+ (1�s)·hBs0•ihBs0•i = t+ (1� t)·hAs0•i

Analyzing Probabilistic Pushdown Automata Qualitative Reachability/Termination

Qualitative Term./Reach. Dueling Cowboys

Justin Winkens | 30. June 2016 40/42

hAd0•i = p·hAs0•i+ (1�p)·hBs0•ihAs0•i = s+ (1�s)·hBs0•ihBs0•i = t+ (1� t)·hAs0•i

p = 1/2

s = 1/2

t = 1/3

Analyzing Probabilistic Pushdown Automata Qualitative Reachability/Termination

Qualitative Term./Reach. Dueling Cowboys

Justin Winkens | 30. June 2016 40/42

hAd0•i = p·hAs0•i+ (1�p)·hBs0•ihAs0•i = s+ (1�s)·hBs0•ihBs0•i = t+ (1� t)·hAs0•i

hAd0•i = 1, hAs0•i = 1, hBs0•i = 1

p = 1/2

s = 1/2

t = 1/3

Analyzing Probabilistic Pushdown Automata Qualitative Reachability/Termination

Qualitative Term./Reach. Dueling Cowboys

Justin Winkens | 30. June 2016 40/42

hAd0•i = p·hAs0•i+ (1�p)·hBs0•ihAs0•i = s+ (1�s)·hBs0•ihBs0•i = t+ (1� t)·hAs0•i

hAd0•i = 0, hAs0•i = 0, hBs0•i = 0

p = 1/2

s = 0

t = 0

Analyzing Probabilistic Pushdown Automata Qualitative Reachability/Termination

Qualitative Term./Reach. Dueling Cowboys

Justin Winkens | 30. June 2016 40/42

I We know that the duel ends if both s, t > 0

I What is the probability that e.g. A wins the duel?I ) [Ad0A] =?, C = ;I Same equations apply!

Analyzing Probabilistic Pushdown Automata Quantitative Reachability/Termination

Quantitative Term./Reach Dueling Cowboys

Justin Winkens | 30. June 2016 41/42

I We know that the duel ends if both s, t > 0

I What is the probability that e.g. A wins the duel?

I ) [Ad0A] =?, C = ;I Same equations apply!

Analyzing Probabilistic Pushdown Automata Quantitative Reachability/Termination

Quantitative Term./Reach Dueling Cowboys

Justin Winkens | 30. June 2016 41/42

I We know that the duel ends if both s, t > 0

I What is the probability that e.g. A wins the duel?I ) [Ad0A] =?, C = ;

I Same equations apply!

Analyzing Probabilistic Pushdown Automata Quantitative Reachability/Termination

Quantitative Term./Reach Dueling Cowboys

Justin Winkens | 30. June 2016 41/42

I We know that the duel ends if both s, t > 0

I What is the probability that e.g. A wins the duel?I ) [Ad0A] =?, C = ;I Same equations apply!

[Ad0A] = p · [As0A] + (1� p)[Bs0A]

[As0A] = s+ (1� s)[Bs0A]

[Bs0A] = (1� t)[As0A]

Analyzing Probabilistic Pushdown Automata Quantitative Reachability/Termination

Quantitative Term./Reach Dueling Cowboys

Justin Winkens | 30. June 2016 41/42

I We know that the duel ends if both s, t > 0

I What is the probability that e.g. A wins the duel?I ) [Ad0A] =?, C = ;I Same equations apply!

hAd0Ai = p · hAs0Ai+ (1� p)hBs0AihAs0Ai = s+ (1� s)hBs0AihBs0Ai = (1� t)hAs0Ai

Analyzing Probabilistic Pushdown Automata Quantitative Reachability/Termination

Quantitative Term./Reach Dueling Cowboys

Justin Winkens | 30. June 2016 41/42

I We know that the duel ends if both s, t > 0

I What is the probability that e.g. A wins the duel?I ) [Ad0A] =?, C = ;I Same equations apply!

p = 1/2, s = 1/2, t = 1/2

Analyzing Probabilistic Pushdown Automata Quantitative Reachability/Termination

Quantitative Term./Reach Dueling Cowboys

Justin Winkens | 30. June 2016 41/42

I We know that the duel ends if both s, t > 0

I What is the probability that e.g. A wins the duel?I ) [Ad0A] =?, C = ;I Same equations apply!

p = 1/2, s = 1/2, t = 1/2

hAd0Ai = 1/2

hAs0Ai = 2/3

hBs0Ai = 1/3

Analyzing Probabilistic Pushdown Automata Quantitative Reachability/Termination

Quantitative Term./Reach Dueling Cowboys

Justin Winkens | 30. June 2016 41/42

I pPDA nice way to model and analyze systems that use probability aswell as recursion

I 2 formulae enough to study quantitative and qualitative reachabilityI Can be done efficiently in polynomial spaceI Construction technique to pPBA allows analysis in polynomial time.

Analyzing Probabilistic Pushdown Automata Quantitative Reachability/Termination

Conclusion

Justin Winkens | 30. June 2016 42/42

I pPDA nice way to model and analyze systems that use probability aswell as recursion

I 2 formulae enough to study quantitative and qualitative reachability

I Can be done efficiently in polynomial spaceI Construction technique to pPBA allows analysis in polynomial time.

Analyzing Probabilistic Pushdown Automata Quantitative Reachability/Termination

Conclusion

Justin Winkens | 30. June 2016 42/42

I pPDA nice way to model and analyze systems that use probability aswell as recursion

I 2 formulae enough to study quantitative and qualitative reachabilityI Can be done efficiently in polynomial space

I Construction technique to pPBA allows analysis in polynomial time.

Analyzing Probabilistic Pushdown Automata Quantitative Reachability/Termination

Conclusion

Justin Winkens | 30. June 2016 42/42

I pPDA nice way to model and analyze systems that use probability aswell as recursion

I 2 formulae enough to study quantitative and qualitative reachabilityI Can be done efficiently in polynomial spaceI Construction technique to pPBA allows analysis in polynomial time.

Analyzing Probabilistic Pushdown Automata Quantitative Reachability/Termination

Conclusion

Justin Winkens | 30. June 2016 42/42

Definition: RuntimeLet � be a transition system with a set of configurations S and targetconfigurations T .

Let f : S ! R�0 be a function that assigns run times to states.For every run r 2 Runs(�) we define kr as the least n 2 N0 such thatr(n) 2 T .

T ime(�) =

krX

i=0

f(r(i)) .

) kr depends on probability) E(T ime(�)), E(T ime(�)|Reach(pX, C))

Expected Runtime

Justin Winkens | 30. June 2016 1/6

Definition: RuntimeLet � be a transition system with a set of configurations S and targetconfigurations T .Let f : S ! R�0 be a function that assigns run times to states.

For every run r 2 Runs(�) we define kr as the least n 2 N0 such thatr(n) 2 T .

T ime(�) =

krX

i=0

f(r(i)) .

) kr depends on probability) E(T ime(�)), E(T ime(�)|Reach(pX, C))

Expected Runtime

Justin Winkens | 30. June 2016 1/6

Definition: RuntimeLet � be a transition system with a set of configurations S and targetconfigurations T .Let f : S ! R�0 be a function that assigns run times to states.For every run r 2 Runs(�) we define kr as the least n 2 N0 such thatr(n) 2 T .

T ime(�) =

krX

i=0

f(r(i)) .

) kr depends on probability) E(T ime(�)), E(T ime(�)|Reach(pX, C))

Expected Runtime

Justin Winkens | 30. June 2016 1/6

Definition: RuntimeLet � be a transition system with a set of configurations S and targetconfigurations T .Let f : S ! R�0 be a function that assigns run times to states.For every run r 2 Runs(�) we define kr as the least n 2 N0 such thatr(n) 2 T .

T ime(�) =

krX

i=0

f(r(i)) .

) kr depends on probability) E(T ime(�)), E(T ime(�)|Reach(pX, C))

Expected Runtime

Justin Winkens | 30. June 2016 1/6

Definition: RuntimeLet � be a transition system with a set of configurations S and targetconfigurations T .Let f : S ! R�0 be a function that assigns run times to states.For every run r 2 Runs(�) we define kr as the least n 2 N0 such thatr(n) 2 T .

T ime(�) =

krX

i=0

f(r(i)) .

) kr depends on probability

) E(T ime(�)), E(T ime(�)|Reach(pX, C))

Expected Runtime

Justin Winkens | 30. June 2016 1/6

Definition: RuntimeLet � be a transition system with a set of configurations S and targetconfigurations T .Let f : S ! R�0 be a function that assigns run times to states.For every run r 2 Runs(�) we define kr as the least n 2 N0 such thatr(n) 2 T .

T ime(�) =

krX

i=0

f(r(i)) .

) kr depends on probability) E(T ime(�)), E(T ime(�)|Reach(pX, C))

Expected Runtime

Justin Winkens | 30. June 2016 1/6

Definition: Expected Runtime pPDA

Let � = (Q,�, ,!,P) be a pPDA.EpXq = E(T ime(�)|Reach(pX, {q"})) conditional expected runtime

hEpXqi = f(pX) +

X

pXx

,!rY

x · [rY q]

[pXq]· hErY qi

+

X

pXx

,!rY Z

X

t2Qx · [rY t] · [tZq]

[pXq]· (hErY ti+ hEtZqi)

) Here: f(pX) = 1 for all pX 2 Q⇥ � ) discrete time

Expected Runtime

Justin Winkens | 30. June 2016 2/6

Definition: Expected Runtime pPDA

Let � = (Q,�, ,!,P) be a pPDA.EpXq = E(T ime(�)|Reach(pX, {q"})) conditional expected runtime

hEpXqi = f(pX) +

X

pXx

,!rY

x · [rY q]

[pXq]· hErY qi

+

X

pXx

,!rY Z

X

t2Qx · [rY t] · [tZq]

[pXq]· (hErY ti+ hEtZqi)

) Here: f(pX) = 1 for all pX 2 Q⇥ � ) discrete time

Expected Runtime

Justin Winkens | 30. June 2016 2/6

Definition: Expected Runtime pPDA

Let � = (Q,�, ,!,P) be a pPDA.EpXq = E(T ime(�)|Reach(pX, {q"})) conditional expected runtime

hEpXqi = f(pX) +

X

pXx

,!rY

x · [rY q]

[pXq]· hErY qi

+

X

pXx

,!rY Z

X

t2Qx · [rY t] · [tZq]

[pXq]· (hErY ti+ hEtZqi)

) Here: f(pX) = 1 for all pX 2 Q⇥ � ) discrete time

Expected Runtime

Justin Winkens | 30. June 2016 2/6

P(Reach(rY, {q"})|Reach(pX, {q"})) = P(Reach(rY, {q"}) \Reach(pX, {q"}))P(Reach(pX, {q"}))

=

P(Reach(rY, {q"}))P(Reach(pX, {q"}))

=

[rY q]

[pXq]

Expected Runtime

Justin Winkens | 30. June 2016 3/6

Expected runtime for all runs that start in Ad0 and end in A":

hEAs0Ai = 1 +

[As1A]

[As0A]

· hEAs1Ai

hEAs1Ai = 1 +

s

[As1A]

· (hEAk0Ai+ hEAs3Ai) + (1� s) · [Bs0A]

[As1A]

(hEBs0Ai)

hEBs0Ai = 1 +

[Bs2A]

[Bs0A]· hEBs2Ai

hEBs2Ai = 1 + (1� t) · [As0A]

[Bs2A]

· (hEAs0Ai+ hEAs6Ai)

hEAd1Ai = 1

hEAk0Ai = 1

hEAs3Ai = 1

hEAs6Ai = 1

Expected Runtime

Justin Winkens | 30. June 2016 4/6

Expected runtime for all runs that start in Ad0 and end in A":

hEAs0Ai = 1 +

[As1A]

[As0A]

· hEAs1Ai

hEAs1Ai = 1 +

s

[As1A]

· (hEAk0Ai+ hEAs3Ai) + (1� s) · [Bs0A]

[As1A]

(hEBs0Ai)

hEBs0Ai = 1 +

[Bs2A]

[Bs0A]· hEBs2Ai

hEBs2Ai = 1 + (1� t) · [As0A]

[Bs2A]

· (hEAs0Ai+ hEAs6Ai)

hEAd1Ai = 1

hEAk0Ai = 1

hEAs3Ai = 1

hEAs6Ai = 1

Expected Runtime

Justin Winkens | 30. June 2016 4/6

Let’s assume p = s = t = 1/2

hEAd0Ai = 2 +

2

3

· hAs0Ai+ 1

3

· hBs0AihEAs0Ai = 1 + hEAs1AihEAs1Ai =

5

2

+

1

4

hEBs0AihEBs0Ai = 1 + hEBs2AihEBs2Ai = 2 + hEAs0Ai

) hEAd0Ai = 26/3 = 8.66

Expected Runtime

Justin Winkens | 30. June 2016 5/6

Let’s assume p = s = t = 1/2

hEAd0Ai = 2 +

2

3

· hAs0Ai+ 1

3

· hBs0AihEAs0Ai = 1 + hEAs1AihEAs1Ai =

5

2

+

1

4

hEBs0AihEBs0Ai = 1 + hEBs2AihEBs2Ai = 2 + hEAs0Ai

) hEAd0Ai = 26/3 = 8.66

Expected Runtime

Justin Winkens | 30. June 2016 5/6

Let’s assume p = s = t = 1/2

hEAd0Ai = 2 +

2

3

· hAs0Ai+ 1

3

· hBs0AihEAs0Ai = 1 + hEAs1AihEAs1Ai =

5

2

+

1

4

hEBs0AihEBs0Ai = 1 + hEBs2AihEBs2Ai = 2 + hEAs0Ai

) hEAd0Ai = 26/3 = 8.66

Expected Runtime

Justin Winkens | 30. June 2016 5/6

hAd0Ai = �p� (1� p) · (1� t)

2(st� s� t)

hAs0Ai = �1

2(st� s� t)

hBs0Ai = �(1� t)

2(st� s� t)

Quantitative System Parametrized

Justin Winkens | 30. June 2016 6/6

Recommended