Docsity

Petri Nets-Object Oriented Design and Analysis-Lecture Slides, Slides of Object Oriented Analysis and Design

Partial preview of the text

Download Petri Nets-Object Oriented Design and Analysis-Lecture Slides and more Slides Object Oriented Analysis and Design in PDF only on Docsity!

© SERG

Software Design (Behavioral)

Petri Nets

© SERG

Software Design (Behavioral)

A Simple Petri Net

P

P

t

t

t

P

P

© SERG

Software Design (Behavioral)

A Marked Petri Net

After Firing t

P

P

t

t

t

P

P

© SERG

Software Design (Behavioral)

Definition of a Petri Net

  • PNet = (P, T, A, M0)

P

is a finite set of

places

(labeled circles),

where a place holds tokens.

T

is a finite set of

transitions

(bars), where a

transition represents an activity.

A

is a finite set of directed

arcs

, where an arc

connects a place and a transition.

M

is the initial

marking

of

PNet

, where a

marking is an arrangement of tokens in placesrepresenting state.

© SERG

Software Design (Behavioral)

Petri Net

Execution Model (Cont’d)

•^

Firing a Transition:

An enabled transition

is non deterministically selected and

fired

by removing one token from each of itsinput places and depositing one token ateach of its output places.

-^

Firing Sequence:

A firing sequence

<t0,t1, …, tn>

such that

t

is enabled and

fired in

M

,^

t

is enabled and fired in

M

© SERG

Software Design (Behavioral)

Petri Net Firing

© SERG

Software Design (Behavioral)

A Marked Petri Net Semaphore

IN

IN

CR

CR

SEM

OUT

OUT

IN = Input of ProcessOUT = Output of ProcessCR = Critical Region

SEM = Semaphore

© SERG

Software Design (Behavioral)

Enabled Transitions IN

IN

CR

CR

SEM

OUT

OUT

© SERG

Software Design (Behavioral)

Enabled Transition

IN

IN

CR

CR

SEM

OUT

OUT

© SERG

Software Design (Behavioral)

After Firing

IN

IN

CR

CR

SEM

OUT

OUT

© SERG

Software Design (Behavioral)

Deadlock and Starvation

  • A Petri Net with a given marking is in

deadlock

iff no transition is enabled in that

marking.

  • A Petri Net with a given marking is in

starvation

iff one or more transitions have

been permanently disabled.

  • A Petri Net is

live

if every transition can

eventually be fired.

© SERG

Software Design (Behavioral)

A Deadlocked Petri Net

© SERG

Software Design (Behavioral)

A Deadlocked Petri Net

© SERG

Software Design (Behavioral)

Modification into a

Live Petri Net