Download as pdf or txt
Download as pdf or txt
You are on page 1of 21

Petri net basics

Comparison with nite automaton

Analysis of Petri nets

Discrete Event Systems Petri nets


Mt Hegyhti
1

Department of Computer Science Faculity of Information Technology University of Pannonia

Last modied: June 25, 2011

hegyhati@dcs.uni-pannon.hu

http://dcs.uni-pannon.hu/hegyhati/oktatas

Petri net basics

Comparison with nite automaton

Analysis of Petri nets

Contents

Petri net basics Denition Comparison with nite automaton Finite automata and petri nets Analysis of Petri nets Denitions Coverability tree Linear algebraic approach

Petri net basics Denition

Comparison with nite automaton

Analysis of Petri nets

Denition
A petri net graph is a (P , T , A, w ), where: P is the nite set of places T is the nite set of transitions A (P T ) (T P ) is the set of arcs w : A Z+ is the weight of the arcs Notation:

n m I (tj ) O (tj ) I (pi ) O (pi )

= |P |

= |T |

= {pi P | (pi , tj ) A} = {pi P | (tj , pi ) A} = {tj T | (tj , pi ) A} = {tj T | (pi , tj ) A}

Petri net basics Denition

Comparison with nite automaton

Analysis of Petri nets

Example
89:; ?>=< ?>=< / 89:;

p1 P T A w
= {p1 , p2 }

t1

p2

= {(p1 , t1 , 2), (t1 , p2 , 1)}

= {(p1 , t1 ), (t1 , p2 )}

= {t1 }

Petri net basics Denition

Comparison with nite automaton

Analysis of Petri nets

Marked Petri nets


A marked petri net is a (P , T , A, w , x ), where: (P , T , A, w , x ) is a petri net graph x : P N is a marking Example:
89:; ?>=<
2

HIJK / ONML

p1
Notation:

t1

p2

= {x | x is a marking}

Petri net basics Denition

Comparison with nite automaton

Analysis of Petri nets

Enabled transition

A transition,

t is enabled, if x (pi ) w (pi , t )


89:; / ?>=< ONML HIJK

pi I (t )

No enabled transitions
89:; ?>=<
2

An enabled transition
2

()*+ //.-,

p1

t1

p2

p1

t1

p2

Petri net basics Denition

Comparison with nite automaton

Analysis of Petri nets

Petri net dynamics


f :X T
X is a transition function

f (x , t ) =
where

if t is not enabled {(p , x (p )) | p P } if t is enabled not dened

x (p) = x (p) w (p, t ) + w (t , p)

Extended transition function: f (x , u ) for u T . Reachible set of states: R (x ) = {x | u T x = f (x , u )} Note:


pP

w (t , p) <>

p P

w (p, t )

Petri net basics Denition

Comparison with nite automaton

Analysis of Petri nets

Example

_ _ _ _ _ _ _ _ _  ?>=< 89:; 2 /  _ _ _ _ _ _ O _ _ _ O O t1 O O O _ _ _ _ _ _O _ _  2 /  ?>=< 89:;  _ _ _ _ _ _ _ _

_ _ _ ?>=< / 89:;   _ _ _

_ _ _ ?>=< / 89:;   _ _ _

Petri net basics Denition

Comparison with nite automaton

Analysis of Petri nets

Petri net languages


Labelled Petri net:

N = (P , T , A, w , E , l , x0 , Xm )
where:
(P , T , A, w ) is a Petri net

x0 E l Xm

is the initial marking/state event set : T E transition labelling function set of marked/accepting states

Languages generated and marked by a labelled Petri net:

L(N ) = {l (u ) E | u T and f (x0 , u ) is dened} Lm (N ) = {l (u ) E | u T and f (x0 , u ) Xm }

Petri net basics Finite automata and petri nets

Comparison with nite automaton

Analysis of Petri nets

Automaton equivalent Petri net


Let (K , , , s , F ) be an automaton, then:

P T A

:= K :=

w (z , y ) := 1 (z , y ) A E := l ((q , , p)) := (q , , p ) T x (p) := 1 p = s ;


0

:= {((q , , p ), p ) | (q , , p ) } {(q , (q , , p )) | (q , , p ) }

otherwise

Xm

:=

xq | q F xq (p) =

1 0

p = q;

otherwise

Petri net basics Finite automata and petri nets

Comparison with nite automaton

Analysis of Petri nets

Languages of Petri nets


Corollary: Regular languages can be accepted by labelled Petri nets

Lm (N ) = {an bn | n Z+ }: p1 b p3

89:; ?>=< j *

 ?>=< 89:; * 

a p2 b

o
 ?>=< 89:; j

Xm = {{(p1 , 0), (p2 , 0), (p3 , 1)}}

Petri net basics Finite automata and petri nets

Comparison with nite automaton

Analysis of Petri nets

Languages of Petri nets


Lm (N ) = {an bn c n | n Z+ }: 89:; ?>=< p1 j
*

 ?>=< 89:;

a p2 b p4 c

b P3 c p5

// // //  / *  89:; ?>=< j /// // // /   89:; ?>=< o  ?>=< 89:; j * 

Xm = {{(p1 , 0), (p2 , 0), (p3 , 0), (p4 , 0), (p5 , 1)}}

Petri net basics

Comparison with nite automaton

Analysis of Petri nets

Analysis of Petri nets

Boundness Blocking State coverability Conservation Liveness Persistence

Petri net basics Denitions

Comparison with nite automaton

Analysis of Petri nets

Boundness and blocking


Place If If

p P is k -bounded, if x

R (x0 )

x (p) k .

p is 1-bounded, it is called safe. p is k -bounded for some k , then p is bounded.

If all the places are bounded, the net is called bounded.

Deadlock and livelock can be analogically dened as for the automatons.

Petri net basics Denitions

Comparison with nite automaton

Analysis of Petri nets

State coverability, conservation and persistence


State

x covers x if x

R (x ) :

x (p) x (p)

p P .

Petri net is conservative with respect to R|P | if T x is constant x R (X0 ). If a petri net is conservative with respect to some conservative.

k than it is called

Petri net is persistent if, for any two enabled transitions, the ring of one cannot disable the other.

Petri net basics Denitions

Comparison with nite automaton

Analysis of Petri nets

Liveness

Transition t from a state x is called L0-live (or Dead) if t can never re L1-live there is a reing sequence, such that t can re at least at once. ( Coverability) L2-live t can re at least k times for some given k L3-live there is a reing sequence, such that t can re innitely many times. L4-live t is L1-live for all x R (x )

Petri net basics Coverability tree

Comparison with nite automaton

Analysis of Petri nets

Reachability tree

Node is terminal if it has no enabled transition (Deadlock). Node is a duplicate if it already appears on the path from the root to it. Node

x dominates x if x on the path from the root to x and: p P x (p ) x (p ) p P x (p ) > x (p )

Reachability tree can be innitely large.

Petri net basics Coverability tree

Comparison with nite automaton

Analysis of Petri nets

Coverability tree
represents the innity, + k = x = x0 k Z.

for all new state x do if t T f (x , t ) is undened then mark x terminal else for all x = f (x , t ) do if x dominates some x then for all p x (p ) > x (p ) do

end for end if end for end if end for Coverability tree is always nite.

x (p ) =

Petri net basics Coverability tree

Comparison with nite automaton

Analysis of Petri nets

Example for coverability tree

Petri net basics Coverability tree

Comparison with nite automaton

Analysis of Petri nets

Application of coverability tree


If there is no in the coverability tree: it is a reachability tree itself the net is bounded state space is nite Coverability tree is enough to answer coverability questions. If the net is conservative, (p ) must be zero for all p , that has somewhere in the coverability tree. Conservativity can be decided by solving a linear equation system.

Petri net basics Linear algebraic approach

Comparison with nite automaton

Analysis of Petri nets

Linear algeabraic approach


Solving vA = x x gives only a necessery but not sucient condition.

l is a place invariant if Al = 0. In this case: x xl xl


= = =

x0 + vA x0 l + vAl x0 l

thus, the net is conservative with respect to l .

You might also like