Tools for random generation in safe Petri nets GASCOM 2016 Samy Abbes (Universit´ e Paris Diderot) June 2016
Concurrency and Petri nets Concurrent systems ◮ Systems with parallel actions ◮ Examples: communication networks, distributed databases Locality ◮ Notions of local components with local states ◮ Moto: “Most objects should be relative to local components” Petri nets models ◮ Transition systems featuring concurrent actions ◮ Models for various systems: queuing networks, distributed systems, workflows
Petri nets and their dynamics Static model ◮ Two disjoint sets P of places and T of transitions ◮ Bi-partite graph ( P , T , → ) ◮ Each transition t ∈ T has a pre-set • t ⊆ P and a post-set t • ⊆ P t • = { p ∈ P : t → p } • t = { p ∈ P : p → t }
Petri nets and their dynamics Static model ◮ Two disjoint sets P of places and T of transitions ◮ Bi-partite graph ( P , T , → ) ◮ Each transition t ∈ T has a pre-set • t ⊆ P and a post-set t • ⊆ P t • = { p ∈ P : t → p } • t = { p ∈ P : p → t } Marking ◮ Each place p ∈ P contains 0 or 1 token ◮ The marking α : P → { 0 , 1 } is the distribution of tokens among places
� � � � � � � � � � � � � � � � � Petri nets and their dynamics Dynamics ◮ Given a markig α : P → { 0 , 1 } , a transition t may fire whenever α = 1 on • t ◮ The firing of t yields a new marking α t → α ′ according to the − following comsumption-production rule (only a and b can fire) • • • a − − − → a c a c b b • •
� � � � � � � � � � � � � � � � Petri nets and their dynamics Dynamics ◮ Given a markig α : P → { 0 , 1 } , a transition t may fire whenever α = 1 on • t ◮ The firing of t yields a new marking α t → α ′ according to the − following comsumption-production rule (only a and b can fire) • • b − − − → a c a c b b •
Petri nets: a model for concurrency Firing sequences ◮ The marking is the state of the system ◮ The initial marking determines the possible sequences of firing transitions t 1 · ... · t k t 1 · . . . · t k ∈ T ∗ firing sequence α 0 − − − − → α k Concurrency features ◮ Only • t • = • t ∪ t • is affected by the firing of t ◮ Transitions act locally
Petri nets: a model for concurrency Changing the dynamics ◮ Define two transitions t 1 and t 2 to be concurrent: ⇒ • t • 1 ∩ • t • t 1 � t 2 ⇐ 2 = ∅ ◮ Identify two firing sequences of the form u · t · t ′ · v u · t ′ · t · v with u , v ∈ T ∗ and t � t ′ and and consider the congruence generated ∼ ◮ The congruence ∼ forgets irrelevant interleavings of concurrent actions
Petri nets: a model for concurrency A right action on markings ◮ The action of T ∗ on the set M of markings factorizes through the quotient monoid M = T ∗ / ∼ ◮ Elements of M are called traces, and M acts on M on the right: α · e = α α · ( u · v ) = ( α · u ) · v ◮ Intuition: traces only retain causal dependencies
Petri nets: a model for concurrency Extending the action ◮ Actually, not all words are able to act on a given initial marking ◮ Idem for traces ◮ We extend the action to all traces on M ′ = M ∪ {⊥} by putting α · u = ⊥ if u is not enabled at M α · ⊥ = ⊥ ◮ For each initial marking α we put M α = { x ∈ M : α · x � = ⊥} (a downward closed language of traces)
Outline Trace/heap interpretation of trajectories on an example Uniform measure for a trace monoid action Computing the uniform measure for the Petri net example
� � � � � � � � � � � � � An example • b a • • c d e We record traces (sequences of transitions up to interleavings) as heaps of pieces, taking into account a · d = d · a a · e = e · e b · d = d · b b · e = e · b c · e = e · c
� � � � � � � � � � � � � � � � � An example • b a • • c d e a , b c d e a d heap c a · a · d · e · b · e · c · a · d = e b a · d · e · a · e · b · c · d · a a e a d
Outline Trace/heap interpretation of trajectories on an example Uniform measure for a trace monoid action Computing the uniform measure for the Petri net example
Uniform dynamics? An analogy with irreducible sub-shifts of finite type ◮ The Parry measure is the measure of maximal entropy on infinite trajectories of an irreducible sub-shift ◮ It is realized as a Markov chain on the set of states of the sub-shift
Uniform dynamics? An analogy with irreducible sub-shifts of finite type ◮ The Parry measure is the measure of maximal entropy on infinite trajectories of an irreducible sub-shift ◮ It is realized as a Markov chain on the set of states of the sub-shift ◮ For a Petri net model (“sub-shift featuring concurrency”): ◮ What are infinite trajectories? ◮ What are Markov measures? ◮ Is there a measure of maximal entropy with a Markov realization? ◮ All these notions can be developped in the framework of a trace monoid acting on a finite set
Infinite trajectories Framework A trace monoid M acting on a finite set X ∪ {⊥} with ⊥ an absorbing state α ∈ X M α = { x ∈ M : α · x � = ⊥} Identifications trajectories ↔ traces ↔ heaps A compactification We consider the space ∂ M of infinite heaps seen as infinite trajectories (up to interleavings) and M = M ∪ ∂ M compact metrisable space M α = Adh( M α ) ∩ ∂ M
Markov measures featuring concurrency Definition A Markov measure is a family ( m α ) α ∈ X with ◮ m α a probability measure on ∂ M ◮ m α ( ∂ M α ) = 1 ◮ for all x , y ∈ M : � � ↑ ( x · y ) = m α ( ↑ x ) · m α · x ( ↑ y ) m α where ↑ x = { ξ ∈ ∂ M : x ≤ ξ } , the set of infinite trajectories that start with x Remark The existence of Markov measures is not trivial
Irreducible actions Definition The action of a trace monoid M on a set X is irreducible if for every α, β ∈ X there is some x ∈ M such that β = α · x Generating series z | x | = � � λ α ( k ) z k G α ( z ) = x ∈M α k ≥ 0 λ α ( k ) = # { x ∈ M α : | x | = k } Proposition All the series G α ( z ) are rational. If the action is irreducible, they all have the same radius of convergence q 0 ∈ (0 , 1), the characteristic root of the action.
Uniform measure Theorem For an irreducible action of a trace monoid M over a finite set X and with characteristic root q 0 , there exists a Markov measure m = ( m α ) α ∈ X with the following form: ⇒ m α ( ↑ x ) = q | x | x ∈ M α = 0 Γ( α, α · x ) ∈ M α = ⇒ m α ( ↑ x ) = 0 x / where Γ : X × X → R > 0 satisfies the cocyle identities Γ( α, γ ) = Γ( α, β ) · Γ( β, γ ) in particular Γ( α, α ) = 1 The Markov measure m is the uniform measure associated with the action.
Uniform measure Remarks ◮ The uniform measure generalizes the Parry measure to a context featuring concurrency. ◮ The Markov identity is easy to verify given the previous form and the cocycle property: = q | x · y | � � � � ↑ ( x · y ) Γ α, α · ( x · y ) m α 0 = q | x | 0 Γ( α, α · x ) · q | y | � � 0 Γ α · x , ( α · x ) · y = m α ( ↑ x ) · m α · x ( ↑ y )
Uniform measure Remarks ◮ The measure m α can be constructed as the following weak limit 1 � z | x | δ x m α = lim G α ( q ) q → q − x ∈M α 0 ◮ It yields the following expression for Γ( · , · ): G β ( q ) Γ( α, β ) = lim G α ( q ) q → q 0 −
Outline Trace/heap interpretation of trajectories on an example Uniform measure for a trace monoid action Computing the uniform measure for the Petri net example
� � � � � � � � � � � � � An example • Two markings: α depicted b and β = α · b a • • c d e The root q 0 is determined as the root of smallest modulus of the following determinant: � 1 − 3 z + 2 z 2 − z + 2 z 2 � � = (1 − z )(1 − 2 z )(1 − 2 z − z 2 ) � � θ ( z ) = � � − z + z 2 1 − 2 z � √ q 0 = 2 − 1
� � � � � � � � � � � � � An example • Two markings: α depicted b and β = α · b a • • c d e From the cocyle identity: Γ( β, α ) = λ − 1 Γ( α, α ) = Γ( β, β ) = 1 Γ( α, β ) = λ Apply the inclusion-exclusion decomposition to the following union: ∂ M α = ( ↑ a ) ∪ ( ↑ b ) ∪ ( ↑ d ) ∪ ( ↑ e ) , ( ↑ b ) ∩ ( ↑ d ) = ↑ ( b · d ) , . . . √ � � = q 2 ↑ ( b · d ) 0 λ, . . . yields λ = 2 m α
� � � � � � � � � � � � � An example • Two markings: α depicted b and β = α · b a • • c d e Finally: √ � 2 − 1) | x | , ( if α · x = α m α ( ↑ x ) = √ √ 2 − 1) | x | , 2( if α · x = β √ � 2 − 1) | x | , ( if β · x = β √ m β ( ↑ x ) = 1 2 − 1) | x | , if β · x = α √ 2 (
Recommend
More recommend