1 / 18

Petri Nets

Talen & Correctheid - 2004-2005 Inleiding tot Reeks 6. Petri Nets. Pieter Van Gorp Formal Techniques in Software Engineering Pieter.VanGorp@ua.ac.be. Animations from http://www.csse.monash.edu.au/courseware/cse5510/Lectures/lecture2b.ppt by Chris Ling, CSSE. Static Structure.

aysel
Download Presentation

Petri Nets

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Talen & Correctheid - 2004-2005 Inleiding tot Reeks 6 Petri Nets Pieter Van Gorp Formal Techniques in Software Engineering Pieter.VanGorp@ua.ac.be Animations from http://www.csse.monash.edu.au/courseware/cse5510/Lectures/lecture2b.pptby Chris Ling, CSSE.

  2. Static Structure • Places (circles) possible states of the system • Tokens (bullets) e.g. active state • Transitions (rectangles) events or actions which cause the change of state • Arcs (arrows) connects a place with a transition or a transition with a place

  3. e2 e3 e1 e3 e2 e1 e5 e4 Dynamic Behavior • “Firing of State Transitions” • Condition: Availability of Tokens • State is Enabled • Effect: Tokens move from Input to Output Places • Meaning: Event occurs (+ Actions)

  4. e1 e2 e3 e4 Concurrency Issues • Non-deterministic Concurrency

  5. e1 Concurrency Issues • Synchronization

  6. 2 Fast 2 Petri Nets http://402streetrace.com/ Starter Car A Car B Conditions P1: Car A, preparing for start P10: Car B, preparing for start --- P2: Car A, Waiting for start P11: Car B, Waiting for start --- P4: Car A, Ready Sign P8: Car B, Ready Sign --- P6: Starter, waiting for Ready Signs --- P7: Starter, Start Sign given --- P5: Car A, See Start Sign P9: Car B, See Start Sign --- P3: Car A, Racing P12: Car B, Racing Actions T1: Car A, Send Ready Sign T4: Car B, Send Ready Sign --- T3: Starter, Give Start Sign --- T2: Car A, Start Racing T5: Car B, Start Racing

  7. Relating Places and Transitions

  8. Composing Nets

  9. Nondeterministic Concurrency “Stap”, cursus p. 103

  10. Sharing Resources: MUTEX • Junction of 2 roads into 1: • First come, first serve… who decides? 1. Golf, from Road A 2. Focus, from Road B 3. Golf, gets Road C first

  11. A safe Racing Circuit MUTEX RETRIEVE MUTEX RELEASE

  12. Waiter free Customer 1 Customer 2 Take order Take order wait Order taken wait eating eating Tell kitchen Serve food Serve food Example: Restaurant (scenario 1)

  13. Waiter free Customer 1 Customer 2 Take order Take order wait Order taken wait eating eating Tell kitchen Serve food Serve food Example: Restaurant (scenario 2)

  14. t1 t3 t5 t8 t2 t6 M0 M1 M2 M3 M0 M2 M4 A marking is a concrete state ... t8 p4 M0 = (1,0,0,0,0) t4 M1 = (0,1,0,0,0) p2 t1 M2 = (0,0,1,0,0) M3 = (0,0,0,1,0) p1 M4 = (0,0,0,0,1) t3 t7 t5 Initial marking:M0 t6 p5 t2 “Firing Sequence” p3 t9

  15. t1 t3 t5 t8 t2 t6 M0 M1 M2 M3 M0 M2 M4 Reachability & Liveness • “M2 is reachable from M1 • M4 is reachable from M0.” • … • In this example, all markings are reachable from every marking • A Petri net with initial marking M0 is live if, no matter what marking has been reached from M0, it is possible to ultimately fire any transition by progressing through some further firing sequence. • A transition is dead if it can never be fired in any firing sequence.

  16. An non-live Petri Net example t1 p3 t3 t4 p2 p1 p4 t2 M0 = (1,0,0,1) M1 = (0,1,0,1) M2 = (0,0,1,0) M3 = (0,0,0,1)

  17. Boundedness • A Petri net is said to be k-bounded or simply bounded if the number of tokens in each place does not exceed a finite number kfor any marking reachable from M0. • C/E systems are 1-bounded.

  18. M0 = (1, 0, 0, 0, 0) M1 = (0, 1, 1, 0, 0) M2 = (0, 0, 0, 1, 1) M3 = (1, 1, 0, 0, 0) M4 = (0, 2, 1, 0, 0) Boundedness Example p1 t1 p2 p3 t2 t3 p4 p5 t4 An unbounded but live Petri net

More Related