introduction to petri nets

17
Introduction to Petri Nets Hugo Andrés López [email protected]

Upload: analu

Post on 11-Jan-2016

52 views

Category:

Documents


3 download

DESCRIPTION

Introduction to Petri Nets. Hugo Andrés López [email protected]. Plan for lectures. 6th November ‘07 Informal Introduction, Intuitions. Formal definition Properties for PNets. 8th November ’07 Examples on specifications. Applications. Petri Nets Variants. Advantages, Limitations. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Introduction to Petri Nets

Introduction to Petri Nets

Hugo Andrés Ló[email protected]

Page 2: Introduction to Petri Nets

2

Plan for lectures

6th November ‘07

Informal Introduction, Intuitions.

Formal definition

Properties for PNets.

8th November ’07

Examples on specifications.

Applications.

Petri Nets Variants.

Advantages, Limitations.

Page 3: Introduction to Petri Nets

3

A little of HistoryC.A. Petri proposes a new model for information flow (early 60’s).

Main ideas: Modelling Systems with asynchronous and Concurrent executions as graphs.

Holt and Petri: “net theory” (mid 70’s)

MIT and ADR: Research in Petri Net Properties and Relations with Automata Theory

Nowadays: Event Structures, Bigraphs, (new) flowcharts, relations with Process algebra.

Page 4: Introduction to Petri Nets

4

Intuitions

A Petri Net (PN) is a formalism for representing concurrent programs in terms of events and transitions.

Defining Static Properties (Structural).

Dynamic Properties (Behavioural).

Page 5: Introduction to Petri Nets

5

Producer - Consumers PNET

Static Structure

Page 6: Introduction to Petri Nets

6

Producer - Consumers PNET

Markings introducethe dynamics of

the system

Initial Marking

Page 7: Introduction to Petri Nets

7

Producer - Consumers PNET (Non-Determinism)

Firing T1 again will leadto multiple production

of tokens in P3

Page 8: Introduction to Petri Nets

8

Producer - Consumers PNET (Non-Determinism)

Firing T6 disable T3Firing T3 disable T6

Page 9: Introduction to Petri Nets

9

PNet Evolutions

Resembles a board game.

A transition can be fired if their input events are marked.

Possible Scenarios:

Concurrent Execution Conflicting Execution

Page 10: Introduction to Petri Nets

10

Formal Model for PNets

Structure

Dynamics

Page 11: Introduction to Petri Nets

11

Occurrence Rule

Page 12: Introduction to Petri Nets

12

Occurrences and Reachability

Page 13: Introduction to Petri Nets

13

Example: An Scheduler

Resources:

A buffer of input processes with k=4.

A dual-core processor.

Buffer of Results with k=4.

Processes are independent.

Page 14: Introduction to Petri Nets

14

Behavioural Properties of Marked Petri Nets

•A marked p/t-net is

terminatingterminating – if there is no infinite occurrence sequence deadlock-freedeadlock-free – if each reachable marking enables a transition livelive – if each reachable marking enables an occurrence sequence containing all transitions boundedbounded - if, for each place p, there is a bound b(p) s.t. m(p) <= b(p) for every reachable marking m1-Safe1-Safe - if b(s) = 1 is a bound for each place sReversibleReversible – if m0 is reachable from each other reachable marking

Page 15: Introduction to Petri Nets

15

A vending machine

5c

Take 15c bar

Deposit 5c

0c

Deposit 10c

Deposit 5c

10c

Deposit 10c

Deposit5c

Deposit 10c20c

Deposit5c

15c

Take 20c bar

-VM is Deadlock-free.

t8

t1

p1

t2

p2

t3

p3

t4

t5

t6 p5

t7

p4

t9

Every marking generated from m0 enables a transition

-VM is Live.

The occurrences generated by m0 contains all the transitions

-VM is bounded by 1 (1-safe)

there are no induced tokens, the constraints used in m0 holds for the system.

-VM is Reversible

It is possible to go back to m0 from every

marking derived from

m0

Page 16: Introduction to Petri Nets

16

Exercise

Show by inspection (or other methods) the properties that holds for the scheduler example.

Page 17: Introduction to Petri Nets

17

BibliographyJ.L. Peterson. “Petri Nets”. Computing Surveys, Vol. 9 No. 3, 1977.

A. Kondratyev et al. “The use of Petri nets for the design and verification of asynchronous circuits and systems”. Journal of Circuits Systems and Computers. 1998.

Balbo et al. Lecture notes of the 21st. Int. Conference on Application and Theory of Petri Nets. 2000.

The World of Petri nets:http://www.daimi.au.dk/PetriNets/

C. Ling. The Petri Net Method. http://www.utdallas.edu/~gupta/courses/semath/petri.ppt