Title: Petri%20Nets
1Petri Nets
Formal Methods for SoC Design
Sorin Manolache
sorma_at_ida.liu.se
Compiled from lecture slides by Petru Eles
petel_at_ida.liu.se
2Outline
- History and rationale
- Structure
- Behaviour
- Analysis
- Extensions
- Petri Nets resources
Petri Nets Sorin Manolache and Petru Eles
3History and Rationale
- Graphical and mathematical modelling language
- Applicable to a large variety of systems
- Able to model synchronisation, concurrency,
non-determinism - Amenable to analysis
- With extensions, able to model real-time
- With extensions, they have the expressive power
of Turing Machines
- Carl Adam Petri, Kommunikation mit Automaten,
PhD dissertation, 1962 - Kurt Jensen, Coloured Petri Nets and the
Invariant Method, Theoretical Computer Science
(14) 1981 - M.K. Molloy, Performance Analysis Using
Stochastic Petri Nets, IEEE Trans. on Computers,
C-31, 9, 1982
Petri Nets Sorin Manolache and Petru Eles
4Structure
- Directed, bipartite graph
- The two types of vertices are places and
transitions
- Multisets of input arcs and multisets of output
arcs (input and output relative to transitions)
- Places are like holders of something (defining
state), while transitions are like activities
(defining state transformations/behaviour)
Petri Nets Sorin Manolache and Petru Eles
5Behaviour
- Places hold tokens, the place is said to be
marked - The marking of a net indicates how many tokens
there are in each place
- Tokens circulate among places through transitions
- We say that the transition fires
- A transition fires when it is enabled
- A transition is enabled when each of its input
places contain more tokens than the multiplicity
of the corresponding input arc - Upon firing, Ip tokens are removed from each
input place and Op tokens are placed in each
output place, where Ip and Op are the
corresponding input and output arc multiplicities
Petri Nets Sorin Manolache and Petru Eles
6Producer-Consumer Example
prod
cons
Petri Nets Sorin Manolache and Petru Eles
7Producer-Consumer Example
prod
cons
Petri Nets Sorin Manolache and Petru Eles
8Concurrency, Synchronisation
Petri Nets Sorin Manolache and Petru Eles
9Analysis
- We're interested in certain properties of the
modelled system expressed in terms of properties
of the Petri Net representation - Reachability
- Liveness
- Boundedness
- Safety
- Computation of invariants
Petri Nets Sorin Manolache and Petru Eles
10Reachability
Marking M'
Marking M
Is there a sequence of transition firings such
that M M'?
NO
Petri Nets Sorin Manolache and Petru Eles
11Liveness
- A transition T is live if in any marking there
exists a firing sequence such that T becomes
enabled - An entire net is live if all its transitions are
live - Important for checking deadlock
Live?
YES
NO
Petri Nets Sorin Manolache and Petru Eles
12Boudedness
YES
NO
Is there a limit of the number of tokens in any
place?
A net is safe if its bound is 1
Petri Nets Sorin Manolache and Petru Eles
13Place Invariants
P1
P2
P1 P2 2
Petri Nets Sorin Manolache and Petru Eles
14Extensions
- Sometimes non-determinism is not desirable ?
Introduction of transition priorities - We can have partial order on transition firings,
but no explicit notion of time ? Introduction of
transition firing delays (Timed Petri Nets) or
transition firing delay probability distributions
(Stochastic Petri Nets or Extended Stochastic
Petri Nets) or a combination thereof
(Deterministic and Stochastic Petri Nets) - Some behaviours cannot be expressed with Basic
Petri Nets ? Introduction of inhibitor arcs
giving Petri Nets the same expressive power as
Turing Machines
Petri Nets Sorin Manolache and Petru Eles
15Hierarchy
1
2
1
1
1
2
Petri Nets Sorin Manolache and Petru Eles
16Coloured Petri Nets
- Petri Nets quickly grow to large dimensions when
modelling non-trivial systems - In order to reduce modelling complexity, tokens
have associated values of different types
(colours) and transitions are functions defined
on the colour domains of their input places with
values in the colour domains of their output
places
- The most useful application is associating time
stamps to tokens, easily modelling real-time
systems - Danger the modelling language is so powerful
that it easily leads to non-analysable models
(real-valued time stamps lead to unbounded nets,
as the set of real numbers is uncountable)
- It is just syntactic sugar, CPN are equivalent to
Basic Petri Nets and therefore CPN models can be
translated to BPN models and the other way around
Petri Nets Sorin Manolache and Petru Eles
17Worker-Resource Example
idle
update
use
Petri Nets Sorin Manolache and Petru Eles
18Multiprocessor System Example
A
B
Petri Nets Sorin Manolache and Petru Eles
19Application Modelling
Petri Nets Sorin Manolache and Petru Eles
20Reachability Graph
Petri Nets Sorin Manolache and Petru Eles
21Discussion
- Powerful modelling language
- Amenable to analysis
- Models parallelism, synchronisation,
non-determinism, real-time - Extended to support hierarchy
- Almost all analysis methods die because of
complexity issues - Unsatisfying composability when it comes to
analysis because the modelling hierarchy is
usually lost in a flat representation at analysis
Petri Nets Sorin Manolache and Petru Eles
22Petri Nets Resources
- http//www.daimi.au.dk/PetriNets/
- Books
- Tools
- Papers
- Conferences
- Success stories
- Mailing lists
- News
Petri Nets Sorin Manolache and Petru Eles