Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
31 views
10 pages
Petri Net Intro
Uploaded by
D20CQCN01-N NGUYEN DUC CHI DANH
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download
Save
Save PetriNetIntro For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
31 views
10 pages
Petri Net Intro
Uploaded by
D20CQCN01-N NGUYEN DUC CHI DANH
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Carousel Previous
Carousel Next
Download
Save
Save PetriNetIntro For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 10
Search
Fullscreen
470 8/NETWORK MODELS AND PETRI NETS +1 te re FIGURE 8.5.1 A i 8.5 Petri Nets f Consider the computer program shown in Figure 8.5.1. Normally, the instructions would be processed sequentially —first, A = 1, then B = 2, and so on, However, notice that there is no logical reason that prevents the first three instructions— A= 1;B = 2; C = 3—from being processed in any order or concurrently. With the continuing decline of the cost of computer hardware, and processors in par. ticular, there is increasing interest in concurrent processing to achieve greater speed and efficiency. The use of Petri nets, graph models of concurrent process- ing, is one method of modeling and studying concurrent processing. 3 Definition 8.5.1 A Petri net is a directed graph G = (V, E), where V = PU Tand POT = a 3 ©. Any edge ¢ in E is incident on one member of P and one member of T. The = set P is called the set of places and the set T is called the set of transitions. Less formally, a Petri net is a directed, bipartite graph where the two classes of vertices are called places and transitions. In general, parallel edges are allowed Hl 4 ; in Petri nets; however, for simplicity, we will not permit parallel edges. ; plicity permit p les ‘ 3 Example 8.5.2 a An example of a Petri net is given in Figure 8.5.2. Places are typically drawn as : ai it i s circles and transitions as bars or rectangular boxes. a Definition 8.5.3 ‘A marking of a Petri net assigns each place a nonnegative integer. A Petri net with a marking is called a marked Petri net (or sometimes just a Petri net) FIGURE 8.5.2+ instructions n, However; astructions— rently, With ssors in par. sieve greater rent process- WwPAT= ver of 7. The sitions two classes 5 are allowed ges. uly drawn as a] 85/PETRINETS 474 Py © a % FIGURE 8.5.3 Ifa marking assigns the nonnegative integer n to place p, we say that there are 1n tokens on p. The tokens are represented as black dots. Example 8.5.4 ‘An example of a marked Petri net is given in Figure 8.5.3. In modeling, the places represent conditions, the transitions represent events, and the presence of at least one token in a place (condition) indicates that that condition is met. Example 8.5.5 In Figure 8.5.4 we have modeled the computer program of Figure 8.5.1, Here the events (transitions) are the instructions, and the places represent the conditions under which an instruction can be executed. Definition 8.5.6 Ina Petri net, if an edge is directed from place p to transition 1, we say p is an input place for transition t. An output place is defined similarly. If every input place for a transition ¢ has at least one token, we say that 1 is enabled. A firing of an enabled transition removes one token from each input place and adds one token to each output place. FIGURE 8.5.4i LLU JO ALISA AT SMUAE iartnson z Bs 472 8/NETWORK MODELS AND PETRI NETS FIGURE 8. Example 8.5.7 In the Petri net of Figure 8.5.3, places p, and p, are input places for transition 1, Transitions f, and ¢, are enabled, but transition tis not enabled. If we fire transition 1, we obtain the marked Petri net of Figure 8.5.5. Transition ¢, is now enabled. If we then fire transition ¢,, we obtain the net shown. At this point no transition is enabled and thus none may be fired. Definition 8.5.8 If a sequence of firings transforms a marking M to a marking M', we say that M’ is reachable from M. a a Fire # c 8 4 5 ™ id Fire ts) Fire 12 ry ia FIGURE 8.5.6Zor transition 1... ve fire transition 's now enabled, we say that Mf) Q5/PETRINETS 473 Example 8.5.9 $_$€_____________ In Figure 8.5.6, M" is reachable from M by first firing transition f, and then firing 1, —— In modeling, the firing of a transition/simulates the occurrence of that event. Of course, an event can take place only’ if all of the conditions for its execution have been met; that is, the transition can be fired only if itis enabled. By putting tokens in places p,, p2, and ps in Figure 8.5.4, we show that the conditions for executing the instructions A = 1, B = 2, and C = 3 are met. The program is ready to be executed. Since the transitions A = 1, B = 2, and C = 3 are enabled, they can be fired in any order or concurrently. Transition C B + C is enabled only if places p, and p, have tokens. But these places will have tokens only if transitions B = 2 and C = 3 have been fired. In other words, the condition under which the event C = B + C can occur is that B = 2 and C = 3 must have been executed. In this way we model the legal execution sequences of Figure 8.5.1 and the implicit concurrency within this program. Among the most important properties studied in Petri net theory are liveness and safeness. Liveness is related to the absence of deadlocks and safeness is related to bounded memory capacity. Example 8.5.10 —____________ ‘Two persons are sharing a computer system that has a disk drive D and a printer P. Bach person needs both D and P. A possible Petri net model of this situation is shown in Figure 8.5.7. The marking indicates that both D and P are available. Now suppose that person 1 requests D and then P (while person 2 requests neither). The occurrences of these events are simulated by first firing transition “request D’’ and then firing transition “‘request P”” for person 1. The resulting Petri net is shown in Figure 8.5.8. When person 1 finishes the processing and releases D and P, simulated by firing the transitions ‘‘process”” and then “release Dand P,”’ we return to the Petri net of Figure 8.5.7. If person 2 requests D and then P (while person 1 requests neither), we obtain a similar firing sequence. Again, assume that we have the situation of Figure 8.5.7. Now suppose that person 1 requests D and then person 2 requests P. After the appropriate transitions are fired to simulate the occurrences of these events, we obtain the Petri net of Figure 8.5.9. Notice that at this point, no transition can fire. Person 1 is waiting for person 2 to release P and person 2 is waiting for person 1 to release D. Activity within the system stops. We say that a deadlock occurs. Formally, we say that a marked Petri net is deadlocked if no transition can fire. Prevention of deadlocks within concurrent processing environments is a major practical concern. cca aSn eS Example 8.5.10 motivates the following definition.474 8 /NETWORK MODELS AND PETRI NETS Request D D ready Finished with'D and ? Request P, P avaiable Person 1 Person 2 FIGURE 8.5.7 Definition 8.5.11 A marking M for a Petri net is live if, beginning from M, no matter what sequence of firings has occurred, it is possible to fire any given transition by proceeding through some additional firing sequence. witoadakt AD ALSMAINAY Athen am SMIAR ia, 2 Person 1 Person 2 FIGURE 8.5.8hhat sequence: Y proceeding 85/PETRINETS 475 Person 1 Person 2 FIGURE 8.5.9 If a marking M is live for a Petri net P, then no matter what sequence of transitions is fired, P will never deadlock. Indeed, we can fire any transition by proceeding through some additional firing sequence. Example 8.5.12 ‘The marking M of the net of Figure 8.5.6 is live. To see this, notice that the only transition for marking M that can be fired is t,, which produces marking M'. The only transition for marking M’ that can be fired is f, which produces. marking M". The only transition for marking M" that can be fired is f,, which returns us to marking M. Thus any firing sequence, starting with marking M, produces one of the markings M, M’, or M" and from there we can fire any transition ,, f, or 1, by proceeding as in Figure 8.5.6. Therefore, the marking M for the net of Figure 8.5.6 is live. Example 8.5.13 ‘The marking shown in Figure 8.5.4 is not live since after transition A = 1 is, fired, it can never fire again. If a place is regarded as having limited capacity, boundedness assures us that no place will overflow.476 8 /NETWORK MODELS AND PETRI NETS FIGURE 8.5.10 Definition 8.5.14 A marking M for a Petri net is bounded if there is some positive integer n having the property that in any firing sequence, no place ever receives more than n tokens, If a marking M is bounded and in any firing sequence no place ever receives mote than one token, we call Ma safe marking. if an initial marking is safe, we are guaranteed that the memory capacity of the 3 B 3 If each place represents a register capable of holding one computer word and g registers will not be exceeded. Example 8.5.15 ‘The markings of Figure 8.5.6 are safe. The marking M of Figure 8.5.10 is not safe, since as shown, if transition t, is fired, place p, then has two tokens. By listing all the markings reachable from M, it can be verified that M is bounded and live (see Exercise 7) UB Ame oe ae ¥ EXERCISES In Exercises 1-3, model each program by a Petri net. Provide a marking that represents the situation prior to execution of the program. 1. A=1 B=2 C=A+B c=C#H1 2. A=2 B=A+A Cod D=A+A C=A+Bt+Crm having 1 n tokens, sives more word and sity of the 10 is not akens. By bounded king that 85/PETRINETS 477 10 Describe three situations involving concurrency that might be modeled as Petri nets. j Give an example of a marked Petri net in which two transitions are enabled, but firing either one disables the other. Consider the following algorithm for washing a lion. . Get lion. Get soap. Get tub. Put water in tub. Put lion in tub. Wash lion with soap, Rinse lion. Remove lion from tub, Dry lion. Model this algorithm as a Petri net. Provide a marking that represents the situation prior to execution, eerawavpe Show that the marking M of Figure 8.5.10 is live and bounded. Answer the following questions for each marked Petri net in Exercises 8-12. (a) Which transitions are enabled? (b) Show the marking that results from firing f,. (©) Is M live? (@) Is M safe? (@) Is M bounded? () Show or describe all markings reachable from M. (g) Exhibit a marking (other than the marking that puts zero tokens in each place) not reachable from M. t i { i“as ow RAUF UUAE Ua trctimn on. x 2 478 6 /NETWORK MODELS AND PETRI NETS. 10. ry 1. 4 yn 18 dj “ “ +12, 19 13. Give an example of a Petri net with a marking that is safe, but not live. 14. Give an example of a Petri net with a marking that is bounded, but not safe. 15. The Dining Philosophers’ Problem (see (Dijkstra, 1968]) concerns five philoso- phers seated at a round table. Each philosopher either eats or meditates. The table is set alternately with one plate and one chopstick. Eating requires two chopsticks 8o that if each philosopher picks up the chopstick to the right of the plate, none 20 can eat—the system will deadlock. Model this situation as a Petri net. Your mode! should be live so that the system will not deadlock and so that, at any point, any 421 philosopher can potentially either eat or meditate. 16. Develop an alternative Petri net model for the situation of Example 8.5.10 that +22 prevents deadlock. If each place in a marked Petri net P has one incoming and one outgoing 23 edge, then P can be redrawn as a directed graph where vertices correspond to transitions and edges to places. The tokens are placed on the edges. Such 24 a graph is called a marked graph. Here we show a marked Petri net and its representation as a marked graph. eS > ; Nor @ ©88/PETRINETS 479 17, Which Petri nets in Exercises 8-12 can be redrawn as marked graphs? 48. Redraw the marked Petri net as a marked graph. 19. Redraw the marked Petri net as a marked graph. ve, rot safe, ive philoso. 8. The table = > chopsticks plate, none: | 20, Show that the token count of a simple directed cycle does not change during any ‘Your model b firing sequence. ¥ point, any = 421. Show that a marking M for a marked graph G is live if and only if M places at least one token in each simple directed cycle in G. The foken count of a simple directed cycle in a marked graph is the number of tokens on all the edges in the cycle. 8.5.10 that +22. Show that a live marking is safe for a marked graph G if and only if every edge s in G belongs to a simple directed cycle with token count one. te outgoing 23. Give an example of a marked graph with a nonlive marking in which every edge correspond belongs to a simple directed cycle with token count one. ‘dges. Such 24, Let G be a marked graph, Show that each edge in G is contained in a simple net and its 3E directed cycle if and only if every marking for G is bounded. 425, Let G be a directed graph where, if we ignore the direction of the edges in G, G is connected as an undirected graph. Show that G has a live and safe marking if and only if given any two vertices v and w in G there is a directed path from vtow. NOTES General references that contain sections on network models are (Berge; Busacker; Deo; Liu, 1968, 1985; and Tucker]. The classic work on networks is [Ford]; many
You might also like
Parallel Process Modeling with Petri Nets and Finite Automata
PDF
No ratings yet
Parallel Process Modeling with Petri Nets and Finite Automata
33 pages
Petri Nets
PDF
100% (9)
Petri Nets
122 pages
CPN Slides 96
PDF
No ratings yet
CPN Slides 96
100 pages
Coloured Petri Nets: Lars M. Kristensen Department of Computer Engineering Bergen University College, NORWAY
PDF
No ratings yet
Coloured Petri Nets: Lars M. Kristensen Department of Computer Engineering Bergen University College, NORWAY
55 pages
BP 10 PetriNetsNewLectureNotes
PDF
No ratings yet
BP 10 PetriNetsNewLectureNotes
30 pages
Final Year Project On Petri Net Model
PDF
No ratings yet
Final Year Project On Petri Net Model
34 pages
Petri Nets: Places Transitions Arcs Input Arcs Output Arcs Tokens Marking
PDF
No ratings yet
Petri Nets: Places Transitions Arcs Input Arcs Output Arcs Tokens Marking
17 pages
Petri nets are monoids
PDF
No ratings yet
Petri nets are monoids
51 pages
ECE 590 Spring 2017
PDF
No ratings yet
ECE 590 Spring 2017
201 pages
Safety Analysis Using Petr Nets
PDF
No ratings yet
Safety Analysis Using Petr Nets
12 pages
An Approach To Workflow Modeling and Analysis: Abstract - in This Paper We Present A New Approach To
PDF
No ratings yet
An Approach To Workflow Modeling and Analysis: Abstract - in This Paper We Present A New Approach To
5 pages
3.+Petri+Net+Properties
PDF
No ratings yet
3.+Petri+Net+Properties
34 pages
Communication Protocol Engineering: Lecturer: Associate Prof. Richard Lai
PDF
No ratings yet
Communication Protocol Engineering: Lecturer: Associate Prof. Richard Lai
84 pages
Lecture-4 (Petri Nets)
PDF
No ratings yet
Lecture-4 (Petri Nets)
34 pages
Petri Net Synthesis For Discrete Event Control of Manufacturing Systems (PDFDrive)
PDF
No ratings yet
Petri Net Synthesis For Discrete Event Control of Manufacturing Systems (PDFDrive)
247 pages
Apps Ch24 Raw3a
PDF
No ratings yet
Apps Ch24 Raw3a
23 pages
Lec23 PDF
PDF
No ratings yet
Lec23 PDF
24 pages
System Modeling With Petri Nets: Andrea Bobbio and Kishor Trivedi
PDF
No ratings yet
System Modeling With Petri Nets: Andrea Bobbio and Kishor Trivedi
97 pages
Petri Nets
PDF
No ratings yet
Petri Nets
18 pages
Petri Net Slide
PDF
No ratings yet
Petri Net Slide
15 pages
Formal.methods.09.Petri.nets
PDF
No ratings yet
Formal.methods.09.Petri.nets
30 pages
PN ESTII
PDF
No ratings yet
PN ESTII
96 pages
Mô Hình Hóa Toán Học (Co2011)
PDF
No ratings yet
Mô Hình Hóa Toán Học (Co2011)
10 pages
Petri Net
PDF
No ratings yet
Petri Net
30 pages
Petri Nets For Manufacturing Modeling
PDF
No ratings yet
Petri Nets For Manufacturing Modeling
80 pages
Petri Nets - PETERSON 1977
PDF
No ratings yet
Petri Nets - PETERSON 1977
30 pages
Petri
PDF
No ratings yet
Petri
41 pages
Petri Net
PDF
No ratings yet
Petri Net
15 pages
Petri Net
PDF
No ratings yet
Petri Net
96 pages
Towards Distributed Verification of Petri Nets Properties: Boukala@lsi-Usthb - DZ
PDF
No ratings yet
Towards Distributed Verification of Petri Nets Properties: Boukala@lsi-Usthb - DZ
12 pages
m4p2
PDF
No ratings yet
m4p2
82 pages
Cap 2
PDF
No ratings yet
Cap 2
19 pages
petri
PDF
No ratings yet
petri
14 pages
PN 1
PDF
No ratings yet
PN 1
20 pages
7 System Modeling with Petri Nets
PDF
No ratings yet
7 System Modeling with Petri Nets
18 pages
Petri Nets
PDF
No ratings yet
Petri Nets
17 pages
Petri Nets by R. Johnsonbaugh
PDF
100% (1)
Petri Nets by R. Johnsonbaugh
10 pages
Petri Nets Intro
PDF
No ratings yet
Petri Nets Intro
12 pages
123327-Article Text-337765-1-10-20151008
PDF
No ratings yet
123327-Article Text-337765-1-10-20151008
7 pages
Introduction To Petri Net Theory
PDF
No ratings yet
Introduction To Petri Net Theory
30 pages
Chapter2 M. USAM
PDF
No ratings yet
Chapter2 M. USAM
38 pages
22VD1A6631_KRR
PDF
No ratings yet
22VD1A6631_KRR
9 pages
Petri Net
PDF
No ratings yet
Petri Net
13 pages
Intro To Petri Nets
PDF
No ratings yet
Intro To Petri Nets
8 pages
Flexible Manufacturing System Simulation Using Petri Nets
PDF
No ratings yet
Flexible Manufacturing System Simulation Using Petri Nets
15 pages
Petrinets Toc
PDF
No ratings yet
Petrinets Toc
4 pages
15ssm Draft
PDF
No ratings yet
15ssm Draft
17 pages
Livro Peterson PDF
PDF
No ratings yet
Livro Peterson PDF
318 pages
Petri Nets
PDF
No ratings yet
Petri Nets
69 pages
Petrinets - An Itroduction
PDF
No ratings yet
Petrinets - An Itroduction
11 pages
Design of Efficient Production
PDF
No ratings yet
Design of Efficient Production
19 pages
COMP290-084: Graphical Representation of Asynchronous Systems Jan 15, 2004
PDF
No ratings yet
COMP290-084: Graphical Representation of Asynchronous Systems Jan 15, 2004
38 pages
The Petri Net Method: DR Chris Ling
PDF
No ratings yet
The Petri Net Method: DR Chris Ling
41 pages