Inroducory Tuorial I. Inroducion o place/ransiion nes Place/Transiion Nes I Prepared by: Jörg Desel, Caholic Universiy in Eichsä and Karsen Schmid, Humbold-Universiä zu Berlin Speaker: Wolfgang Reisig, Humbold-Universiä zu Berlin I. Inroducion o place/ransiion nes II. Basic analysis echniques An example eaures of PT-nes PT-nes vs EN-sysems ormal definiions PT-ne Occurrence sequence, reachabiliy Marking graph Behavioral properies Deadlock, Liveness Boundedness, 1-safey Reversibiliy Exensions Capaciies Complemen places Inhibior arcs 1 ready for erion iem ready o rejec er ep Conrol srucure: ready for erion iem ready o er rejec ep Adding concurren capaciy one ready for erion iem rejec ready o er ep er rejec ep ep an EN sysem is behaviour 4 iem er rejec Adding concurren capaciy four ready for erion iem rejec er Add unbounded couners: ready for erion iem rejec er s ready o ep ready o ep disp rej disp rej disp rej disp rej rej 5 er er er er iem rejec iem rejec iem rejec rejec... iem 6 ep ep ep ep 1
Adding arc weighs: Adding capaciies: ready for erion er ready for erion er iem rejec selling pairwise iem rejec ready o ready for erion iem rejec ep er soring pairwise k=4 ready o ep ready for erion er iem rejec ready o ep 7 ready o ep 8 P/T Nes generalize EN sysems Each conac free EN sysem is a 1-safe marked PT ne Terminology in EN sysems: in P/T nes condiion place even ransiion case, sae marking c condiions m : places {0,1,...} sequenial case graph marking graph (reachabiliy graph, sae graph) ormal definiion A place/ransiion ne consiss of: S se of places, [german: Sellen ], finie T se of ransiions, finie, disjoin o S flow relaion, (S x T) (T x S) [S,T,] is a ne k parial capaciy resricion, k: S {1,,,...} { } w arc weigh funcion, w: {1,,,...} m 0 - he iniial marking, m 0 : S {0,1,,...} s.. s S, m 0 (s) k(s) a marking 9 [S,T,,k,w,m 0 ] 10 Occurrence Rule Occurrence sequences, reachabiliy k=4 m m m [ > m k=4 m 0 1 m... n m n Transiion is enabled a marking m if for [s,] : w(s,) m(s) and for [,s] : m(s) + w(,s) k(s) Successor marking: m(s) if [s,] [,s] m(s) w(s,) if [s,] [,s] m (s) = m(s) + w(,s) if [s,] [,s] 11 m(s) w(s,) + w(,s) if [s,] [,s] 1... n is finie occurrence sequence m n is reachable from m 0 [m 0 > - he se of all reachable markings m 0 1 m... n... 1... is infinie occurrence sequence 1
1 s 1 s Marking graph (110) (101) 1 1 (00) (011) (00) Marking graph = direced edge-labeled graph wih iniial verex - verices = reachable markings - iniial verex = m 0 - labeled edges = m m A marked ne is Behavioral properies erminaing has only finie occurrence sequences deadlock-free each marking enables a ransiion live each reachable marking enables an occurrence sequence conaining all ransiions bounded each place has a bound b(s): m(s) b(s), for all reachable markings m 1-safe b(s) = 1 is a bound for all places reversible always possible o reurn o m 0 Our vending machines are deadlock-free and live. We had 1-safe, bounded, and unbounded versions. The bounded vending machines are reversible. occurrence sequence = direced pah saring a m 0 1 14 1 urher examples 1 4 urher examples 4 1 1 5 4 5 4 deadlock-free, no live 4 no deadlock-free live = no reachable marking where a ransiion is dead (canno become enabled again) deadlock = verex wihou successor deadlock-free no erminaing 15 1 1,, dead 4 5 4 5 16 Why? Boundedness bounded = finiely many reachable markings finiely many reachable markings ake max. number of okens as bound urher examples 1 4 1 5 1-safe, deadlock-free, no live, no reversible 45 bounded m(s) beween 0,...,b(s) b(s) + 1 possibiliies max. (b(s 1 )+1) (b(s )+1)...(b(s n )+1) differen markings finiely many 1-safe ne has up o n reachable markings 17...... unbounded, no reversible unbounded, reversible 1 5 4 1-safe, live, no reversible 5 4 4 1 reversible = marking graph srongly conneced 18
k=4 Subsiuing capaciies Every ne wih capaciies can be replaced by one wihou! ready for erion iem rejec er Weak capaciies k= Consrucion: complemen ready o ready for erion iem rejec ep er... does no quie implemen original enabling rule, bu: enabled a m if - m(s) w(s,) for [s,] [,s] - m(s) + w(,s) k(s) for [s,] [,s] - m(s) w(s,) + w(,s) k(s) for [s,] [,s] place 19 bu: for finie k(s), s is k(s)-bounded 0 ready o ep Srong capaciies Consrucion: k= Inhibior arcs only enabled if m(s) = 0 s - implemens original enabling rule: enabled a m if - m(s) w(s,) for [s,] - m(s) + w(,s) k(s) for [,s] -generalizes conac in EN sysems: EN sysem = marked PT ne - no arc weighs - k(s) = 1 (srong!) for all places s 1 If k(s) is finie, consrucion: k= II. Basic analysis echniques Linear algebra Marking equaion Place invarians Transiion invarians Srucural ecchniques Siphons Traps Siphon/rap propery Resriced ne classes Sae machine Marked graph ree choice ne Causal semanics Occurrence ne Process ne Marking, ransiion as vecor s 1 1 s 5 s 4 m 0 : ( 4, 0, 0, 0, 1 ) s 5 4 = ( -1, 1, 1, 0, -1 ) If m 0 m 1 hen m 0 + = m 1 = (, 1, 1, 0, 0 ) 4 4
1 Marix represenaion of a ne s 1 (N) = s 5 s 4 1 1 0 0 0-1 1 0 0 0 0 1 1 0 1 0 0 1 1 1 0 1 0 1 0 4 s 5 5 The marking equaion If m 0 5 1 m hen m 0 + + + 5 + 1 + = m m 0 + (1 1 ) + (1 ) + ( ) + (0 4 ) + (1 5 ) = m m 0 + (N) (1,1,,0,1) = m If m 0 m hen m 0 + (N) Parikh() = m A marking is only reachable if (N) x = (m m 0 ) has a soluion for na. x Parikh-Vecor of 5 1 6 1 Example 4 5 Place invarians Process 1 Example: muual exclusion Process reachable markings: corresponding soluaions s 1 s ( 1, 0, 0, 0, 0 ) ( 0, 0, 0, 0, 0), ( 1, 0, 1, 0, 1),... ( 0, 1, 0, 0, 1 ) ( 1, 0, 0, 0, 0),... ( 0, 0, 1, 1, 0 ) ( 0, 1, 0, 0, 0),... ( 0, 0, 0, 1, 1 ) ( 1, 0, 1, 0, 0), ( 0, 1, 0, 1, 0),... ener cs ener cs muex: m reachable m(s ) + m(s 4 ) 1 use place invarian non-reachable marking has also soluions! ( 0, 1, 1, 0, 0 ) ( 1, 1, 0, 0, 1),... 7 Proof: 1. m(s ) + m( ) + m(s 4 ) = 1 iniially rue. m(s ) + m( ) + m(s 4 ) = 1 is sable. m(s ) + m( ) + m(s 4 ) = 1 m(s ) + m(s 4 ) 1 8 Place invarian i Def. 1: for all, Σ [s,] w(s) i(s) = Σ [,s] w(s) i(s) Def. : for all, i = 0 Def. : i (N) = (0,...,0) Place invarians Process 1 Process s 1 s ener cs ener cs If m reachable from m 0 hen i m= i m 0 Proof: m 0 s m m 0 + (N) Parikh(s) = m i m 0 + i (N) Parikh(s) = i m ( = 0 ) i m 0 = i m 9 ( 0, 1, 1, 1, 0 ) is place invarian i m 0 = 1 = i m= m(s ) + m( ) + m(s 4 ) for all reachable m m(s ) + m( ) + m(s 4 ) = 1 is sable. 0 5
urher place invarians Place invarians and liveness Process 1 Process ener cs s 1 s ener cs ( 0, 1, 1, 1, 0 ) muual exclusion ( 0, 1, 1, 0, -1) m(s ) + m( ) = m(s 5 ) - if s is marked hen s 5 is marked ( 1, 1, 0, 0, 0 ) m(s 1 ) + m(s ) = 1 or all PT nes, for all place invarians i -live - no negaive enries : i m 0 > 0 -no isolaed places - some posiive enry s (oherwise ransiions conneced wih s are dead) Process 1 Process ener cs s 1 s ener cs m(s ) 1, m(s ) 1, s,s bounded 1 1 1 ( 0, 1, 1, 1, 0 ) ( 1, 1,0, 0, 0 ) ( 0, 0, 0, 1, 1 ) Place invarians and boundedness if exiss place invarian i - for all s, i(s) > 0 ne is bounded Proof: m reachable i m= i m 0 i(s) m(s) i m= i m 0 m(s) i m 0 / i(s) Process 1 Process s 1 s Place invarians and reachabiliy -m unreachable -for all place invarians i: i m= i m 0 no place invarian is able o prove non-reachabiliy of m -Marking equaion (N) x = (m m 0 ) : no soluion in naurals marking equaion is able o prove non-reachabiliy of m - Marking equaion does have raional soluion: (1, 0, 1, ½, ½) ener cs ( 1,,1,, 1 ) ener cs There is a place invarian i s.. i m i m 0 if and only if marking equaion does no have raional soluion 4 modulo invarians Transiion invarians = soluions of (N) y = (0,...,0) Process 1 Process s 1 s ener cs ener cs ( 1, 1, 0, 0 ) ( 0, 0, 1, 1 ) (,, 1, 1 ) Transiion invarians, liveness, boundedness ne here is ransiion invarian j - live - for all, j() > 0 - bounded Proof: By liveness: m 0 1 m 1 m m... all ransiions By boundedness: for some i < j: m i =m j all ransiions all ransiions... m 0 m m 0 = m if and only if Parikh() is ransiion invarian 5 m i i+1... j m j = m i Parikh( i+1... j ) is ransiion invarian. 6 6
Srucural echniques 4 1 5 s1 Example 1 4 s4 s5 5 siphon once empy always empy Def.: S S if produces ino S, hen consumes from S rap once marked, always marked Def.: S S if consumes from S, hen produces ino S {s1,s4,s5} iniially marked rap! ( 0, 1, 1, 0, 0 ) unreachable (Marking equaion could no prove non-reachabiliy!) 7 8 Siphons, raps and liveness, deadlocks ne - live every siphon ( ) iniially marke - no isolaed places (ransiions conneced o empy siphon are dead) Resriced ne classes 4 1 5 ne - has a ransiion - no capaciy resricion - all arc weighs 1 ne deadlock-free -every siphon ( ) cona iniially marked rap -every ransiion has exacly one pre-place -every ransiion has exacly one pos-place -all arc weighs 1 -no capaciy resricions sae machine: sae machine (Se of places unmarked a a deadlock marking is siphon. This siphon is empy does no conain marked rap - bounded - live if and only if - srongly conneced, - iniially marked cona no iniially marked rap) 9 40 Resriced ne classes {s1,s} {s,s4} {s1,s,s4} {s,s,s4} {s1,s,s,s4} Resriced ne classes s1 s 1 s s4 4 {s1,s,s,s4} -every place has exacly one pre-ransiion -every place has exacly one pos-ransiion -all arc weighs 1 -no capaciy resricions marked graph -all arc weighs 1 -no capaciy resricions -if ransiions share pre-places, hey share all heir pre-places: (s,) x s free choice ne marked graph: no free choice free choice - 1-safe if and only if each place belongs o a cycle wih exacly 1 oken - live if and only if each cycle iniially marked 41 free choice is live if and only if every siphon ( ) cona 4 iniially marked rap 7
produce Causal semanics of PT nes produced sen sen produce produced sen produce produced sen A consumer/producer sysem send full a causal run: send send full full receive receive consumed consume received consumed received consume Causal runs A causal run of a PT ne is a labeled Peri ne (B, E, K) ne elemen name symbol inerpreaion place condiion B oken on place ransiion even E ransiion occurrence arc causal K oken flow relaion consumed 4 44 Causal runs: Occurrence nes -no cycles K+ is parial order -no branch a condiions b 1, b 1 -evens have finie fan-in, fan-ou e finie, e finie -evens have a leas one inpu, e 1, e 1 one oupu condiion -every node has finie hisory {x x n} finie occurrence ne 45 Process ne represens causal run of a PT ne = occurrence ne relaed o given PT ne labels: π: B S, E T labels a B,E -m0 agrees wih sar condiions: for all s: m0(s) = {b B b = Ø, π(b) = s} -respec ransiion viciniies π( e) = π(e), w(s,π(e)) = {b e π(b) = s} π(e ) = π(e), w(π(e),s) = {b e π(b) = s} process ne 46 Occurrence sequence vs process ne D E a b G occurrence sequences abc bac acb bca provide oal orders respecing causaliy independence arbirary inerleaving informaion abou causaliy can ge los c H process nes D E a b G c D a c E b G provide parial order lecing causaliy 47 H H 1 occurrence sequence in process nes dis rej dis dis rej dis dis rej dis dis rej 48 8
process nes, no common sequence dis rej dis dis rej dis dis rej 49 9