Petri Nets Petri Nets Inputs and Outputs Petri Nets vs FSM - - PowerPoint PPT Presentation

petri nets
SMART_READER_LITE
LIVE PREVIEW

Petri Nets Petri Nets Inputs and Outputs Petri Nets vs FSM - - PowerPoint PPT Presentation

April 5, 2006 Lionel Morel Introduction Definitions Petri Nets Petri Nets Inputs and Outputs Petri Nets vs FSM Lionel Morel Modeling Templates TUCS Analysis Methods for Petri Nets April 5, 2006 Extensions and Restrictions Lionel


slide-1
SLIDE 1

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Petri Nets

Lionel Morel

TUCS

April 5, 2006

Lionel Morel Spring 2006 1

slide-2
SLIDE 2

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Content

1

Introduction

2

Definitions

3

Petri Nets vs FSM

4

Modeling Templates

5

Analysis Methods for Petri Nets

6

Extensions and Restrictions

Lionel Morel Spring 2006 2

slide-3
SLIDE 3

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Why Petri Nets?

Models based on finite state machines are inherently focused on the state of a system and the observable input-output behavior. They are not well suited to studying the interaction of concurrently active parts of a system and the combined behavior of distributed parallel systems.

Lionel Morel Spring 2006 3

slide-4
SLIDE 4

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Why Petri Nets? - 2

To address issues of concurrency, synchronization and communication, we need to generalize state machines into a model of communicating, concurrent state machines. A first necessary step into that direction is to study the phenomenon of concurrency isolated from the internal complexities of the subparts of a system. Why? Mainly because Concurrency itself is an important source of complexity that can be rapidly overwhelming. ⇒ Petri Nets.

Lionel Morel Spring 2006 4

slide-5
SLIDE 5

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Petri Nets: What’s this?

2 principal abstractions that render them so suitable for the study of concurrency: They are concentrating of the act of communication, and are not concerned with the data being communicated. The mean of communication is a token which does not contain any data. All details of behavior are omitted if they do not contribute to the consumption and emission of tokens.

Lionel Morel Spring 2006 5

slide-6
SLIDE 6

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Content

1

Introduction

2

Definitions Petri Nets Inputs and Outputs

3

Petri Nets vs FSM

4

Modeling Templates

5

Analysis Methods for Petri Nets

6

Extensions and Restrictions

Lionel Morel Spring 2006 6

slide-7
SLIDE 7

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Definition

A Petri net is a six-tuple N = (P, T, A, w, x0), where P is a finite set of places T is a finite set of transitions A is a set of arcs, A ⊆ (P × T) ∪ (T × P) w is a weight function, w : A → N

  • x0

is an initial marking vector, x0 ∈ N|P|

Lionel Morel Spring 2006 7

slide-8
SLIDE 8

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Places and Transitions

Let N = (P, T, A, w, x0) be a petri net. The set I(t) = {p ∈ P|(p, t) ∈ A} is the set of input places of transition t. The set O(t) = {p ∈ P|(t, p) ∈ A} is the set of output places of transition t. A transition t is enabled in state x if: x(p) ≥ w(p, t)∀p ∈ I(t).

Lionel Morel Spring 2006 8

slide-9
SLIDE 9

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Examples

p1 t1 p2 p1 t1 p2 t1 p1 p2

Lionel Morel Spring 2006 9

slide-10
SLIDE 10

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Petri Net Transition

Let N = (P, T, A, w, x0) be a petri net with P = {p0, ..., pn−1} and x = [x(p0), ..., x(pn−1)] be a marking for the n places. The transition function G : (Nn × T) → Nn is defined as follows: G( x, t) = x′ if x(p) ≥ w(p, t)∀p ∈ I(t)

  • x
  • therwise

with

  • x′ = [x′(p0), ..., x′(pn−1)]

x′(pi) = x(pi) − w(pi, t) + w(t, pi) for 0 ≤ i < n

if the number of token in p is greater or equal to the sum of the transitions exiting the place, then take the transition

  • therwise nothing changes !

Lionel Morel Spring 2006 10

slide-11
SLIDE 11

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Firing example

t1 p1 p2 t1 p1 p2

Lionel Morel Spring 2006 11

slide-12
SLIDE 12

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Dynamics - Example

Petri net N = (P, T, A, w, x0) with: P = {p1, p2, p3, p4} T = {t1, t2, t3} A = {(p1, t1), (p1, t3), (p2, t2), (p3, t2), (p3, t3), (p4, t3), (t1, p2), (t1, p3), (t2, p2), (t2, p3), (t2, p4)} w(a) = 1∀a ∈ A

  • x0

= [2, 0, 0, 1]

= t1 p1 p2 p3 t3 p4 t2 x0 = [2, 0, 0, 1]

Lionel Morel Spring 2006 12

slide-13
SLIDE 13

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Dynamics - Example

Petri net N = (P, T, A, w, x0) with: P = {p1, p2, p3, p4} T = {t1, t2, t3} A = {(p1, t1), (p1, t3), (p2, t2), (p3, t2), (p3, t3), (p4, t3), (t1, p2), (t1, p3), (t2, p2), (t2, p3), (t2, p4)} w(a) = 1∀a ∈ A

  • x0

= [2, 0, 0, 1]

= t1 p1 p2 p3 t3 p4 t2 x1 = [1, 1, 1, 1]

Lionel Morel Spring 2006 12

slide-14
SLIDE 14

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Dynamics - Example

Petri net N = (P, T, A, w, x0) with: P = {p1, p2, p3, p4} T = {t1, t2, t3} A = {(p1, t1), (p1, t3), (p2, t2), (p3, t2), (p3, t3), (p4, t3), (t1, p2), (t1, p3), (t2, p2), (t2, p3), (t2, p4)} w(a) = 1∀a ∈ A

  • x0

= [2, 0, 0, 1]

= t1 p1 p2 p3 t3 p4 t2

Lionel Morel Spring 2006 12

slide-15
SLIDE 15

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

The Reachability Set

Definition For a Petri net N = (P, T, A, w, x0) and a given state x, a state y is immediately reachable from x if there exists a transition t ∈ T such that G( x, t) =

  • y. The reachability set

R( x) is the smallest set of states defined by:

1

x ∈ R( x)

2 If

y ∈ R( x) and z = G( y, t) for some t ∈ T, then

  • z ∈ R(x).

More intuitively, the reachability set of a state includes all the states that can eventually be reached by repeatedly firing transitions.

Lionel Morel Spring 2006 13

slide-16
SLIDE 16

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Reachability Set Example

t1 p1 p2 p3 t3 p4 t2

R( x0) = R1 ∪ R2 ∪ R3 ∪ R4 R1 = { x0} R2 = { y| y = [1, 1, 1, n], n ≥ 1} R3 = { y| y = [0, 2, 2, n], n ≥ 1} R4 = { y| y = [0, 1, 0, n], n ≥ 0}

Lionel Morel Spring 2006 14

slide-17
SLIDE 17

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Firing Vector and Incidence Matrix

Definition Let N = (P, T, A, w, x0) be a petri net with P = p1, ..., pn and T = t1, ..., tm. A firing vector u = [0, ..., 0, 1, 0, ..., 0] is a vector of length m where entry j, 1 ≥ j ≥ m corresponds to transition tj . All entries of the vector are 0 but one, where it has a value of 1. If entry j is 1, transition tj fires. The incidence matrix A is an m × n matrix whose (j, i) entry is: aj,i = w(tj, pi) − w(pi, tj)

aj,i contains the information about the net effect of firing transition tj from place pi. A state equation can be written as: x′ = x + uA

Lionel Morel Spring 2006 15

slide-18
SLIDE 18

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Example - Building the incidence matrix

t1 p1 p2 p3 t3 p4 t2

A =   −1 1 1 1 −1 −1 −1  

Lionel Morel Spring 2006 16

slide-19
SLIDE 19

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Example - Using the incidence matrix to evaluate Petri Nets (1)

t1 p1 p2 p3 t3 p4 t2 t1 p1 p2 p3 t3 p4 t2

  • x1 =

x0 + u1A = [2, 0, 0, 1] + [1, 0, 0]   −1 1 1 1 −1 −1 −1   = [2, 0, 0, 1] + [−1 + 0 + 0, 1 + 0 + 0, 1 + 0 + 0, 0 + 0 + 0] = [2, 0, 0, 1] + [−1, 1, 1, 0] = [1, 1, 1, 1]

Lionel Morel Spring 2006 17

slide-20
SLIDE 20

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Example - Using the incidence matrix to evaluate Petri Nets (2)

t1 p1 p2 p3 t3 p4 t2 t1 p1 p2 p3 t3 p4 t2

  • x2 =

x1 + u2A = [1, 1, 1, 1] + [0, 0, 1]   −1 1 1 1 −1 −1 −1   = [1, 1, 1, 1] + [−1, 0, −1, −1] = [0, 1, 0, 0]

Lionel Morel Spring 2006 18

slide-21
SLIDE 21

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

I/O in Petri Nets

So far, we have not considered input/outputs of petri nets Many modeling tasks can be achieved with isolated nets without interfaces It is however sometimes very useful to be able to model explicitely inputs and outputs

Lionel Morel Spring 2006 19

slide-22
SLIDE 22

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

I/O modeled as Places

Lionel Morel Spring 2006 20

slide-23
SLIDE 23

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

I/O modeled as Transitions

Lionel Morel Spring 2006 21

slide-24
SLIDE 24

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

I/O modeling

Both methods are equivalent (you can always model one by the other) We’ll use the ”places” representation, because it seems slightly more intuitive

Lionel Morel Spring 2006 22

slide-25
SLIDE 25

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Example - A server modeled as Petri Nets

Customers arrive at input p1 and depart at output p4.

Lionel Morel Spring 2006 23

slide-26
SLIDE 26

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Content

1

Introduction

2

Definitions

3

Petri Nets vs FSM

4

Modeling Templates

5

Analysis Methods for Petri Nets

6

Extensions and Restrictions

Lionel Morel Spring 2006 24

slide-27
SLIDE 27

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Finite State Machines: Remember?

Definition: A deterministic Mealy machine is a six-tuple (Σ, ∆, X, g, f , x0) where: Σ is a finite input alphabet ∆ is a finite output alphabet X is a finite set of states x0 is the initial state, x0 ∈ X g is a a state transition function, g : X × Σ → X f is an output function, f : X × Σ → ∆

Lionel Morel Spring 2006 25

slide-28
SLIDE 28

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

FSM - Example

Lionel Morel Spring 2006 26

slide-29
SLIDE 29

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Petri Nets vs. FSM?

FSM are used to model I/O behavior Petri Nets are used to model concurrent behavior Compositions of Petri-Nets are much simpler (composition

  • f FSM actually generates a state explosion)

Lionel Morel Spring 2006 27

slide-30
SLIDE 30

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Compositions of Petri Nets

Sequential composition Parallel composition

Lionel Morel Spring 2006 28

slide-31
SLIDE 31

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Sequential composition of PN

Lionel Morel Spring 2006 29

slide-32
SLIDE 32

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Parallel composition of PN

Lionel Morel Spring 2006 30

slide-33
SLIDE 33

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Composition of FSM

1 1 1 1 1 1 x0 x1 x1 x1, x1 x0, x1 x1, x0 x0 x0, x0

Lionel Morel Spring 2006 31

slide-34
SLIDE 34

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Petri Nets vs. FSM?

The composition is more complex because the resulting FSM’s state space is a product of the two component state spaces... But, are PN and FSM equally powerful? No (every FSM can be modeled by a PN but not vice-versa)

Lionel Morel Spring 2006 32

slide-35
SLIDE 35

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

From FSM to Petri Nets

FSM M = (Σ, ∆, X, g, f , x0) with mutually exclusive sets Σ and ∆. An equivalent Petri net is N = (P, T, A, y0) with: P = X ∪ Σ ∪ ∆ T = {tx,a|x ∈ X, a ∈ Σ} A = I(tx,a)O(tx,a)∀tx,a ∈ T I(tx,a) = x, a O(tx,a) = {g(x, a), f (x, a)}

  • y0 = [1, 0, ..., 0]

Σ are input places; ∆ are output places; X are internal places; Each (state, input) pair in M becomes a transition in N ; Initial marking represents state x0 and no input;

Lionel Morel Spring 2006 33

slide-36
SLIDE 36

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Example

Computation of the two’s complement of a binary number represented with the least significant bit first.

Lionel Morel Spring 2006 34

slide-37
SLIDE 37

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Content

1

Introduction

2

Definitions

3

Petri Nets vs FSM

4

Modeling Templates

5

Analysis Methods for Petri Nets

6

Extensions and Restrictions

Lionel Morel Spring 2006 35

slide-38
SLIDE 38

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Modeling Templates

Goal: illustrate Petri Nets We’ll look at several practical templates for standard modeling tasks

Lionel Morel Spring 2006 36

slide-39
SLIDE 39

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Sequence and Concurrency

Lionel Morel Spring 2006 37

slide-40
SLIDE 40

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Fork and Join

Fork: doubles the control flow, resulting in two parallel threads Join: merges two control flows into one

Lionel Morel Spring 2006 38

slide-41
SLIDE 41

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Fork and Join

Lionel Morel Spring 2006 39

slide-42
SLIDE 42

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Conflict

Used to model situations where two processes compete for data

  • r resources.

Lionel Morel Spring 2006 40

slide-43
SLIDE 43

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Mutual Exclusion - Problem

Lionel Morel Spring 2006 41

slide-44
SLIDE 44

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Mutual Exclusion - Petri Net solution

Lionel Morel Spring 2006 42

slide-45
SLIDE 45

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Producer/Consumer

Lionel Morel Spring 2006 43

slide-46
SLIDE 46

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Modeling Templates - Conclusion

We have introduced different modeling templates: Sequence and Concurrency Fork and Join Conflict (e.g. for Mutual Exclusion) Producer/Consumer

Lionel Morel Spring 2006 44

slide-47
SLIDE 47

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Content

1

Introduction

2

Definitions

3

Petri Nets vs FSM

4

Modeling Templates

5

Analysis Methods for Petri Nets

6

Extensions and Restrictions

Lionel Morel Spring 2006 45

slide-48
SLIDE 48

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Analysis Methods - Intro

In general, when modeling a system, we want to be able to formulate particular questions on it: Will a system ever enter a particular state? Will it always be able to avoid a particular dangerous state? Will it always eventually reach some desired state? The next part introduces: Questions on Petri Nets How to answer these questions These questions are not typical to PN but are encountered with system models in general.

Lionel Morel Spring 2006 46

slide-49
SLIDE 49

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Analysis Methods - Intro

Boundedness Conservation Liveness Reachability and Coverability Persistence A technique for addressing these questions on PN: The Coverability Tree

Lionel Morel Spring 2006 47

slide-50
SLIDE 50

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Boundedness

Places are often used to represent a buffer, a memory or a queue Example Tokens can represent arriving and emitted messages. The number of tokens in a place represents the number of messages arrived but not yet processed. We would then like to guarantee taht the number of tokens in that place never exceeds a particular limit. ⇒ Boundedness

Lionel Morel Spring 2006 48

slide-51
SLIDE 51

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Boudedness - Definition

A place p ∈ P in a Petri net N = (P, T, A, w, x0) is k-bounded if: ∀y ∈ R( x0) : y(p) ≤ k. The Petri net is called k-bounded if all places p ∈ P are k-bounded.

Lionel Morel Spring 2006 49

slide-52
SLIDE 52

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Boundedness - Example: an unbounded PN

t1 p1 p2 p3 t3 p4 t2 x0 = [2, 0, 0, 1]

This PN is not bounded because p4 is not bounded !

Lionel Morel Spring 2006 50

slide-53
SLIDE 53

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Boundedness - Example: a bounded PN

That definition is only useful for nets in isolation with no inputs because an input place may always be unbounded, depending

  • f course on the environment’s behavior.

Lionel Morel Spring 2006 51

slide-54
SLIDE 54

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Conservation

Token can also represent other things (data, requests, customers, services, ressources, etc.) It can be interesting to know if the number of tokens for all reachable states is constant

Lionel Morel Spring 2006 52

slide-55
SLIDE 55

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Conservation - Example

Tokens in a place m represent available printers Tokens in place p1 and p2 represent incoming printing requests Initial marking for m represent the total number of printers (n) n would be assumed to be constant

Lionel Morel Spring 2006 53

slide-56
SLIDE 56

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Strict Conservation - Definition

A Petri net N = (P, T, A, w, x0) is strictly conservative if for all y ∈ R( x0),

  • p∈P

y(p) =

  • p∈P

x0(p) N is strictly conservative if the number of tokens is the same in all possible reachable state configuration

Lionel Morel Spring 2006 54

slide-57
SLIDE 57

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Strict Conservation - Remark, Example

Strict conservation is very strong and severely restricts expressiveness of PN. Is not strictly conservative (t1 consumes 2 tokens while producing only one)

Lionel Morel Spring 2006 55

slide-58
SLIDE 58

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Conservation

A Petri net N = (P, T, A, w, x0) with n places is conservative with respect to a weighting vector γ = [γ1, γ2, ..., γn], γi ∈ N, if

n

  • i=1

γi x(p) = constant ∀p ∈ P and x ∈ R( x0) The Petri net is conservative if it is conservative with respect to a weighting vector which has a positive non zero weight for all places. N is conservative with respect to some weighting vector if the number of tokens within the specified places is constant !

Lionel Morel Spring 2006 56

slide-59
SLIDE 59

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Conservation - Example

We are interested in the constant number of printers. This PN is conservative with respect to

  • y = [0, 0, 1, 1, 1, 0, 0]

(places p1, p2, p6, p7 and p8 are actually not relevant for the number of printers, but p3, p4 and p5 are! )

Lionel Morel Spring 2006 57

slide-60
SLIDE 60

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Liveness - What’s a deadlock?

Concurrent processes that interact with each other can come into a situation of deadlock : All processes waiting for some action to be taken by another process. This phenomenon is: widespread potentially very harmful difficult to predict and to avoid (it requires the analysis of all involved processes)

Lionel Morel Spring 2006 58

slide-61
SLIDE 61

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Liveness - What’s a deadlock?

Lionel Morel Spring 2006 59

slide-62
SLIDE 62

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Liveness

Let N = (P, T, A, w, x0) be a Petri net and x a state reachable from x0. L0-live: A transition t is live at level 0 in state x if it cannot fire in any state reachable from x, A PN is L0-live if it cannot fire any transition. It is deadlocked

Lionel Morel Spring 2006 60

slide-63
SLIDE 63

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Liveness - Example

t0 is dead (L0-live)

Lionel Morel Spring 2006 61

slide-64
SLIDE 64

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Liveness

L1-live: A transition t is live at level 1 in state x if it is potentially fire-able, i.e. if there exists a y ∈ R(x) such that t is enabled in y. A transition is L1-live if there exists at least one state configuration in which it can be fired

Lionel Morel Spring 2006 62

slide-65
SLIDE 65

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Liveness - Example

t1 is L1-live

Lionel Morel Spring 2006 63

slide-66
SLIDE 66

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Liveness

L2-live: A transition t is live at level 2 in state x if for every integer n there exists a firing sequence in which t occurs at least n times. A transition is L2-live if it can potentially fire repeatidly for any number of time

Lionel Morel Spring 2006 64

slide-67
SLIDE 67

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Liveness - Example

t2 is L2-live

Lionel Morel Spring 2006 65

slide-68
SLIDE 68

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Liveness

L3-live: A transition t is live at level 3 in state x if there is an infinite firing sequence in which t occurs infinitely often. A transition is L3-live if it can potentially fire infinitely often.

Lionel Morel Spring 2006 66

slide-69
SLIDE 69

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Liveness - Example

t3 is L3-live

Lionel Morel Spring 2006 67

slide-70
SLIDE 70

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Liveness

L4-live: A transition t is live at level 4 in state x if it is L1-live in every y ∈ R(x). A transition is L4-live if, at any moment, whatever the state configuration, it can eventually fire

Lionel Morel Spring 2006 68

slide-71
SLIDE 71

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Liveness - Example

t4 is L4-live

Lionel Morel Spring 2006 69

slide-72
SLIDE 72

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Liveness

A Petri net is live at level i if every transition is live at level i.

Lionel Morel Spring 2006 70

slide-73
SLIDE 73

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Reachability and Coverability

Many other problems (including deadlock avoidance) can be viewed as a special case of the state reachability problem. This asks if a particular state can be reached from a given state. i.e., given a state x, is a state y ∈ R( x). If one can answer this question for any x and y, then one can also answer for all questions about boundedness, conservation, deadlock and liveness. Unfortunattely, we do not have an efficient method to answer this question for PN with infinite state space. Fortunatelly, we can still solve some of these problems by analyzing a weaker property: Coverability!

Lionel Morel Spring 2006 71

slide-74
SLIDE 74

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Coverability

N = (P, T, A, w, x0) is a Petri net; x and y are arbitrary states; State x covers state y if all transitions enabled in y are also enabled in x: x(p) ≥ y(p)∀p ∈ P. State x strictly covers state y if x covers y and, in addition, ∃p ∈ P : x(p) > y(p). Let x ∈ R( x0). A state y is coverable by x iff there exists a state x′ ∈ R( x) such that x′(p) ≥ y(p) for all p ∈ P. From a given state x0, can we reach a state that ”covers” a state y?

Lionel Morel Spring 2006 72

slide-75
SLIDE 75

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Coverability - Example

  • y0 = [1, 0, 1, 0, 0] :

state with minimal number of tokens required to enable t0

  • y1 = [0, 0, 1, 1, 0] :

same for t2

  • y1 is coverable by

x0 (we can reach it from x0

  • y0 is not

⇒ t0 is dead while t2 is at least L1-live The question whether a transition is dead or L1-live can be formulated as a coverability problem!

Lionel Morel Spring 2006 73

slide-76
SLIDE 76

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Coverability vs. Reachability

Coverability is weaker than reachability: Coverability = can we reach one state of an infinite set that share a common property Reachability = can we reach one specific state But still, coverability can solve a great deal of the most common problems !

Lionel Morel Spring 2006 74

slide-77
SLIDE 77

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Persistence

Understanding of the impact of one activity on another activity is of particular interest Eg: can the occurence of an interrupt cause some tasks to miss their deadline? ⇒ Persistence captures some aspects of the relationship between transitions.

Lionel Morel Spring 2006 75

slide-78
SLIDE 78

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Persistence - Definition

Two transitions are persistent with respect to each other if, when both are enabled the firing of one does not disable the

  • ther.

A Petri net is persistent if any two transitions are persistent with respect to each other.

Lionel Morel Spring 2006 76

slide-79
SLIDE 79

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Persistence - Example

This is not persistent because, if both t1 and t3 are enabled, the firing of t3 will disable t1. But t2 and t3 are persistent with each other.

Lionel Morel Spring 2006 77

slide-80
SLIDE 80

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Next...

Coverability tree - formal definition Construction algorithm Example Expressing the previously introduced properties on the coverability tree

Lionel Morel Spring 2006 78

slide-81
SLIDE 81

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

The coverability tree

Efficient technique for addressing some of the problems discussed previously Intuition: tree with the arcs representing transitions and nodes denoting sets of states that can be covered by a sequence of transitions

Lionel Morel Spring 2006 79

slide-82
SLIDE 82

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

The coverability tree - Finite state space

The tree simply contains all the reachable states. Works fine for finite state spaces, not for inifinite state spaces (would lead to infinite coverability trees)

Lionel Morel Spring 2006 80

slide-83
SLIDE 83

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

The coverability tree - Infinite state space

Idea: represents two states (one covering the other) by the same node in the tree Leads to a finite representation for infinite coverability

Lionel Morel Spring 2006 81

slide-84
SLIDE 84

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

The coverability tree - Remarks

During the construction of the CT, if we find y that covers

  • x already contained in the tree, we can set an ω for all

places where the marking of y is greater than that of x Of course, we loose information (we only know that a place can contain a unbounded number of tokens, not the exact number) But: we gain a finite representation for Infinite PN

Lionel Morel Spring 2006 82

slide-85
SLIDE 85

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

The coverability tree - Definition

Let N = (P, T, A, w, x0) be a Petri Net. A coverability tree is a tree where the arcs denote transitions t ∈ T and the nodes represent w-enhanced states of the Petri net. The root node of the tree is x0. A terminal node is an w-enhanced state in which no transition is enabled. A duplicate node is an w-enhanced state which already exists somewhere else in the coverability tree. An arc t connects two nodes x and y in the tree, iff firing of t in state x leads to state y.

Lionel Morel Spring 2006 83

slide-86
SLIDE 86

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

The coverability tree - Algorithm

Given is the Petri net N = (P, T, A, w, x0). Algorithm:

Step 1. Set L, the list of open nodes, to L := x0. Step 2. Take one node from L, named x, and remove it from L; Step 2.1. if G( x, t) = x∀t ∈ T then x is a terminal node goto Step 3; Step 2.2. for all x′ ∈ G( x, t), t ∈ T, x¬ = x′ Step 2.2.1. do if x(p) = ω then set x′(p) := x ; Step 2.2.2. if there is a node y already in the tree, such that x′ covers y and there is a path from y to x′, then set x(p) := ω for all p for which x′(p) > y(p); Step 2.2.3. if x′ is not a duplicate node then L := L ∪ { x′}; Step 3. if L is not empty then goto Step 2.

Lionel Morel Spring 2006 84

slide-87
SLIDE 87

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

The coverability tree - Example

Lionel Morel Spring 2006 85

slide-88
SLIDE 88

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

The coverability tree - Boundedness

A Petri net can be k-bounded if the symbol ω never appears in its coverability tree. If the coverability tree contains an ω, a transition cycle to exceed a given k-bound can be identified. The coverability tree does not inform about the number of cycles required.

Lionel Morel Spring 2006 86

slide-89
SLIDE 89

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

The coverability tree - Conservation

Recal: n

i=1 γix(p) = constant for all p ∈ P and

  • x ∈ R(

x0). If there is an ω the corresponding i must be 0. Algo:

Check if previous condition is fulfilled Check conservation (evaluated the weighted sum for each node in the CT If result = 0 then PN is conservative w.r.t. weighted vectore

Lionel Morel Spring 2006 87

slide-90
SLIDE 90

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Computing a conservation vector

Algo: Set i = 0 for every unbounded place pi. For b bounded places and r nodes in the coverability tree we set up r equations with b + 1 unknown variables

r

  • i=1

γix(pi) = C. Check if there exists a solution If so, calculate the solution to find weighting vector and C (= the exact number of tokens that are needed for that weighting vector)

Lionel Morel Spring 2006 88

slide-91
SLIDE 91

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Computing the conservation vector - Example

γ4 = 0 2γ1 + 0γ2 + 0γ3 = C 1γ1 + 1γ2 + 1γ3 = C 0γ1 + 2γ2 + 2γ3 = C 0γ1 + 1γ2 + 0γ3 = C Only non-negative solu- tion is γ = [0, 0, 0, 0] and C = 0. PN is not conservative w.r.t. any nontrivial weighting vector

Lionel Morel Spring 2006 89

slide-92
SLIDE 92

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Coverability Tree: Coverability and Reachability

The coverability problem can be solved by inspection of the coverability tree. The shortest transition sequence leading to a covering state can be found efficiently. The reachability problem cannot be solved in general.

Lionel Morel Spring 2006 90

slide-93
SLIDE 93

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Limitations

Distinct Petri Nets with Identical Coverability Tree - 1

Left PN can have any number of token in p3 Right PN can only have an even number of tokens in p3

Lionel Morel Spring 2006 91

slide-94
SLIDE 94

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Limitations

Distinct Petri Nets with Identical Coverability Tree - 2

Lionel Morel Spring 2006 92

slide-95
SLIDE 95

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Limitations ?

Sometimes, it can however help solve deadlock, liveness or reachability problems: If a state without an ω symbol is in the coverability tree it is also reachable Conversely, if a state cannot be covered, then it cannot be reached !

Lionel Morel Spring 2006 93

slide-96
SLIDE 96

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Content

1

Introduction

2

Definitions

3

Petri Nets vs FSM

4

Modeling Templates

5

Analysis Methods for Petri Nets

6

Extensions and Restrictions

Lionel Morel Spring 2006 94

slide-97
SLIDE 97

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Extensions and Restrictions

PN represent a compromise between expressive power and decision power ↑ Expressive power means that more situations can be formulated and expressed ↑ Decision power means that more problems can be decided effectively It has been shown that PN are not as expressive as Turing machines (because they cannot model test for the emptiness of a place)

Lionel Morel Spring 2006 95

slide-98
SLIDE 98

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Example: a shared channel

C1 C2 P1 P2 B1 B2

two pairs of consumer/producer communicate through a shared channel P1/C1 has a higher priority ⇒ communication from B2 to C2 takes place only when B1 is empty

Lionel Morel Spring 2006 96

slide-99
SLIDE 99

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Possible extensions

PN can be extended so as to solve the empty place problem: Inhibitor arcs timed-PN colored-PN

Lionel Morel Spring 2006 97

slide-100
SLIDE 100

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Extension: inhibitor arcs

Inhibitor arc: inhibits a transition when there is a token in its input place Some of the places are considered to be inhibitor places in the system A transition is then enabled when there are tokens in its normal input places and there are zero tokens in all its inhibitor input places.

Lionel Morel Spring 2006 98

slide-101
SLIDE 101

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Extensions - Timed Petri Nets

Time can also be used to solve this zero testing problem... The passing of time is an important aspect of system modeling It is not encompassed by the basic PN model This also solves this zero testing problem

Lionel Morel Spring 2006 99

slide-102
SLIDE 102

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Extensions - Timed Petri Nets

Example Associate a duration d to every place: when a token arrives at the place at time τ, it is not available before time τ + d: Associate a duration d to transitions (Arc-timed Petri Nets, Temporal arcs):

[d1, d2] is associated to an arc connecting place p and transition t if a token arrives in p at time τ, it contributes enabling the τ during [τ + d1, τ + d2]

Lionel Morel Spring 2006 100

slide-103
SLIDE 103

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Extensions - Timed Petri Nets

All these variants are equivalent to each other They emphasize different aspects and promote different modeling styles:

Timed places associate a duration with a system state Timed-transitions associate durations with activities

Lionel Morel Spring 2006 101

slide-104
SLIDE 104

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Extensions - Colored Petri Nets

Idea: introduce types of tokens Every token has a value (or color) Places are typed and restrict the types of tokens they can hold When a transition is fired, tokens of one type from the input place are transformed into tokens of some other type to the output places

Lionel Morel Spring 2006 102

slide-105
SLIDE 105

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Extensions

Of course, all these extensions lead to models with increased expressiveness but also increased complexity ! One can also look the other way round: reduce complexity to make more manageable the solving

  • f particular analysis problems

Lionel Morel Spring 2006 103

slide-106
SLIDE 106

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Limitations

State machines:

PN where each transition has exactly one input and one

  • utput

Strictly conservative in preserving the number of tokens = FSM !

Marked graphs:

PN where each state has exactly one input and one output can easily model concurrency and synchronizaion, but they have difficulties in conflict and data-dependent decisions

Lionel Morel Spring 2006 104

slide-107
SLIDE 107

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

Limitation

✁✁✁✁ ✂✁✂✁✂✁✂✁✂ ✄✁✄✁✄✁✄✁✄ ☎✁☎✁☎✁☎✁☎ ✆✁✆✁✆✁✆✁✆ ✝✁✝✁✝✁✝✁✝ ✞✁✞✁✞✁✞✁✞ ✟✁✟✁✟✁✟✁✟ ✠✁✠✁✠✁✠✁✠ ✡✁✡✁✡✁✡✁✡ ☛✁☛✁☛✁☛✁☛ ☞✁☞✁☞✁☞✁☞ ✌✁✌✁✌✁✌✁✌✁✌✁✌ ✌✁✌✁✌✁✌✁✌✁✌✁✌ ✌✁✌✁✌✁✌✁✌✁✌✁✌ ✍✁✍✁✍✁✍✁✍✁✍✁✍ ✍✁✍✁✍✁✍✁✍✁✍✁✍ ✍✁✍✁✍✁✍✁✍✁✍✁✍ ✎✁✎✁✎✁✎✁✎✁✎✁✎ ✎✁✎✁✎✁✎✁✎✁✎✁✎ ✎✁✎✁✎✁✎✁✎✁✎✁✎ ✏✁✏✁✏✁✏✁✏✁✏✁✏ ✏✁✏✁✏✁✏✁✏✁✏✁✏ ✏✁✏✁✏✁✏✁✏✁✏✁✏ ✑✁✑✁✑✁✑✁✑✁✑✁✑ ✑✁✑✁✑✁✑✁✑✁✑✁✑ ✑✁✑✁✑✁✑✁✑✁✑✁✑ ✒✁✒✁✒✁✒✁✒✁✒✁✒ ✒✁✒✁✒✁✒✁✒✁✒✁✒ ✒✁✒✁✒✁✒✁✒✁✒✁✒ ✓✁✓✁✓✁✓✁✓✁✓✁✓ ✓✁✓✁✓✁✓✁✓✁✓✁✓ ✓✁✓✁✓✁✓✁✓✁✓✁✓ ✔✁✔✁✔✁✔✁✔✁✔✁✔ ✔✁✔✁✔✁✔✁✔✁✔✁✔ ✔✁✔✁✔✁✔✁✔✁✔✁✔ ✕✁✕✁✕✁✕✁✕✁✕ ✕✁✕✁✕✁✕✁✕✁✕ ✕✁✕✁✕✁✕✁✕✁✕ ✖✁✖✁✖✁✖✁✖✁✖ ✖✁✖✁✖✁✖✁✖✁✖ ✖✁✖✁✖✁✖✁✖✁✖ ✗✁✗✁✗✁✗✁✗✁✗ ✗✁✗✁✗✁✗✁✗✁✗ ✗✁✗✁✗✁✗✁✗✁✗ ✘✁✘✁✘✁✘✁✘✁✘ ✘✁✘✁✘✁✘✁✘✁✘ ✘✁✘✁✘✁✘✁✘✁✘ ✙✁✙✁✙✁✙✁✙✁✙✁✙ ✙✁✙✁✙✁✙✁✙✁✙✁✙ ✙✁✙✁✙✁✙✁✙✁✙✁✙ ✚✁✚✁✚✁✚✁✚✁✚✁✚ ✚✁✚✁✚✁✚✁✚✁✚✁✚ ✚✁✚✁✚✁✚✁✚✁✚✁✚ ✛✁✛✁✛✁✛✁✛✁✛ ✛✁✛✁✛✁✛✁✛✁✛ ✛✁✛✁✛✁✛✁✛✁✛ ✜✁✜✁✜✁✜✁✜✁✜ ✜✁✜✁✜✁✜✁✜✁✜ ✜✁✜✁✜✁✜✁✜✁✜

A marked graph A state machine

Lionel Morel Spring 2006 105

slide-108
SLIDE 108

April 5, 2006 Lionel Morel Introduction Definitions

Petri Nets Inputs and Outputs

Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions

References...

THE website on petri nets: http://www.informatik.uni- hamburg.de/TGI/PetriNets/tools/db.html toy examples (same site): http://www.informatik.uni- hamburg.de/TGI/PetriNets/tools/java/

  • n FSM (if needed): Introduction to Automata Theory,

Languages and Computation (Hopcroft, Ed. Addison-Wesley)

  • n Petri Nets:

Petri Nets: Properties, analysis and applications. Proc. of the IEEE, 1989

Lionel Morel Spring 2006 106