An Introduction to Petri Nets

Slides:



Advertisements
Similar presentations
School of Computer Science & Software Engineering
Advertisements

Principles of Engineering System Design Dr T Asokan
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.
Course: Software Engineering II academic year: Course Web-site: [ Lecturer: Catia Trubiani.
Principles of Engineering System Design Dr T Asokan
Introduction to Petri Nets Hugo Andrés López
1 Analysis of workflows : Verification, validation, and performance analysis. Wil van der Aalst Eindhoven University of Technology Faculty of Technology.
A university for the world real R © 2009, Chapter 3 Advanced Synchronization Moe Wynn Wil van der Aalst Arthur ter Hofstede.
Petri Nets Section 2 Roohollah Abdipur.
Based on: Petri Nets and Industrial Applications: A Tutorial
Chapter 3 Petri nets Learning objectives : Introduce Petri nets
IE 469 Manufacturing Systems
Discrete Interaction Design Specification Prof. Dr. Matthias Rauterberg Faculty Industrial Design Technical University of Eindhoven
Lei Bu Petri Nets 11 Dining Philosphier 4 States , 5 transitions.
Petri net modeling of biological networks Claudine Chaouiya.
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.
CP — Concurrent Programming 12. Petri Nets Prof. O. Nierstrasz Wintersemester 2005 / 2006.
1 Petri Nets H Plan: –Introduce basics of Petri Net models –Define notation and terminology used –Show examples of Petri Net models u Calaway Park model.
FunState – An Internal Design Representation for Codesign A model that enables representations of different types of system components. Mixture of functional.
1 Petri Nets Marco Sgroi EE249 - Fall 2001 Most slides borrowed from Luciano Lavagno’s lecture ee249 (1998)
Mata kuliah :K0362/ Matematika Diskrit Tahun :2008
Petri Nets An Overview IE 680 Presentation April 30, 2007 Renata Kopach- Konrad.
PETRINETS Nipun Devlekar Zauja Lahtau. PETRINETS DEFINITION : DEFINITION :  PETRINET (place/ transition net): a formal, graphical, executable technique.
From requirements to specification Specification is a refinement of requirements Can be included together as Software Requirements Specifications (SRS)
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.
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.
Stochastic Activity Networks ( SAN ) Sharif University of Technology,Computer Engineer Department, Winter 2013 Verification of Reactive Systems Mohammad.
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.
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.
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 Petri Nets Ina Koch and Monika Heiner. 2 Petri Nets(1962) Carl Adam Petri.
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,
26/04/04 Petri nets in systems biology: creation, analysis and simulation Oliver Shaw School of Computing Science.
Petri-Nets and Other Models
2008/10E-Enterprise Integration - eEI1 Lecture 6 Petri Net Techniques for Modeling Workflows and Their Support of Reuse.
Technology of information systems Lecture 5 Process management.
Process Mining – Concepts and Algorithms Review of literature on process mining techniques for event log data.
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
Clockless Computing COMP
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
Introduction to Petri Nets (PNs)
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:

An Introduction to Petri Nets By Chris Ling

Introduction First introduced by Carl Adam Petri in 1962. A diagrammatic tool to model concurrency and synchronization in distributed systems. Used as a visual communication aid to model the system behaviour. Based on strong mathematical foundation. (C) Copyright 2001, Chris Ling

Example: EFTPOS System (FSM) Initial 1 digit d1 d2 d3 d4 OK pressed approve Approved Rejected Initial state Final state Reject (C) Copyright 2001, Chris Ling

Example: EFTPOS System (A Petri net) Initial 1 digit d1 d2 d3 d4 OK pressed approve approved Reject Rejected! (C) Copyright 2001, Chris Ling

Scenario 2: Exceptional (Enters only 3 digits) EFTPOS Systems Scenario 1: Normal Scenario 2: Exceptional (Enters only 3 digits) (C) Copyright 2001, Chris Ling

Example: EFTPOS System (Token Games) Initial 1 digit d1 d2 d3 d4 OK pressed approve approved Reject Rejected! (C) Copyright 2001, Chris Ling

A Petri Net Specification ... consists of three types of components: places (circles), transitions (rectangles) and arcs (arrows): Places represent possible states of the system; Transitions are events or actions which cause the change of state; And Every arc simply connects a place with a transition or a transition with a place. (C) Copyright 2001, Chris Ling

A Change of State … is a movement of token(s) (black dots) from place(s) to place(s); and is caused by the firing of a transition. The firing represents an occurrence of the event. The firing is subject to the input conditions, denoted by the tokens available. (C) Copyright 2001, Chris Ling

A Change of State A transition is firable or enabled when there are sufficient tokens in its input place. After firing, tokens will be transferred from the input places (old state) to the output places, denoting the new state. (C) Copyright 2001, Chris Ling

Example: Vending Machine The machine dispenses two kinds of snack bars – 20c and 15c. Only two types of coins can be used – 10c coins and 5c coins. The machine does not return any change. (C) Copyright 2001, Chris Ling

Example: Vending Machine (Finite State Machine) 0 cent 5 cents 10 cents 15 cents 20 cents Deposit 5c Deposit 10c Take 20c snack bar Take 15c snack bar (C) Copyright 2001, Chris Ling

Example: Vending Machine (A Petri net) Take 15c bar Deposit 5c 0c Deposit 10c Deposit 5c 10c Deposit 20c 15c Take 20c bar (C) Copyright 2001, Chris Ling

Example: Vending Machine (3 Scenarios) Deposit 5c, deposit 5c, deposit 5c, deposit 5c, take 20c snack bar. Scenario 2: Deposit 10c, deposit 5c, take 15c snack bar. Scenario 3: Deposit 5c, deposit 10c, deposit 5c, take 20c snack bar. (C) Copyright 2001, Chris Ling

Example: Vending Machine (Token Games) Take 15c bar Deposit 5c 0c Deposit 10c Deposit 5c 10c Deposit 20c 15c Take 20c bar (C) Copyright 2001, Chris Ling

Example: In a Restaurant (A Petri Net) Waiter free Customer 1 Customer 2 Take order Take order wait Order taken wait eating eating Tell kitchen Serve food Serve food (C) Copyright 2001, Chris Ling

Example: In a Restaurant (Two Scenarios) Waiter takes order from customer 1; serves customer 1; takes order from customer 2; serves customer 2. Scenario 2: Waiter takes order from customer 1; takes order from customer 2; serves customer 2; serves customer 1. (C) Copyright 2001, Chris Ling

Example: In a Restaurant (Scenario 1) Waiter free Customer 1 Customer 2 Take order Order taken Tell kitchen wait Serve food eating (C) Copyright 2001, Chris Ling

Example: In a Restaurant (Scenario 2) Waiter free Customer 1 Customer 2 Take order Order taken Tell kitchen wait Serve food eating (C) Copyright 2001, Chris Ling

What is a Petri Net Structure A directed, weighted, bipartite graph G = (V,E) Nodes (V) places (shown as circles) transitions (shown as bars) Arcs (E) from a place to a transition or from a transition to a place labelled with a weight (a positive integer, omitted if it is 1) (C) Copyright 2001, Chris Ling

Marking Marking (M) An m-vector (k0,k1,…,km) m: the number of places ki >= 0: the number of “tokens” in place pi (C) Copyright 2001, Chris Ling

A marking is a state ... M0 = (1,0,0,0,0) M1 = (0,1,0,0,0) 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 p3 t9 (C) Copyright 2001, Chris Ling

Another Example A producer-consumer system, consist of one producer, two consumers and one storage buffer with the following conditions: The storage buffer may contain at most 5 items; The producer sends 3 items in each production; At most one consumer is able to access the storage buffer at one time; Each consumer removes two items when accessing the storage buffer (C) Copyright 2001, Chris Ling

A Producer-Consumer Example In this Petri net, every place has a capacity and every arc has a weight. This allows multiple tokens to reside in a place. (C) Copyright 2001, Chris Ling

A Producer-Consumer System k=2 k=1 accepted ready p1 p4 Buffer p3 produce accept 3 2 t1 t2 t3 t4 consume send k=5 p2 p5 idle ready k=1 k=2 Producer Consumers (C) Copyright 2001, Chris Ling

A Producer-Consumer System k=2 k=1 accepted ready p1 p4 Buffer p3 produce accept 3 2 t1 t2 t3 t4 consume send k=5 p2 p5 idle ready k=1 k=2 Producer Consumers (C) Copyright 2001, Chris Ling

A Producer-Consumer System k=2 k=1 accepted ready p1 p4 Buffer p3 produce accept 3 2 t1 t2 t3 t4 consume send k=5 p2 p5 idle ready k=1 k=2 Producer Consumers (C) Copyright 2001, Chris Ling

A Producer-Consumer System k=2 k=1 accepted ready p1 p4 Buffer p3 produce accept 3 2 t1 t2 t3 t4 consume send k=5 p2 p5 idle ready k=1 k=2 Producer Consumers (C) Copyright 2001, Chris Ling

A Producer-Consumer System k=2 k=1 accepted ready p1 p4 Buffer p3 produce accept 3 2 t1 t2 t3 t4 consume send k=5 p2 p5 idle ready k=1 k=2 Producer Consumers (C) Copyright 2001, Chris Ling

A Producer-Consumer System k=2 k=1 accepted ready p1 p4 Buffer p3 produce accept 3 2 t1 t2 t3 t4 consume send k=5 p2 p5 idle ready k=1 k=2 Producer Consumers (C) Copyright 2001, Chris Ling

Formal Definition of Petri Net N = (P, T, F, W) is a Petri net structure A Petri net with the given initial marking is denoted by (N, M0 ) (C) Copyright 2001, Chris Ling

Formal Definition of Petri Net (C) Copyright 2001, Chris Ling

Inhibitor Arc Elevator Button (Figure 10.21) Press Elevator in Button Button Pressed Press Button Elevator in action At Floor g At Floor f (C) Copyright 2001, Chris Ling

Net Structures A sequence of events/actions: Concurrent executions: e1 (C) Copyright 2001, Chris Ling

Net Structures Non-deterministic events - conflict, choice or decision: A choice of either e1 or e3. e1 e2 e3 e4 (C) Copyright 2001, Chris Ling

Net Structures Synchronization e1 (C) Copyright 2001, Chris Ling

Net Struture – Confusion Murata (1989) (C) Copyright 2001, Chris Ling

Modelling Examples Finite State Machines Parallel Activities Dataflow Computation Communication Protocols Synchronisation Control Producer Consumer Systems Multiprocessor Systems (C) Copyright 2001, Chris Ling

Properties Behavioural properties Structural properties Properties hold given an initial marking Structural properties Independent of initial markings Relies on the topology of the net structure. (C) Copyright 2001, Chris Ling

Behavioural Properties Reachability Boundedness Liveness Reversibility Coverability Etc.... (C) Copyright 2001, Chris Ling

Reachability p1 t8 t1 t2 p2 t3 p3 t4 t5 t6 p5 t7 p4 t9 Initial marking:M0 M0 = (1,0,0,0,0) M1 = (0,1,0,0,0) M2 = (0,0,1,0,0) M3 = (0,0,0,1,0) M4 = (0,0,0,0,1) M0 M1 M2 M3 M4 t3 t1 t5 t8 t2 t6 (C) Copyright 2001, Chris Ling

Reachability “M2 is reachable from M1 and M4 is reachable from M0.” A firing or occurrence sequence: “M2 is reachable from M1 and M4 is reachable from M0.” In fact, in the vending machine example, all markings are reachable from every marking. (C) Copyright 2001, Chris Ling

Reachability Reachability or Coverability Tree M0 M1 M2 M3 M4 t1 t2 t3 (C) Copyright 2001, Chris Ling

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 k for any marking reachable from M0. The Petri net for vending machine is 1-bounded and the Petri net for the producer-consumer system is not bounded. A 1-bounded Petri net is also safe. (C) Copyright 2001, Chris Ling

Liveness 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 live Petri net guarantees deadlock-free operation, no matter what firing sequence is chosen. (C) Copyright 2001, Chris Ling

Liveness The vending machine is live and the producer-consumer system is also live. A transition is dead if it can never be fired in any firing sequence. (C) Copyright 2001, Chris Ling

An Example A bounded but non-live Petri net t1 p3 t3 t4 p1 p2 p4 t2 (C) Copyright 2001, Chris Ling

Another Example An unbounded but live Petri net M0 = (1, 0, 0, 0, 0) (C) Copyright 2001, Chris Ling

Structural Properties Structurally live There exists a live initial marking for N Controllability Any marking is reachable for any other marking Structural Boundedness Bounded for any finite initial marking Conservativeness Total number of tokens in the net is a constant (C) Copyright 2001, Chris Ling

Net Structures Subclasses of Petri Nets (PN): State Machine (SM) Marked Graph (MG) Free Choice (FC) Extended Free Choice (EFC) Asymmetric Choice (AC) (C) Copyright 2001, Chris Ling

Analysis Methods Reachability Analysis: Reachability or coverability tree. State explosion problem. Incidence Matrix and State Equations. Structural Analysis Based on net structures. (C) Copyright 2001, Chris Ling

Analysis Methods Reduction Rules: reduce the model to a simpler one. For example: (C) Copyright 2001, Chris Ling

Other Types of Petri Nets High-level Petri nets Tokens have “colours”, holding complex information. Timed Petri nets Time delays associated with transitions and/or places. Fixed delays or interval delays. Stochastic Petri nets: exponentially distributed random variables as delays. (C) Copyright 2001, Chris Ling

Other Types of Petri Nets Object-Oriented Petri nets Tokens are instances of classes, moving from one place to another, calling methods and changing attributes. Net structure models the inner behaviour of objects. The purpose is to use object-oriented constructs to structure and build the system. (C) Copyright 2001, Chris Ling

My Thesis Title: Petri net modelling and analysis of real-time systems based on net structure [manuscript] / by Sea Ling (1998) Monash University. Thesis. Monash University. School of Computer Science and Software Engineering. Publication notes: Thesis (Ph.D.)--Monash University, 1998. (C) Copyright 2001, Chris Ling

Other works Business processes and workflows Wil van der Aalst Petri net markup language (PNML) Agent technology SOA and Web services Grid (C) Copyright 2001, Chris Ling

References Murata, T. (1989, April). Petri nets: properties, analysis and applications. Proceedings of the IEEE, 77(4), 541-80. Peterson, J.L. (1981). Petri Net Theory and the Modeling of Systems. Prentice-Hall. Reisig, W and G. Rozenberg (eds) (1998). Lectures on Petri Nets 1: Basic Models. Springer-Verlag. The World of Petri nets: http://www.daimi.au.dk/PetriNets/ (C) Copyright 2001, Chris Ling