model checking continuous time markov chains
play

Model Checking Continuous-Time Markov Chains Joost-Pieter Katoen - PowerPoint PPT Presentation

Model Checking Continuous-Time Markov Chains Joost-Pieter Katoen Software Modeling and Verification Group RWTH Aachen University associated to University of Twente, Formal Methods and Tools Lecture at MOVEP Summerschool, July 1, 2010 c


  1. Checking probabilistic reachability = P J (Φ U � h Ψ) if and only if Pr( s | = Φ U � h Ψ) ∈ J • s | = Φ U � h Ψ) is the least solution of: • Pr( s | (Hansson & Jonsson, 1990) – 1 if s | = Ψ – for h > 0 and s | = Φ ∧ ¬ Ψ : X P ( s, s ′ ) · Pr( s ′ | = Φ U � h − 1 Ψ) s ′∈ S – 0 otherwise • Standard reachability for P > 0 (Φ U � h Ψ) and P � 1 (Φ U � h Ψ) – for efficiency reasons (avoiding solving system of linear equations) � JPK c 27

  2. Reduction to transient analysis • Make all Ψ - and all ¬ (Φ ∨ Ψ) -states absorbing in D • Check ✸ = h Ψ in the obtained DTMC D ′ • This is a standard transient analysis in D ′ : X s { π ∈ Paths ( s ) | σ [ h ] = s ′ } Pr s ′| =Ψ – compute by ( P ′ ) h · ι Ψ where ι Ψ is the characteristic vector of Sat (Ψ) ⇒ Matrix-vector multiplication � JPK c 28

  3. Time complexity For finite DTMC D and PCTL formula Φ , D | = Φ can be solved in time � � O poly ( |D| ) · n max · | Φ | where n max = max { n | Ψ 1 U � n Ψ 2 occurs in Φ } with max ∅ = 1 � JPK c 29

  4. The qualitative fragment of PCTL • For a ∈ AP : � � � � � � a � Φ ∧ Φ � ¬ Φ � P > 0 ( ϕ ) � P =1 ( ϕ ) Φ ::= true � � Φ 1 U Φ 2 ϕ ::= X Φ • The probability bounds = 0 and < 1 can be derived: P =0 ( ϕ ) ≡ ¬ P > 0 ( ϕ ) and P < 1 ( ϕ ) ≡ ¬ P =1 ( ϕ ) • No bounded until, and only > 0 , = 0 , > 1 and = 1 intervals so: P =1 ( ✸ P > 0 ( X a )) and P < 1 ( P > 0 ( ✸ a ) U b ) are qualitative PCTL formulas � JPK c 30

  5. Qualitative PCTL versus CTL • There is no CTL-formula that is equivalent to P =1 ( ✸ a ) • There is no CTL-formula that is equivalent to P > 0 ( ✷ a ) • There is no qualitative PCTL-formula that is equivalent to ∀ ✸ a • There is no qualitative PCTL-formula that is equivalent to ∃ ✷ a ⇒ PCTL with ∀ ϕ and ∃ ϕ is more expressive than PCTL � JPK c 31

  6. Content of this lecture • Introduction – motivation, DTMCs, PCTL model checking ⇒ Negative exponential distribution – definition, usage, properties • Continuous-time Markov chains – definition, semantics, examples • Performance measures – transient and steady-state probabilities, uniformization � JPK c 32

  7. Time in DTMCs • Time in a DTMC proceeds in discrete steps • Two possible interpretations – accurate model of (discrete) time units ∗ e.g., clock ticks in model of an embedded device – time-abstract ∗ no information assumed about the time transitions take • Continuous-time Markov chains (CTMCs) – dense model of time – transitions can occur at any (real-valued) time instant – modelled using negative exponential distributions � JPK c 33

  8. Continuous random variables • X is a random variable (r.v., for short) – on a sample space with probability measure Pr – assume the set of possible values that X may take is dense • X is continuously distributed if there exists a function f ( x ) such that: � d Pr { X � d } = f ( x ) dx for each real number d −∞ � ∞ where f satisfies: f ( x ) � 0 f ( x ) dx = 1 for all x and −∞ – F X ( d ) = Pr { X � d } is the (cumulative) probability distribution function – f ( x ) is the probability density function � JPK c 34

  9. Negative exponential distribution The density of an exponentially distributed r.v. Y with rate λ ∈ R > 0 is: f Y ( x ) = λ · e − λ · x for x > 0 and f Y ( x ) = 0 otherwise The cumulative distribution of Y : � d λ · e − λ · x dx = [ − e − λ · x ] d 0 = 1 − e − λ · d F Y ( d ) = 0 R ∞ x · λ · e − λ · x dx = 1 • expectation E [ Y ] = 0 λ 1 • variance Var [ Y ] = λ 2 the rate λ ∈ R > 0 uniquely determines an exponential distribution. � JPK c 35

  10. Exponential pdf and cdf 1.5 1 λ = 0.5 1.4 0.9 λ = 1.0 1.3 λ = 1.5 1.2 0.8 1.1 0.7 1 0.9 0.6 0.8 0.5 0.7 0.6 0.4 0.5 0.3 0.4 0.3 0.2 λ = 0.5 λ = 1.0 0.2 λ = 1.5 0.1 0.1 0 0 0 1 2 3 4 5 0 1 2 3 4 5 the higher λ , the faster the cdf approaches 1 � JPK c 36

  11. Why exponential distributions? • Are adequate for many real-life phenomena – the time until a radioactive particle decays – the time between successive car accidents – inter-arrival times of jobs, telephone calls in a fixed interval • Are the continuous counterpart of geometric distribution • Heavily used in physics, performance, and reliability analysis • Can approximate general distributions arbitrarily closely • Yield a maximal entropy if only the mean is known � JPK c 37

  12. Memoryless property For any random variable X with an exponential distribution: 1. Pr { X > t + d | X > t } = Pr { X > d } for any t, d ∈ R � 0 . 2. Any continuous distribution which is memoryless is an exponential one. Proof of 1. : Let λ be the rate of X ’s distribution. Then we derive: Pr { X > t + d | X > t } = Pr { X > t + d ∩ X > t } = Pr { X > t + d } Pr { X > t } Pr { X > t } = e − λ · ( t + d ) = e − λ · d = Pr { X > d } . e − λ · t Proof of 2. : by contradiction, using the total law of probability. � JPK c 38

  13. Closure under minimum For independent, exponentially distributed random variables X and Y with rates λ, µ ∈ R > 0 , r.v. min( X, Y ) is exponentially distributed with rate λ + µ , i.e.,: Pr { min( X, Y ) � t } = 1 − e − ( λ + µ ) · t for all t ∈ R � 0 � JPK c 39

  14. Proof Let λ ( µ ) be the rate of X ’s ( Y ’s) distribution. Then we derive: Pr { min( X, Y ) � t } = Pr X,Y { ( x, y ) ∈ R 2 � 0 | min( x, y ) � t } Z ∞ „Z ∞ « I min( x,y ) � t ( x, y ) · λe − λx · µe − µy dy = dx 0 0 Z t Z ∞ Z t Z ∞ λe − λx · µe − µy dy dx + λe − λx · µe − µy dx dy = 0 x 0 y Z t Z t λe − λx · e − µx dx + e − λy · µe − µy dy = 0 0 Z t Z t λe − ( λ + µ ) x dx + µe − ( λ + µ ) y dy = 0 0 Z t ( λ + µ ) · e − ( λ + µ ) z dz = 1 − e − ( λ + µ ) t = 0 � JPK c 40

  15. Winning the race with two competitors For independent, exponentially distributed random variables X and Y with rates λ, µ ∈ R > 0 , it holds: λ Pr { X � Y } = λ + µ � JPK c 41

  16. Proof Let λ ( µ ) be the rate of X ’s ( Y ’s) distribution. Then we derive: Pr { X � Y } = Pr X,Y { ( x, y ) ∈ R 2 � 0 | x � y } Z ∞ „Z y « λe − λx dx µe − µy = dy 0 0 Z ∞ µe − µy “ 1 − e − λy ” = dy 0 Z ∞ Z ∞ µe − µy · e − λy dy = 1 − µe − ( µ + λ ) y dy = 1 − 0 0 Z ∞ µ ( µ + λ ) e − ( µ + λ ) y dy = 1 − µ + λ · 0 | {z } =1 µ λ = 1 − µ + λ = µ + λ � JPK c 42

  17. Winning the race with many competitors For independent, exponentially distributed random variables X 1 , X 2 , . . . , X n with rates λ 1 , . . . , λ n ∈ R > 0 , it holds: λ i Pr { X i = min( X 1 , . . . , X n ) } = P n j =1 λ j � JPK c 43

  18. Content of this lecture • Introduction – motivation, DTMCs, PCTL model checking • Negative exponential distribution – definition, usage, properties ⇒ Continuous-time Markov chains – definition, semantics, examples • Performance measures – transient and steady-state probabilities, uniformization � JPK c 44

  19. Continuous-time Markov chain A continuous-time Markov chain (CTMC) is a tuple ( S, P , r, L ) where: • S is a countable (today: finite) set of states • P : S × S → [0 , 1] , a stochastic matrix – P ( s, s ′ ) is one-step probability of going from state s to state s ′ – s is called absorbing iff P ( s, s ) = 1 • r : S → R > 0 , the exit-rate function – r ( s ) is the rate of exponential distribution of residence time in state s ⇒ a CTMC is a Kripke structure with random state residence times � JPK c 45

  20. Continuous-time Markov chain a CTMC ( S, P , r, L ) is a DTMC plus an exit-rate function r : S → R > 0 1 4 2 2 s u t 1 1 2 2 5 1 2 1 2 1 00 v 1 1 the average residence time in state s is r ( s ) � JPK c 46

  21. A classical (though equivalent) perspective a CTMC is a triple ( S, R , L ) with R ( s, s ′ ) = P ( s, s ′ ) · r ( s ) 2 s u t 25 2 2 25 2 2 v 100 � JPK c 47

  22. CTMC semantics: example • Transition s → s ′ := r.v. X s,s ′ with rate R ( s, s ′ ) • Probability to go from state s 0 to, say, state s 2 is: Pr { X s 0 ,s 2 � X s 0 ,s 1 ∩ X s 0 ,s 2 � X s 0 ,s 3 } = R ( s 0 , s 1 ) + R ( s 0 , s 2 ) + R ( s 0 , s 3 ) = R ( s 0 , s 2 ) R ( s 0 , s 2 ) r ( s 0 ) • Probability of staying at most t time in s 0 is: Pr { min( X s 0 ,s 1 , X s 0 ,s 2 , X s 0 ,s 3 ) � t } = 1 − e − ( R ( s 0 ,s 1)+ R ( s 0 ,s 2)+ R ( s 0 ,s 3)) · t = 1 − e − r ( s 0) · t � JPK c 48

  23. CTMC semantics • The probability that transition s → s ′ is enabled in [0 , t ] : 1 − e − R ( s,s ′ ) · t • The probability to move from non-absorbing s to s ′ in [0 , t ] is: R ( s, s ′ ) � 1 − e − r ( s ) · t � · r ( s ) • The probability to take some outgoing transition from s in [0 , t ] is: � t r ( s ) · e − r ( s ) · x dx = 1 − e − r ( s ) · t 0 � JPK c 49

  24. Enzyme-catalysed substrate conversion � JPK c 50

  25. Stochastic chemical kinetics • Types of reaction described by stochiometric equations: k 1 k 3 E + S ES − − → E + P ⇋ k 2 • N different types of molecules that randomly collide where state X ( t ) = ( x 1 , . . . , x N ) with x i = # molecules of sort i • Reaction probability within infinitesimal interval [ t, t +∆) : α m ( � x ) · ∆ = Pr { reaction m in [ t, t +∆) | X ( t ) = � x } where α m ( � x ) = k m · # possible combinations of reactant molecules in � x • Process is a continuous-time Markov chain � JPK c 51

  26. Enzyme-catalyzed substrate conversion as a CTMC 2400 1 8 1 1000 1310 2301 States: init goal 2 3 1 6 enzymes 2 2 2 1 1000 1000 substrates 4 0 0220 2202 1211 complex 0 0 2 2 1 4 products 0 4 2 1 1000 1000 0121 1112 2103 2 1 1 2 2 1 1000 1000 0022 1013 2004 1 0 . 001 Transitions: E + S 1 C − − − − → E + P ⇋ 0 . 001 · xC e.g., ( x E , x S , x C , x P ) − − − − − − − → ( x E + 1 , x S , x C − 1 , x P + 1) for x C > 0 � JPK c 52

  27. CTMCs are omnipresent! • Markovian queueing networks (Kleinrock 1975) • Stochastic Petri nets (Molloy 1977) • Stochastic activity networks (Meyer & Sanders 1985) • Stochastic process algebra (Herzog et al. , Hillston 1993) • Probabilistic input/output automata (Smolka et al. 1994) • Calculi for biological systems (Priami et al. , Cardelli 2002) CTMCs are one of the most prominent models in performance analysis � JPK c 53

  28. Content of this lecture • Introduction – motivation, DTMCs, PCTL model checking • Negative exponential distribution – definition, usage, properties • Continuous-time Markov chains – definition, semantics, examples ⇒ Performance measures – transient and steady-state probabilities, uniformization � JPK c 54

  29. Time-abstract evolution of a CTMC 21 21 4 4 8 8 21 4 21 4 1 2 1 2 10 10 zero-th epoch first epoch 21 21 4 4 8 8 21 21 4 4 1 2 1 2 10 10 second epoch third epoch � JPK c 55

  30. On the long run 21 4 1 18 8 21 4 1 2 2 1 1 10 3 9 6 � JPK c 56

  31. Transient distribution of a CTMC Let X ( t ) denote the state of a CTMC at time t ∈ R � 0 . Probability to be in state s at time t : p s ( t ) = Pr { X ( t ) = s } � Pr { X (0) = s ′ } · Pr { X ( t ) = s | X (0) = s ′ } = s ′ ∈ S Transient probability vector p ( t ) = ( p s 1 ( t ) , . . . , p s k ( t )) satisfies: p ′ ( t ) = p ( t ) · ( R − r ) p (0) given where r is the diagonal matrix of vector r . � JPK c 57

  32. A triple modular redundant system • 3 processors and a single voter: – processors run same program; voter takes a majority vote – each component (processor and voter) is failure-prone – there is a single repairman for repairing processors and voter • Modelling assumptions: Proc 1 vote – if voter fails, entire system goes down output input vote Voter Proc 2 – after voter-repair, system starts “as new” vote Proc 3 – state = (# processors , # voters ) � JPK c 58

  33. Modelling a TMR system as a CTMC • processor failure rate is λ fph; its repair rate is µ rph up 2 up 3 3 λ • voter failure rate is ν fph; µ 2,1 3,1 its repair rate is δ rph ν ν δ 2 λ • rate matrix: e.g., R ((3 , 1) , (2 , 1)) = 3 λ down µ 0,0 ν ν µ • exit rates: e.g., r ((3 , 1)) = 3 λ + ν 1,1 0,1 λ • probability matrix: e.g., up 0 up 1 3 λ P ((3 , 1) , (2 , 1)) = 3 λ + ν � JPK c 59

  34. Transient probabilities p s 3 , 1 ( t ) for t � 10 hours p ( t ) for t � 10 hours (log-scale) λ = 0 . 01 fph, ν = 0 . 001 fph µ = 1 rph and δ = 0 . 2 rph ( c � book by B.R. Haverkort) � JPK c 60

  35. Steady-state distribution of a CTMC For any finite and strongly connected CTMC it holds: t →∞ p ′ p s = lim t →∞ p s ( t ) ⇔ lim s ( t ) = 0 ⇔ t →∞ p s ( t ) · ( R − r ) = 0 lim Steady-state probability vector p = ( p s 1 , . . . , p s k ) satisfies: � p · ( R − r ) = 0 where s ∈ S p s = 1 � JPK c 61

  36. Steady-state distribution s s 3 , 1 s 2 , 1 s 1 , 1 s 0 , 1 s 0 , 0 9 . 655 · 10 − 1 2 . 893 · 10 − 2 5 . 781 · 10 − 4 5 . 775 · 10 − 6 4 . 975 · 10 − 3 p ( s ) The probability of � two processors and the voter are up once the CTMC has reached an equilibrium is 0.9655+0.02893 ≈ 0.993 λ = 0 . 01 fph, ν = 0 . 001 fph µ = 1 rph and δ = 0 . 2 rph � JPK c 62

  37. Computing transient probabilities • Transient probability vector p ( t ) = ( p s 1 ( t ) , . . . , p s k ( t )) satisfies: p ′ ( t ) = p ( t ) · ( R − r ) given p (0) • Solution using Taylor-Maclaurin expansion: ∞ (( R − r ) · t ) i � p ( t ) = p (0) · e ( R − r ) · t = p (0) · i ! i =0 • Main problems: infinite summation + numerical instability due to – non-sparsity of ( R − r ) i and presence positive and negative entries � JPK c 63

  38. Uniform CTMCs • A CTMC is uniform if r ( s ) = r for all s for some r ∈ R > 0 • Any CTMC can be changed into a weak bisimilar uniform CTMC • Let r ∈ R > 0 such that r � max s ∈ S r ( s ) 1 – r is at most the shortest mean residence time in CTMC C • Then u ( r, C ) = ( S, P , r, L ) with r ( s ) = r for any s , and: P ( s, s ′ ) = r ( s ) P ( s, s ) = r ( s ) r · P ( s, s )+1 − r ( s ) r · P ( s, s ′ ) if s ′ � = s and r � JPK c 64

  39. Uniformization 1 3 3 1 2 4 4 3 6 6 6 6 4 1 1 3 2 1 2 1 1 4 3 4 k = 6 uniformization with all state transitions in CTMC u ( r, C ) occur at an average pace of r per time unit � JPK c 65

  40. Computing transient probabilities ∞ e − r · t ( r · t ) i � • Now: p ( t ) = p (0) · e r · ( P − I ) t = p (0) · e − rt · e r · t · P = i · P i ! � �� � i =0 Poisson prob. • Summation can be truncated a priori for a given error bound ε > 0 : ‚ ‚ ‚ ‚ ‚ ‚ ∞ kε ∞ e − rt ( rt ) i e − rt ( rt ) i e − rt ( rt ) i ‚ ‚ X X X ‚ ‚ ‚ ‚ i ! · p ( i ) − i ! · p ( i ) ‚ = · p ( i ) ‚ ‚ ‚ ‚ ‚ ‚ i ! ‚ ‚ ‚ i =0 i =0 i = kε +1 ∞ k ε e − rt ( rt ) i e − rt ( rt ) i � � • Choose k ε minimal s.t.: = 1 − � ε i ! i ! i =0 i = k ε +1 � JPK c 66

  41. Transient probabilities: example � � � � � � 0 1 3 0 1 P = , r = and P 3 = 2 1 1 0 2 3 3 Let initial distribution p (0) = (1 , 0) , and time bound t =1 . Then: ∞ e − 3 3 i X i p (0) · i ! · P i =0 » 0 » 0 – – 1 1 = (1 , 0) · e − 3 1 + (1 , 0) · e − 3 3 0! · 1! · 2 1 1 0 3 3 » 0 – 2 1 + (1 , 0) · e − 3 9 2! · + . . . . . . 2 1 3 3 ≈ (0 . 404043 , 0 . 595957) � JPK c 67

  42. CTMC paths • An infinite path σ in a CTMC C = ( S, P , r, L ) is of the form: t 0 t 1 t 2 σ = s 0 − − → s 1 − − → s 2 − − → s 3 . . . . . . with s i is a state in S , t i ∈ R > 0 is a duration, and P ( s i , s i +1 ) > 0 . • A Borel space on infinite paths exists (cylinder construction) – reachability, timed reachability, and ω -regular properties are measurable • A path is Zeno if � i t i is converging • Theorem: the probability of the set of Zeno paths in any CTMC is 0 � JPK c 68

  43. Summarizing • Negative exponential distribution – suitable for many practical phenomena – nice mathematical properties • Continuous-time Markov chains – Kripke structures with exponential state residence times – used in many different fields, e.g., performance, biology, . . . • Performance measures – transient probability vector: where is a CTMC at time t ? – steady-state probability vector: where is a CTMC on the long run? � JPK c 69

  44. Model Checking Continuous-Time Markov Chains Joost-Pieter Katoen Software Modeling and Verification Group RWTH Aachen University associated to University of Twente, Formal Methods and Tools Lecture at MOVEP Summerschool, July 1, 2010 c � JPK

  45. Content of this lecture • Continuous Stochastic Logic – syntax, semantics, examples • CSL model checking – basic algorithms and complexity • Bisimulation – definition, minimization algorithm, examples • Priced continuous-time Markov chains – motivation, definition, some properties � JPK c 1

  46. Content of this lecture ⇒ Continuous Stochastic Logic – syntax, semantics, examples • CSL model checking – basic algorithms and complexity • Bisimulation – definition, minimization algorithm, examples • Priced continuous-time Markov chains – motivation, definition, some properties � JPK c 2

  47. Continuous-time Markov chain A continuous-time Markov chain (CTMC) is a tuple ( S, P , r, L ) where: • S is a countable (today: finite) set of states • P : S × S → [0 , 1] , a stochastic matrix – P ( s, s ′ ) is one-step probability of going from state s to state s ′ – s is called absorbing iff P ( s, s ) = 1 • r : S → R > 0 , the exit-rate function – r ( s ) is the rate of exponential distribution of residence time in state s � JPK c 3

  48. CTMC paths • An infinite path σ in a CTMC C = ( S, P , r, L ) is of the form: t 0 t 1 t 2 σ = s 0 − − → s 1 − − → s 2 − − → s 3 . . . . . . with s i is a state in S , t i ∈ R > 0 is a duration, and P ( s i , s i +1 ) > 0 . • A Borel space on infinite paths exists (cylinder construction) – reachability, timed reachability, and ω -regular properties are measurable • Let Paths ( s ) denote the set of infinite path starting in state s � JPK c 4

  49. Reachability probabilities • Let C = ( S, P , r, L ) be a finite CTMC and G ⊆ S a set of states • Let ✸ G be the set of infinite paths in C reaching a state in G • Question: what is the probability of ✸ G when starting from s ? – what is the probability mass of all infinite paths from s that eventually hit G ? • As state residence times are not relevant for ✸ G , this is simple � JPK c 5

  50. Probabilistic reachability • Pr( s, ✸ G ) is the least solution of the set of linear equations:  1 if s ∈ G  Pr( s, ✸ G ) = �  s ′ ∈ S P ( s, s ′ ) · Pr( s ′ , ✸ G ) otherwise • Unique solution by pre-computing Sat ( ∀ ✸ G ) and Sat ( ∃ ✸ G ) – this is a standard graph analysis (as in CTL model checking) • This is the same as in the first lecture this morning � JPK c 6

  51. Continuous stochastic logic (CSL) • CSL equips the until-operator with a time interval: – let interval I ⊆ R � 0 with rational bounds, e.g., I = [0 , 17] – Φ U I Ψ asserts that a Ψ -state can be reached via Φ -states . . . while reaching the Ψ -state at some time t ∈ I • CSL contains a probabilistic operator P with arguments – a path formula, e.g., good U [0 , 12] bad , and – a probability interval J ⊆ [0 , 1] with rational bounds, e.g., J = [0 , 1 2 ] • CSL contains a long-run operator L with arguments – a state formula, e.g., a ∧ b or P =1 ( ✸ Φ) , and – a probability interval J ⊆ [0 , 1] with rational bounds � JPK c 7

  52. The branching-time logic CSL • For a ∈ AP , J ⊆ [0 , 1] and I ⊆ R � 0 intervals with rational bounds: � � � � � ¬ Φ � Φ ∧ Φ � L J (Φ) Φ ::= a P J ( ϕ ) � � � Φ U I Φ ϕ ::= Φ U Φ = Φ U I Ψ if Ψ is reached at t ∈ I and prior to t , Φ holds • s 0 t 0 s 1 t 1 s 2 . . . | • s | = P J ( ϕ ) if the probability of the set of ϕ -paths starting in s lies in J • s | = L J (Φ) if starting from s , the probability of being in Φ on the long run lies in J � JPK c 8

  53. Derived operators ✸ Φ = true U Φ � t Φ = true U � t Φ ✸ P � p ( ✷ Φ) = P � 1 − p ( ✸ ¬ Φ) P ] p,q ] ( ✷ � t Φ) = P [1 − q, 1 − p [ ( ✸ � t ¬ Φ) abbreviate P [0 , 0 . 5] ( ϕ ) by P � 0 . 5 ( ϕ ) and P ]0 , 1] ( ϕ ) by P > 0 ( ϕ ) and so on � JPK c 9

  54. Timed reachability formulas • In � 92% of the cases, a goal state is legally reached within 3.1 sec: legal U � 3 . 1 goal � � P � 0 . 92 • Almost surely stay in a legal state for at least 10 sec: � ✷ � 10 legal � P =1 • Combining these two constraints: legal U � 3 . 1 P =1 � � ✷ � 10 legal �� P � 0 . 92 � JPK c 10

  55. Long-run formulas • The long-run probability of being in a safe state is at most 0.00001: L � 10 − 5 ( safe ) • On the long run, with at least “five nine” likelihood almost surely a goal state can be reached within one sec.: � � P =1 ( ✸ � 1 goal ) L � 0 . 99999 • The probability to reach a state that in the long run guarantees more than five-nine safety exceeds 1 2 : P > 0 . 5 ( ✸ L > 0 . 99999 ( safe )) � JPK c 11

  56. CSL semantics C , s | = Φ if and only if formula Φ holds in state s of CTMC C s | = a iff a ∈ L ( s ) s | = ¬ Φ iff not ( s | = Φ) s | = Φ ∧ Ψ iff ( s | = Φ) and ( s | = Ψ) = L J (Φ) s | iff lim t →∞ Pr { σ ∈ Paths ( s ) | σ @ t | = Φ } ∈ J s | = P J ( ϕ ) iff Pr { σ ∈ Paths ( s ) | σ | = ϕ } ∈ J = Φ U I Ψ iff ∃ t ∈ I. (( ∀ t ′ ∈ [0 , t ) . σ @ t ′ | σ | = Φ) ∧ σ @ t | = Ψ) where σ @ t is the state along σ that is occupied at time t � JPK c 12

  57. Content of this lecture • Continuous Stochastic Logic – syntax, semantics, examples ⇒ CSL model checking – basic algorithms and complexity • Bisimulation – definition, minimization algorithm, examples • Priced continuous-time Markov chains – motivation, definition, some properties � JPK c 13

  58. CSL model checking • Let C be a finite CTMC and Φ a CSL formula. • Problem: determine the states in C satisfying Φ • Determine Sat (Φ) by a recursive descent over parse tree of Φ • For the propositional fragment ( ¬ , ∧ , a ): do as for CTL • How to check formulas of the form P J ( ϕ ) ? – ϕ is an until-formula: do as for PCTL, i.e., linear equation system – ϕ is a time-bounded until-formula: integral equation system • How to check formulas of the form L J (Ψ) ? – graph analysis + solving linear equation system(s) � JPK c 14

  59. Model-checking the long-run operator • For a strongly-connected CTMC: � p ( s ′ ) ∈ J s ∈ Sat ( L J (Φ)) iff s ′ ∈ Sat (Φ) = ⇒ this boils down to a standard steady-state analysis • For an arbitrary CTMC: – determine the bottom strongly-connected components (BSCCs) – for BSCC B determine the steady-state probability of a Φ -state – compute the probability to reach BSCC B from state s 0 1 X X p B ( s ′ ) s ∈ Sat ( L J (Φ)) iff @ Pr { s | = ✸ B } · A ∈ J B C B s ′∈ B ∩ Sat (Φ) � JPK c 15

  60. Verifying long-run properties: an example 1 3 6 1 3 1 2 1 determine the bottom strongly-connected components � JPK c 16

  61. Verifying long-run properties: an example 1 3 6 1 3 1 2 1 = ✸ a t yellow } · p yellow ( magenta ) s | = L > 3 4 ( magenta ) iff Pr { s | = ✸ a t blue } · p blue ( magenta ) > 3 + Pr { s | 4 � JPK c 17

  62. Verifying long-run properties: an example 1 3 6 1 3 1 2 1 = ✸ a t yellow } · p yellow ( magenta ) s | = L > 3 4 ( magenta ) iff Pr { s | � �� � = 1 = ✸ a t blue } · p blue ( magenta ) > 3 + Pr { s | 4 � �� � = 2 3 � JPK c 18

  63. Verifying long-run properties: an example 1 3 6 1 3 1 2 1 = ✸ a t yellow } + 2 = ✸ a t blue } > 3 = L > 3 s | 4 ( magenta ) iff Pr { s | 3 Pr { s | 4 � JPK c 19

  64. Verifying long-run properties: an example 1 3 6 1 3 1 2 1 = ✸ a t yellow } + 2 = ✸ a t blue } > 3 s | = L > 3 4 ( magenta ) iff Pr { s | 3 Pr { s | 4 2 Pr { s ′ | 1 2 + 1 Pr { s | = ✸ a t yellow } = = ✸ a t yellow } Pr { s ′ | 1 = ✸ a t yellow } = 2 Pr { s | = ✸ a t yellow } � k = � 1 � ∞ 1 2 ⇒ Pr { s | = ✸ a t yellow } = k =0 2 4 3 � JPK c 20

  65. Verifying long-run properties: an example 1 3 6 1 3 1 2 1 + 2 > 3 s | = L > 3 4 ( magenta ) iff Pr { s | = ✸ a t yellow } 3 Pr { s | = ✸ a t blue } 4 � �� � � �� � 1 2 6 3 � JPK c 21

  66. Verifying long-run properties: an example 1 3 6 1 3 1 2 1 2 3 + 2 3 · 1 6 > 3 = L > 3 s | 4 ( magenta ) iff 4 � JPK c 22

  67. Verifying long-run properties: an example 1 3 6 1 3 1 2 1 3 + 2 2 3 · 1 > 3 Thus: s | = L > 3 4 ( magenta ) as 6 4 � �� � 7 9 � JPK c 23

  68. Time-bounded reachability � � Φ U I Ψ = Φ U I Ψ } ∈ J • s | = P J if and only if Pr { s | = Φ U � t Ψ } is the least solution of: • For I = [0 , t ] , Pr { s | – 1 if s ∈ Sat (Ψ) – if s ∈ Sat (Φ) − Sat (Ψ) : � t � Pr { s ′ | = Φ U � t − x Ψ } R ( s, s ′ ) · e − r ( s ) · x · dx � �� � � �� � 0 s ′ ∈ S probability to fulfill Φ U Ψ probability to move to state s ′ at time x before time t − x from s ′ – 0 otherwise � JPK c 24

  69. Reduction to transient analysis • For an arbitrary CTMC C and property ϕ = Φ U � t Ψ we have: – ϕ is fulfilled once a Ψ -state is reached before t along a Φ -path – ϕ is violated once a ¬ (Φ ∨ Ψ) -state is visited before t • This suggests to transform the CTMC C as follows: – make all Ψ -states and all ¬ (Φ ∨ Ψ) -states absorbing = P J (Φ U � t Ψ) = P J ( ✸ = t Ψ) • Theorem: s | iff s | � �� � � �� � in C ′ in C � = C ′ P J ( ✸ = t Ψ) • Then it follows: s | iff p s ′ ( t ) ∈ J s ′ | =Ψ � �� � transient probs in C ′ � JPK c 25

  70. Example: TMR with P J (( green ∨ blue ) U [0 , 3] red ) transformation recursive computation like PCTL uniformisation bounded until � JPK c 26

  71. Interval-bounded reachability • For any path σ that fulfills Φ U [ t,t ′ ] Ψ with 0 < t � t ′ : – Φ holds continuously up to time t , and – the suffix of σ starting at time t fulfills Φ U [0 ,t ′− t ] Ψ • Approach: divide the problem into two: � � p C ′ ( s, s ′ , t ) p C ′′ ( s ′ , s ′′ , t ′ − t ) · s ′ | s ′′ | =Φ =Ψ � �� � � �� � check ✷ [0 ,t ] Φ check Φ U [0 ,t ′− t ] Ψ with starting distribution p C ′ ( t ) – where CTMC C ′ equals C with all Φ -states absorbing – and CTMC C ′′ equals C with all Ψ and ¬ (Φ ∨ Ψ) -states absorbing � JPK c 27

  72. Verification times veri fi cation time (in ms) Workstation cluster (CTMC) Tandem queue (CTMC) 104 Crowds protocol (DTMC) Randomised mutex (DTMC) 103 102 state space size 101 0 5 ⋅ 105 1 ⋅ 106 1.5 ⋅ 106 2 ⋅ 106 2.5 ⋅ 106 command-line tool MRMC ran on a Pentium 4, 2.66 GHz, 1 GB RAM laptop � JPK c 28

  73. Reachability probabilities Nondeterminism Nondeterminism no yes Reachability linear equation system linear programming DTMC MDP Timed reachability transient analysis discretisation + linear programming CTMC CTMDP � JPK c 29

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend