Ch5: Software Specification. 1 Petri Nets  Introduced by C. Adams Petri in 1960.  Widely used in the modeling and analysis of computer systems.  Basic.

Slides:



Advertisements
Similar presentations
School of Computer Science & Software Engineering
Advertisements

Workflow Management Systems © Dr. Rafael A. Calvo – Edited by Mark Aufflick (pumptheory.com) School of Electrical and Information Eng, University of Sydney.
1 Petri Nets I Paul Fishwick author From
1 SE-561 Formal Methods in Software Petri Nets - I.
An Introduction to Petri Nets
Principles of Engineering System Design Dr T Asokan
Introduction to Petri Nets Hugo Andrés López
Based on: Petri Nets and Industrial Applications: A Tutorial
26 September 2003U. Buy -- SEES 2003 Sidestepping verification complexity with supervisory control Ugo Buy Department of Computer Science Houshang Darabi.
Solutions for Scheduling Assays. Why do we use laboratory automation? Improve quality control (QC) Free resources Reduce sa fety risks Automatic data.
1 Modeling based on Petri-nets. Lecture 8. 2 High-level Petri nets The classical Petri net was invented by Carl Adam Petri in A lot of research.
IE 469 Manufacturing Systems
Discrete Interaction Design Specification Prof. Dr. Matthias Rauterberg Faculty Industrial Design Technical University of Eindhoven
Synthesis of Embedded Software Using Free-Choice Petri Nets.
10. Petri Nets Prof. O. Nierstrasz. Roadmap  Definition: —places, transitions, inputs, outputs —firing enabled transitions  Modelling: —concurrency.
Petri Nets Overview 1 Definition of Petri Net C = ( P, T, I, O) Places P = { p 1, p 2, p 3, …, p n } Transitions T = { t 1, t 2, t 3, …, t n } Input.
CS447/ECE453/SE465 Prof. Alencar University of Waterloo 1 CS447/ECE453/SE465 Software Testing Tutorial Winter 2008 Based on the tutorials by Prof. Kontogiannis,
XML Documentation of Biopathways and Their Simulations in Genomic Object Net Speaker : Hungwei chen.
CP — Concurrent Programming 12. Petri Nets Prof. O. Nierstrasz Wintersemester 2005 / 2006.
1 Gas Station and Cruise Control Specifications Ronnie Apcar Edwin Chiu Hasmik Jerejian November 2, 2000 CSCI 599 Formal Methods November 2, 2000 Concurrency.
FunState – An Internal Design Representation for Codesign A model that enables representations of different types of system components. Mixture of functional.
12/07/2007Jiacun Wang1 SE-561 Math Foundations Petri Nets - II Dr. Jiacun Wang Department of Software Engineering Monmouth University.
Lecture 6 & 7 System Models.
1 Formal Models for Transactions: Zero Safe Nets Roberto Bruni Dipartimento di Informatica Università di Pisa Models and Languages for Coordination and.
Ch5: Software Specification. 1 Overview  Use of specifications  Specification qualities  Classification of specification styles  Verification of specifications.
Petri Net Modeling for dynamic MM composite Object.
1 Software Requirements Specification Lecture 14.
Mata kuliah :K0362/ Matematika Diskrit Tahun :2008
PETRINETS Nipun Devlekar Zauja Lahtau. PETRINETS DEFINITION : DEFINITION :  PETRINET (place/ transition net): a formal, graphical, executable technique.
程建群 博士(Dr. Jason Cheng) 年03月
System Models Hoang Huu Hanh, Hue University hanh-at-hueuni.edu.vn Lecture 6 & 7.
Modeling with ordinary Petri Nets Events: Actions that take place in the system The occurrence of these events is controlled by the state of the system.
Petri Nets Copyright, 2003 © Jerzy R. Nawrocki Models and Analysis of Software Lecture.
CY2003 Computer Systems Lecture 7 Petri net. © LJMU, 2004CY2003- Week 72 Overview Petri net –concepts –Petri net representation –Firing a transition –Marks.
Virtual Storytelling Adam Abonyi Daniel Balaš. Agenda 1.Introduction to virtual storytelling 2.Petri Nets 3.Our improvements in Petri Nets 4.Example.
Generalized stochastic Petri nets (GSPN)
Petri Nets Lecturer: Roohollah Abdipour. Agenda Introduction Petri Net Modelling with Petri Net Analysis of Petri net 2.
Petri Nets Invented by Carl Adam Petri in 1962 Concurrent systems with timing problems  Synchronization, race problem, deadlock A petri net consists of.
Modelling by Petri nets
CSCI1600: Embedded and Real Time Software Lecture 11: Modeling IV: Concurrency Steven Reiss, Fall 2015.
School of Computer Science & Software Engineering
CAP 4800/CAP 5805: Computer Simulation Concepts
1 Lecture 23 – April 11, 2002 Semester end questions More about Bond agents Models and languages supporting concurrency Petri Nets.
/faculteit technologie management PN-1 Petri nets refresher Prof.dr.ir. Wil van der Aalst Eindhoven University of Technology, Faculty of Technology Management,
Capturing Requirements. Questions to Ask about Requirements 1)Are the requirements correct? 2)Consistent? 3)Unambiguous? 4)Complete? 5)Feasible? 6)Relevant?
CS 145A Protocols Netlab.caltech.edu/course. Misc. Extension Extension Textbooks Textbooks.
/faculteit technologie management PN-1 Petri nets refresher Prof.dr.ir. Wil van der Aalst Eindhoven University of Technology, Faculty of Technology Management,
Petri-Nets and Other Models
Week 8 Computational Level
Laurea Triennale in Informatica – Corso di Ingegneria del Software I – A.A. 2006/2007 Andrea Polini VIII. Specifications (II)
composition of workflows
Advantages of FSM Their simplicity make it easy for inexperienced developers to implement with little to no extra knowledge (low entry level)
Concurrent Systems Modeling using Petri Nets
Dr. Eng Amr T. Abdel-Hamid
2. Specification and Modeling
Clockless Computing COMP
State Machine Diagrams
Week 8 Computational Level
COT 5611 Operating Systems Design Principles Spring 2014
Concurrent Systems Modeling using Petri Nets – Part II
Workflow Management Systems
CAP 4800/CAP 5805: Computer Simulation Concepts
CAP 4800/CAP 5805: Computer Simulation Concepts
CSCI1600: Embedded and Real Time Software
COT 5611 Operating Systems Design Principles Spring 2012
CAP 4800/CAP 5805: Computer Simulation Concepts
Petri nets.
CSCI1600: Embedded and Real Time Software
Petri Nets Laurie Frazier.
Presentation transcript:

Ch5: Software Specification

1 Petri Nets  Introduced by C. Adams Petri in  Widely used in the modeling and analysis of computer systems.  Basic elements:  Places  Transitions  Directed arcs  Tokens

2 Petri Nets Legend: Place Transition Directed arc P1 P2 P3 t1 Token

3 Petri Nets (contd..) P1 P2 P3 t1 Input place: Output place:

4 Petri Nets (contd..) P1 P2 P3 t1 2 Weighted connection: Default weight is 1.

5 Petri Nets (contd..)  Net structure:  Marking: Overall state.  Marked vs. Unmarked places: Places with zero or more tokens.  Local state vs. Global state: Number of tokens in a place, number of tokens in all places.

6 Petri Nets (contd..) P1 P2 P3 t1 Local State: P1 – 1 P2 – 0 P3 – 0 Overall State:

7 Petri Nets (contd..)  Dynamic behavior:  Firing of transitions  Transition firing:  Tokens from input place are moved to output place  Evolution of the net  Steps involved in firing of a transition

8 Petri Nets (contd..) Step #1 P1 P2 P3 t1 2

9 Petri Nets (contd..) P1 P2 P3 t1 2 Step 2

10 Petri Nets (contd..) P1 P2 P3 t1 2 Step 3:

11 Petri Nets (contd..)  Enabled transitions not forced to fire  Can be subject to external conditions  Ordinary Petri net, firing of transitions occurs instantly

12 Petri Nets (contd..) Machine Idle Loading Part Operation in Progress Unloading Part Robot Idle Petri Nets: Manufacturing Example Place represents availability of a resource.

13 Petri Nets (contd..) User & Candy User has coin Machine ready User has candy Machine busy eat reset Dispense candy

14 Petri nets (contd..)  Petri nets may be used to model concurrent systems  Concurrent transitions:  Petri nets are non-deterministic

15 Petri nets (contd..) P P P t t P t P P P t t t Transitions t1 and t2 are both enabled. Any one of t1 and t2 can fire.

16 Petri nets (contd..) P P P t t P t P P P t t t Before t1 firesAfter t1 fires Which transitions are enabled? P P P t t P t P P P t t t 2 4 6

17 Petri nets (contd..) Before t2 firesAfter t2 fires Which transitions are enabled? P P P t t P t P P P t t t P P P t t P t P P P t t t 2 4 6

18 Petri nets (contd..) Before t1 & t2 fireFiring sequence t1,t2 t2,t1 P P P t t P t P P P t t t P P P t t P t P P P t t t 2 4 6

19 Petri nets (contd..) Before t3 fires After t3 fires P P P t t P t P P P t t t P P P t t P t P P P t t t 2 4 6

20 Petri nets (contd..) Before t4 fires After t4 fires P P P t t P t P P P t t t P P P t t P t P P P t t t 2 4 6

21 Petri nets (contd..)  Transitions t3 and t4 were both enabled:  Conflict  A process may never get a resource (starvation)

22 Petri nets (contd..) How to avoid starvation

23 Petri nets (contd..) How to avoid starvation Transition t1 fires. Which transitions are enabled?

24 Petri nets (contd..) How to avoid starvation Transition t3 fires. Which transitions are enabled? P P P P P t t t t P P t t

25 Petri nets (contd..) How to avoid starvation Transition t5 fires. Which transitions are enabled?

26 Petri nets (contd..) How to avoid starvation Transition t2 fires. Which transitions are enabled? P P P P P t t t t P P t t

27 Petri nets (contd..)  Firing sequence: t1, t3, t5  Firing sequence: t2, t4, t6  The shared resource alternates between the two processes

28 Petri nets (contd..)  Deadlock:  Live:

29 Petri nets (contd..) Initial state of the net

30 Petri nets (contd..) Transition t1 fires

31 Petri nets (contd..) Transition t3’ fires R P P t t t' t" t t' t" t

32 Petri nets (contd..) Transition t2 fires

33 Petri nets (contd..) Transition t4’ fires No transition is enabled. The net is deadlocked. R P P t t t' t" t t' t" t

34 Petri nets (contd..) R P P t t t' t" t t' t" t A deadlock free net

35 Petri nets: Limitations  Tokens are anonymous:  Cannot compute the value of a token  No selection policy to decide between different enabled transitions  Lack exact timing constraints

36 Petri nets: Limitations and extensions P channel1channel2 Token represents a message. Delivery channel depends on the contents. Correct message goes Through one channel, incorrect through the other one.

37 Petri nets: Limitations and extensions  Assign values to tokens  Predicates and functions can be associated with transitions   Firing of a transition implies:  Ready tokens consumed from input places  h new tokens produced by the function associated with the transition go to output places.

38 Petri nets: Limitations and extensions P P P P P tt Assigning values to tokens

39 Petri Net: Case Study Consider the process of producing a document in an organization. Each document is written by two technical writers, one technical writer is responsible for writing the text, while the other writer is responsible for drawing and inserting figures. When the technical writers complete their respective pieces, these pieces are merged into a single draft. This draft is then forwarded to the manager for review. Upon review the manager prints this draft using a printer. The printer is usually available except when it is offline for either maintenance or repair. Draw a Petri net model to represent the document production process.

40 Petri Nets: Case Study WrtTxt DrwFg DrwFgCmp WrtTxtCmp MrgDoc RvDoc PrDoc PrOn PrOff