Professional Documents
Culture Documents
VL Formal Models
Armin Biere Martina Seidl
Petri Nets
one of the most widely used modeling language for describing distributed systems
formal basis for UML activity diagrams
many theoretical results
reachability
liveness
deadlocks
many variants and extensions
1
Excursus: Labeled Transition System
a set of states S
a set of actions Σ
a transition relation T ⊆ S × Σ × S
initial states I ⊆ S
2
Excursus: Labeled Transition System
a set of states S
a set of actions Σ
a transition relation T ⊆ S × Σ × S
initial states I ⊆ S
LTS
2
LTS: Example
3
Condition-Event Net (CEN)
most basic form of a petri net
Definition
A condition-event net N = (C, I, E, G) consists of
Graphical representation
Definition
Let N = (C, I, E, G) be a CEN. The preconditions G−1 (e) and the postconditions G(e) of an
event e ∈ E are defined as follows:
G(e) = {c | (e, c) ∈ G}
(informally: if event e has fired, all postconditions of e are true)
5
CEN Semantics as LTS
Definition
Let N = (C, I, E, G) be a CEN. The LTS L = (S , {I}, Σ, T ) consists of the following components:
S = P(C)
state M ∈ S is also called a marking
Σ=E
(C1 , e, C2 ) ∈ T iff
1. G−1 (e) ⊆ C1
(preconditions of e are true)
2. G(e) ∩ C1 = ∅
(postconditions of e are false)
3. C2 = (C1 \G−1 (e)) ∪ G(e)
(state update: after e has fired, the preconditions of e are false and the postconditions are true)
6
Example: Producer Consumer
7
Deadlock
Let N = (C, I, E, G) be a CEN with LTS L = (S , {I}, Σ, T ).
{M 0 | (M, e, M 0 ) ∈ T } , ∅
8
Deadlock
Let N = (C, I, E, G) be a CEN with LTS L = (S , {I}, Σ, T ).
{M 0 | (M, e, M 0 ) ∈ T } , ∅
8
Deadlock
Let N = (C, I, E, G) be a CEN with LTS L = (S , {I}, Σ, T ).
{M 0 | (M, e, M 0 ) ∈ T } , ∅
8
Place Transition Net (PTN)
Definition
A PTN N = (P, I, T, G, C) consists of
places P
initial marking I : P → N
transitions T
˙ × P)
connection graph G ⊆ (P × T ) ∪(T
capacities C : P ∪˙ G → N ∪ {∞}
default value for places: ∞
default value for connections: 1
Graphical representation
. . . place with multiple tokens
like CEN, but places can have multiple tokens
9
PTN Semantics as LTS
Definition
Let N = (P, I, T, G, C) be a PTN. The LTS L = (S , {I}, Σ, T L ) consists of the following
components:
states S = {M : P → N}
a state M : P → N is also called a marking
markings can also be written as elements of NP
Σ=T
(M1 , e, M2 ) ∈ T L iff
1. C((p, t)) ≤ M(p) ∀p ∈ G−1 (t)
(enough tokens in the preconditions of e)
2. C((t, q)) + M(q) ≤ C(q) ∀q ∈ G(t)
(enough space in the postconditions of e)
3. state update: ∀p ∈ P : M2 (p) = M1 (p) − M− (p) + M+ (p) where
C((p, t)) p ∈ G−1 (t) C((t, p) p ∈ G(t))
M− (p) = M+ (p) =
0
0
10
Example: Place Transition Net
cars leave
cars in filling
filling station
station exitway
cars in free
filling station freed pumps cashiers
cars enter
filling station
do free pumps
unfueled cars
at pump
drive up cars leave
to a pump pumps
tanks are fueled cars payment cars ready
filled at pump to leave
free spaces
12