Escolar Documentos
Profissional Documentos
Cultura Documentos
BF - ES
- 1-
Petri nets
Introduced in 1962 by Carl Adam Petri in his PhD thesis.
Different Types of Petri nets known
Condition/event nets
Place/transition nets
Predicate/transition nets
Hierachical Petri nets,
BF - ES
- 2-
BF - ES
- 3-
BF - ES
- 4-
Key Elements
Conditions
Either met or not met. Conditions represent local states. Set of
conditions describes the potential state space.
Events
May take place if certain conditions are met. Event represents a state
transition.
Flow relation
Relates conditions and events, describes how an event changes the
local and global state.
Tokens
Assignments of tokens to conditions specifies a global state.
Conditions, events and the flow relation form
a bipartite graph (graph with two kinds of nodes).
BF - ES
- 5-
Example 2:
Synchronization at single track rail segment
mutual exclusion:
there is at most one train using the track rail
Preconditions
of x fulfilled
BF - ES
- 6-
BF - ES
- 7-
BF - ES
- 8-
BF - ES
- 9-
BF - ES
- 10 -
Petri Nets
Def.: N=(C,E,F) is called a Petri net, iff the following holds
1. C and E are disjoint sets
2. F (C E) (E C); is binary relation, (flow relation)
Def.: Let N be a net and let x (C E).
x := {y | y F x} is called the set of preconditions.
x := {y | x F y} is called the set of postconditions.
Example:
x
BF - ES
- 11 -
Boolean marking
and computing changes of markings
A Boolean marking is a mapping M: C { 0,1 }.
Firing events x generate new markings on each of the conditions c
according to the following rules:
a transition at x can be fired, iff x, i.e. all preconditions of x are
marked and x is not marked, after firing x is unmarked and x is
marked
M M, iff M results from M by firing exactly one transition
BF - ES
- 12 -
BF - ES
- 13 -
BF - ES
- 14 -
0
-3
-2
-1
BF - ES
- 15 -
M1
M2
M3
Split 1.1
M4
M5
Split 4.1
BF - ES
M6
Split 5.1
- 16 -
M6
M1
Split 6.1
BF - ES
- 17 -
M6
M7
M2s
Split 6.2
BF - ES
- 18 -
M5
M6s
Split 5.2
BF - ES
- 19 -
M4
M8
M6
Split 4.2
BF - ES
- 20 -
10
M2s
M1
Split 1.2
BF - ES
- 21 -
M3
M4
M1
M5
M5s
M2s
M3s
M4s
M6
M7
M7s
M6s
M8s
BF - ES
- 22 -
11
- 23 -
BF - ES
- 24 -
12
BF - ES
- 25 -
M8
M2
M3
M4
M1
M5
M5s
M2s
M3s
M4s
M6
M7
M7s
M6s
M8s
BF - ES
- 26 -
13
Properties of C/E
Def.:
BF - ES
- 27 -
concurrency of
transitions
BF - ES
alternative or
conflict
synchronization
- 28 -
14
Example Thalys
trains:
more complex
Thalys
Thalystrains
trains
between
between Cologne,
Cologne,
Amsterdam,
Amsterdam,
Brussels
Brusselsand
andParis.
Paris.
Synchronization
Synchronization at
at
Brussels
Brusselsand
andParis
Paris
BF - ES
- 29 -
k=1
accepted
ready
p1
Storage p3
produce
t2
t1
p4
accept
t3
t4
consume
send
p2
k=5
p5
idle
BF - ES
ready
k=1
k=2
Producer
Consumers
- 30 -
15
Place/transition nets
Def.: (P, T, F, K, W, M0) is called a place/transition net (P/T net) iff
1. N=(P,T,F) is a net with places p P and transitions t T
2. K: P (N0 {}) \{0} denotes the capacity of places
( symbolizes infinite capacity)
3. W: F (N0 \{0}) denotes the weight of graph edges
4. M0: P N0 {} represents the initial marking of places
M0
defaults:
defaults:
KK==
W
W==11
BF - ES
- 31 -
BF - ES
- 32 -
16
Activated transitions
Transition t is activated
iff
Activated
Activatedtransitions
transitionscan
can take
takeplace
place or
or fire,
fire,
but
dont
have
to.
but dont have to.
The
The order
order in
in which
which activated
activated transitions
transitionsfire
fireisisnot
notfixed
fixed
(it
is
non-deterministic).
(it is non-deterministic).
BF - ES
- 33 -
Let
BF - ES
W ( p, t ) if p t \ t
+ W (t , p ) if p t \ t
t ( p) =
W ( p, t ) + W (t , p ) if p t t
0
p P: M(p) = M(p)+ t(p)
M = M+ t
+: vector add
- 34 -
17
+ W (t , p ) if p t \ t
t ( p) =
W ( p, t ) + W (t , p ) if p t t
0
Def.: Matrix N of net N is a mapping
N: P T Z (integers)
such that t T: N(p,t)=t(p)
Component in column t and row p indicates the change of
the marking of place p if transition t takes place.
BF - ES
- 35 -
Example: N =
t1 t2 t3
p1 1
p2 1 1
1 1
p3
p6
p7
p8
p9 1
p10
p11
BF - ES
p12
p13
t5
t6 t7
1
t8
t9
t10
1 1
1 1
1 1
p4
p5
s
t4
1
1
1 1
1
1
1
1
1
1
- 36 -
18
Computation of Invariants
We are interested in subsets R of places whose number
of labels remain invariant under transitions,
e.g. the number of trains commuting between
Amsterdam and Paris (Cologne and Paris) remains
constant
Important for correctness proofs, e.g. the proof of
liveness
BF - ES
- 37 -
2
0
-2
BF - ES
- 38 -
19