Petri Nets Ree Alreht Seminr: Automt Theory Chir of Softwre Engeneering
Overview 1. Motivtion: Why not just using finite utomt for everything? Wht re Petri Nets nd when do we use them? 2. Introdution: How do Petri Nets work? 3. Lnguges: Wht is the generl expressiveness power of Petri Nets? 4. Deidility nd Complexity: Wht is the omplexity of ertin deision prolems? Wht if we ssure ertin onditions? 16.07.2012 Petri Nets 2
Overview 1. Motivtion: Why not just using finite utomt for everything? Wht re Petri Nets nd when do we use them? 2. Introdution: 3. Lnguges: 4. Deidility nd Complexity: 16.07.2012 Petri Nets 3
Motivtion Consider: Two groups of workers produe goods of type A nd type B. Two goods of type A nd type B n e omined into type C. The orresponding lnguge: L = {,,,,, } 16.07.2012 Petri Nets 4
Motivtion The orresponding lnguge: L = {,,,,, } The orresponding finite utomton: A B A A B A B B B B A A C 16.07.2012 Petri Nets 5
Prolem Anlysis The prolem: A nd B re produed onurrently nd synhronous. The prodution hs to e synhronized when produing C. The solution: Automton model whih llows for expressing these properties of system or proess more onise Petri Nets. 16.07.2012 Petri Nets 6
Possile Solution The orresponding lnguge: L = {,,,,, } A Petri Net for the given prolem: 16.07.2012 Petri Nets 7
Overview 1. Motivtion: 2. Introdution: How do Petri Nets work? 3. Lnguges: 4. Deidility nd Complexity: 16.07.2012 Petri Nets 8
Struturl Definitions A Petri Net for the given prolem: N = (P, T, F) 16.07.2012 Petri Nets 9
Struturl Definitions A Petri Net for the given prolem: p0 p1 p2 p6 N = (P, T, F) P = {p 0,, p 6 } p3 p4 p5 16.07.2012 Petri Nets 10
Struturl Definitions A Petri Net for the given prolem: p0 t0 p1 p2 N = (P, T, F) t4 p6 P = p 0,, p 6 T = t 0,, t 4 p3 p4 t3 p5 16.07.2012 Petri Nets 11
Struturl Definitions A Petri Net for the given prolem: p0 t0 p1 p2 N = (P, T, F) t4 p6 P = p 0,, p 6 T = t 0,, t 4 F P T T P p3 p4 t3 p5 16.07.2012 Petri Nets 12
Struturl Definitions A Petri Net for the given prolem: p0 t0 p1 p2 N = (P, T, F) p3 p4 t3 p5 t4 p6 P = p 0,, p 6 T = t 0,, t 4 F P T T P m: P N 16.07.2012 Petri Nets 13
Struturl Definitions A Petri Net for the given prolem: p0 p1 p2 N = (P, T, F) p3 p4 p5 p6 P = p 0,, p 6 T = t 0,, t 4 F P T T P m: P N Σ =,, l: T Σ 16.07.2012 Petri Nets 14
Behvior L = {,,,,, } A Petri Net for the given lnguge: P = (p 0,, p 6 ) p0 p1 p2 M 0 = 1, 0, 0, 1, 0, 0, 0 p6 p3 p4 p5 16.07.2012 Petri Nets 15
Behvior L = {,,,,, } A Petri Net for the given lnguge: P = (p 0,, p 6 ) p0 p1 p2 p6 M 0 = 1, 0, 0, 1, 0, 0, 0 M 1 = 0, 1, 0, 1, 0, 0, 0 p3 p4 p5 16.07.2012 Petri Nets 16
Behvior L = {,,,,, } A Petri Net for the given lnguge: P = (p 0,, p 6 ) p0 p1 p2 p6 M 0 = 1, 0, 0, 1, 0, 0, 0 M 1 = 0, 1, 0, 1, 0, 0, 0 M 2 = 0, 0, 1, 1, 0, 0, 0 p3 p4 p5 16.07.2012 Petri Nets 17
Behvior L = {,,,,, } A Petri Net for the given lnguge: P = (p 0,, p 6 ) p0 p1 p2 p6 M 0 = 1, 0, 0, 1, 0, 0, 0 M 1 = 0, 1, 0, 1, 0, 0, 0 M 2 = 0, 0, 1, 1, 0, 0, 0 M 3 = 0, 0, 1, 0, 1, 0, 0 p3 p4 p5 16.07.2012 Petri Nets 18
Behvior L = {,,,,, } A Petri Net for the given lnguge: P = (p 0,, p 6 ) p0 p1 p2 p3 p4 p5 p6 M 0 = 1, 0, 0, 1, 0, 0, 0 M 1 = 0, 1, 0, 1, 0, 0, 0 M 2 = 0, 0, 1, 1, 0, 0, 0 M 3 = 0, 0, 1, 0, 1, 0, 0 M 4 = 0, 0, 1, 0, 0, 1, 0 16.07.2012 Petri Nets 19
Behvior L = {,,,,, } A Petri Net for the given lnguge: P = (p 0,, p 6 ) p0 p1 p2 p3 p4 p5 p6 M 0 = 1, 0, 0, 1, 0, 0, 0 M 1 = 0, 1, 0, 1, 0, 0, 0 M 2 = 0, 0, 1, 1, 0, 0, 0 M 3 = 0, 0, 1, 0, 1, 0, 0 M 4 = 0, 0, 1, 0, 0, 1, 0 M 5 = 0, 0, 0, 0, 0, 0, 1 16.07.2012 Petri Nets 20
Overview 1. Motivtion: 2. Introdution: 3. Lnguges: Wht is the generl expressiveness power of Petri Nets? 4. Deidility nd Complexity: 16.07.2012 Petri Nets 21
Lnguge Aeptne Definition: N = N, M I, M F, l with, N = P, T, F petri net, l: T Σ leling funtion, Σ non-empty lphet, nd M I, M F finite sets of initil nd finl mrkings respetively, epts word w Σ if there exists firing sequene τ = t 1,, t n from m i M I to m j M F. 16.07.2012 Petri Nets 22
Petri Net Lnguges CSL PNL REG CFL n n n ww ww R Figure tken from [3] 16.07.2012 Petri Nets 23
Lnguge - Exmple Let Σ =,,, L = n n n n > 0} Petri Net: p2 p4 p0 p1 p3 p5 Initil mrking: (1,0,0,0,0,0) Finl mrking: (0,0,0,0,0,1) 16.07.2012 Petri Nets 24
Lnguge - Exmple Let Σ =,,, L = n n n n > 0} Consider: Petri Net: p2 p4 p0 p1 p3 p5 Initil mrking: (1,0,0,0,0,0) Finl mrking: (0,0,0,0,0,1) 16.07.2012 Petri Nets 25
Lnguge - Exmple Let Σ =,,, L = n n n n > 0} Consider: Petri Net: p2 p4 p0 p1 p3 p5 Initil mrking: (1,0,0,0,0,0) Finl mrking: (0,0,0,0,0,1) 16.07.2012 Petri Nets 26
Lnguge - Exmple Let Σ =,,, L = n n n n > 0} Consider: Petri Net: p2 p4 p0 p1 p3 p5 Initil mrking: (1,0,0,0,0,0) Finl mrking: (0,0,0,0,0,1) 16.07.2012 Petri Nets 27
Lnguge - Exmple Let Σ =,,, L = n n n n > 0} Consider: Petri Net: p2 p4 p0 p1 p3 p5 Initil mrking: (1,0,0,0,0,0) Finl mrking: (0,0,0,0,0,1) 16.07.2012 Petri Nets 28
Lnguge - Exmple Let Σ =,,, L = n n n n > 0} Consider: Petri Net: p2 p4 p0 p1 p3 p5 Initil mrking: (1,0,0,0,0,0) Finl mrking: (0,0,0,0,0,1) 16.07.2012 Petri Nets 29
Lnguge - Exmple Let Σ =,,, L = n n n n > 0} Consider: Petri Net: p2 p4 p0 p1 p3 p5 Initil mrking: (1,0,0,0,0,0) Finl mrking: (0,0,0,0,0,1) 16.07.2012 Petri Nets 30
Lnguge - Exmple Let Σ =,,, L = n n n n > 0} Consider: Petri Net: p2 p4 p0 p1 p3 p5 Initil mrking: (1,0,0,0,0,0) Finl mrking: (0,0,0,0,0,1) 16.07.2012 Petri Nets 31
Lnguge - Exmple Let Σ =,,, L = n n n n > 0} Consider: Petri Net: p2 p4 p0 p1 p3 p5 Initil mrking: (1,0,0,0,0,0) Finl mrking: (0,0,0,0,0,1) 16.07.2012 Petri Nets 32
Lnguge - Exmple Let Σ =,,, L = n n n n > 0} Consider: Petri Net: p2 p4 p0 p1 p3 p5 Initil mrking: (1,0,0,0,0,0) Finl mrking: (0,0,0,0,0,1) 16.07.2012 Petri Nets 33
Lnguge - Exmple Let Σ =,,, L = n n n n > 0} Consider: Petri Net: p2 p4 p0 p1 p3 p5 Initil mrking: (1,0,0,0,0,0) Finl mrking: (0,0,0,0,0,1) 16.07.2012 Petri Nets 34
Overview 1. Motivtion: 2. Introdution: 3. Lnguges: 4. Deidility nd Complexity: Wht is the omplexity of ertin deision prolems? Wht if we ssure ertin onditions? 16.07.2012 Petri Nets 35
Rehility Prolem Is ertin mrking rehle in Petri Net? I.e. n system reh some d stte? Anlysis: 1. Wht out the rehility prolem for Petri Nets in generl? 2. Are there ertin properties whih llow for deiding the rehility prolem effiiently? Generl nlysis tool: The rehility/overility tree. 16.07.2012 Petri Nets 36
Rehility Tree Petri Net: Rehility Tree: p1 (1, 0, 1, 0) p0 t0 p3 p2 Exmple tken from [2] 16.07.2012 Petri Nets 37
Rehility Tree Petri Net: Rehility Tree: p0 t0 p1 (1, 0, 1, 0) (1, 0, 0, 1) p3 p2 Exmple tken from [2] 16.07.2012 Petri Nets 38
Rehility Tree Petri Net: Rehility Tree: p0 t0 p1 (1, 0, 1, 0) (1, 0, 0, 1) p3 (1, 1, 1, 0) p2 Exmple tken from [2] 16.07.2012 Petri Nets 39
Rehility Tree Petri Net: Rehility Tree: p0 t0 p1 (1, 0, 1, 0) (1, 0, 0, 1) p3 (1, 1, 1, 0) p2 (1, 1, 0, 1) Exmple tken from [2] 16.07.2012 Petri Nets 40
Rehility Tree Petri Net: Rehility Tree: p0 t0 p1 (1, 0, 1, 0) (1, 0, 0, 1) p3 (1, 1, 1, 0) p2 (1, 1, 0, 1) (1, 2, 1, 0) Exmple tken from [2] 16.07.2012 Petri Nets 41
Coverility Tree Petri Net: Coverility Tree: p0 t0 p1 (1, 0, 1, 0) (1, 0, 0, 1) p3 (1, ω, 1, 0) p2 (1, ω, 0, 1) (1, ω, 1, 0) Exmple tken from [2] 16.07.2012 Petri Nets 42
Coverility Tree Petri Net: Coverility Tree: p0 t0 p1 (1, 0, 1, 0) (1, 0, 0, 1) p3 t0 (1, ω, 1, 0) p2 (1, ω, 0, 0) (1, ω, 0, 1) (1, ω, 1, 0) Exmple tken from [2] 16.07.2012 Petri Nets 43
Boundedness Unounded Petri Net: Coverility Tree: p0 t0 p1 (1, 0, 1, 0) (1, 0, 0, 1) p3 t0 (1, ω, 1, 0) p2 (1, ω, 0, 0) (1, ω, 0, 1) (1, ω, 1, 0) A Petri net ist unounded if nd only if there exists rehle mrking M nd sequene of trnsitions σ suh tht: M σ M + L, where L is non-zero lel 16.07.2012 Petri Nets 44
Boundedness A Petri net ist unounded if nd only if there exists rehle mrking M nd sequene of trnsitions σ suh tht: M σ M + L, where L is non-zero lel Deidle in 2n log n Sulsses of Petri Nets wrt. oundness: 1-ounded (or 1-sfe) k-ounded (or ounded) 16.07.2012 Petri Nets 45
Conflits Petri Net: Coverility Tree: p0 t0 p1 (1, 0, 1, 0) (1, 0, 0, 1) p3 t0 (1, ε, 1, 0) p2 (1, ε, 0, 0) (1, ε, 0, 1) (1, ε, 1, 0) 16.07.2012 Petri Nets 46
Conflits Conflited Petri Net: Coverility Tree: p0 t0 p1 (1, 0, 1, 0) (1, 0, 0, 1) p2 Informl Definition: p3 (1, ε, 1, 0) (1, ε, 0, 0) (1, ε, 0, 1) (1, ε, 1, 0) A Petri hs onfliting onfigurtion if two or more trnsitions re enled nd firing one trnsition disles the other trnsitions. t0 16.07.2012 Petri Nets 47
Conflits Conflited Petri Net: Coverility Tree: p0 t0 p1 (1, 0, 1, 0) (1, 0, 0, 1) p2 p3 t0 (1, ε, 1, 0) (1, ε, 0, 0) (1, ε, 0, 1) (1, ε, 1, 0) Informl Definition: A Petri is onflit free if it hs no onfliting onfigurtions. 16.07.2012 Petri Nets 48
Rehility Prolem Is ertin mrking rehle in Petri Net? I.e. n system reh some d stte? Anlysis: 1. Wht out the rehility prolem for Petri Nets in generl? 2. Are there ertin properties whih llow for deiding the rehility prolem effiiently? Generl nlysis tool: The rehility/overility tree. 16.07.2012 Petri Nets 49
Rehility Prolem Deide whether mrking M n e rehed for Petri Net N. In generl, doule exponentil time. 1-sfe, PSPACE-omplete. Conflit-free, NP-omplete. Bounded nd onflit-free, polynominl. 16.07.2012 Petri Nets 50
Conlusion Petri Nets llow for onise representtion of onurrent proesses. In generl, Petri Nets reognize ll regulr lnguges, some ontext-free lnguges nd some ontext-sensitive lnguges. In generl, ertin deision prolems re hrder thn in other utomt models. The expressiveness power of Petri Nets n e restrited in order to deide ertin deision prolems effiiently. 16.07.2012 Petri Nets 51
Referenes [1] Murt, T. (1989, April). Petri Nets: Properties, Anlysis nd pplitions. In Proeedings of the IEEE (Vol. 77, pp. 541-580). [2] Peterson, J. L. (1977, Septemer). Petri Nets. ACM Computing Surveys, 9 (3), 223-252. [3] Thoms, W. (2005) Applied Automt Theory. Sript ville: http://dron.s.iis.ernet.in/~deepkd/tommon/wolfgng-t.pdf [4] Esprz, J. nd Nielsen, M. (1995) Deidility issues for Petri nets - survey. In Bulletin of the EATCS, 1994. Revised, 1995. 16.07.2012 Petri Nets 52
The End Thnk you for your ttention! 16.07.2012 Petri Nets 53