SLIDE 1
Tools for random generation in safe Petri nets GASCOM 2016 Samy - - PowerPoint PPT Presentation
Tools for random generation in safe Petri nets GASCOM 2016 Samy - - PowerPoint PPT Presentation
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
SLIDE 2
SLIDE 3
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 : p → t}
t• = {p ∈ P : t → p}
SLIDE 4
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 : p → t}
t• = {p ∈ P : t → p}
Marking
◮ Each place p ∈ P contains 0 or 1 token ◮ The marking α : P → {0, 1} is the distribution of tokens
among places
SLIDE 5
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
- b
- c
a − − − →
- a
- b
- c
SLIDE 6
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
- b
- c
b − − − →
- a
- b
- c
SLIDE 7
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 firing sequence t1 · . . . · tk ∈ T ∗ α0
t1·...·tk
− − − − → αk
Concurrency features
◮ Only •t• = •t ∪ t• is affected by the firing of t ◮ Transitions act locally
SLIDE 8
Petri nets: a model for concurrency
Changing the dynamics
◮ Define two transitions t1 and t2 to be concurrent:
t1 t2 ⇐ ⇒ •t•
1 ∩ •t• 2 = ∅ ◮ Identify two firing sequences of the form
u · t · t′ · v and u · t′ · t · v with u, v ∈ T ∗ and t t′ and consider the congruence generated ∼
◮ The congruence ∼ forgets irrelevant interleavings of
concurrent actions
SLIDE 9
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
SLIDE 10
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)
SLIDE 11
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
SLIDE 12
An example
- a
- b
- 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
SLIDE 13
An example
- a
- b
- c
- d
- e
heap a·a·d ·e·b·e·c·a·d = a·d ·e ·a·e ·b ·c ·d ·a a d a e b e c a d a, b c d e
SLIDE 14
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
SLIDE 15
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
SLIDE 16
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
SLIDE 17
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
SLIDE 18
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:
mα
- ↑(x · y)
- = mα( ↑x) · mα·x( ↑y)
where ↑x = {ξ ∈ ∂M : x ≤ ξ}, the set of infinite trajectories that start with x
Remark
The existence of Markov measures is not trivial
SLIDE 19
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
Gα(z) =
- x∈Mα
z|x| =
- k≥0
λα(k)zk λα(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 q0 ∈ (0, 1), the characteristic root of the action.
SLIDE 20
Uniform measure
Theorem
For an irreducible action of a trace monoid M over a finite set X and with characteristic root q0, there exists a Markov measure m = (mα)α∈X with the following form: x ∈ Mα = ⇒ mα( ↑x) = q|x|
0 Γ(α, α · x)
x / ∈ Mα = ⇒ mα( ↑x) = 0 where Γ : X × X → R>0 satisfies the cocyle identities Γ(α, γ) = Γ(α, β) · Γ(β, γ) in particular Γ(α, α) = 1 The Markov measure m is the uniform measure associated with the action.
SLIDE 21
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: mα
- ↑(x · y)
- = q|x·y|
Γ
- α, α · (x · y)
- = q|x|
0 Γ(α, α · x) · q|y| 0 Γ
- α · x, (α · x) · y
- = mα( ↑x) · mα·x( ↑y)
SLIDE 22
Uniform measure
Remarks
◮ The measure mα can be constructed as the following weak
limit mα = lim
q→q−
1 Gα(q)
- x∈Mα
z|x|δx
◮ It yields the following expression for Γ(·, ·):
Γ(α, β) = lim
q→q0−
Gβ(q) Gα(q)
SLIDE 23
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
SLIDE 24
An example
Two markings: α depicted and β = α · b
- a
- b
- c
- d
- e
The root q0 is determined as the root of smallest modulus of the following determinant: θ(z) =
- 1 − 3z + 2z2
−z + 2z2 −z + z2 1 − 2z
- = (1 − z)(1 − 2z)(1 − 2z − z2)
q0 = √ 2 − 1
SLIDE 25
An example
Two markings: α depicted and β = α · b
- a
- b
- 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), . . . mα
- ↑(b · d)
- = q2
0λ, . . .
yields λ = √ 2
SLIDE 26
An example
Two markings: α depicted and β = α · b
- a
- b
- c
- d
- e
Finally: mα( ↑x) =
- (
√ 2 − 1)|x|, if α · x = α √ 2( √ 2 − 1)|x|, if α · x = β mβ( ↑x) =
- (
√ 2 − 1)|x|, if β · x = β
1 √ 2(
√ 2 − 1)|x|, if β · x = α
SLIDE 27
Extensions
General Markov measures
mα
- ↑(x · y)
- = mα( ↑x) · mα·x( ↑y)
◮ They can be characterized by finitely many probabilistic
parameters with suitable normalization conditions
◮ Analogous to the transition matrix of a Markov chain ◮ Yields a notion of “discrete time Markov chain with several
tokens”
SLIDE 28
Extensions
Application to uniform generation
◮ Infinite executions (traces) may be generated through a large
but finite Markov chain
◮ A variant for finite traces allows for Boltzman sampling ◮ Not entirely satisfying since it does not fit the “distributed”
nature of the model
SLIDE 29