uppaal smc: statistical model checking for stochastic hybrid systems af marius mikučionis, ciss/aau

28
UPPAAL SMC: Statistical Model Checking for Stochastic Hybrid Systems Alexandre David Dehui Du Kim G. Larsen Axel Legay Marius Mikucionis Danny Bøgsted Poulsen Sean Sedwards Arne Skou

Upload: infinit-innovationsnetvaerket-for-it

Post on 19-Jan-2015

779 views

Category:

Documents


2 download

DESCRIPTION

Oplægget blev holdt ved et seminar i InfinIT-interessegruppen Softwaretest afholdt den 13. november 2012. Læs mere om interessegruppen her: http://infinit.dk/dk/interessegrupper/softwaretest/softwaretest.htm

TRANSCRIPT

Page 1: UPPAAL SMC: Statistical Model Checking for Stochastic Hybrid Systems af Marius Mikučionis, CISS/AAU

UPPAAL SMC:Statistical Model Checking

for Stochastic Hybrid Systems

Alexandre DavidDehui Du

Kim G. LarsenAxel Legay

Marius MikucionisDanny Bøgsted Poulsen

Sean SedwardsArne Skou

Page 2: UPPAAL SMC: Statistical Model Checking for Stochastic Hybrid Systems af Marius Mikučionis, CISS/AAU

Outline

• Overview of UPPAAL flavors• Modeling language• Model-checking technology• Properties and results• Some case studies

2

Page 3: UPPAAL SMC: Statistical Model Checking for Stochastic Hybrid Systems af Marius Mikučionis, CISS/AAU

UPPAAL/SMCAbstract Model Query

UPPAAL TIGA

SystemImplementation

Engineering Processes

UPPAAL/SMC QueryDetailed Model

UPPAAL ECDAR

UPPAAL TRON

3

propertysatisfyDoes ?

Page 4: UPPAAL SMC: Statistical Model Checking for Stochastic Hybrid Systems af Marius Mikučionis, CISS/AAU

UPPAAL flavors• “Classical” UPPAAL – model-checking:

– M ⊨ φ ⇒ true/false, counterexample trace• UPPAAL SMC – statistical model-checking:

– M Pr⊨ t≤T φ ⇒ probability estimate, distribution

• UPPAAL TIGA – controller synthesis: – S(P C) ∥ ⊨ φ ⇒ control strategy: state → action

• UPPAAL ECDAR – refinement checking: – C ≤ A ⇒ true/false, counterexample trace

• UPPAAL TRON – conformance testing: – T(IUT) T(M) ⊆ ⇒ pass/fail/inconc., diagnostics

4

Page 5: UPPAAL SMC: Statistical Model Checking for Stochastic Hybrid Systems af Marius Mikučionis, CISS/AAU

UPPAAL-SMC – Architecture

Graphical Interface

Editor

Simulator

Verifier

Plot composer

Stochastic EngineHypothesis

TestingProbability Evaluation

Probability Comparison

Simulation Engine

Dataprocessing

engineCompiler

Virtual Machine

ExecutionEngine

Server

5

Page 6: UPPAAL SMC: Statistical Model Checking for Stochastic Hybrid Systems af Marius Mikučionis, CISS/AAU

Stochastic Semantics of UPPAAL TAUniform Distribution

6

Page 7: UPPAAL SMC: Statistical Model Checking for Stochastic Hybrid Systems af Marius Mikučionis, CISS/AAU

Stochastic Semantics of UPPAAL TAExponential Distribution

Input enabledbroadcast channels

Composition =Repeated races between components

7

Page 8: UPPAAL SMC: Statistical Model Checking for Stochastic Hybrid Systems af Marius Mikučionis, CISS/AAU

Statistical Model-Checking

1. Generate random runs– According to a stochastic semantics

2. Monitor the runs accept/reject– LTL/MITL formula, monitor

3. Use statistical methods to derive results– Guaranteed with specified confidence– Probabilities, distributions, hypothesis testing

8

Page 9: UPPAAL SMC: Statistical Model Checking for Stochastic Hybrid Systems af Marius Mikučionis, CISS/AAU

Queries: Syntax• Hypothesis testingPr[<=100](<> expr)>=0.1x<=100 #<=50 [] expr <=0.5

• EvaluationPr[<=100](<> expr)

• ComparisonPr[<=20](<> e1)>=Pr[<=20](<> e2)

• Expected valueE[<=10;1000](min: expr)Explicit number of runs. Min or max.

• Simulationssimulate 10 [<=100]{expr1,expr2}

9

Page 10: UPPAAL SMC: Statistical Model Checking for Stochastic Hybrid Systems af Marius Mikučionis, CISS/AAU

Queries: Syntax• Hypothesis testingPr[<=100](<> expr)>=0.1x<=100 #<=50 [] expr <=0.5

• EvaluationPr[<=100](<> expr)

• ComparisonPr[<=20](<> e1)>=Pr[<=20](<> e2)

• Expected valueE[<=10;1000](min: expr)Explicit number of runs. Min or max.

• Simulationssimulate 10 [<=100]{expr1,expr2}

10

Page 11: UPPAAL SMC: Statistical Model Checking for Stochastic Hybrid Systems af Marius Mikučionis, CISS/AAU

Queries in UPPAAL SMC

11

Pr[ <= 200](<> Train(5).Cross)

++precision

Page 12: UPPAAL SMC: Statistical Model Checking for Stochastic Hybrid Systems af Marius Mikučionis, CISS/AAU

Queries: Syntax• Hypothesis testingPr[<=100](<> expr)>=0.1x<=100 #<=50 [] expr <=0.5

• EvaluationPr[<=100](<> expr)

• ComparisonPr[<=20](<> e1) >= Pr[<=20](<> e2)

• Expected valueE[<=10;1000](min: expr)Explicit number of runs. Min or max.

• Simulationssimulate 10 [<=100]{expr1,expr2}

12

Page 13: UPPAAL SMC: Statistical Model Checking for Stochastic Hybrid Systems af Marius Mikučionis, CISS/AAU

Distribution for Comparisons

13

Page 14: UPPAAL SMC: Statistical Model Checking for Stochastic Hybrid Systems af Marius Mikučionis, CISS/AAU

Queries: Syntax

• Hypothesis testingPr[<=100](<> expr)>=0.1x<=100 #<=50 [] expr <=0.5

• EvaluationPr[<=100](<> expr)

• ComparisonPr[<=20](<> e1)>=Pr[<=20](<> e2)

• Expected valueE[<=10;1000](min: expr)Explicit number of runs. Min or max.

• Simulationssimulate 10 [<=100]{expr1,expr2}

14

Page 15: UPPAAL SMC: Statistical Model Checking for Stochastic Hybrid Systems af Marius Mikučionis, CISS/AAU

Queries in UPPAAL SMC

15

simulate 1 [<=100]{ Gate.len }

simulate 10 [<=100]{ Gate.len }

Pr[<=100](<> t > 5 && Gate.len < 3) [0.58,0.69]

Pr[<=100](<> t > 14 && Gate.len < 3) [0.08,0.19]

Page 16: UPPAAL SMC: Statistical Model Checking for Stochastic Hybrid Systems af Marius Mikučionis, CISS/AAU

17

SMC in UPPAAL• Stochastic hybrid automata

– Clocks may have different slopes in different locations, integer/float or expressions involving clocks ODEs.

– Branching edges with discrete probabilities (weights).– Beyond DTMC, beyond CTMC.

• All features of UPPAAL supported– User defined functions and types– Expressions in guards, invariants, clock-rates, delay-

rates (rationals), and weights.• New GUI for plot-composing and exporting.

Invariants:x’==0 && y’==function() &&z’==2*x+cos(y)

Page 17: UPPAAL SMC: Statistical Model Checking for Stochastic Hybrid Systems af Marius Mikučionis, CISS/AAU

SMC in UPPAAL• Stochastic hybrid automata

– Clocks may have different slopes in different locations, integer/float or expressions involving clocks ODEs.

– Branching edges with discrete probabilities (weights).– Beyond DTMC, beyond CTMC.

• All features of UPPAAL supported– User defined functions and types– Expressions in guards, invariants, clock-rates, delay-

rates (rationals), and weights.• New GUI for plot-composing and exporting.

18

Page 18: UPPAAL SMC: Statistical Model Checking for Stochastic Hybrid Systems af Marius Mikučionis, CISS/AAU

19

SMC in UPPAAL• Stochastic hybrid automata

– Clocks may have different slopes in different locations, integer/float or expressions involving clocks ODEs.

– Branching edges with discrete probabilities (weights).– Beyond DTMC, beyond CTMC.

• All features of UPPAAL supported– User defined functions and types– Expressions in guards, invariants, clock-rates, delay-

rates (rationals), and weights.• New GUI for plot-composing and exporting.

Page 19: UPPAAL SMC: Statistical Model Checking for Stochastic Hybrid Systems af Marius Mikučionis, CISS/AAU

20

SMC in UPPAAL• Stochastic hybrid automata

– Clocks may have different slopes in different locations, integer/float or expressions involving clocks ODEs.

– Branching edges with discrete probabilities (weights).– Beyond DTMC, beyond CTMC.

• All features of UPPAAL supported– User defined functions and types– Expressions in guards, invariants, clock-rates, delay-

rates (rationals), and weights.• New GUI for plot-composing and exporting.

Page 20: UPPAAL SMC: Statistical Model Checking for Stochastic Hybrid Systems af Marius Mikučionis, CISS/AAU

Estimating Energy Consumption

21

ListeningIdle

ReceivingSending

1 1

x==L

x=0x==2

1:10 x<=L

x<=S

x=0

x<=2

x=0

energy1' == (sum(i:id_t) power1[i])&&energy2' == sum(i:id_t) power2[i]

MonitorMinimum, maximum, average: 125.762, 327.947, 226.452.Probability sums: 1 displayed, 0 remaining.Runs: 738 in total, 738 displayed, 0 remaining.

averagedensity

energy1

pro

babili

ty d

ensi

ty

0

0.002

0.004

0.006

0.008

0.010

125 158 191 224 257 290 323

Probability Density Distribution

Pr[energy1<=1000](<> time==100)

ListeningIdle

ReceivingSending

x<=L

11

x==L

power=2power=4

x==2

1:10

x<=2

x=0,power=1

x=0

x<=S

power=0

x=0,power=4

Page 21: UPPAAL SMC: Statistical Model Checking for Stochastic Hybrid Systems af Marius Mikučionis, CISS/AAU

A Biological Oscillator • Circadian rhythm oscillator.

N. Barkai and S. Leibler. Biological rhythms: Circadian clocks limited by noise. Nature, 403:267–268, 2000

• Two ways to model:1. Stochastic model that follow the reactions.2. Dynamical model solving the ODEs.

• Analysis:– Evaluate time between peaks.– The continuous model is the limit behavior of the

stochastic model.– Use frequency analysis for comparison. 22

Page 22: UPPAAL SMC: Statistical Model Checking for Stochastic Hybrid Systems af Marius Mikučionis, CISS/AAU

Stochastic Model

23

Page 23: UPPAAL SMC: Statistical Model Checking for Stochastic Hybrid Systems af Marius Mikučionis, CISS/AAU

Continuous Model

24

Page 24: UPPAAL SMC: Statistical Model Checking for Stochastic Hybrid Systems af Marius Mikučionis, CISS/AAU

Results of Simulations

25

Page 25: UPPAAL SMC: Statistical Model Checking for Stochastic Hybrid Systems af Marius Mikučionis, CISS/AAU

Time Between Peaks

• MITL formula for peak:true U[<=1000] (A>1100 &

true U[<=5] A<=1000).• Generate monitors.• Run SMC.

27

1100

10005

Page 26: UPPAAL SMC: Statistical Model Checking for Stochastic Hybrid Systems af Marius Mikučionis, CISS/AAU

Energy Aware Buildings

• Rooms to be heated.– Only one heater available.– Matrix of coefficients for heat transfer between

rooms.

– Local and central controllers– Environment temperature weather model.– User profiles

28

Page 27: UPPAAL SMC: Statistical Model Checking for Stochastic Hybrid Systems af Marius Mikučionis, CISS/AAU

31

Other Case Studies

FIREWIRE BLUETOOTH

LMAC for Wireless Sensor Networks Herschel-Planck Satellite schedulability analysis

Page 28: UPPAAL SMC: Statistical Model Checking for Stochastic Hybrid Systems af Marius Mikučionis, CISS/AAU

Conclusions• Symbolic MC proves hard properties: true/false• Statistical MC measures performance: Pr over time/cost• SMC ingredients:

– Stochastic modeling extensions– Compatible stochastic semantics– Support for dynamical equations– Statistical methods for confidence intervals

• Case-studies:– Biology.– Communication protocols.– Temperature controllers.– Disproving schedulability

Extend the application domains of MC/SMC. 32