193
1/ 193 SPA for quantitative analysis: Lecture 3 — Case Studies and Tools Jane Hillston LFCS, School of Informatics The University of Edinburgh Scotland 5th March 2013

SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

  • Upload
    others

  • View
    6

  • Download
    0

Embed Size (px)

Citation preview

Page 1: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

1/ 193

SPA for quantitative analysis:Lecture 3 — Case Studies and Tools

Jane Hillston

LFCS, School of InformaticsThe University of Edinburgh

Scotland

5th March 2013

Page 2: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

2/ 193

Outline

1 Recap

2 Case Studies

3 Roland the Gunslinger

4 Tools

5 Web Service Composition

6 Querying models

Page 3: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Recap 3/ 193

Outline

1 Recap

2 Case Studies

3 Roland the Gunslinger

4 Tools

5 Web Service Composition

6 Querying models

Page 4: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Recap 4/ 193

Dynamic behaviour

The behaviour of a model is dictated by the semantic rulesgoverning the combinators of the language.

The possible evolutions of a model are captured by applyingthese rules exhaustively, generating a labelled transitionsystem.

This can be viewed as a graph in which each node is a stateof the model (comprised of the local states of each of thecomponents) and the arcs represent the actions which cancause the move from one state to another.

The language is also equipped with observational equivalencewhich can be used to compare models.

Page 5: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Recap 5/ 193

Dynamic behaviour

The behaviour of a model is dictated by the semantic rulesgoverning the combinators of the language.

The possible evolutions of a model are captured by applyingthese rules exhaustively, generating a labelled transitionsystem.

This can be viewed as a graph in which each node is a stateof the model (comprised of the local states of each of thecomponents) and the arcs represent the actions which cancause the move from one state to another.

The language is also equipped with observational equivalencewhich can be used to compare models.

Page 6: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Recap 6/ 193

Dynamic behaviour

The behaviour of a model is dictated by the semantic rulesgoverning the combinators of the language.

The possible evolutions of a model are captured by applyingthese rules exhaustively, generating a labelled transitionsystem.

This can be viewed as a graph in which each node is a stateof the model (comprised of the local states of each of thecomponents) and the arcs represent the actions which cancause the move from one state to another.

The language is also equipped with observational equivalencewhich can be used to compare models.

Page 7: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Recap 7/ 193

Dynamic behaviour

The behaviour of a model is dictated by the semantic rulesgoverning the combinators of the language.

The possible evolutions of a model are captured by applyingthese rules exhaustively, generating a labelled transitionsystem.

This can be viewed as a graph in which each node is a stateof the model (comprised of the local states of each of thecomponents) and the arcs represent the actions which cancause the move from one state to another.

The language is also equipped with observational equivalencewhich can be used to compare models.

Page 8: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Recap 8/ 193

PEPA Eclipse Plug-In input

P1def= (start, r1).P2 P2

def= (run, r2).P3 P3

def= (stop, r3).P1

P1 ‖ P1

Page 9: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Recap 9/ 193

PEPA Eclipse Plug-In input

P1def= (start, r1).P2 P2

def= (run, r2).P3 P3

def= (stop, r3).P1

P1 ‖ P1

State space

1 P1 ‖ P1

2 P1 ‖ P2

3 P2 ‖ P1

4 P1 ‖ P3

5 P2 ‖ P2

6 P3 ‖ P1

7 P3 ‖ P2

8 P3 ‖ P2

9 P3 ‖ P3

Page 10: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Recap 10/ 193

PEPA Eclipse Plug-In input

P1def= (start, r1).P2 P2

def= (run, r2).P3 P3

def= (stop, r3).P1

P1 ‖ P1

CTMC representation computed by the plug-in

−2r1 r1 r1 0 0 0 0 0 00 −r1 − r2 0 r2 r1 0 0 0 00 0 −r1 − r2 0 r1 r2 0 0 0r3 0 0 −r1 − r3 0 0 0 r1 00 0 0 0 −2r2 0 r2 r2 0r3 0 0 0 0 −r1 − r3 r1 0 00 r3 0 0 0 0 −r2 − r3 0 r20 0 r3 0 0 0 0 −r2 − r3 r20 0 0 r3 0 r3 0 0 −2r3

Page 11: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Recap 11/ 193

The PEPA Eclipse Plug-in processing the model

Page 12: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Case Studies 12/ 193

Outline

1 Recap

2 Case Studies

3 Roland the Gunslinger

4 Tools

5 Web Service Composition

6 Querying models

Page 13: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Case Studies 13/ 193

PEPA Case Studies (1)

Multiprocessor access-contention protocols (Gilmore, Hillstonand Ribaudo, Edinburgh and Turin)

Protocols for fault-tolerant systems (Clark, Gilmore, Hillstonand Ribaudo, Edinburgh and Turin)

Multimedia traffic characteristics (Bowman et al, Kent)

QoS protocols for mobile devices (Wang et al., EEdepartment, Edinburgh)

Software Architectures (Pooley, Bradley and Thomas,Heriot-Watt and Durham)

Switch behaviour in active networks (Hillston, Kloul andMokhtari, Edinburgh and Versailles)

Page 14: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Case Studies 14/ 193

PEPA Case Studies (1)

Multiprocessor access-contention protocols (Gilmore, Hillstonand Ribaudo, Edinburgh and Turin)

Protocols for fault-tolerant systems (Clark, Gilmore, Hillstonand Ribaudo, Edinburgh and Turin)

Multimedia traffic characteristics (Bowman et al, Kent)

QoS protocols for mobile devices (Wang et al., EEdepartment, Edinburgh)

Software Architectures (Pooley, Bradley and Thomas,Heriot-Watt and Durham)

Switch behaviour in active networks (Hillston, Kloul andMokhtari, Edinburgh and Versailles)

Page 15: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Case Studies 15/ 193

PEPA Case Studies (1)

Multiprocessor access-contention protocols (Gilmore, Hillstonand Ribaudo, Edinburgh and Turin)

Protocols for fault-tolerant systems (Clark, Gilmore, Hillstonand Ribaudo, Edinburgh and Turin)

Multimedia traffic characteristics (Bowman et al, Kent)

QoS protocols for mobile devices (Wang et al., EEdepartment, Edinburgh)

Software Architectures (Pooley, Bradley and Thomas,Heriot-Watt and Durham)

Switch behaviour in active networks (Hillston, Kloul andMokhtari, Edinburgh and Versailles)

Page 16: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Case Studies 16/ 193

PEPA Case Studies (1)

Multiprocessor access-contention protocols (Gilmore, Hillstonand Ribaudo, Edinburgh and Turin)

Protocols for fault-tolerant systems (Clark, Gilmore, Hillstonand Ribaudo, Edinburgh and Turin)

Multimedia traffic characteristics (Bowman et al, Kent)

QoS protocols for mobile devices (Wang et al., EEdepartment, Edinburgh)

Software Architectures (Pooley, Bradley and Thomas,Heriot-Watt and Durham)

Switch behaviour in active networks (Hillston, Kloul andMokhtari, Edinburgh and Versailles)

Page 17: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Case Studies 17/ 193

PEPA Case Studies (1)

Multiprocessor access-contention protocols (Gilmore, Hillstonand Ribaudo, Edinburgh and Turin)

Protocols for fault-tolerant systems (Clark, Gilmore, Hillstonand Ribaudo, Edinburgh and Turin)

Multimedia traffic characteristics (Bowman et al, Kent)

QoS protocols for mobile devices (Wang et al., EEdepartment, Edinburgh)

Software Architectures (Pooley, Bradley and Thomas,Heriot-Watt and Durham)

Switch behaviour in active networks (Hillston, Kloul andMokhtari, Edinburgh and Versailles)

Page 18: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Case Studies 18/ 193

PEPA Case Studies (1)

Multiprocessor access-contention protocols (Gilmore, Hillstonand Ribaudo, Edinburgh and Turin)

Protocols for fault-tolerant systems (Clark, Gilmore, Hillstonand Ribaudo, Edinburgh and Turin)

Multimedia traffic characteristics (Bowman et al, Kent)

QoS protocols for mobile devices (Wang et al., EEdepartment, Edinburgh)

Software Architectures (Pooley, Bradley and Thomas,Heriot-Watt and Durham)

Switch behaviour in active networks (Hillston, Kloul andMokhtari, Edinburgh and Versailles)

Page 19: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Case Studies 19/ 193

PEPA Case Studies (2)

Task scheduling in a Grid-based processing system, (Benoit etal., Edinburgh)

Probability of airbag deployment (Clark, Gilmore andTribastone, Edinburgh)

Crowd Interactions in Smart Environments (Harrison, Massinkand Latella, Newcastle and ISTI)

Spread of a computer virus via a computer network (Bradley,Gilmore and Hillston, Imperial and Edinburgh)

Disease spread within animal populations (Benkrine, McCaig,Norman and Shankland, Stirling)

Page 20: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Case Studies 20/ 193

PEPA Case Studies (2)

Task scheduling in a Grid-based processing system, (Benoit etal., Edinburgh)

Probability of airbag deployment (Clark, Gilmore andTribastone, Edinburgh)

Crowd Interactions in Smart Environments (Harrison, Massinkand Latella, Newcastle and ISTI)

Spread of a computer virus via a computer network (Bradley,Gilmore and Hillston, Imperial and Edinburgh)

Disease spread within animal populations (Benkrine, McCaig,Norman and Shankland, Stirling)

Page 21: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Case Studies 21/ 193

PEPA Case Studies (2)

Task scheduling in a Grid-based processing system, (Benoit etal., Edinburgh)

Probability of airbag deployment (Clark, Gilmore andTribastone, Edinburgh)

Crowd Interactions in Smart Environments (Harrison, Massinkand Latella, Newcastle and ISTI)

Spread of a computer virus via a computer network (Bradley,Gilmore and Hillston, Imperial and Edinburgh)

Disease spread within animal populations (Benkrine, McCaig,Norman and Shankland, Stirling)

Page 22: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Case Studies 22/ 193

PEPA Case Studies (2)

Task scheduling in a Grid-based processing system, (Benoit etal., Edinburgh)

Probability of airbag deployment (Clark, Gilmore andTribastone, Edinburgh)

Crowd Interactions in Smart Environments (Harrison, Massinkand Latella, Newcastle and ISTI)

Spread of a computer virus via a computer network (Bradley,Gilmore and Hillston, Imperial and Edinburgh)

Disease spread within animal populations (Benkrine, McCaig,Norman and Shankland, Stirling)

Page 23: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Case Studies 23/ 193

PEPA Case Studies (2)

Task scheduling in a Grid-based processing system, (Benoit etal., Edinburgh)

Probability of airbag deployment (Clark, Gilmore andTribastone, Edinburgh)

Crowd Interactions in Smart Environments (Harrison, Massinkand Latella, Newcastle and ISTI)

Spread of a computer virus via a computer network (Bradley,Gilmore and Hillston, Imperial and Edinburgh)

Disease spread within animal populations (Benkrine, McCaig,Norman and Shankland, Stirling)

Page 24: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 24/ 193

Outline

1 Recap

2 Case Studies

3 Roland the Gunslinger

4 Tools

5 Web Service Composition

6 Querying models

Page 25: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 25/ 193

Roland the Gunslinger

This sequence of small examples are based around a charactercalled Roland Deschain.

Roland is a gunslinger and his life consists of wanderingaround firing his gun.

We will consider Roland in a number of different scenarios.

These are not intended to be serious but they serve to

illustrate the main features of the language,give you some experience of how models are constructed, anddemonstrate a variety of solution techniques.

Page 26: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 26/ 193

Roland the Gunslinger

This sequence of small examples are based around a charactercalled Roland Deschain.

Roland is a gunslinger and his life consists of wanderingaround firing his gun.

We will consider Roland in a number of different scenarios.

These are not intended to be serious but they serve to

illustrate the main features of the language,give you some experience of how models are constructed, anddemonstrate a variety of solution techniques.

Page 27: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 27/ 193

Roland the Gunslinger

This sequence of small examples are based around a charactercalled Roland Deschain.

Roland is a gunslinger and his life consists of wanderingaround firing his gun.

We will consider Roland in a number of different scenarios.

These are not intended to be serious but they serve to

illustrate the main features of the language,give you some experience of how models are constructed, anddemonstrate a variety of solution techniques.

Page 28: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 28/ 193

Roland the Gunslinger

This sequence of small examples are based around a charactercalled Roland Deschain.

Roland is a gunslinger and his life consists of wanderingaround firing his gun.

We will consider Roland in a number of different scenarios.

These are not intended to be serious but they serve to

illustrate the main features of the language,give you some experience of how models are constructed, anddemonstrate a variety of solution techniques.

Page 29: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 29/ 193

Roland alone

In the first scenario we consider Roland alone, with the singleactivity of firing his gun which is a six-shooter. When his gun isempty Roland will reload the gun and then continue shooting.

Roland6def= (fire, rfire).Roland5

Roland5def= (fire, rfire).Roland4

Roland4def= (fire, rfire).Roland3

Roland3def= (fire, rfire).Roland2

Roland2def= (fire, rfire).Roland1

Roland1def= (fire, rfire).Rolandempty

Rolandemptydef= (reload, rreload).Roland6

Page 30: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 30/ 193

Roland with two guns

All self-respecting gun-slingers have one gun in each hand. If wesuppose that Roland has two guns then he should be allowed tofire either gun independently. A simplistic model of this has twoinstances of Roland in parallel:

Roland6 ‖ Roland6

But this does not capture the fact that Roland needs both handsin order to reload either gun. The simplest solution is to assumethat Roland only reloads both guns when both are empty.

Roland6 ��{reload}

Roland6

From now on we restrict Roland to his shotgun, which has twoshots and requires both hands for firing.

Page 31: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 31/ 193

Roland with two guns

All self-respecting gun-slingers have one gun in each hand. If wesuppose that Roland has two guns then he should be allowed tofire either gun independently. A simplistic model of this has twoinstances of Roland in parallel:

Roland6 ‖ Roland6

But this does not capture the fact that Roland needs both handsin order to reload either gun. The simplest solution is to assumethat Roland only reloads both guns when both are empty.

Roland6 ��{reload}

Roland6

From now on we restrict Roland to his shotgun, which has twoshots and requires both hands for firing.

Page 32: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 32/ 193

Roland with two guns

All self-respecting gun-slingers have one gun in each hand. If wesuppose that Roland has two guns then he should be allowed tofire either gun independently. A simplistic model of this has twoinstances of Roland in parallel:

Roland6 ‖ Roland6

But this does not capture the fact that Roland needs both handsin order to reload either gun. The simplest solution is to assumethat Roland only reloads both guns when both are empty.

Roland6 ��{reload}

Roland6

From now on we restrict Roland to his shotgun, which has twoshots and requires both hands for firing.

Page 33: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 33/ 193

Roland meets an Enemy

Upon his travels Roland encounters some enemies and whenhe does so he must fight them.

Roland is the wildest gunslinger in the west so we assume thatno enemy has the skill to seriously harm Roland.

Each time Roland fires he might miss or hit his target.

But with nothing to stop him he will keep firing until hesuccessfully hits (and kills) the enemy.

We assume that some sense of cowboy honour prevents anyenemy attacking Roland if he is already involved in a gunfight.

Page 34: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 34/ 193

The model

Rolandidledef= (attack, rattack).Roland2

Roland2def= (hit, rhit).(reload, rreload).Rolandidle

+(miss, rmiss).Roland1

Roland1def= (hit, rhit).(reload, rreload).Rolandidle

+(miss, rmiss).Rolandempty

Rolandemptydef= (reload, rreload).Roland2

Page 35: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 35/ 193

Parameter settings for the Roland2 model

parameter value explanation

rfire 1.0 Roland can fire the gun onceper-second

phit-success 0.8 Roland has an 80% success raterhit 0.8 rfire × phit-success

rmiss 0.2 rfire × (1− phit-success)rreload 0.3 It takes Roland about 3 seconds

to reloadrattack 0.01 Roland is attacked once every

100 seconds

Page 36: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 36/ 193

Steady state analysis

We can calculate the probability that at arbitrary time Roland isinvolved in a battle.

This can be based on the steady state probability that Roland is inany of the states in which a battle is on-going, i.e. Roland2,Roland1 and Rolandempty .

State Measure ’roland peaceful’

mean 9.5490716180e-01

State Measure ’roland in battle’

mean 0.0450928382e-01

> 95% chance that Roland is not currently involved in a gunbattle.

Page 37: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 37/ 193

Steady state analysis

We can calculate the probability that at arbitrary time Roland isinvolved in a battle.

This can be based on the steady state probability that Roland is inany of the states in which a battle is on-going, i.e. Roland2,Roland1 and Rolandempty .

State Measure ’roland peaceful’

mean 9.5490716180e-01

State Measure ’roland in battle’

mean 0.0450928382e-01

> 95% chance that Roland is not currently involved in a gunbattle.

Page 38: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 38/ 193

Steady state analysis

We can calculate the probability that at arbitrary time Roland isinvolved in a battle.

This can be based on the steady state probability that Roland is inany of the states in which a battle is on-going, i.e. Roland2,Roland1 and Rolandempty .

State Measure ’roland peaceful’

mean 9.5490716180e-01

State Measure ’roland in battle’

mean 0.0450928382e-01

> 95% chance that Roland is not currently involved in a gunbattle.

Page 39: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 39/ 193

Steady state analysis

We can calculate the probability that at arbitrary time Roland isinvolved in a battle.

This can be based on the steady state probability that Roland is inany of the states in which a battle is on-going, i.e. Roland2,Roland1 and Rolandempty .

State Measure ’roland peaceful’

mean 9.5490716180e-01

State Measure ’roland in battle’

mean 0.0450928382e-01

> 95% chance that Roland is not currently involved in a gunbattle.

Page 40: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 40/ 193

Passage-Time Analysis

Passage-time analysis allows us to calculate measures such as theprobability that Roland has killed his enemy at a given time afterhe is attacked.

This would involve calculating the probability that the modelperforms a hit action within the given time after performing anattack action.

Page 41: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 41/ 193

Passage-Time Analysis

Passage-time analysis allows us to calculate measures such as theprobability that Roland has killed his enemy at a given time afterhe is attacked.

This would involve calculating the probability that the modelperforms a hit action within the given time after performing anattack action.

Page 42: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 42/ 193

Passage-Time Analysis results

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

0 1 2 3 4 5 6 7 8 9 10

Pr

time

Probability that Roland will have hit after an attack

The probability that Roland will successfully perform a hit action a given

time after an attack. Gun battles typically last about 5 seconds and occurs

about every 100 seconds. The probability that Roland has performed a hit

action five seconds after an attack action is ≈ 90%

Page 43: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 43/ 193

Passage-Time Analysis results

0

0.01

0.02

0.03

0.04

0.05

0.06

0.07

0.08

0.09

0 1 2 3 4 5 6 7 8 9 10

Pr

time

Probability that Roland will have missed after an attack

The probability that Roland has performed a miss action a given time after

an attack action. These probabilities are much lower because Roland’s

probability of success are high and if he successfully kills an enemy we

must wait for the next attack in order to have a chance of seeing a miss.

Page 44: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 44/ 193

Cooperation

In the previous model Roland’s enemies were represented onlyimplicitly.

We now consider a model in which the enemies appearexplicitly and allow them to fight back.

However for now we still assume that they are ratherineffectual and so they never seriously injure Roland.

This model can be used to calculate properties such as thelikelihood that an enemy will manage to fire one shot beforethey are killed by Roland.

Page 45: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 45/ 193

Cooperation

In the previous model Roland’s enemies were represented onlyimplicitly.

We now consider a model in which the enemies appearexplicitly and allow them to fight back.

However for now we still assume that they are ratherineffectual and so they never seriously injure Roland.

This model can be used to calculate properties such as thelikelihood that an enemy will manage to fire one shot beforethey are killed by Roland.

Page 46: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 46/ 193

Cooperation

In the previous model Roland’s enemies were represented onlyimplicitly.

We now consider a model in which the enemies appearexplicitly and allow them to fight back.

However for now we still assume that they are ratherineffectual and so they never seriously injure Roland.

This model can be used to calculate properties such as thelikelihood that an enemy will manage to fire one shot beforethey are killed by Roland.

Page 47: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 47/ 193

Cooperation

In the previous model Roland’s enemies were represented onlyimplicitly.

We now consider a model in which the enemies appearexplicitly and allow them to fight back.

However for now we still assume that they are ratherineffectual and so they never seriously injure Roland.

This model can be used to calculate properties such as thelikelihood that an enemy will manage to fire one shot beforethey are killed by Roland.

Page 48: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 48/ 193

Revised Model

Rolandidledef= (attack,>).Roland2

Roland2def= (hit, rhit).(reload, rreload).Rolandidle

+ (miss, rmiss).Roland1

Roland1def= (hit, rhit).(reload, rreload).Rolandidle

+ (miss, rmiss).Rolandempty

Rolandemptydef= (reload, rreload).Roland2

Enemiesidledef= (attack, rattack).Enemiesattack

Enemiesattackdef= (fire, re-miss).Enemiesattack

+ (hit,>).Enemiesidle

Rolandidle ��{hit,attack}

Enemiesidle

Page 49: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 49/ 193

Additional parameters

parameter value explanation

rattack 0.01 Roland is attacked once every100 seconds

re-miss 0.3 Enemies can fire only once every3 seconds

Page 50: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 50/ 193

Levels of abstraction

Notice that in this model the behaviour of the enemy hasbeen simplified.

There is no running out of bullets or reloading.

This model can be thought of as an approximation to a morecomplicated component similar to the one which modelsRoland.

Here the rate at which the enemy fires encompasses all of theactions, including the reloading of an empty gun.

We may choose to model a component in such an abstractway when the focus of our modelling is really elsewhere in themodel.

Page 51: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 51/ 193

Levels of abstraction

Notice that in this model the behaviour of the enemy hasbeen simplified.

There is no running out of bullets or reloading.

This model can be thought of as an approximation to a morecomplicated component similar to the one which modelsRoland.

Here the rate at which the enemy fires encompasses all of theactions, including the reloading of an empty gun.

We may choose to model a component in such an abstractway when the focus of our modelling is really elsewhere in themodel.

Page 52: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 52/ 193

Levels of abstraction

Notice that in this model the behaviour of the enemy hasbeen simplified.

There is no running out of bullets or reloading.

This model can be thought of as an approximation to a morecomplicated component similar to the one which modelsRoland.

Here the rate at which the enemy fires encompasses all of theactions, including the reloading of an empty gun.

We may choose to model a component in such an abstractway when the focus of our modelling is really elsewhere in themodel.

Page 53: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 53/ 193

Levels of abstraction

Notice that in this model the behaviour of the enemy hasbeen simplified.

There is no running out of bullets or reloading.

This model can be thought of as an approximation to a morecomplicated component similar to the one which modelsRoland.

Here the rate at which the enemy fires encompasses all of theactions, including the reloading of an empty gun.

We may choose to model a component in such an abstractway when the focus of our modelling is really elsewhere in themodel.

Page 54: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 54/ 193

Levels of abstraction

Notice that in this model the behaviour of the enemy hasbeen simplified.

There is no running out of bullets or reloading.

This model can be thought of as an approximation to a morecomplicated component similar to the one which modelsRoland.

Here the rate at which the enemy fires encompasses all of theactions, including the reloading of an empty gun.

We may choose to model a component in such an abstractway when the focus of our modelling is really elsewhere in themodel.

Page 55: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 55/ 193

Model Validation

It is also sometimes useful to carry out a validation of the modelby calculating a metric which we believe we already know the valueof.

For example in this model we could make such a sanity check bycalculating the probability that the model is in a state in whichRoland is idle but the enemies are not, or vice versa.

This should never occur and hence the probability should be zero.

Page 56: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 56/ 193

Model Validation

It is also sometimes useful to carry out a validation of the modelby calculating a metric which we believe we already know the valueof.

For example in this model we could make such a sanity check bycalculating the probability that the model is in a state in whichRoland is idle but the enemies are not, or vice versa.

This should never occur and hence the probability should be zero.

Page 57: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 57/ 193

Model Validation

It is also sometimes useful to carry out a validation of the modelby calculating a metric which we believe we already know the valueof.

For example in this model we could make such a sanity check bycalculating the probability that the model is in a state in whichRoland is idle but the enemies are not, or vice versa.

This should never occur and hence the probability should be zero.

Page 58: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 58/ 193

Sensitivity Analysis

Sensitivity analysis studies how much influence particularparameter values, such as activity rates, have on performancemetrics calculated for the system as a whole.

A single activity in a PEPA model may have a significantimpact on the dynamics of the model, or, conversely, mayexert very little influence.

Sensitivity analysis is performed by solving the model manytimes while varying the rates slightly.

For this model we chose to vary three of the rates involvedand measured the passage time between an attack and a hitactivity, for each combintation of rates.

Page 59: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 59/ 193

Sensitivity Analysis

Sensitivity analysis studies how much influence particularparameter values, such as activity rates, have on performancemetrics calculated for the system as a whole.

A single activity in a PEPA model may have a significantimpact on the dynamics of the model, or, conversely, mayexert very little influence.

Sensitivity analysis is performed by solving the model manytimes while varying the rates slightly.

For this model we chose to vary three of the rates involvedand measured the passage time between an attack and a hitactivity, for each combintation of rates.

Page 60: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 60/ 193

Sensitivity Analysis

Sensitivity analysis studies how much influence particularparameter values, such as activity rates, have on performancemetrics calculated for the system as a whole.

A single activity in a PEPA model may have a significantimpact on the dynamics of the model, or, conversely, mayexert very little influence.

Sensitivity analysis is performed by solving the model manytimes while varying the rates slightly.

For this model we chose to vary three of the rates involvedand measured the passage time between an attack and a hitactivity, for each combintation of rates.

Page 61: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 61/ 193

Sensitivity Analysis

Sensitivity analysis studies how much influence particularparameter values, such as activity rates, have on performancemetrics calculated for the system as a whole.

A single activity in a PEPA model may have a significantimpact on the dynamics of the model, or, conversely, mayexert very little influence.

Sensitivity analysis is performed by solving the model manytimes while varying the rates slightly.

For this model we chose to vary three of the rates involvedand measured the passage time between an attack and a hitactivity, for each combintation of rates.

Page 62: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 62/ 193

Sensitivity Analysis: Results

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

0.2 0.3 0.4 0.5 0.6 0.7 0.8 0 1 2 3 4 5 6 7 8 9 10

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9

1

Pr

Sensitivity of cumulative distribution function to hitSuccess

hitSuccess

Time

Pr

The effect of varying the phit-success parameter.

Page 63: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 63/ 193

Sensitivity Analysis: Results

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9

0.4 0.5 0.6 0.7 0.8 0.9 1 0 1 2 3 4 5 6 7 8 9 10 0

0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9

Pr

Sensitivity of cumulative distribution function to fireRate

fireRate

Time

Pr

The effect of varying the rfire parameter.

Page 64: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 64/ 193

Sensitivity Analysis: Results

0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9

0.1 0.15 0.2 0.25 0.3 0.35 0.4 0 1 2 3 4 5 6 7 8 9 10

0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9

Pr

Sensitivity of cumulative distribution function to reloadRate

reloadRate

Time

Pr

The effect of varying the rreload parameter.

Page 65: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 65/ 193

Accurate Enemies

We now allow the enemies of Roland to actually hit him. Thismeans that Roland may die. It is important to note that thishas the consequence that the model will always deadlock. Theunderlying Markov process is no longer ergodic.

We assume that the enemies can only hit Roland once every50 seconds. This rate approximates the rate of a more detailedmodel in which we would assign a process to the enemieswhich is much like that of the process which describes Roland.

The only new parameter is re-hit which is assigned a value 0.02to reflect this assumption.

Page 66: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 66/ 193

Accurate Enemies

We now allow the enemies of Roland to actually hit him. Thismeans that Roland may die. It is important to note that thishas the consequence that the model will always deadlock. Theunderlying Markov process is no longer ergodic.

We assume that the enemies can only hit Roland once every50 seconds. This rate approximates the rate of a more detailedmodel in which we would assign a process to the enemieswhich is much like that of the process which describes Roland.

The only new parameter is re-hit which is assigned a value 0.02to reflect this assumption.

Page 67: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 67/ 193

Accurate Enemies

We now allow the enemies of Roland to actually hit him. Thismeans that Roland may die. It is important to note that thishas the consequence that the model will always deadlock. Theunderlying Markov process is no longer ergodic.

We assume that the enemies can only hit Roland once every50 seconds. This rate approximates the rate of a more detailedmodel in which we would assign a process to the enemieswhich is much like that of the process which describes Roland.

The only new parameter is re-hit which is assigned a value 0.02to reflect this assumption.

Page 68: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 68/ 193

New Roland

Rolandidledef= (attack,>).Roland2

Roland2def= (hit, rhit).(reload, rreload).Rolandidle

+ (miss, rmiss).Roland1

+ (e-hit,>).Rolanddead

Roland1def= (hit, rhit).(reload, rreload).Rolandidle

+ (miss, rmiss).Rolandempty

+ (e-hit,>).Rolanddead

Rolandemptydef= (reload, rreload).(reload, rreload).Roland2

+ (e-hit,>).Rolanddead

Rolanddeaddef= Stop

Page 69: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 69/ 193

New Enemy

Enemiesidledef= (attack, rattack).Enemiesattack

Enemiesattackdef= (e-hit, re-hit).Enemiesidle

+ (hit,>).Enemiesidle

Rolandidle ��{hit,attack,e-hit}

Enemiesidle

Page 70: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 70/ 193

Model Analysis

Steady-State Analysis Since there is an infinite supply of enemieseventually Roland will always die and the model willdeadlock.

Transient Analysis Transient analysis on this model can be used tocalculate the probability that Roland is dead after agiven amount of time. As time increases this shouldtend towards probability 1.

Passage-Time Analysis Passage-time analysis could be used tocalculate the probability of a given event happeningat a given time after another given event, e.g. froman attack on Roland until he dies or wins the gunfight.

Page 71: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 71/ 193

Model Analysis

Steady-State Analysis Since there is an infinite supply of enemieseventually Roland will always die and the model willdeadlock.

Transient Analysis Transient analysis on this model can be used tocalculate the probability that Roland is dead after agiven amount of time. As time increases this shouldtend towards probability 1.

Passage-Time Analysis Passage-time analysis could be used tocalculate the probability of a given event happeningat a given time after another given event, e.g. froman attack on Roland until he dies or wins the gunfight.

Page 72: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 72/ 193

Model Analysis

Steady-State Analysis Since there is an infinite supply of enemieseventually Roland will always die and the model willdeadlock.

Transient Analysis Transient analysis on this model can be used tocalculate the probability that Roland is dead after agiven amount of time. As time increases this shouldtend towards probability 1.

Passage-Time Analysis Passage-time analysis could be used tocalculate the probability of a given event happeningat a given time after another given event, e.g. froman attack on Roland until he dies or wins the gunfight.

Page 73: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 73/ 193

Roland makes a friend

In the next revision of the model we introduce an accomplice whois befriended by Roland and who, when Roland is attacked, fightsalongside him.

In this scenario cooperation is used to synchronise betweencomponents of the model such that they observe events which theyneither directly cause nor are directly affected by.

Whenever either Roland or the accomplice kills the enemy theother must witness this action, so as to stop firing at a deadopponent (it would be a waste of ammunition!).

Page 74: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 74/ 193

Roland makes a friend

In the next revision of the model we introduce an accomplice whois befriended by Roland and who, when Roland is attacked, fightsalongside him.

In this scenario cooperation is used to synchronise betweencomponents of the model such that they observe events which theyneither directly cause nor are directly affected by.

Whenever either Roland or the accomplice kills the enemy theother must witness this action, so as to stop firing at a deadopponent (it would be a waste of ammunition!).

Page 75: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 75/ 193

Roland makes a friend

In the next revision of the model we introduce an accomplice whois befriended by Roland and who, when Roland is attacked, fightsalongside him.

In this scenario cooperation is used to synchronise betweencomponents of the model such that they observe events which theyneither directly cause nor are directly affected by.

Whenever either Roland or the accomplice kills the enemy theother must witness this action, so as to stop firing at a deadopponent (it would be a waste of ammunition!).

Page 76: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 76/ 193

A new component for Roland

Rolandidledef= (attack,>).Roland2

+ (befriend, rbefriend).Rolandidle

Roland2def= (hit, rhit).Rolandhit + (miss, rmiss).Roland1

+ (a-hit,>).Rolandidle

Roland1def= (hit, rhit).Rolandhit

+ (miss, rmiss).Rolandempty

+ (a-hit,>).(reload, rreload).Rolandidle

Rolandhitdef= (enemy-die,>).(reload, rreload).Rolandidle

Rolandemptydef= (reload, rreload).Roland2

+ (a-hit,>).(reload, rreload).Rolandidle

Page 77: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 77/ 193

Synchronising Roland and the Accomplice

When there is an accomplice, he and Roland fight togetheragainst the enemy.

This involves some cooperation between them.

However we do not want to leave Roland vulnerable whenthere is no accomplice present because some of his actionsbecome blocked.

To prevent this we introduce a dummy componentrepresenting the absence of an accomplice.

In this state the accomplice component will passivelyparticipate in any attack which Roland makes.

Acmplabsdef= (befriend, rbefriend).Acmplidle

+ (hit,>).Acmplabs

+ (attack,>).Acmplabs

Page 78: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 78/ 193

Synchronising Roland and the Accomplice

When there is an accomplice, he and Roland fight togetheragainst the enemy.

This involves some cooperation between them.

However we do not want to leave Roland vulnerable whenthere is no accomplice present because some of his actionsbecome blocked.

To prevent this we introduce a dummy componentrepresenting the absence of an accomplice.

In this state the accomplice component will passivelyparticipate in any attack which Roland makes.

Acmplabsdef= (befriend, rbefriend).Acmplidle

+ (hit,>).Acmplabs

+ (attack,>).Acmplabs

Page 79: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 79/ 193

Synchronising Roland and the Accomplice

When there is an accomplice, he and Roland fight togetheragainst the enemy.

This involves some cooperation between them.

However we do not want to leave Roland vulnerable whenthere is no accomplice present because some of his actionsbecome blocked.

To prevent this we introduce a dummy componentrepresenting the absence of an accomplice.

In this state the accomplice component will passivelyparticipate in any attack which Roland makes.

Acmplabsdef= (befriend, rbefriend).Acmplidle

+ (hit,>).Acmplabs

+ (attack,>).Acmplabs

Page 80: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 80/ 193

Synchronising Roland and the Accomplice

When there is an accomplice, he and Roland fight togetheragainst the enemy.

This involves some cooperation between them.

However we do not want to leave Roland vulnerable whenthere is no accomplice present because some of his actionsbecome blocked.

To prevent this we introduce a dummy componentrepresenting the absence of an accomplice.

In this state the accomplice component will passivelyparticipate in any attack which Roland makes.

Acmplabsdef= (befriend, rbefriend).Acmplidle

+ (hit,>).Acmplabs

+ (attack,>).Acmplabs

Page 81: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 81/ 193

Synchronising Roland and the Accomplice

When there is an accomplice, he and Roland fight togetheragainst the enemy.

This involves some cooperation between them.

However we do not want to leave Roland vulnerable whenthere is no accomplice present because some of his actionsbecome blocked.

To prevent this we introduce a dummy componentrepresenting the absence of an accomplice.

In this state the accomplice component will passivelyparticipate in any attack which Roland makes.

Acmplabsdef= (befriend, rbefriend).Acmplidle

+ (hit,>).Acmplabs

+ (attack,>).Acmplabs

Page 82: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 82/ 193

Synchronising Roland and the Accomplice

When there is an accomplice, he and Roland fight togetheragainst the enemy.

This involves some cooperation between them.

However we do not want to leave Roland vulnerable whenthere is no accomplice present because some of his actionsbecome blocked.

To prevent this we introduce a dummy componentrepresenting the absence of an accomplice.

In this state the accomplice component will passivelyparticipate in any attack which Roland makes.

Acmplabsdef= (befriend, rbefriend).Acmplidle

+ (hit,>).Acmplabs

+ (attack,>).Acmplabs

Page 83: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 83/ 193

Component for the Accomplice

Acmplidledef= (attack,>).Acmpl2

Acmpl2def= (a-hit, ra-hit).Acmplhit + (hit,>).Acmplidle

+ (miss, rmiss).Acmpl1+ (enemy-hit,>).Acmplabs

Acmpl1def= (a-hit, ra-hit).Acmplhit

+ (hit,>).(reload, ra-reload).Acmplidle

+ (miss, rmiss).Acmplempty

+ (enemy-hit,>).Acmplabs

Acmplhitdef= (enemy-die,>).(reload, ra-reload).Acmplidle

Acmplemptydef= (reload, ra-reload).Acmpl2+ (enemy-hit,>).Acmplabs

+ (hit,>).(reload, ra-reload).Acmplidle

Page 84: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 84/ 193

Parameter Settings for the Accomplice

parameter value explanation

rbefriend 0.001 Roland befriends a strangeronce every 1000 seconds

ra-fire 1.0 the accomplice can also fire onceper second

pa-hit-success 0.6 the accomplice has a 60 percentaccuracy

ra-hit 0.6 rfire × phit-success

ra-miss 0.4 rfire × (1.0− phit-success)ra-reload 0.25 it takes the accomplice 4 seconds

to reload

Page 85: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 85/ 193

Component for the Enemy

The component representing the enemy is similar to before.

Enemiesidledef= (attack, rattack).Enemiesattack

Enemiesattackdef= (enemy-hit, re-hit).Enemiesattack

+ (enemy-die, rdie).Enemiesidle

The system equation is as follows:

(Roland2 ��{attack,hit,a-hit,befriend}

Acmplabs) ��{attack,enemy-die,enemy-hit}

Enemiesidle

Page 86: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 86/ 193

Model Analysis

Steady-State Analysis

As before we can determine the probability that Roland isinvolved in a gun battle at an arbitrary time.

We could also determine the likelihood that Roland has anaccomplice at an arbitrary time.

Since Roland cannot perform a befriending action whilecurrently involved in a battle, the probabilty that Roland is insuch a battle clearly affects the probability that he is alone inhis quest.

So, for example, if Roland’s success rate is reduced then gunbattles will take longer to resolve, hence Roland will beinvolved in a gun battle more often, and therefore he willbefriend fewer accomplices.

Page 87: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 87/ 193

Model Analysis

Steady-State Analysis

As before we can determine the probability that Roland isinvolved in a gun battle at an arbitrary time.

We could also determine the likelihood that Roland has anaccomplice at an arbitrary time.

Since Roland cannot perform a befriending action whilecurrently involved in a battle, the probabilty that Roland is insuch a battle clearly affects the probability that he is alone inhis quest.

So, for example, if Roland’s success rate is reduced then gunbattles will take longer to resolve, hence Roland will beinvolved in a gun battle more often, and therefore he willbefriend fewer accomplices.

Page 88: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 88/ 193

Model Analysis

Steady-State Analysis

As before we can determine the probability that Roland isinvolved in a gun battle at an arbitrary time.

We could also determine the likelihood that Roland has anaccomplice at an arbitrary time.

Since Roland cannot perform a befriending action whilecurrently involved in a battle, the probabilty that Roland is insuch a battle clearly affects the probability that he is alone inhis quest.

So, for example, if Roland’s success rate is reduced then gunbattles will take longer to resolve, hence Roland will beinvolved in a gun battle more often, and therefore he willbefriend fewer accomplices.

Page 89: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 89/ 193

Model Analysis

Steady-State Analysis

As before we can determine the probability that Roland isinvolved in a gun battle at an arbitrary time.

We could also determine the likelihood that Roland has anaccomplice at an arbitrary time.

Since Roland cannot perform a befriending action whilecurrently involved in a battle, the probabilty that Roland is insuch a battle clearly affects the probability that he is alone inhis quest.

So, for example, if Roland’s success rate is reduced then gunbattles will take longer to resolve, hence Roland will beinvolved in a gun battle more often, and therefore he willbefriend fewer accomplices.

Page 90: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 90/ 193

Model Analysis

Transient Analysis

An example transient analysis would be to determine the expectedtime after Roland has set off before he meets his first accomplice.

Page 91: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 91/ 193

Model Analysis

Passage-Time Analysis

An example analysis would be to calculate the passage-timefrom an attack action until the death of the enemy or of theaccomplice.

Since all gun battles now end in the enemy being killedstopping the analysis there would give us the expectedduration of any one gun battle.

There is also the possibility to start the analysis from thebefriend action and stop it with the death of the accomplice.

Page 92: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 92/ 193

Model Analysis

Passage-Time Analysis

An example analysis would be to calculate the passage-timefrom an attack action until the death of the enemy or of theaccomplice.

Since all gun battles now end in the enemy being killedstopping the analysis there would give us the expectedduration of any one gun battle.

There is also the possibility to start the analysis from thebefriend action and stop it with the death of the accomplice.

Page 93: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 93/ 193

Model Analysis

Passage-Time Analysis

An example analysis would be to calculate the passage-timefrom an attack action until the death of the enemy or of theaccomplice.

Since all gun battles now end in the enemy being killedstopping the analysis there would give us the expectedduration of any one gun battle.

There is also the possibility to start the analysis from thebefriend action and stop it with the death of the accomplice.

Page 94: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 94/ 193

Hiding

Currently there is nothing in the model to stop an enemy fromdisrupting the interaction between Roland and his accomplice,e.g. by performing a befriend action.

One way to avoid this is to ‘hide’ those actions only Rolandand the accomplice should cooperate on.

To do this for our model we can simply change the systemequation:

((Roland2 ��L1

Acmpl)/L1) ��L2

Enemiesidle

where L1 = {hit, a-hit, befriend} andL2 = {attack, enemy-die, enemy-hit}.

Page 95: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 95/ 193

Hiding

Currently there is nothing in the model to stop an enemy fromdisrupting the interaction between Roland and his accomplice,e.g. by performing a befriend action.

One way to avoid this is to ‘hide’ those actions only Rolandand the accomplice should cooperate on.

To do this for our model we can simply change the systemequation:

((Roland2 ��L1

Acmpl)/L1) ��L2

Enemiesidle

where L1 = {hit, a-hit, befriend} andL2 = {attack, enemy-die, enemy-hit}.

Page 96: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Roland the Gunslinger 96/ 193

Hiding

Currently there is nothing in the model to stop an enemy fromdisrupting the interaction between Roland and his accomplice,e.g. by performing a befriend action.

One way to avoid this is to ‘hide’ those actions only Rolandand the accomplice should cooperate on.

To do this for our model we can simply change the systemequation:

((Roland2 ��L1

Acmpl)/L1) ��L2

Enemiesidle

where L1 = {hit, a-hit, befriend} andL2 = {attack, enemy-die, enemy-hit}.

Page 97: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Tools 97/ 193

Outline

1 Recap

2 Case Studies

3 Roland the Gunslinger

4 Tools

5 Web Service Composition

6 Querying models

Page 98: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Tools 98/ 193

The PEPA Eclipse Plug-in

Calculating by hand the transitions of a PEPA model andsubsequently expressing these in a form which was suitable forsolution was a tedious task prone to errors. The PEPA EclipsePlug-in relieves the modeller of this work.

Page 99: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Tools 99/ 193

The PEPA Eclipse Plug-in: functionality

The plug-in will report errors in the model function:

deadlock,

absorbing states,

static synchronisation mismatch (cooperations which do notinvolve active participants).

The plug-in also generates the transition graph of the model,computes the number of states, formulates the Markov processmatrix QQQ and communicates the matrix to a solver.

The plug-in provides a simple pattern language for selecting statesfrom the stationary distribution.

Page 100: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Tools 100/ 193

The PEPA Eclipse Plug-in: functionality

The plug-in will report errors in the model function:

deadlock,

absorbing states,

static synchronisation mismatch (cooperations which do notinvolve active participants).

The plug-in also generates the transition graph of the model,computes the number of states, formulates the Markov processmatrix QQQ and communicates the matrix to a solver.

The plug-in provides a simple pattern language for selecting statesfrom the stationary distribution.

Page 101: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Tools 101/ 193

The PEPA Eclipse Plug-in: functionality

The plug-in will report errors in the model function:

deadlock,

absorbing states,

static synchronisation mismatch (cooperations which do notinvolve active participants).

The plug-in also generates the transition graph of the model,computes the number of states, formulates the Markov processmatrix QQQ and communicates the matrix to a solver.

The plug-in provides a simple pattern language for selecting statesfrom the stationary distribution.

Page 102: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Tools 102/ 193

The PEPA Eclipse Plug-in processing the model

Page 103: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Tools 103/ 193

The PEPA website

http://www.dcs.ed.ac.uk/pepa

From the website the PEPA Eclipse Plug-in and some other toolsare available for download.

There is also information about people involved in the PEPAproject, projects undertaken and a collection of published papers.

Page 104: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Web Service Composition 104/ 193

Outline

1 Recap

2 Case Studies

3 Roland the Gunslinger

4 Tools

5 Web Service Composition

6 Querying models

Page 105: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Web Service Composition 105/ 193

Web Service Composition: Introduction

We consider an example of a business application which iscomposed from a number of offered web services.

A user accesses the application via an SMS message requestingdirections to the nearest facility (post-office, restaurant, bank etc.)and receives a response as an MMS message containing a map.

Since the application involves a users’ current location there is anaccess control issue since it must be ensured that the web serviceconsumer has the requisite authority to execute the web service itrequests.

Moreover the service provider imposes a restriction that only onerequest may be handled for each SMS message received.

Page 106: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Web Service Composition 106/ 193

Web Service Composition: Introduction

We consider an example of a business application which iscomposed from a number of offered web services.

A user accesses the application via an SMS message requestingdirections to the nearest facility (post-office, restaurant, bank etc.)and receives a response as an MMS message containing a map.

Since the application involves a users’ current location there is anaccess control issue since it must be ensured that the web serviceconsumer has the requisite authority to execute the web service itrequests.

Moreover the service provider imposes a restriction that only onerequest may be handled for each SMS message received.

Page 107: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Web Service Composition 107/ 193

Web Service Composition: Introduction

We consider an example of a business application which iscomposed from a number of offered web services.

A user accesses the application via an SMS message requestingdirections to the nearest facility (post-office, restaurant, bank etc.)and receives a response as an MMS message containing a map.

Since the application involves a users’ current location there is anaccess control issue since it must be ensured that the web serviceconsumer has the requisite authority to execute the web service itrequests.

Moreover the service provider imposes a restriction that only onerequest may be handled for each SMS message received.

Page 108: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Web Service Composition 108/ 193

Web Service Composition: Introduction

We consider an example of a business application which iscomposed from a number of offered web services.

A user accesses the application via an SMS message requestingdirections to the nearest facility (post-office, restaurant, bank etc.)and receives a response as an MMS message containing a map.

Since the application involves a users’ current location there is anaccess control issue since it must be ensured that the web serviceconsumer has the requisite authority to execute the web service itrequests.

Moreover the service provider imposes a restriction that only onerequest may be handled for each SMS message received.

Page 109: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Web Service Composition 109/ 193

Schematic view

WS componentfor SMS

ApplicationLogic

Session Manager

Location request

WS SMS notification

MMS deliveryLocation result

Start Session

SMS

End Session

Check request validity

Web Service Consumer

Web Service Provider

Policy Access Provider

WS componentfor MMS

WS componentfor location

Page 110: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Web Service Composition 110/ 193

Schematic view

1WS componentfor SMS

ApplicationLogic

Session Manager

Location request

WS SMS notification

MMS deliveryLocation result

Start Session

SMS

End Session

Check request validity

Web Service Consumer

Web Service Provider

Policy Access Provider

WS componentfor MMS

WS componentfor location

Page 111: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Web Service Composition 111/ 193

Schematic view

2

WS componentfor SMS

ApplicationLogic

Session Manager

Location request

WS SMS notification

MMS deliveryLocation result

Start Session

SMS

End Session

Check request validity

Web Service Consumer

Web Service Provider

Policy Access Provider

WS componentfor MMS

WS componentfor location

Page 112: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Web Service Composition 112/ 193

Schematic view

3

WS componentfor SMS

ApplicationLogic

Session Manager

Location request

WS SMS notification

MMS deliveryLocation result

Start Session

SMS

End Session

Check request validity

Web Service Consumer

Web Service Provider

Policy Access Provider

WS componentfor MMS

WS componentfor location

Page 113: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Web Service Composition 113/ 193

Schematic view

4

WS componentfor SMS

ApplicationLogic

Session Manager

Location request

WS SMS notification

MMS deliveryLocation result

Start Session

SMS

End Session

Check request validity

Web Service Consumer

Web Service Provider

Policy Access Provider

WS componentfor MMS

WS componentfor location

Page 114: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Web Service Composition 114/ 193

Schematic view

5

WS componentfor SMS

ApplicationLogic

Session Manager

Location request

WS SMS notification

MMS deliveryLocation result

Start Session

SMS

End Session

Check request validity

Web Service Consumer

Web Service Provider

Policy Access Provider

WS componentfor MMS

WS componentfor location

Page 115: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Web Service Composition 115/ 193

Schematic view

6

WS componentfor SMS

ApplicationLogic

Session Manager

Location request

WS SMS notification

MMS deliveryLocation result

Start Session

SMS

End Session

Check request validity

Web Service Consumer

Web Service Provider

Policy Access Provider

WS componentfor MMS

WS componentfor location

Page 116: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Web Service Composition 116/ 193

Schematic view

7

WS componentfor SMS

ApplicationLogic

Session Manager

Location request

WS SMS notification

MMS deliveryLocation result

Start Session

SMS

End Session

Check request validity

Web Service Consumer

Web Service Provider

Policy Access Provider

WS componentfor MMS

WS componentfor location

Page 117: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Web Service Composition 117/ 193

Schematic view

8WS component

for SMS

ApplicationLogic

Session Manager

Location request

WS SMS notification

MMS deliveryLocation result

Start Session

SMS

End Session

Check request validity

Web Service Consumer

Web Service Provider

Policy Access Provider

WS componentfor MMS

WS componentfor location

Page 118: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Web Service Composition 118/ 193

Schematic view

WS componentfor SMS

ApplicationLogic

Session Manager

Location request

WS SMS notification

MMS deliveryLocation result

Start Session

SMS

End Session

Check request validity

Web Service Consumer

Web Service Provider

Policy Access Provider

WS componentfor MMS

WS componentfor location

Page 119: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Web Service Composition 119/ 193

The PEPA model

The PEPA model of the system consists of four components:

The user;

The web service provider;

The web service consumer, and

The policy access provider.

The Web Service Provider consists of three distinct elements butthe web service consumer is associated with a session whichaccesses each element in sequence.

Concurrency is introduced into the model by allowing multiplesessions rather than by representing the constituent web servicesseparately.

Page 120: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Web Service Composition 120/ 193

The PEPA model

The PEPA model of the system consists of four components:

The user;

The web service provider;

The web service consumer, and

The policy access provider.

The Web Service Provider consists of three distinct elements butthe web service consumer is associated with a session whichaccesses each element in sequence.

Concurrency is introduced into the model by allowing multiplesessions rather than by representing the constituent web servicesseparately.

Page 121: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Web Service Composition 121/ 193

The PEPA model

The PEPA model of the system consists of four components:

The user;

The web service provider;

The web service consumer, and

The policy access provider.

The Web Service Provider consists of three distinct elements butthe web service consumer is associated with a session whichaccesses each element in sequence.

Concurrency is introduced into the model by allowing multiplesessions rather than by representing the constituent web servicesseparately.

Page 122: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Web Service Composition 122/ 193

The PEPA model

The PEPA model of the system consists of four components:

The user;

The web service provider;

The web service consumer, and

The policy access provider.

The Web Service Provider consists of three distinct elements butthe web service consumer is associated with a session whichaccesses each element in sequence.

Concurrency is introduced into the model by allowing multiplesessions rather than by representing the constituent web servicesseparately.

Page 123: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Web Service Composition 123/ 193

Component Customer

The customer’s behaviour is simply modelled with two local states.

Customerdef= (getSMS , r1).Customer1

Customer1def= (getMap,>).Customer

+ (get404 ,>).Customer

We associate the user-perceived system performance with thethroughput of the getMap action which can be calculated directlyfrom the steady state probability distribution of the underlyingMarkov chain.

Page 124: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Web Service Composition 124/ 193

Component Customer

The customer’s behaviour is simply modelled with two local states.

Customerdef= (getSMS , r1).Customer1

Customer1def= (getMap,>).Customer

+ (get404 ,>).Customer

We associate the user-perceived system performance with thethroughput of the getMap action which can be calculated directlyfrom the steady state probability distribution of the underlyingMarkov chain.

Page 125: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Web Service Composition 125/ 193

Component Customer

The customer’s behaviour is simply modelled with two local states.

Customerdef= (getSMS , r1).Customer1

Customer1def= (getMap,>).Customer

+ (get404 ,>).Customer

We associate the user-perceived system performance with thethroughput of the getMap action which can be calculated directlyfrom the steady state probability distribution of the underlyingMarkov chain.

Page 126: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Web Service Composition 126/ 193

Component WSConsumer

Once a session has been started, it initiates a request for the user’scurrent location and waits for a response.

For valid requests, location is returned and used to compute theappropriate map, which is then sent via an MMS message, usingthe web service.

WSConsumerdef= (notify ,>).WSConsumer2

WSConsumer2def= (locReq, r4).WSConsumer3

WSConsumer3def= (locRes,>).WSConsumer4

+ (locErr ,>).WSConsumer

WSConsumer4def= (compute, r7).WSConsumer5

WSConsumer5def= (sendMMS , r9).WSConsumer

Page 127: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Web Service Composition 127/ 193

Component WSConsumer

Once a session has been started, it initiates a request for the user’scurrent location and waits for a response.

For valid requests, location is returned and used to compute theappropriate map, which is then sent via an MMS message, usingthe web service.

WSConsumerdef= (notify ,>).WSConsumer2

WSConsumer2def= (locReq, r4).WSConsumer3

WSConsumer3def= (locRes,>).WSConsumer4

+ (locErr ,>).WSConsumer

WSConsumer4def= (compute, r7).WSConsumer5

WSConsumer5def= (sendMMS , r9).WSConsumer

Page 128: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Web Service Composition 128/ 193

Component WSConsumer

Once a session has been started, it initiates a request for the user’scurrent location and waits for a response.

For valid requests, location is returned and used to compute theappropriate map, which is then sent via an MMS message, usingthe web service.

WSConsumerdef= (notify ,>).WSConsumer2

WSConsumer2def= (locReq, r4).WSConsumer3

WSConsumer3def= (locRes,>).WSConsumer4

+ (locErr ,>).WSConsumer

WSConsumer4def= (compute, r7).WSConsumer5

WSConsumer5def= (sendMMS , r9).WSConsumer

Page 129: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Web Service Composition 129/ 193

Component WSProvider

The use of sessions restricts a user’s access to the services of theWeb Service Provider to be sequential.

We assume that there is a distinct instance of the componentWSProvider for each distinct session.

The checkValid action is represented twice, to capture the twopossible distinct outcomes of the action.

If the check is successful the location must be returned to theWeb Service Consumer in the form of a map (getMap).

If the check revealed an invalid request (locErr) then an errormust be returned to the Web Service Consumer (get404) andthe session terminated (stopSession).

Page 130: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Web Service Composition 130/ 193

Component WSProvider

The use of sessions restricts a user’s access to the services of theWeb Service Provider to be sequential.

We assume that there is a distinct instance of the componentWSProvider for each distinct session.

The checkValid action is represented twice, to capture the twopossible distinct outcomes of the action.

If the check is successful the location must be returned to theWeb Service Consumer in the form of a map (getMap).

If the check revealed an invalid request (locErr) then an errormust be returned to the Web Service Consumer (get404) andthe session terminated (stopSession).

Page 131: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Web Service Composition 131/ 193

Component WSProvider

The use of sessions restricts a user’s access to the services of theWeb Service Provider to be sequential.

We assume that there is a distinct instance of the componentWSProvider for each distinct session.

The checkValid action is represented twice, to capture the twopossible distinct outcomes of the action.

If the check is successful the location must be returned to theWeb Service Consumer in the form of a map (getMap).

If the check revealed an invalid request (locErr) then an errormust be returned to the Web Service Consumer (get404) andthe session terminated (stopSession).

Page 132: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Web Service Composition 132/ 193

Component WSProvider

The use of sessions restricts a user’s access to the services of theWeb Service Provider to be sequential.

We assume that there is a distinct instance of the componentWSProvider for each distinct session.

The checkValid action is represented twice, to capture the twopossible distinct outcomes of the action.

If the check is successful the location must be returned to theWeb Service Consumer in the form of a map (getMap).

If the check revealed an invalid request (locErr) then an errormust be returned to the Web Service Consumer (get404) andthe session terminated (stopSession).

Page 133: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Web Service Composition 133/ 193

Component WSProvider

The use of sessions restricts a user’s access to the services of theWeb Service Provider to be sequential.

We assume that there is a distinct instance of the componentWSProvider for each distinct session.

The checkValid action is represented twice, to capture the twopossible distinct outcomes of the action.

If the check is successful the location must be returned to theWeb Service Consumer in the form of a map (getMap).

If the check revealed an invalid request (locErr) then an errormust be returned to the Web Service Consumer (get404) andthe session terminated (stopSession).

Page 134: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Web Service Composition 134/ 193

Component WSProvider

WSProviderdef= (getSMS ,>).WSProvider2

WSProvider2def= (startSession, r2).WSProvider3

WSProvider3def= (notify , r3).WSProvider4

WSProvider4def= (locReq,>).WSProvider5

WSProvider5def= (checkValid , 99 · >).WSProvider6

+ (checkValid ,>).WSProvider10

Page 135: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Web Service Composition 135/ 193

Component WSProvider cont.

WSProvider6def= (locRes, r6).WSProvider7

WSProvider7def= (sendMMS ,>).WSProvider8

WSProvider8def= (getMap, r8).WSProvider9

WSProvider9def= (stopSession, r2).WSProvider

WSProvider10def= (locErr , r6).WSProvider11

WSProvider11def= (get404 , r8).WSProvider9

Page 136: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Web Service Composition 136/ 193

Component PAProvider

We consider a stateless implementation of the policy accessprovider.

PAProviderdef= (startSession,>).PAProvider

+ (checkValid , r5).PAProvider

+ (stopSession,>).PAProvider

Page 137: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Web Service Composition 137/ 193

Model Component WSComp

The complete system is composed of some number of instances ofthe components interacting on their shared activities:

WSCompdef=

((Customer [NC ] ��

L1WSProvider [NWSP ])

��L2

WSConsumer [NWSC ])

��L3

PAProvider [NPAP ]

where the cooperation sets are

L1 = {getSMS , getMap, get404}L2 = {notify , locReq, locRes, locErr , sendMMS}L3 = {startSession, checkValid , stopSession}

Page 138: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Web Service Composition 138/ 193

Parameter Values

param. value explanationr1 0.0010 rate customers request mapsr2 0.5 rate session can be startedr3 0.1 notification exchange between consumer and providerr4 0.1 rate requests for location can be satisfiedr5 0.05 rate the provider can check the validity of the requestr6 0.1 rate location information can be returned to consumerr7 0.05 rate maps can be generatedr8 0.02 rate MMS messages can be sent from provider to customerr9 10.0 ∗ r8 rate MMS messages can be sent via the Web Service

Page 139: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Web Service Composition 139/ 193

Steady State Analysis for System Tuning

Suppose that we want to design the system in such a way thatit can handle 30 independent customers.

Some parameters such as the network delays may beconstrained by the available technology.

However, there are a number of degrees of freedom which letus vary, for example, the number of threads of control of thecomponents of the system.

The aim of the analysis is to deliver a satisfactory service in acost-effective way.

The simplest example of a cost function may be a linearlydependency on the number of copies of a component or therate at which an activity is performed.

Page 140: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Web Service Composition 140/ 193

Steady State Analysis for System Tuning

Suppose that we want to design the system in such a way thatit can handle 30 independent customers.

Some parameters such as the network delays may beconstrained by the available technology.

However, there are a number of degrees of freedom which letus vary, for example, the number of threads of control of thecomponents of the system.

The aim of the analysis is to deliver a satisfactory service in acost-effective way.

The simplest example of a cost function may be a linearlydependency on the number of copies of a component or therate at which an activity is performed.

Page 141: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Web Service Composition 141/ 193

Steady State Analysis for System Tuning

Suppose that we want to design the system in such a way thatit can handle 30 independent customers.

Some parameters such as the network delays may beconstrained by the available technology.

However, there are a number of degrees of freedom which letus vary, for example, the number of threads of control of thecomponents of the system.

The aim of the analysis is to deliver a satisfactory service in acost-effective way.

The simplest example of a cost function may be a linearlydependency on the number of copies of a component or therate at which an activity is performed.

Page 142: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Web Service Composition 142/ 193

Steady State Analysis for System Tuning

Suppose that we want to design the system in such a way thatit can handle 30 independent customers.

Some parameters such as the network delays may beconstrained by the available technology.

However, there are a number of degrees of freedom which letus vary, for example, the number of threads of control of thecomponents of the system.

The aim of the analysis is to deliver a satisfactory service in acost-effective way.

The simplest example of a cost function may be a linearlydependency on the number of copies of a component or therate at which an activity is performed.

Page 143: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Web Service Composition 143/ 193

Steady State Analysis for System Tuning

Suppose that we want to design the system in such a way thatit can handle 30 independent customers.

Some parameters such as the network delays may beconstrained by the available technology.

However, there are a number of degrees of freedom which letus vary, for example, the number of threads of control of thecomponents of the system.

The aim of the analysis is to deliver a satisfactory service in acost-effective way.

The simplest example of a cost function may be a linearlydependency on the number of copies of a component or therate at which an activity is performed.

Page 144: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Web Service Composition 144/ 193

Throughput of the getMap action

0

0.002

0.004

0.006

0.008

0.01

0.012

0.014

0 5 10 15 20 25 30

Thr

ough

put g

etM

ap

Number of Customers

Number of WSProviders=1Number of WSProviders=2Number of WSProviders=3Number of WSProviders=4

As the number of customers varies between 1 and 30 for variousnumbers of copies of the WSProvider component.

Page 145: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Web Service Composition 145/ 193

Throughput of the getMap action

Under heavy load increasing the number of providers initiallyleads to a sharp increase in the throughput. However the gaindeteriorates so that the system with four copies is just 8.7%faster than the system with three.

In the following we settle on three copies of WSProvider .

Page 146: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Web Service Composition 146/ 193

Throughput of getMap action

0.002

0.004

0.006

0.008

0.01

0.012

0.014

0.016

0.018

0.02

0.022

0 0.005 0.01 0.015 0.02 0.025 0.03 0.035 0.04 0.045 0.05

Thr

ough

put g

etM

ap

Rate r1

Number of WSConsumers=1Number of WSConsumers=2Number of WSConsumers=3

As the request arrival rate (r1) varies for differing numbers ofWSConsumer .

Page 147: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Web Service Composition 147/ 193

Throughput of getMap action

Every line starts to plateau at approximately r1 = 0.010following an initial sharp increase. This suggests that the useris the bottle next in the system when the arrival rate is lower.Conversely, at high rates the system becomes congested.

Whilst having two copies of WSConsumer , corresponding totwo operating threads of control, improves performancesignificantly, the subsequent increase with three copies is lesspronounced.

So we set the number of copies of WSConsumer to 2.

Page 148: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Web Service Composition 148/ 193

Optimising the number of copies of PAProvider

Here we are particularly interested in the overall impact of therate at which the validity check is performed.

Slower rates may mean more computationally expensivevalidation.

Faster rates may involve less accuracy and lower security ofthe system.

Page 149: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Web Service Composition 149/ 193

Throughput of getMap action

0

0.002

0.004

0.006

0.008

0.01

0.012

0.014

0.016

0.018

0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11

Thr

ough

put g

etM

ap

Rate r5

Number of PAProviders=1Number of PAProviders=2Number of PAProviders=3

As the validity check rate (r5) varies for differing numbers ofPAProvider .

Page 150: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Web Service Composition 150/ 193

Throughput of getMap action

A sharp increase followed by a constant levelling off suggeststhat optimal rate values lie on the left of the plateau, as fasterrates do not improve the system considerably.

As for the optimal number of copies of PAProvider , deployingtwo copies rather than one dramatically increases the qualityof service of the overall system.

With a similar approach as previously discussed, the modellermay want to consider the trade-off between the cost of addinga third copy and the throughput increase.

Page 151: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Web Service Composition 151/ 193

An alternative design for PAProvider

The original design of PAProvider is stateless.

Any of its services can be called at any point, the correctnessof the system being guaranteed by implementation-specificconstraints such as session identifiers being uniquely assignedto the clients and passed as parameters of the method calls.

Alternatively we may consider a stateful implementation,modelled as a sequential component with three local states.

This implementation has the consequence that there cannever be more than NPAP WSProvider which have started asession with a PAProvider

Page 152: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Web Service Composition 152/ 193

An alternative design for PAProvider

The original design of PAProvider is stateless.

Any of its services can be called at any point, the correctnessof the system being guaranteed by implementation-specificconstraints such as session identifiers being uniquely assignedto the clients and passed as parameters of the method calls.

Alternatively we may consider a stateful implementation,modelled as a sequential component with three local states.

This implementation has the consequence that there cannever be more than NPAP WSProvider which have started asession with a PAProvider

Page 153: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Web Service Composition 153/ 193

Component PAProvider — Stateful Version

It maintains a thread for each session and carries out the validitycheck on behalf of the Web Service Provider.

PAProviderdef= (startSession,>).PAProvider2

PAProvider2def= (checkValid , r5).PAProvider3

PAProvider3def= (stopSession,>).PAProvider

Page 154: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Web Service Composition 154/ 193

Throughput of getMap action

0

0.002

0.004

0.006

0.008

0.01

0.012

0.014

0.016

0.018

0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11

Thr

ough

put g

etM

ap

Rate r5

Number of PAProviders=1Number of PAProviders=2Number of PAProviders=3

As the validity check rate (r5) varies for differing numbers ofPAProvider (stateful version).

Page 155: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Web Service Composition 155/ 193

Throughput of getMap action

In this case the incremental gain in adding more copies hasbecome more marked.

However, the modeller may want to prefer the original version,as three copies of the stateful provider deliver about as muchas the throughput of only one copy of the statelessimplementation.

Page 156: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Web Service Composition 156/ 193

Acknowledgements

The models of Roland the Gunslinger are due to Allan Clark andthe model of the web service composition is joint work with MircoTribastone.

Page 157: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Querying models 157/ 193

Outline

1 Recap

2 Case Studies

3 Roland the Gunslinger

4 Tools

5 Web Service Composition

6 Querying models

Page 158: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Querying models 158/ 193

Querying models

So far we have focussed on the construction of the model anddemonstrated the use of some particular examples to derivequantitative measures.

PEPA is complemented by a couple of formal approaches to querymodels.

stochastic model checking based on CSL formulae; and

(eXtended) stochastic probes within the PEPA model.

Page 159: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Querying models 159/ 193

Querying models

So far we have focussed on the construction of the model anddemonstrated the use of some particular examples to derivequantitative measures.

PEPA is complemented by a couple of formal approaches to querymodels.

stochastic model checking based on CSL formulae; and

(eXtended) stochastic probes within the PEPA model.

Page 160: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Querying models 160/ 193

Model checking

Model checking requires two inputs:

a description of the system, usually given in some high-levelmodelling formalism such as a process algebra description, ora Petri net;

a specification of one or more desired properties of the system,normally using termporal logics such as CTL (ComputationalTree Logic) or LTL (Linear-time Temporal Logic).

Page 161: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Querying models 161/ 193

Model checking

Model checking requires two inputs:

a description of the system, usually given in some high-levelmodelling formalism such as a process algebra description, ora Petri net;

a specification of one or more desired properties of the system,normally using termporal logics such as CTL (ComputationalTree Logic) or LTL (Linear-time Temporal Logic).

Page 162: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Querying models 162/ 193

Model checking

From the high-level description the model checker constructs alabelled transition system which captures all possible behaviours ofthe system.

The model checking algorithms then automatically verify whetheror not each property is satisfied in the system.

Page 163: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Querying models 163/ 193

Model checking

From the high-level description the model checker constructs alabelled transition system which captures all possible behaviours ofthe system.

The model checking algorithms then automatically verify whetheror not each property is satisfied in the system.

Page 164: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Querying models 164/ 193

Stochastic model checking

In stochastic model checking it is assumed that the labelledtransition system is a Continuous Time Markov Chain (CTMC).

This makes stochastic process algebras suitable high-level languagefor stochastic model checking.

The logic is also enhanced to query not just logical behaviour(whether some property is satisfied or not) but also quantifiedbehaviour (e.g. the probability that a property is satisfied at aparticular time).

Page 165: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Querying models 165/ 193

Stochastic model checking

In stochastic model checking it is assumed that the labelledtransition system is a Continuous Time Markov Chain (CTMC).

This makes stochastic process algebras suitable high-level languagefor stochastic model checking.

The logic is also enhanced to query not just logical behaviour(whether some property is satisfied or not) but also quantifiedbehaviour (e.g. the probability that a property is satisfied at aparticular time).

Page 166: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Querying models 166/ 193

Stochastic model checking

In stochastic model checking it is assumed that the labelledtransition system is a Continuous Time Markov Chain (CTMC).

This makes stochastic process algebras suitable high-level languagefor stochastic model checking.

The logic is also enhanced to query not just logical behaviour(whether some property is satisfied or not) but also quantifiedbehaviour (e.g. the probability that a property is satisfied at aparticular time).

Page 167: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Querying models 167/ 193

Model checking

There are two broad approaches to model checking:

Explicit state model checking (exhaustive exploration for allpossible states/executions): exact results obtained vianumerical computation.

Statistical model-checking (discrete event simulation andsampling over multiple runs): approximate results.

Page 168: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Querying models 168/ 193

PRISM model and model checking

Probabilistic model checking in PRISM is based on a CTMCand the logic CSL.

Formally the mapping from PEPA is based on the structuredoperational semantics, generating the underlying CTMC in theusual way.

In practice PEPA is an input language for PRISM with adirect mapping between PEPA components and theinteracting, reactive modules of the PRISM input language.

Note, however, that this places a restriction to havesynchronisations in which only one participant is active asPRISM cannot handle the apparent rate based calculations ofcooperation in PEPA.

Page 169: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Querying models 169/ 193

PRISM model and model checking

Probabilistic model checking in PRISM is based on a CTMCand the logic CSL.

Formally the mapping from PEPA is based on the structuredoperational semantics, generating the underlying CTMC in theusual way.

In practice PEPA is an input language for PRISM with adirect mapping between PEPA components and theinteracting, reactive modules of the PRISM input language.

Note, however, that this places a restriction to havesynchronisations in which only one participant is active asPRISM cannot handle the apparent rate based calculations ofcooperation in PEPA.

Page 170: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Querying models 170/ 193

PRISM model and model checking

Probabilistic model checking in PRISM is based on a CTMCand the logic CSL.

Formally the mapping from PEPA is based on the structuredoperational semantics, generating the underlying CTMC in theusual way.

In practice PEPA is an input language for PRISM with adirect mapping between PEPA components and theinteracting, reactive modules of the PRISM input language.

Note, however, that this places a restriction to havesynchronisations in which only one participant is active asPRISM cannot handle the apparent rate based calculations ofcooperation in PEPA.

Page 171: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Querying models 171/ 193

PRISM model and model checking

Probabilistic model checking in PRISM is based on a CTMCand the logic CSL.

Formally the mapping from PEPA is based on the structuredoperational semantics, generating the underlying CTMC in theusual way.

In practice PEPA is an input language for PRISM with adirect mapping between PEPA components and theinteracting, reactive modules of the PRISM input language.

Note, however, that this places a restriction to havesynchronisations in which only one participant is active asPRISM cannot handle the apparent rate based calculations ofcooperation in PEPA.

Page 172: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Querying models 172/ 193

The CSL logic

The syntax of CSL is as follows:

φ ::= true | a | ¬φ | φ ∧ φ |P∼p[φ UI φ] | S∼p[φ] |R∼r [I=t ] | R∼r [C≤t ] | R∼r [F φ] | R∼r [S]

where a is an atomic proposition, ∼∈ {<,≤,≥, >}, p ∈ [0, 1], I isan interval of R≥0 and r , t ∈ R≥0.

P and S are probabilistic operators which include a probabilisticbound ∼p.

R is a reward operator with a reward bound ∼ r .

Page 173: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Querying models 173/ 193

Probabilistic operators

A formula P∼p[φ UI φ] is true in a state s if the probability of theformula (φ UI φ) being satisfied from state s meets the bound ∼p.

A formula of type φ1 UI φ2 is an until formula.

It is true of a path σ through the state space if, for some timeinstant t ∈ I , at time t in the path σ the CSL subformula φ2 istrue and the subformula φ1 is true at all preceding time instants.

A formula S∼p[φ] is true in state s if the probability that theformula φ being satisfied in a steady state reached from state smeets the bound ∼p.

Page 174: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Querying models 174/ 193

Probabilistic operators

A formula P∼p[φ UI φ] is true in a state s if the probability of theformula (φ UI φ) being satisfied from state s meets the bound ∼p.

A formula of type φ1 UI φ2 is an until formula.

It is true of a path σ through the state space if, for some timeinstant t ∈ I , at time t in the path σ the CSL subformula φ2 istrue and the subformula φ1 is true at all preceding time instants.

A formula S∼p[φ] is true in state s if the probability that theformula φ being satisfied in a steady state reached from state smeets the bound ∼p.

Page 175: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Querying models 175/ 193

Probabilistic operators

A formula P∼p[φ UI φ] is true in a state s if the probability of theformula (φ UI φ) being satisfied from state s meets the bound ∼p.

A formula of type φ1 UI φ2 is an until formula.

It is true of a path σ through the state space if, for some timeinstant t ∈ I , at time t in the path σ the CSL subformula φ2 istrue and the subformula φ1 is true at all preceding time instants.

A formula S∼p[φ] is true in state s if the probability that theformula φ being satisfied in a steady state reached from state smeets the bound ∼p.

Page 176: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Querying models 176/ 193

The CSL Reward operator

The CSL reward operator R is used to express propertiesconcerning the expected value of rewards.

R∼r [I=t ] asserts that the expected value of the state reward attime instant t meets the bound ∼ r .

R∼r [C≤t ] refers to the expected reward accumulated up until t.

R∼r [F φ] asserts that the expected reward accumulated before astate satisfying φ is reached meets the bound ∼ r .

R∼r [S] asserts that the long-run/steady state expected rewardmeets the bound ∼ r .

Page 177: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Querying models 177/ 193

The CSL Reward operator

The CSL reward operator R is used to express propertiesconcerning the expected value of rewards.

R∼r [I=t ] asserts that the expected value of the state reward attime instant t meets the bound ∼ r .

R∼r [C≤t ] refers to the expected reward accumulated up until t.

R∼r [F φ] asserts that the expected reward accumulated before astate satisfying φ is reached meets the bound ∼ r .

R∼r [S] asserts that the long-run/steady state expected rewardmeets the bound ∼ r .

Page 178: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Querying models 178/ 193

The CSL Reward operator

The CSL reward operator R is used to express propertiesconcerning the expected value of rewards.

R∼r [I=t ] asserts that the expected value of the state reward attime instant t meets the bound ∼ r .

R∼r [C≤t ] refers to the expected reward accumulated up until t.

R∼r [F φ] asserts that the expected reward accumulated before astate satisfying φ is reached meets the bound ∼ r .

R∼r [S] asserts that the long-run/steady state expected rewardmeets the bound ∼ r .

Page 179: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Querying models 179/ 193

The CSL Reward operator

The CSL reward operator R is used to express propertiesconcerning the expected value of rewards.

R∼r [I=t ] asserts that the expected value of the state reward attime instant t meets the bound ∼ r .

R∼r [C≤t ] refers to the expected reward accumulated up until t.

R∼r [F φ] asserts that the expected reward accumulated before astate satisfying φ is reached meets the bound ∼ r .

R∼r [S] asserts that the long-run/steady state expected rewardmeets the bound ∼ r .

Page 180: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Querying models 180/ 193

The CSL Reward operator

The CSL reward operator R is used to express propertiesconcerning the expected value of rewards.

R∼r [I=t ] asserts that the expected value of the state reward attime instant t meets the bound ∼ r .

R∼r [C≤t ] refers to the expected reward accumulated up until t.

R∼r [F φ] asserts that the expected reward accumulated before astate satisfying φ is reached meets the bound ∼ r .

R∼r [S] asserts that the long-run/steady state expected rewardmeets the bound ∼ r .

Page 181: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Querying models 181/ 193

Computation in PRISM

The underlying computation in PRISM for explicit state modelchecking involves a combination of:

graph-theoretical algorithms, for conventional temporal logicmodel checking and qualitative probabilistic modelchecking;

numerical computation, for quantitative probabilistic modelchecking, i.e. calculation of probabilities and rewardvalues.

Page 182: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Querying models 182/ 193

Statistical model checking

The basic idea of statistical model checking is to simulate thesystem for finitely many runs, and use statistics to infer whetherthe samples provide evidence for the satisfaction or violation of theproperty of interest.

Page 183: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Querying models 183/ 193

Advantages of statistical model checking

Much larger models can be handled since the state space doesnot need to be constructed and stored all at once.

Since the approach is based on observations and samples itcan be applied to any system which is executable — theunderlying stochastic process does not need to be a CTMC.

Since many independent samples are required it is susceptibleto coarse-grained parallelization.

Page 184: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Querying models 184/ 193

Advantages of statistical model checking

Much larger models can be handled since the state space doesnot need to be constructed and stored all at once.

Since the approach is based on observations and samples itcan be applied to any system which is executable — theunderlying stochastic process does not need to be a CTMC.

Since many independent samples are required it is susceptibleto coarse-grained parallelization.

Page 185: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Querying models 185/ 193

Advantages of statistical model checking

Much larger models can be handled since the state space doesnot need to be constructed and stored all at once.

Since the approach is based on observations and samples itcan be applied to any system which is executable — theunderlying stochastic process does not need to be a CTMC.

Since many independent samples are required it is susceptibleto coarse-grained parallelization.

Page 186: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Querying models 186/ 193

Advantages of statistical model checking

Much larger models can be handled since the state space doesnot need to be constructed and stored all at once.

Since the approach is based on observations and samples itcan be applied to any system which is executable — theunderlying stochastic process does not need to be a CTMC.

Since many independent samples are required it is susceptibleto coarse-grained parallelization.

These advantages are off-set by the disadvantage that is it anapproximation compared with the exact, explicit state approach.

Page 187: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Querying models 187/ 193

General framework

Consider a CTMC X and a property φ.

An execution or run of X is a, possibly infinite, sequence of statesin X .

We wish to decide P∼p[φ], i.e. whether X satisfies φ withprobability satisfying the bound ∼ p.

The result of each execution is taken to be the result of a Bernoullitrial, 0 or 1, according to whether φ is satisfied or not.

Let q be the probability that φ is satisfied, then we seek toestablish if q ∼ p.

Page 188: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Querying models 188/ 193

General framework

Consider a CTMC X and a property φ.

An execution or run of X is a, possibly infinite, sequence of statesin X .

We wish to decide P∼p[φ], i.e. whether X satisfies φ withprobability satisfying the bound ∼ p.

The result of each execution is taken to be the result of a Bernoullitrial, 0 or 1, according to whether φ is satisfied or not.

Let q be the probability that φ is satisfied, then we seek toestablish if q ∼ p.

Page 189: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Querying models 189/ 193

General framework

Consider a CTMC X and a property φ.

An execution or run of X is a, possibly infinite, sequence of statesin X .

We wish to decide P∼p[φ], i.e. whether X satisfies φ withprobability satisfying the bound ∼ p.

The result of each execution is taken to be the result of a Bernoullitrial, 0 or 1, according to whether φ is satisfied or not.

Let q be the probability that φ is satisfied, then we seek toestablish if q ∼ p.

Page 190: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Querying models 190/ 193

General framework

Consider a CTMC X and a property φ.

An execution or run of X is a, possibly infinite, sequence of statesin X .

We wish to decide P∼p[φ], i.e. whether X satisfies φ withprobability satisfying the bound ∼ p.

The result of each execution is taken to be the result of a Bernoullitrial, 0 or 1, according to whether φ is satisfied or not.

Let q be the probability that φ is satisfied, then we seek toestablish if q ∼ p.

Page 191: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Querying models 191/ 193

General framework

Consider a CTMC X and a property φ.

An execution or run of X is a, possibly infinite, sequence of statesin X .

We wish to decide P∼p[φ], i.e. whether X satisfies φ withprobability satisfying the bound ∼ p.

The result of each execution is taken to be the result of a Bernoullitrial, 0 or 1, according to whether φ is satisfied or not.

Let q be the probability that φ is satisfied, then we seek toestablish if q ∼ p.

Page 192: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Querying models 192/ 193

Schematic for statistical model checking

Generation

Verification

Analysis

?

a path

?

update estimator

?

enough paths

more pathsneeded

- � high-level model

� property

� reliability parameters

Page 193: SPA for quantitative analysis: Lecture 3 Case Studies and ...homepages.inf.ed.ac.uk/jeh/biss2013/biss_lecture3.pdfSPA for quantitative analysis: Lecture 3 | Case Studies and Tools

Querying models 193/ 193

References

A. Clark, S. Gilmore, J. Hillston, and M. Tribastone, chapterStochastic Process Algebras, in Formal Methods forPerformance Evaluation: 7th Intl. School on Formal Methodsfor the Design of Computer, Communication, and SoftwareSystems, SFM 2007, LNCS 4486, pages 132-179.Springer-Verlag, Bertinoro, Italy, May-June 2007.

http://www.dcs.ed.ac.uk/pepa/

http://www.prismmodelchecker.org/