Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
8 views37 pages

L-2 Modeling With PN

The document discusses the modeling and analysis of Petri Nets, including Generalized Petri Nets (GPN) and their applications. It covers the structure of Petri Nets, firing transitions, reachability, and the limitations of GPN, leading to the evolution of Higher-Level Nets (HLN). Additionally, it provides insights into the representation and operations of Petri Nets, including concepts of boundedness and reachability trees.

Uploaded by

Diwyanshu Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views37 pages

L-2 Modeling With PN

The document discusses the modeling and analysis of Petri Nets, including Generalized Petri Nets (GPN) and their applications. It covers the structure of Petri Nets, firing transitions, reachability, and the limitations of GPN, leading to the evolution of Higher-Level Nets (HLN). Additionally, it provides insights into the representation and operations of Petri Nets, including concepts of boundedness and reachability trees.

Uploaded by

Diwyanshu Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 37

8/22/2025

Modeling with Petri Net

Evolution and Applications

www.cucse.org/NC.htm

Outline

 Introduction
 Generalized Petri Nets (GPN)
 Modeling & Analysis using GPN
 Matrix Representation of PN
 Limitations of GPN and evolution of HLN
 Applications

22 August 2025 2

1
8/22/2025

Outline

 Introduction
 Generalized Petri Nets (GPN)
 Modeling & Analysis using GPN
 Matrix Representation of PN
 Limitations of GPN and evolution of HLN
 Applications

22 August 2025 3

Petri Net

 The graphics, together with the rules


for their coarsening and refinement,
were invented by Carl Adam Petri at
the age of 13!!!
 The purpose was to describe
chemical processes

22 August 2025
http://www.scholarpedia.org/article/Petri_net 4

2
8/22/2025

Petri Net

 Petri net (PN) is a event-modeling


tool.
 Graphically it’s like a directed graph.
 A typical Petri net (PN) has a set of
places (P), transitions (T), an input
function (I) and an output function.
 PN = {P, T, I, O}, where I, O: P→T ˅
T→P.
 A transition fires only if it is enabled. 6
22 August 2025

3
8/22/2025

Making of Sandwich

22 August 2025 Nabendu Chaki, University of Calcutta, India 7

Making of Sandwich

22 August 2025 Nabendu Chaki, University of Calcutta, India 8

4
8/22/2025

Making of Sandwich

22 August 2025 Nabendu Chaki, University of Calcutta, India 9

A PetriofNet
Firing Transitions
p1 p2
t4

Places

t1 p3

t3 Transitions
p4

μ = (1, 0, 1, 1, 0)

p5 t2

22 August 2025 10

10

5
8/22/2025

Representation of PN

 P = {p1, p2, p3, p4, p5}


 T = {t1, t2, t3, t4}
 I(p1) = t4, I(p2) = t2, I(p3) = Ø, I(p4) =
t1, I(p5) = {t2, t3}
 O(p1) = t1, O(p2) = t1, O(p3) = t1,
O(p4) = {t2, t3}, O(p5) = Ø

22 August 2025 11

11

A PetriofNet
Firing Transitions
p1 p2
t4

t1 p3

t3
p4

μ = (1, 0, 1, 1, 0)

p5 t2

22 August 2025 12

12

6
8/22/2025

Representation of PN

 P = {p1, p2, p3, p4, p5}


 T = {t1, t2, t3, t4}
 The input-output function may also
be defined as a mapping set of
places to the set of transitions
 I(t1) = {p1, p2, p3}, I(t2) = p4, I(t3) = p4,
I(t4) = Ø
 O(t1)= {p4}, O(t2)= {p2, p5}, O(t3)=
{p5}, O(t4)= {p1}
22 August 2025 13

13

Alternate Definition of Petri Net

 Formally, an ordinary Petri net


may also be defined as PN = (P,
T, F) where,
F  (P X T) U (T X P)
 F may be derived from I and O
defined earlier and vice versa

22 August 2025 14

14

7
8/22/2025

Alternate Representation of PN

 P = {p1, p2, p3, p4, p5}


 T = {t1, t2, t3, t4}
 F = {(p1, t1), (p2,t1), (p3,t1), (p4,t2),
(p4,t3), (t4,p1), (t2, p2), (t1, p4), (t2,
p5), (t3,p5)}

22 August 2025 15

15

Firing of Petri Net

 The pre-condition for firing an event


is modelled by placing tokens in input
places
 A transition tk is enabled if each input
place p of tk has a token in it
 The state of a PN is defined by the
number of tokens in each place and
is represented by a vector μ called
the marking vector.
22 August 2025 Nabendu Chaki, University of Calcutta, India 16

16

8
8/22/2025

A
Firing
Petriof
Net with Tokens
p1 p2
t4

Places

t1 p3

t3 Transitions
p4

μ = (1, 0, 1, 1, 0)
Tokens
p5 t2

22 August 2025 μ0 = [1, 0, 1, 1, 0] 17

17

Ordinary Petri Net

 In an ordinary Petri net, all arcs are of


unit weight.
 Firing of a transition is instantaneous
 In an ordinary Petri net, firing causes
removal of token from each of the
input places and adding token into
each of the output places.

22 August 2025 Nabendu Chaki, University of Calcutta, India 18

18

9
8/22/2025

Firing ofTransitions
Firing of Event in a Petri Net
p1 p2
t4

t1 p3

t3
p4

μ = (1, 0, 1, 1, 0)

p5 t2

22 August 2025 19

19

Firing ofTransitions
Firing of Event in a Petri Net
p1 p2
t4

t1 p3

t3 t2 t1
p4
μ = [1, 1, 1, 0, 1]
μ = (1, 0, 1, 1, 0)
μ = [0, 0, 0, 1, 1]
p5 t2

22 August 2025 μ0 = [1, 0, 1, 1, 0] 20

20

10
8/22/2025

Pre-Set and Post-Set for PN

 It is equivalent to say that the place pk has


a marking μ(pk) or place pk has μ(pk)
number of tokens in it.
 We denote μ(pk) as μk
 The pre-set of a place pk is the set of input
transitions of pk: •pk = {th  T: (th, pk)  F)}
 The post-set of a place pk is the set of
output transitions of pk: pk• = {th  T: (pk,
th)  F)}
 Similar definitions applies for transitions 21
22 August 2025

21

Pre-Set and Post-Set for PN

 The definition of pre-set and


post-set are extended for a set
of places and transitions too.
 If A  P, then
 •A = ∪ •p ∀ 𝑝 ∈ 𝐴, and
 A• = ∪ p• ∀ 𝑝 ∈ 𝐴

22 August 2025 Nabendu Chaki, University of Calcutta, India 22

22

11
8/22/2025

Pre-Set and Post-Set for PN

 In our example,
 •p1={t4}; •p2={t2}; •p3=ϕ,
•p4={t1} and •p5={t2,t3}
 Similarly,
 p1•={t1}; p2•={t1}; p3•={t1}, p4•={t2} and
p5•= ϕ
 I(p) is equivalent to •p
 O(p) is equivalent to p• 23
22 August 2025

23

Operations on PN

 The marking μ enables a transition t if


 p  •t such that μ(p) = 1
 If μ’ is the new marking after t fires, then
μ’ = μ(p) - 1 if p  •t
= μ(p) +1 if p  t•
= μ(p), otherwise
t
 μ → μ’ represents that firing of transition t
has resulted in the new marking μ’ from μ
22 August 2025 24

24

12
8/22/2025

Outline

 Introduction
 Generalized Petri Nets (GPN)
 Modeling & Analysis using GPN
 Matrix Representation of PN
 Limitations of GPN and evolution of HLN
 Applications

22 August 2025 25

25

Generalized Petri Net

 A Generalized PN is a quadruple (P, T,


F, W) where W is the weight function
that associates each edge with a
numeric weight.
 W: F → N, the set of natural numbers
 A transition tk is enabled if each input
place p of tk has at least w(p, tk)
number of tokens, where w(p, tk) is the
weight of the arc from p to tk.
22 August 2025 Nabendu Chaki, University of Calcutta, India 26

26

13
8/22/2025

Firing of Transitions

22 August 2025 Nabendu Chaki, University of Calcutta, India 27

27

Firing Rule for GPN

 A marking μ enables a transition t if


 p  •t such that μ(p) ≥ W(p,t)
 If μ’ is the new marking after t fires, then
μ’ = μ(p) - W(p,t) if p  •t
= μ(p) + W(p,t) if p  t•
= μ(p) - W(pi,t) + W(pk,t)
 pi: pi •t ∩ pk :pk  t•
= μ(p), otherwise

22 August 2025 Nabendu Chaki, University of Calcutta, India 28

28

14
8/22/2025

Firing Modes for PN

 The firing mode of enabled


transitions has been classified on
when an enabled transition fires
 Strong firing mode
 An enabled transition has to fire
immediately after it is enabled
 Weak firing mode
 Enabling the transition for firing does not
necessarily imply that the transition is
fired instantaneously
22 August 2025 29

29

Problem with Strong Firing Mode


Firing of Transitions

p1

t1 t3

p2 p4

t2 t4

p3 p5
30

30

15
8/22/2025

Outline

 Introduction
 Generalized Petri Nets (GPN)
 Modeling & Analysis using GPN
 Matrix Representation of PN
 Limitations of GPN and evolution of HLN
 Applications

22 August 2025 31

31

Reachability

 The marking μ’ is reachable from


μ if there is a sequence of
markings μ1, μ2, …. μk, …., μn =
μ’ and a sequence of transitions
σ such that
μ →𝜎
μ’

22 August 2025 Nabendu Chaki, University of Calcutta, India 32

32

16
8/22/2025

Reachability

 The set of reachable markings


from the initial marking μ0 may
be denoted as R(PN, μ0)
 The reachability space for a PN
may be represented by a
reachability tree

22 August 2025 Nabendu Chaki, University of Calcutta, India 33

33

Bounded or Unbounded PN?

 A PN is bounded if there is an integer k


such that  μ  R(PN, μ0), p  P, μ(p) ≤
k
 A PN is safe if value of k is 1
 A PN is bounded for initial marking μ0 iff
R(PN,μ0) contains finite no. of elements
 A PN is structurally bounded if (PN, μ0) is
bounded for all possible initial
markings μ0
22 August 2025 Nabendu Chaki, University of Calcutta, India 34

34

17
8/22/2025

Bounded or unbounded?

22 August 2025 35

35

Bounded or unbounded?

22 August 2025 Nabendu Chaki, University of Calcutta, India 36

36

18
8/22/2025

Reachability Tree

22 August 2025 Nabendu Chaki, University of Calcutta, India 37

37

Graph for Unbounded PN

 The reachability graph is finite only


when (PN, μ0) is bounded
 One can still represent the infinite
reachability space by a coverability
graph
 We use a special symbol  that
denotes any large value up to infinity

22 August 2025 Nabendu Chaki, University of Calcutta, India 38

38

19
8/22/2025

Obtaining a Coverability Graph

 Let M = {μ0}
 Select a pair (μ, t), for μ  M
and t  T, that has not been
considered earlier, such that μ
enables t. Stop if no such pair
exists.

22 August 2025 Nabendu Chaki, University of Calcutta, India 39

39

Obtaining a Coverability Graph

 If μ’ is the new marking, then 


μ’’  M on the path from μ0 to μ’,
if μ’ ≥ μ’’, then set μ’(p) =  for
all places p such that μ’(p) >
μ’’(p)
 M = M U {μ’}, add the arc (μ, t,
μ’) to the graph
 Go back to step 2

22 August 2025 Nabendu Chaki, University of Calcutta, India 40

40

20
8/22/2025

Coverability Graph

22 August 2025 Nabendu Chaki, University of Calcutta, India 41

41

Deadlock free PN

 (PN, μ0) is said to be deadlock-


free if for any reachable marking
μ, there is at least one enabled
transition.
 (PN, μ) is in deadlock if no
transition is enabled for marking
μ.

22 August 2025 Nabendu Chaki, University of Calcutta, India 42

42

21
8/22/2025

Deadlock free PN

 A transition t is said to be live if


μR(PN, μ), μ’R(PN, μ) such that
t is enabled by μ’
 Transition t is dead at marking μ
if no marking μ’  R(PN, μ)
enables t
 The entire (PN, μ) is said to be
live if all its transitions are live

22 August 2025 Nabendu Chaki, University of Calcutta, India 43

43

Dead or live?

t5

22 August 2025 44

44

22
8/22/2025

Outline

 Introduction
 Generalized Petri Nets (GPN)
 Modeling & Analysis using GPN
 Matrix Representation of PN
 Limitations of GPN and evolution of HLN
 Applications

22 August 2025 45

45

Incidence Matrix for PN

 A PN with m places and n


transitions will have a m x n
incidence matrix D = D+ - D-
 Matrix D+ is called the input
matrix with elements dij
dij+ = W(tj, pi) if (tj,pi)  F
= 0, otherwise

22 August 2025 46

46

23
8/22/2025

Incidence Matrix for PN

 Matrix D- is called the output


matrix with elements dij
dij- = W(pi,tj) if (pi, tj)  F
= 0, otherwise

22 August 2025 Nabendu Chaki, University of Calcutta, India 47

47

Representing PNs using Matrix

 A PN may be represented as PN=(P, T,


D-, D+).
 If (p, t) F, D-(p, t) ≠ 0 and if (t, p) 
F, D+(p, t) ≠ 0
 (p, t)  F, D-(p, t) = w(p, t)
 (t, p)  F, D+(p, t) = w(t, p)
 A self-loop occurs when p  •t ∩ t•

22 August 2025 Nabendu Chaki, University of Calcutta, India 48

48

24
8/22/2025

Computing Incidence Matrix

input output

22 August 2025 49

49

Properties of Incidence Matrix

 Input and output matrix together


uniquely describe a PN
 Incidence matrix alone cannot
completely describe a PN
 Incidence matrix is unique for a PN free
of self loop
 Incidence matrix for a PN reflects the
impact on marking for firing of each
transition.
 A column in the matrix represents a
transition 50

50

25
8/22/2025

Computing Incidence Matrix

22 August 2025 51

51

Firing Vector and rules for Firing

 μk = μk-1 + Dqk, where qk is called


firing vector and its elements are
all 0 excepting qk,i = 1, where i is
for transition ti that is fired
 Transition ti is enabled iff μk-1 ≥
D-q
 A firing sequence σ is a finite or
infinite sequence transitions

22 August 2025 Nabendu Chaki, University of Calcutta, India 52

52

26
8/22/2025

Firing Vector and rules for Firing

 Given a marking μ, we say that


σ is enabled if we can fire each
of the transitions in σ in that
order
 As for instance σ=t1t2t2 is
enabled for the figure in slide 36
but not for 34

22 August 2025 53

53

Firing Count Vector for PN

 Firing count vector x for a firing


sequence σ is a nx1 vector such that
each element xi of x indicates the
count for ti in σ
 For σ = t1t2t2, x=[1,2]T
 If x is the firing count vector for a
transition sequence that takes the
marking from μi to μk then
μk = μ i + D x
22 August 2025 54

54

27
8/22/2025

Outline

 Introduction
 Generalized Petri Nets (GPN)
 Modeling & Analysis using GPN
 Matrix Representation of PN
 Limitations of GPN and evolution of HLN
 Applications

22 August 2025 55

55

Timing Constraints

 Tasks in real-time system are


normally associated with different
timing constraints.
 The timing constraints are classified
as:
 Maximum timing constraints;
 Minimum timing constraints;
 Duration timing constraints.
56
22 August 2025

56

28
8/22/2025

Timing Constraints

 The imposed timing constraints


may be constants or functions.
 The former includes Timed Petri
nets that treat a timing constraint
as a single delay and Time Petri
nets that treat a timing constraint
as a time pair consisting of lower
and upper bounds.
22 August 2025 57

57

Timing Constraints

 The later includes Stochastic


Petri Nets which treat a timing
constraint as a probability
function of transition firing rate

22 August 2025 58

58

29
8/22/2025

Timed Petri Net

 Timed Petri net was proposed by


Ramchandani to perform timing
analysis of asynchronous
concurrent systems.
 Timed PN's follow the strong
firing mode, i.e., a transition, tj,
with a delayed time, Tdel, will fire
at time Tdel after necessary
token(s) arrive.
22 August 2025 59

59

Timed Petri Net

 During the time period from T0 to


(T0 + Tdel), the tokens are
preserved for tj so that no other
transitions can use these tokens.
 At time (T0+Tdel), the tokens will
and must be removed from tj's
input to output places.

22 August 2025 60

60

30
8/22/2025

Limitations of Timed Petri Net

 The conflict problem for the


immediate transition is not solved
in TPN.
 TPN does not consider the
stochastic problems.

61
22 August 2025

61

Limitations of Timed Petri Net

 As the time delays associated to


transitions is constant, the
occurrence possibility in an
interval of time cannot be
modelled.

62
22 August 2025

62

31
8/22/2025

Time Petri Net

 Time Petri nets were


introduced by Merlin and
Farber.
 Time PN's use a time pair
instead of a single delay.
 A transition in Time PN's is
associated with (TCmin, TCmax).

63
22 August 2025

63

Time Petri Net

 If a transition, tj, is enabled at


time T0, then tj can fire neither
before (T0 + TCmin) nor after
(T0 + TCmax).
 Time PN's too follow strong
firing mode.

64
22 August 2025

64

32
8/22/2025

Stochastic Petri Net

 Stochastic nets use the average


delay which is a probability function
of a transition's firing rate.
 In case, several transitions in an
SPN are simultaneously enabled,
the transition that has the shortest
delay will fire first.
 Quite a good number of extensions
of SPN-s exist.
22 August 2025 65

65

Generalized Stochastic Petri Net

 Generalized Stochastic Petri


Net (GSPN) is a useful
extension of SPN that contains
two types of transitions namely
timed transition and immediate
transition.

22 August 2025 66

66

33
8/22/2025

Generalized Stochastic Petri Net

 Timed transition has an


exponentially distributed firing rate.
 Immediate transition has no firing
delay.
 Another extension is the
Deterministic and Stochastic Petri
nets, (DSPN) which contains both
the deterministic and stochastic
transition delay.
67
22 August 2025

67

Timing Constraint Petri Net

 Tsai, Yang and Chang has


introduced Time Constraint Petri
nets (TCPN's).
 TCPN's extend Petri nets by
adding Minimum timing constraint,
Maximum timing constraint and
Durational timing constraints to
transitions/places.
 TCPN follow the weak firing mode.
68
22 August 2025

68

34
8/22/2025

Color Petri Net

 In Colored Petri Nets, the relation


between an occurrence-color and
token-color involved in the
occurrence of the transition is
defined by functions attached to
the arcs.
 It follows typed enabling and firing
rules for transitions.

22 August 2025 69

69

Color Petri Net

 A transition is enabled, only when


all its input places hold tokens of a
particular colour.
 Colored Petri nets being powerful
formalism for the description of
complex, asynchronous distributed
systems, proper methods for the
simulation of these nets are of
interest.
22 August 2025 70

70

35
8/22/2025

C.A. Petri Receives the Doctor Honoris


Causa, Zaragoza, Spain

Nabendu Chaki, University of Calcutta, India

71

References

 C. A. Petri; "Fundamentals of a Theory of Asynchronous Information Flow"; Proc. of


IFIP Congress 62, Munich, Germany, North-Holland; pp. 386-390, 1962.
 N. Chaki, S. Bhattacharya, Performance analysis of multistage interconnection
networks with a new high level net model, Journal of System Architecture; Elsevier
North-Holland, Inc., vol. 52(1), pp. 56–70, ISSN: 1383-7621, 2006.
 Moitreyee Dasgupta, Sankhayan Choudhury, Nabendu Chaki; “A Hierarchical CPN
Model for Mobility Analysis in Zone based MANET”; Proc. of the 4th Int’l Conf. on
Wireless, Mobile Network & Applications, New Delhi, 2012. ISBN: 978-3-642-30110-0.
 K. Jensen, L. S. Kristensen, L. Wells, “Coloured Petri net and CPN Tool for modelling
and validation for concurrent systems”, International Journal on Software Tools for
Technology Transfer, 2007.
 Nadia Busi, G. Michele Pinna, "Process discovery and Petri nets; Mathematics
Structure in Computer Science", Cambridge Univ. Pr. vol. 19, pp. 1091–1124, 2009.
 James L Piterson, “Petri Net Theory And The Modeling of Systems“; Prentice Hall
Inc., N.J., USA, ISBN: 0-13-661983-5, 1981.
 M. Ajmone Marasoa, G. Balbo, G. Conte, S. Donatelli, G. Franceschinis; “Modelling
with Generalised Stochastic Petri Nets“; Università degli Studi di Torino; Italy, 1994.

22 August 2025 Nabendu Chaki, University of Calcutta, India 72

72

36
8/22/2025

Thanks for your kind attention

Questions??

73

37

You might also like