Petri Nets Copyright, 2003 © Jerzy R. Nawrocki Models and Analysis of Software Lecture.

Slides:



Advertisements
Similar presentations
School of Computer Science & Software Engineering
Advertisements

Principles of Engineering System Design Dr T Asokan
Distributed Snapshots: Determining Global States of Distributed Systems Joshua Eberhardt Research Paper: Kanianthra Mani Chandy and Leslie Lamport.
1 SE-561 Formal Methods in Software Petri Nets - I.
An Introduction to Petri Nets
Introduction to Petri Nets Hugo Andrés López
Petri Nets Section 2 Roohollah Abdipur.
Based on: Petri Nets and Industrial Applications: A Tutorial
Procedures for CMM Level 2 Copyright, 2000 © Jerzy R. Nawrocki Quality Management.
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
Petri net modeling of biological networks Claudine Chaouiya.
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.
Banker’s Algorithm Implementation in CPN Tools Michal Žarnay Department of Transportation Networks University of Žilina, Slovakia.
CSC 402 Requirements Engineering 1 Requirements Techniques, cont. Formal requirements analysis techniques include: – DFD (covered) – ERD (covered) – Finite.
CP — Concurrent Programming 12. Petri Nets Prof. O. Nierstrasz Wintersemester 2005 / 2006.
Requirements Techniques, cont. Brief review Formal Requirements Techniques –Finite State Machines –Petri Nets.
Introduction to ISO 9001:2000 Copyright, 2002 © Jerzy R. Nawrocki Quality Management.
Mata kuliah :K0362/ Matematika Diskrit Tahun :2008
Petri Nets An Overview IE 680 Presentation April 30, 2007 Renata Kopach- Konrad.
RequisitePro (2) Copyright, 2001 © Jerzy R. Nawrocki Requirements Engineering.
PETRINETS Nipun Devlekar Zauja Lahtau. PETRINETS DEFINITION : DEFINITION :  PETRINET (place/ transition net): a formal, graphical, executable technique.
DiscussionsDiscussions Copyright, 2001 © Jerzy R. Nawrocki Quality Management.
Requirements specification Copyright, 2001 © Jerzy R. Nawrocki Quality Management.
Lecture 9 Petri Net Reaction tank – an application example.
From requirements to specification Specification is a refinement of requirements Can be included together as Software Requirements Specifications (SRS)
Standard SRS Copyright, 2001 © Jerzy R. Nawrocki Requirements Engineering Lecture.
An Introduction to Petri Nets Marjan Sirjani Formal Methods Laboratory University of Tehran.
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.
Introduction to Rational Robot Copyright, 2001 © Jerzy R. Nawrocki Quality Management.
CMM Level 2: Repeatable Copyright, 2000 © Jerzy R. Nawrocki Quality Management.
CY2003 Computer Systems Lecture 7 Petri net. © LJMU, 2004CY2003- Week 72 Overview Petri net –concepts –Petri net representation –Firing a transition –Marks.
Quality of Usage Scenarios Copyright, 2000 © Jerzy R. Nawrocki Quality Management.
Virtual Storytelling Adam Abonyi Daniel Balaš. Agenda 1.Introduction to virtual storytelling 2.Petri Nets 3.Our improvements in Petri Nets 4.Example.
Introduction to SoDA Copyright, 2001 © Jerzy R. Nawrocki Requirements Engineering.
Introduction to Requirements Engineering Copyright, 2000 © Jerzy R. Nawrocki Requirements.
Stochastic Activity Networks ( SAN ) Sharif University of Technology,Computer Engineer Department, Winter 2013 Verification of Reactive Systems Mohammad.
Integrating UML and Petri Nets Problem with Current Software Engineering Methodology Stochastic Petri nets and their useful properties Translating UML.
Petri Nets Lecturer: Roohollah Abdipour. Agenda Introduction Petri Net Modelling with Petri Net Analysis of Petri net 2.
CAP 4800/CAP 5805: Computer Simulation Concepts
Modelling by Petri nets
Ch5: Software Specification. 1 Petri Nets  Introduced by C. Adams Petri in  Widely used in the modeling and analysis of computer systems.  Basic.
CIS 842: Specification and Verification of Reactive Systems Lecture INTRO-Examples: Simple BIR-Lite Examples Copyright 2004, Matt Dwyer, John Hatcliff,
Configuration Management at CMM Level 2 Copyright, 2000 © Jerzy R. Nawrocki Requirements.
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
/faculteit technologie management PN-1 Petri nets refresher Prof.dr.ir. Wil van der Aalst Eindhoven University of Technology, Faculty of Technology Management,
DiscussionsDiscussions Copyright, 2001 © Jerzy R. Nawrocki Requirements Engineering.
Introduction to Quality Management Copyright, 2000 © Jerzy R. Nawrocki Quality.
Statecharts Copyright, 2003 © Jerzy R. Nawrocki Models & Analysis of Software Lecture 6.
Introduction to SoDA Copyright, 2001 © Jerzy R. Nawrocki Quality Management Lecture.
Programming what is C++
Requirements Techniques, cont.
GC101 Introduction to computers and programs
Dr. Eng Amr T. Abdel-Hamid
Clockless Computing COMP
Stochastic Activity Networks
CAP 4800/CAP 5805: Computer Simulation Concepts
CAP 4800/CAP 5805: Computer Simulation Concepts
CSCI1600: Embedded and Real Time Software
Modeling based on Petri-nets.
COT 5611 Operating Systems Design Principles Spring 2012
An Introduction to Petri Nets
CAP 4800/CAP 5805: Computer Simulation Concepts
Petri Net :Abstract formal model of information flow Major use:
CSCI1600: Embedded and Real Time Software
Petri Nets Laurie Frazier.
Presentation transcript:

Petri Nets Copyright, 2003 © Jerzy R. Nawrocki Models and Analysis of Software Lecture 7 Models and Analysis of Software Lecture 7

J. Nawrocki, Models & Analysis of Soft. From the previous lecture.. AB e(c) / a e - event c - condition a - action Examples: sending a signal, assignment statement. Action: an instantaneous occurrence ideally takes zero time.

J. Nawrocki, Models & Analysis of Soft. From the previous lecture.. while (a != b) if (a > b) if (a > b) a -= b; a -= b; else b -= a; else b -= a; while (a != b) if (a > b) if (a > b) a -= b; a -= b; else b -= a; else b -= a; E S Loop AB (a>b) / a-=b (b>a) / b-=a B (a=b) a: b:

J. Nawrocki, Models & Analysis of Soft. OrthogonalityOrthogonality B C   (in G) A E F G     D 

J. Nawrocki, Models & Analysis of Soft. From the previous lecture.. Activity: similar to action but takes a nonzero amount of time Examples: reading input beeping displaying lengthy computations

J. Nawrocki, Models & Analysis of Soft. Plan of the lecture From the previous lecture.. Introduction Simple examples Concurrent transitions Transitions in conflict Another example Readers and writers Properties of Petri Nets

J. Nawrocki, Models & Analysis of Soft. Carl Adam Petri Born on July, 12, 1926 in Leipzig Since 1988: Honorary Prof. at the Univ. of Hamburg Kommunikation mit Automaten. Petri, C.A., Bonn: Institut für Instrumentelle Mathematik, Schriften des IIM Nr. 2, 1962, Second Edition:, New York: Griffiss Air Force Base, Technical Report RADC-TR , Vol.1, 1966, English translation.

J. Nawrocki, Models & Analysis of Soft. IntroductionIntroduction Petri nets: a graphical language a good mathematical background Applications: modelling concurrent and/or distributed systems communication protocols, computer networks, manufacturing system, public transport systems etc.

J. Nawrocki, Models & Analysis of Soft. TerminologyTerminology A place A transition A token An input arc An output arc

J. Nawrocki, Models & Analysis of Soft. Plan of the lecture From the previous lecture.. Introduction Simple examples Concurrent transitions Transitions in conflict Another example Readers and writers Properties of Petri Nets

J. Nawrocki, Models & Analysis of Soft. A very simple example A reader in a library: waiting, reading. waiting reading strt_reading stop_reading

J. Nawrocki, Models & Analysis of Soft. A very simple example A reader in a library: waiting, reading. waiting reading strt_reading stop_reading

J. Nawrocki, Models & Analysis of Soft. A very simple example A reader in a library: waiting, reading. waiting reading strt_reading stop_reading

J. Nawrocki, Models & Analysis of Soft. A very simple example A reader in a library: waiting, reading. waiting reading strt_reading stop_reading

J. Nawrocki, Models & Analysis of Soft. A very simple example A reader in a library: waiting, reading. waiting reading strt_reading stop_reading

J. Nawrocki, Models & Analysis of Soft. waiting reading strt_reading stop_reading Another simple example Two readers in a library: waiting, reading.

J. Nawrocki, Models & Analysis of Soft. waiting reading strt_reading stop_reading Another simple example Two readers in a library: waiting, reading.

J. Nawrocki, Models & Analysis of Soft. waiting reading strt_reading stop_reading Another simple example Two readers in a library: waiting, reading.

J. Nawrocki, Models & Analysis of Soft. waiting reading strt_reading stop_reading Another simple example Two readers in a library: waiting, reading.

J. Nawrocki, Models & Analysis of Soft. Plan of the lecture From the previous lecture.. Introduction Simple examples Concurrent transitions Transitions in conflict Another example Readers and writers Properties of Petri Nets

J. Nawrocki, Models & Analysis of Soft. Concurrent transitions 2

J. Nawrocki, Models & Analysis of Soft. Concurrent transitions 2

J. Nawrocki, Models & Analysis of Soft. Concurrent transitions 2

J. Nawrocki, Models & Analysis of Soft. Plan of the lecture From the previous lecture.. Introduction Simple examples Concurrent transitions Transitions in conflict Another example Readers and writers Properties of Petri Nets

J. Nawrocki, Models & Analysis of Soft. Transitions in conflict

J. Nawrocki, Models & Analysis of Soft. Transitions in conflict

J. Nawrocki, Models & Analysis of Soft. Transitions in conflict A decision point

J. Nawrocki, Models & Analysis of Soft. Plan of the lecture From the previous lecture.. Introduction Simple examples Concurrent transitions Transitions in conflict Another example Readers and writers Properties of Petri Nets

J. Nawrocki, Models & Analysis of Soft. Another example while (true) { t 1 ;... t 2 ;... t 3 ; } while (.. t 4..) {... t 5 ;... } Client Server

J. Nawrocki, Models & Analysis of Soft. Another example while (1) { t 1 ;... t 2 ;... t 3 ; } while (..t 4..) {... t 5 ;... } t1t1 t2t2 t3t3 t4t4 t5t5

J. Nawrocki, Models & Analysis of Soft. Another example while (1) { t 1 ;... t 2 ;... t 3 ; } while (..t 4..) {... t 5 ;... } t1t1 t2t2 t3t3 t4t4 t5t5

J. Nawrocki, Models & Analysis of Soft. Another example while (1) { t 1 ;... t 2 ;... t 3 ; } while (..t 4..) {... t 5 ;... } t1t1 t2t2 t3t3 t4t4 t5t5

J. Nawrocki, Models & Analysis of Soft. Another example while (1) { t 1 ;... t 2 ;... t 3 ; } while (..t 4..) {... t 5 ;... } t1t1 t2t2 t3t3 t4t4 t5t5

J. Nawrocki, Models & Analysis of Soft. Another example while (1) { t 1 ;... t 2 ;... t 3 ; } while (..t 4..) {... t 5 ;... } t1t1 t2t2 t3t3 t4t4 t5t5

J. Nawrocki, Models & Analysis of Soft. Another example while (1) { t 1 ;... t 2 ;... t 3 ; } while (..t 4..) {... t 5 ;... } t1t1 t2t2 t3t3 t4t4 t5t5

J. Nawrocki, Models & Analysis of Soft. Another example while (1) { t 1 ;... t 2 ;... t 3 ; } while (..t 4..) {... t 5 ;... } t1t1 t2t2 t3t3 t4t4 t5t5

J. Nawrocki, Models & Analysis of Soft. Another example while (1) { t 1 ;... t 2 ;... t 3 ; } while (..t 4..) {... t 5 ;... } t1t1 t2t2 t3t3 t4t4 t5t5

J. Nawrocki, Models & Analysis of Soft. Another example while (1) { t 1 ;... t 2 ;... t 3 ; } while (..t 4..) {... t 5 ;... } t1t1 t2t2 t3t3 t4t4 t5t5

J. Nawrocki, Models & Analysis of Soft. Another example while (1) { t 1 ;... t 2 ;... t 3 ; } while (..t 4..) {... t 5 ;... } t1t1 t2t2 t3t3 t4t4 t5t5

J. Nawrocki, Models & Analysis of Soft. Another example while (1) { t 1 ;... t 2 ;... t 3 ; } while (..t 4..) {... t 5 ;... } t1t1 t2t2 t3t3 t4t4 t5t5

J. Nawrocki, Models & Analysis of Soft. Another example while (1) { t 1 ;... t 2 ;... t 3 ; } while (..t 4..) {... t 5 ;... } t1t1 t2t2 t3t3 t4t4 t5t5 (t 1 (t 2 || t 4 (t 5 t 4 )*) t 3 )*

J. Nawrocki, Models & Analysis of Soft. Plan of the lecture From the previous lecture.. Introduction Simple examples Concurrent transitions Transitions in conflict Another example Readers and writers Properties of Petri Nets

J. Nawrocki, Models & Analysis of Soft. Readers and writers while(1) { Read(d); Use(d); } while(1) { Think(d); Write(d); }

J. Nawrocki, Models & Analysis of Soft. Readers and writers Library

J. Nawrocki, Models & Analysis of Soft. Readers and writers Library

J. Nawrocki, Models & Analysis of Soft. Readers and writers while(1) { Read(d); Use(d); } while(1) { Think(d); Write(d); }

J. Nawrocki, Models & Analysis of Soft. Readers and writers while(1) { StartRead(); Read(d); StopRead(); Use(d); } while(1) { Think(d); StartWrite(); Write(d); StopWrite(); }

J. Nawrocki, Models & Analysis of Soft. Readers and writers void StartRead() { ReadersIn++; } void StartWrite() { WritersIn++; } void StopRead() {ReadersIn--; } void StopWrite() {WritersIn--; }

J. Nawrocki, Models & Analysis of Soft. Readers and writers void StartRead() { wait(Readers); ReadersIn++; } void StartWrite() { wait(Writers); WritersIn++; } void StopRead() {ReadersIn--; signal(Writers); } void StopWrite() {WritersIn--; signal(Writers); signal(Readers); }

J. Nawrocki, Models & Analysis of Soft. Readers and writers void StartRead() {if(WritersIn > 0) wait(Readers); ReadersIn++; } void StartWrite() {if(ReadersIn > 0 || WritersIn > 0) wait(Writers); WritersIn++; } void StopRead() {ReadersIn--; if(ReadersIn == 0) signal(Writers); } void StopWrite() {WritersIn--; if(!Empty(Writers)) signal(Writers); else if(!Empty(Readers)) signal(Readers); }

J. Nawrocki, Models & Analysis of Soft. Readers and writers StartRead while(1) { StartRead(); Read(d); StopRead(); Use(d); } while(1) { Think(d); StartWrite(); Write(d); StopWrite(); } StopRead StopWrite StartWrite 2 2

J. Nawrocki, Models & Analysis of Soft. Readers and writers StartRead while(1) { StartRead(); Read(d); StopRead(); Use(d); } while(1) { Think(d); StartWrite(); Write(d); StopWrite(); } StopRead StopWrite StartWrite 2 2

J. Nawrocki, Models & Analysis of Soft. Readers and writers StartRead while(1) { StartRead(); Read(d); StopRead(); Use(d); } while(1) { Think(d); StartWrite(); Write(d); StopWrite(); } StopRead StopWrite StartWrite 2 2

J. Nawrocki, Models & Analysis of Soft. Readers and writers StartRead while(1) { StartRead(); Read(d); StopRead(); Use(d); } while(1) { Think(d); StartWrite(); Write(d); StopWrite(); } StopRead StopWrite StartWrite 2 2

J. Nawrocki, Models & Analysis of Soft. Readers and writers StartRead while(1) { StartRead(); Read(d); StopRead(); Use(d); } while(1) { Think(d); StartWrite(); Write(d); StopWrite(); } StopRead StopWrite StartWrite 2 2

J. Nawrocki, Models & Analysis of Soft. Readers and writers StartRead while(1) { StartRead(); Read(d); StopRead(); Use(d); } while(1) { Think(d); StartWrite(); Write(d); StopWrite(); } StopRead StopWrite StartWrite 2 2

J. Nawrocki, Models & Analysis of Soft. Readers and writers StartRead while(1) { StartRead(); Read(d); StopRead(); Use(d); } while(1) { Think(d); StartWrite(); Write(d); StopWrite(); } StopRead StopWrite StartWrite 2 2

J. Nawrocki, Models & Analysis of Soft. Readers and writers StartRead while(1) { StartRead(); Read(d); StopRead(); Use(d); } while(1) { Think(d); StartWrite(); Write(d); StopWrite(); } StopRead StopWrite StartWrite 2 2

J. Nawrocki, Models & Analysis of Soft. Readers and writers StartRead while(1) { StartRead(); Read(d); StopRead(); Use(d); } while(1) { Think(d); StartWrite(); Write(d); StopWrite(); } StopRead StopWrite StartWrite 2 2

J. Nawrocki, Models & Analysis of Soft. Readers and writers StartRead while(1) { StartRead(); Read(d); StopRead(); Use(d); } while(1) { Think(d); StartWrite(); Write(d); StopWrite(); } StopRead StopWrite StartWrite 2 2

J. Nawrocki, Models & Analysis of Soft. Readers and writers StartRead while(1) { StartRead(); Read(d); StopRead(); Use(d); } while(1) { Think(d); StartWrite(); Write(d); StopWrite(); } StopRead StopWrite StartWrite 2 2

J. Nawrocki, Models & Analysis of Soft. Readers and writers StartRead while(1) { StartRead(); Read(d); StopRead(); Use(d); } while(1) { Think(d); StartWrite(); Write(d); StopWrite(); } StopRead StopWrite StartWrite 2 2

J. Nawrocki, Models & Analysis of Soft. Readers and writers StartRead while(1) { StartRead(); Read(d); StopRead(); Use(d); } while(1) { Think(d); StartWrite(); Write(d); StopWrite(); } StopRead StopWrite StartWrite 2 2

J. Nawrocki, Models & Analysis of Soft. Plan of the lecture From the previous lecture.. Introduction Simple examples Concurrent transitions Transitions in conflict Another example Readers and writers Properties of Petri Nets

J. Nawrocki, Models & Analysis of Soft. Properties of Petri Nets Reachability of a given marking k-Boundedness: A number of tokens in each place never exceeds k for any marking M reachable from the initial marking. K-Boundedness

J. Nawrocki, Models & Analysis of Soft. Properties of Petri Nets A PN is live if for every marking M reachable from the initial marking M 0 it is possible eventually to fire every transition in the net in some marking M’ which is reachable from M. Liveness

J. Nawrocki, Models & Analysis of Soft. Properties of Petri Nets An infinite firing sequence s is said to be globally fair if every transition appears in s infinitely often. Global fairness

J. Nawrocki, Models & Analysis of Soft. SummarySummary Petri nets: a simple modelling tool oriented towards concurrent and distributed systems. Timed Petri Nets Coloured Petri Nets Stochastic Petri Nets

J. Nawrocki, Models & Analysis of Soft. Further readings  James L. Peterson, Petri Nets, Computing Surveys, vol. 9, No. 3, September 1977, 223 – 252. N. Nissanke, Realtime Systems, Prentice Hall, London, 1997.

J. Nawrocki, Models & Analysis of Soft. HomeworkHomework Translate the statechart given below to Petri Nets. B C   (in G) A E F G     D

J. Nawrocki, Models & Analysis of Soft. HomeworkHomework Prepare a model of a file access control protocol allowing up to four concurrent readers in read- only mode or a single writer in exclusive read and write mode. Draw statechart counterparts of the presented Petri Nets.

J. Nawrocki, Models & Analysis of Soft. Quality assessment 1. What is your general impression? (1 - 6) 2. Was it too slow or too fast? 3. What important did you learn during the lecture? 4. What to improve and how?