Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Efficient Verification of Timed Automata Kim Guldstrand Larsen Paul PetterssonMogens Nielsen

Similar presentations


Presentation on theme: "1 Efficient Verification of Timed Automata Kim Guldstrand Larsen Paul PetterssonMogens Nielsen"— Presentation transcript:

1 1 Efficient Verification of Timed Automata Kim Guldstrand Larsen Paul PetterssonMogens Nielsen BRICS@Aalborg BRICS@Aarhus

2 2 REGIONS review

3 Petri Net, June 2000Kim G. Larsen, Mogens Nielsen, Paul Pettersson UCb 3 Regions Finite partitioning of state space x y Definition An equivalence class (i.e. a region) in fact there is only a finite number of regions!! 123 1 2

4 Petri Net, June 2000Kim G. Larsen, Mogens Nielsen, Paul Pettersson UCb 4 Regions Finite partitioning of state space x y Definition An equivalence class (i.e. a region) Successor regions, Succ(r) r 123 1 2

5 Petri Net, June 2000Kim G. Larsen, Mogens Nielsen, Paul Pettersson UCb 5 Regions Finite partitioning of state space x y Definition An equivalence class (i.e. a region) r {x}r {y}r r Reset regions THEOREM 123 1 2

6 Petri Net, June 2000Kim G. Larsen, Mogens Nielsen, Paul Pettersson UCb 6 Fischers again A1 B1 CS1 V:=1V=1 A2 B2 CS2 V:=2V=2 Y<1 X:=0 Y:=0 X>1 Y>1 X<1 A1,A2,v=1 A1,B2,v=2 A1,CS2,v=2 B1,CS2,v=1 CS1,CS2,v=1 Untimed case A1,A2,v=1 x=y=0 A1,A2,v=1 0 <x=y <1 A1,A2,v=1 x=y=1 A1,A2,v=1 1 <x,y A1,B2,v=2 0 <x<1 y=0 A1,B2,v=2 0 <y < x<1 A1,B2,v=2 0 <y < x=1 y=0 A1,B2,v=2 0 <y<1 1 <x A1,B2,v=2 1 <x,y A1,B2,v=2 y=1 1 <x A1,CS2,v=2 1 <x,y No further behaviour possible!! Timed case Partial Region Graph

7 Petri Net, June 2000Kim G. Larsen, Mogens Nielsen, Paul Pettersson UCb 7 Regions – Alternativ Definition x y 123 1 2

8 Petri Net, June 2000Kim G. Larsen, Mogens Nielsen, Paul Pettersson UCb 8 Problem with regions  Number of regions over n clocks: Explosion in number of clocks Explosion in maximal constant  Reachability is PSPACE complete for a single TA

9 9 THE UPPAAL ENGINE Reachability & Zones Property and system dependent partitioning

10 Petri Net, June 2000Kim G. Larsen, Mogens Nielsen, Paul Pettersson UCb 10 Zones From infinite to finite State (n, x=3.2, y=2.5 ) x y x y Symbolic state (set ) (n, ) Zone: conjunction of x-y n

11 Petri Net, June 2000Kim G. Larsen, Mogens Nielsen, Paul Pettersson UCb 11 Symbolic Transitions n m x>3 y:=0 x y delays to conjuncts to projects to x y 1<=x<=4 1<=y<=3 x y 1<=x, 1<=y -2<=x-y<=3 x y 3<x, 1<=y -2<=x-y<=3 3<x, y=0 Thus (n,1 (m,3<x, y=0) a

12 Petri Net, June 2000Kim G. Larsen, Mogens Nielsen, Paul Pettersson UCb 12 A1 B1 CS1 V:=1V=1 A2 B2 CS2 V:=2V=2 Init V=1 2 ´´ V Criticial Section Fischer’s Protocol analysis using zones Y<10 X:=0 Y:=0 X>10 Y>10 X<10

13 Petri Net, June 2000Kim G. Larsen, Mogens Nielsen, Paul Pettersson UCb 13 Fischers cont. B1 CS1 V:=1V=1 A2 B2 CS2 V:=2V=2 Y<10 X:=0 Y:=0 X>10 Y>10 X<10 A1,A2,v=1A1,B2,v=2A1,CS2,v=2B1,CS2,v=1CS1,CS2,v=1 Untimed case A1

14 Petri Net, June 2000Kim G. Larsen, Mogens Nielsen, Paul Pettersson UCb 14 Fischers cont. B1 CS1 V:=1V=1 A2 B2 CS2 V:=2V=2 Y<10 X:=0 Y:=0 X>10 Y>10 X<10 A1,A2,v=1A1,B2,v=2A1,CS2,v=2B1,CS2,v=1CS1,CS2,v=1 Untimed case Taking time into account X Y A1

15 Petri Net, June 2000Kim G. Larsen, Mogens Nielsen, Paul Pettersson UCb 15 Fischers cont. B1 CS1 V:=1V=1 A2 B2 CS2 V:=2V=2 Y<10 X:=0 Y:=0 X>10 Y>10 X<10 A1,A2,v=1A1,B2,v=2A1,CS2,v=2B1,CS2,v=1CS1,CS2,v=1 Untimed case Taking time into account X Y A1 10 X Y

16 Petri Net, June 2000Kim G. Larsen, Mogens Nielsen, Paul Pettersson UCb 16 Fischers cont. B1 CS1 V:=1V=1 A2 B2 CS2 V:=2V=2 Y<10 X:=0 Y:=0 X>10 Y>10 X<10 A1,A2,v=1A1,B2,v=2A1,CS2,v=2B1,CS2,v=1CS1,CS2,v=1 Untimed case Taking time into account A1 10 X Y X Y

17 Petri Net, June 2000Kim G. Larsen, Mogens Nielsen, Paul Pettersson UCb 17 Fischers cont. B1 CS1 V:=1V=1 A2 B2 CS2 V:=2V=2 Y<10 X:=0 Y:=0 X>10 Y>10 X<10 A1,A2,v=1A1,B2,v=2A1,CS2,v=2B1,CS2,v=1CS1,CS2,v=1 Untimed case Taking time into account A1 10 X Y X Y X Y

18 Petri Net, June 2000Kim G. Larsen, Mogens Nielsen, Paul Pettersson UCb 18 Fischers cont. B1 CS1 V:=1V=1 A2 B2 CS2 V:=2V=2 Y<10 X:=0 Y:=0 X>10 Y>10 X<10 A1,A2,v=1A1,B2,v=2A1,CS2,v=2B1,CS2,v=1CS1,CS2,v=1 Untimed case Taking time into account A1 10 X Y X Y X Y

19 Petri Net, June 2000Kim G. Larsen, Mogens Nielsen, Paul Pettersson UCb 19 Forward Rechability Passed Waiting Final Init INITIAL Passed := Ø; Waiting := {(n0,Z0)} REPEAT - pick (n,Z) in Waiting - if for some Z’ Z (n,Z’) in Passed then STOP - else (explore) add { (m,U) : (n,Z) => (m,U) } to Waiting; Add (n,Z) to Passed UNTIL Waiting = Ø or Final is in Waiting Init -> Final ?

20 Petri Net, June 2000Kim G. Larsen, Mogens Nielsen, Paul Pettersson UCb 20 Forward Rechability Passed Waiting Final Init n,Z INITIAL Passed := Ø; Waiting := {(n0,Z0)} REPEAT - pick (n,Z) in Waiting - if for some Z’ Z (n,Z’) in Passed then STOP - else (explore) add { (m,U) : (n,Z) => (m,U) } to Waiting; Add (n,Z) to Passed UNTIL Waiting = Ø or Final is in Waiting n,Z’ Init -> Final ?

21 Petri Net, June 2000Kim G. Larsen, Mogens Nielsen, Paul Pettersson UCb 21 Forward Rechability Passed Waiting Final Init n,Z INITIAL Passed := Ø; Waiting := {(n0,Z0)} REPEAT - pick (n,Z) in Waiting - if for some Z’ Z (n,Z’) in Passed then STOP - else /explore/ add { (m,U) : (n,Z) => (m,U) } to Waiting; Add (n,Z) to Passed UNTIL Waiting = Ø or Final is in Waiting n,Z’ m,U Init -> Final ?

22 Petri Net, June 2000Kim G. Larsen, Mogens Nielsen, Paul Pettersson UCb 22 Forward Rechability Passed Waiting Final Init INITIAL Passed := Ø; Waiting := {(n0,Z0)} REPEAT - pick (n,Z) in Waiting - if for some Z’ Z (n,Z’) in Passed then STOP - else /explore/ add { (m,U) : (n,Z) => (m,U) } to Waiting; Add (n,Z) to Passed UNTIL Waiting = Ø or Final is in Waiting n,Z’ m,U n,Z Init -> Final ?

23 Petri Net, June 2000Kim G. Larsen, Mogens Nielsen, Paul Pettersson UCb 23 Canonical Dastructures for Zones Difference Bounded Matrices Bellman 1958, Dill 1989 x<=1 y-x<=2 z-y<=2 z<=9 x<=1 y-x<=2 z-y<=2 z<=9 x<=2 y-x<=3 y<=3 z-y<=3 z<=7 x<=2 y-x<=3 y<=3 z-y<=3 z<=7 D1 D2 Inclusion 0 x y z 12 2 9 0 x y z 23 3 7 3 ? ? Graph

24 Petri Net, June 2000Kim G. Larsen, Mogens Nielsen, Paul Pettersson UCb 24 Bellman 1958, Dill 1989 x<=1 y-x<=2 z-y<=2 z<=9 x<=1 y-x<=2 z-y<=2 z<=9 x<=2 y-x<=3 y<=3 z-y<=3 z<=7 x<=2 y-x<=3 y<=3 z-y<=3 z<=7 D1 D2 Inclusion 0 x y z 12 2 9 Shortest Path Closure Shortest Path Closure 0 x y z 12 2 5 0 x y z 23 3 7 0 x y z 23 3 6 3 3 3 Graph ? ? Canonical Dastructures for Zones Difference Bounded Matrices

25 Petri Net, June 2000Kim G. Larsen, Mogens Nielsen, Paul Pettersson UCb 25 Bellman 1958, Dill 1989 x<=1 y>=5 y-x<=3 x<=1 y>=5 y-x<=3 D Emptiness 0 y x 1 3 -5 Negative Cycle iff empty solution set Graph Canonical Dastructures for Zones Difference Bounded Matrices Compact

26 Petri Net, June 2000Kim G. Larsen, Mogens Nielsen, Paul Pettersson UCb 26 1<= x <=4 1<= y <=3 1<= x <=4 1<= y <=3 D Future x y x y Future D 0 y x 4 3 Shortest Path Closure Remove upper bounds on clocks 1<=x, 1<=y -2<=x-y<=3 1<=x, 1<=y -2<=x-y<=3 y x 3 2 0 y x 3 2 0 4 3 Canonical Dastructures for Zones Difference Bounded Matrices

27 Petri Net, June 2000Kim G. Larsen, Mogens Nielsen, Paul Pettersson UCb 27 Canonical Dastructures for Zones Difference Bounded Matrices x y D 1<=x, 1<=y -2<=x-y<=3 1<=x, 1<=y -2<=x-y<=3 y x 3 2 0 Remove all bounds involving y and set y to 0 x y {y}D y=0, 1<=x Reset y x 0 0 0

28 Petri Net, June 2000Kim G. Larsen, Mogens Nielsen, Paul Pettersson UCb 28 Improved Datastructures Compact Datastructure for Zones x1-x2<=4 x2-x1<=10 x3-x1<=2 x2-x3<=2 x0-x1<=3 x3-x0<=5 x1-x2<=4 x2-x1<=10 x3-x1<=2 x2-x3<=2 x0-x1<=3 x3-x0<=5 x1x2 x3x0 -4 10 2 2 5 3 x1x2 x3x0 -4 4 2 2 5 33 -2 1 Shortest Path Closure O(n^3) RTSS 1997

29 Petri Net, June 2000Kim G. Larsen, Mogens Nielsen, Paul Pettersson UCb 29 Improved Datastructures Compact Datastructure for Zones x1-x2<=4 x2-x1<=10 x3-x1<=2 x2-x3<=2 x0-x1<=3 x3-x0<=5 x1-x2<=4 x2-x1<=10 x3-x1<=2 x2-x3<=2 x0-x1<=3 x3-x0<=5 x1x2 x3x0 -4 10 2 2 5 3 x1x2 x3x0 -4 4 2 2 5 3 x1x2 x3x0 -4 2 2 3 3 -2 1 Shortest Path Closure O(n^3) Shortest Path Reduction O(n^3) 3 Canonical wrt = Space worst O(n^2) practice O(n) RTSS 1997

30 Petri Net, June 2000Kim G. Larsen, Mogens Nielsen, Paul Pettersson UCb 30 v and w are both redundant Removal of one depends on presence of other. v and w are both redundant Removal of one depends on presence of other. Shortest Path Reduction 1st attempt Idea Problem w <=w An edge is REDUNDANT if there exists an alternative path of no greater weight THUS Remove all redundant edges! An edge is REDUNDANT if there exists an alternative path of no greater weight THUS Remove all redundant edges! w v Observation: If no zero- or negative cycles then SAFE to remove all redundancies. Observation: If no zero- or negative cycles then SAFE to remove all redundancies.

31 Petri Net, June 2000Kim G. Larsen, Mogens Nielsen, Paul Pettersson UCb 31 Shortest Path Reduction Solution G: weighted graph

32 Petri Net, June 2000Kim G. Larsen, Mogens Nielsen, Paul Pettersson UCb 32 Shortest Path Reduction Solution G: weighted graph 1. Equivalence classes based on 0-cycles. 2. Graph based on representatives. Safe to remove redundant edges

33 Petri Net, June 2000Kim G. Larsen, Mogens Nielsen, Paul Pettersson UCb 33 Shortest Path Reduction Solution G: weighted graph 1. Equivalence classes based on 0-cycles. 2. Graph based on representatives. Safe to remove redundant edges 3. Shortest Path Reduction = One cycle pr. class + Removal of redundant edges between classes

34 Petri Net, June 2000Kim G. Larsen, Mogens Nielsen, Paul Pettersson UCb 34 Other Symbolic Datastructures zRegions Alur, Dill zNDD’s Maler et. al. zCDD’s UPPAAL/CAV99 zDDD’s Møller, Lichtenberg zPolyhedra HyTech z...... CDD-representations

35 Petri Net, June 2000Kim G. Larsen, Mogens Nielsen, Paul Pettersson UCb 35 Verification Options Diagnostic Trace Breadth-First Depth-First Local Reduction Active-Clock Reduction Global Reduction Re-Use State-Space Over-Approximation Under-Approximation Diagnostic Trace Breadth-First Depth-First Local Reduction Active-Clock Reduction Global Reduction Re-Use State-Space Over-Approximation Under-Approximation Case Studies

36 Petri Net, June 2000Kim G. Larsen, Mogens Nielsen, Paul Pettersson UCb 36 Representation of symbolic states (In)Active Clock Reduction x is only active in location S1 x>3 x<5 x:=0 S x is inactive at S if on all path from S, x is always reset before being tested. Definition x<7 Case Studies

37 Petri Net, June 2000Kim G. Larsen, Mogens Nielsen, Paul Pettersson UCb 37 Representation of symbolic states Active Clock Reduction x>3 x<5 S x is inactive at S if on all path from S, x is always reset before being tested. Definition g1 gk g2 r1 r2rk S1 S2Sk Only save constraints on active clocks

38 Petri Net, June 2000Kim G. Larsen, Mogens Nielsen, Paul Pettersson UCb 38 When to store symbolic state Global Reduction No Cycles: Passed list not needed for termination However, Passed list useful for efficiency Case Studies

39 Petri Net, June 2000Kim G. Larsen, Mogens Nielsen, Paul Pettersson UCb 39 When to store symbolic state Global Reduction Cycles: Only symbolic states involving loop-entry points need to be saved on Passed list Case Studies

40 Petri Net, June 2000Kim G. Larsen, Mogens Nielsen, Paul Pettersson UCb 40 Reuse State Space Passed Waiting prop1 A[] prop1 A[] prop2 A[] prop3 A[] prop4 A[] prop5. A[] propn Search in existing Passed list before continuing search Which order to search? prop2 Case Studies

41 Petri Net, June 2000Kim G. Larsen, Mogens Nielsen, Paul Pettersson UCb 41 Reuse State Space Passed Waiting prop1 A[] prop1 A[] prop2 A[] prop3 A[] prop4 A[] prop5. A[] propn Search in existing Passed list before continuing search Which order to search? Hashtable prop2 Case Studies

42 Petri Net, June 2000Kim G. Larsen, Mogens Nielsen, Paul Pettersson UCb 42 Over-approximation Convex Hull x y Convex Hull 135 1 3 5 Case Studies

43 Petri Net, June 2000Kim G. Larsen, Mogens Nielsen, Paul Pettersson UCb 43 Under-approximation Bitstate Hashing Passed Waiting Final Init n,Z’ m,U n,Z

44 Petri Net, June 2000Kim G. Larsen, Mogens Nielsen, Paul Pettersson UCb 44 Under-approximation Bitstate Hashing Passed Waiting Final Init n,Z’ m,U n,Z Passed= Bitarray 1 0 1 0 0 1 UPPAAL 8 Mbits Hashfunction F

45 Petri Net, June 2000Kim G. Larsen, Mogens Nielsen, Paul Pettersson UCb 45 Bitstate Hashing INITIAL Passed := Ø; Waiting := {(n0,Z0)} REPEAT - pick (n,Z) in Waiting - if for some Z’ Z then STOP (n,Z’) in Passed then STOP - else /explore/ add { (m,U) : (n,Z) => (m,U) } to Waiting; Add (n,Z) to Passed UNTIL Waiting = Ø or Final is in Waiting INITIAL Passed := Ø; Waiting := {(n0,Z0)} REPEAT - pick (n,Z) in Waiting - if for some Z’ Z then STOP (n,Z’) in Passed then STOP - else /explore/ add { (m,U) : (n,Z) => (m,U) } to Waiting; Add (n,Z) to Passed UNTIL Waiting = Ø or Final is in Waiting Passed(F(n,Z)) = 1 Passed(F(n,Z)) := 1

46 46 END


Download ppt "1 Efficient Verification of Timed Automata Kim Guldstrand Larsen Paul PetterssonMogens Nielsen"

Similar presentations


Ads by Google