25
1 Petri Nets LIS Changwon National University

Petri Nets

  • Upload
    torn

  • View
    33

  • Download
    0

Embed Size (px)

DESCRIPTION

Petri Nets. LIS Changwon National University. theory. ?. practice. theoretical. experimental. The theoretician: “Who needs practice? Let’s go home to maths!” . idealised. pragmatic. Mathematics study interesting, consistent structures. Engineering build practicable, - PowerPoint PPT Presentation

Citation preview

Page 1: Petri Nets

1

Petri Nets

LISChangwon National University

Page 2: Petri Nets

2

The theoretician:“Who needs practice?

Let’s go home to maths!”

Mathematicsstudy interesting,

consistent structures

Physicspredict & measure

“real world” structures

Engineeringbuild practicable, useful structures

Computer Science??

theo

retic

alex

peri

men

tal

idealised pragmatic

theorypractice

?

Frederick P. Brooks, Jr.:“The computer “scientist”

as toolsmith”

Frederick P. Brooks, Jr.:"The scientist builds in order to study, the engineer studies in order to build"

Christopher Strachey:“.. the separation of

practical and theoretical work is artificial and injurious.”

Carl Adam Petri:“Computing as a science

could be modelled after physics”

Page 3: Petri Nets

3

패트리 넽 특론 (CDB 2026)

패트리 넽 변형연구(transformation)

Reduction

Composition

unfolding

Simplification

Page 4: Petri Nets

4

강의방법 강의방법 :

강의식 발표 세미나 과제

강의 시간 : 화요일 ( 오후 7:00-10:00)

강의 장소 : 32420 ( 컴공과 세미나실 )

발표 및 자료제출 : 발표자료는 파워포인트형태 수업시작 전에 모두 제출 발표는 임의로 선정 ( 당일 )

강의자료 : 강의노트 : 홈페이지 참조 http://sarim.changwon.ac.kr/~jklee

교재 : 자체 편집 논문집 Petri nets:Properties,Analysis and

Application, T.Murada (Proceed. IEEE)

연락처 : 이종근 055-279-7420 Mail: [email protected]

Page 5: Petri Nets

5

패트리 넽 입문

Petri nets:Properties,Analysis and Applications

Constructs for prototyping information systems with object Petri nets An Extended Petri net Model for Normal Logic Programs

Deadlock Prevention using Petri nets and their Unfoldings

Hierarchical Time-Extended Petri nets based on Error Identification and recovery for Multilevel Systems

Enhancing the Flexibility of Algebraic deadlock Avoidance polices through Petri nets Structural Analysis

Evaluating deadlock detection methods for Concurrent Software

Using logic programs with Stable Model semantics to solve Deadlock and reachability problem for 1-safe Petri nets

The case for feedback Control real-time Scheduling

Design and Evaluation of a feedback Control EDF Scheduling Algorithm

세미나 논문

Page 6: Petri Nets

6

• automata are a theoretical and idealised model

• they reflect a Newtonian world-view:• space & time as an absolute frame of reference • clockwork view of processes within this frame

engineers build systems where the difference matters!

Problems with automata-based approaches

•20th century developments in physics:• special relativity (what is a clock? how fast can signals be?)• quantum physics (interactions by particle exchange)

Page 7: Petri Nets

7

• Newtonian physics is a special case of more recent models. We hardly travel at relativistic speeds or operate in quantum dimensions, do we? So why not use the simpler model?

Models can be unrealistic if they are too simple, andsimplifying designs are harder to realise!

Simple models of complex worlds, or: “What is the problem?”

• in models of existing systems, automata imply an approximation..(simpler, but applicable only if their assumptions hold)

•in designs of new systems, automata involve over-specification!(engineers have to implement the assumptions!)

Page 8: Petri Nets

8

• For his nets, Carl Adam Petri has made an attempt to combine automata from theoretical CS, insights from physics, and pragmatic expertise from engineers:

(but the background explains why things work, why concepts from other disciplines, such as logic, have been integrated into Petri nets so easily, and why foundational research has to continue)

Petri’s nets versus Petri nets,or: complex foundations for simple models

• state is distributed, transitions are localised (space is relevant)• local causality replaces global time (time as a derived concept)• subsystems interact by explicit communication

(information transport is as relevant as information processing)

engineers can often ignore the background - Petri nets just work!

Page 9: Petri Nets

9

From automata ...

One lift Product automaton(meta-level modelling)

1

2

3

Two lifts?

1

2

3Li

ft 1

Lift 2

Page 10: Petri Nets

10

explicittransitions

concurrent subsystems

… to Petri nets

One lift Distributed state,local transitionsA passenger

explicitsynchronisation

localconflict

explicitcommunication

1

2

3

Two lifts!

1

2

3

Page 11: Petri Nets

11

Condition/event-systems (some terms)

• a subclass of Petri nets: state elements hold either one or no token• state elements represent conditions, which can be true or false• transition elements are represent local events

• an event is enabled if and only if • all its pre-conditions (connected by incoming arcs) are true • all its post-conditions (connected by outgoing arcs) are false

• an event occurrence negates its pre- and post-conditions

Automata are a sequential subclass of c/e-systemsexactly one condition is true,

each event has a single pre- and a single post-condition

• events with overlapping pre- or post-conditions are in conflict, non-conflicting enabled events may occur concurrently;• marking of the net: token distribution; c/e-system: c/e-net + marking; configurations: the possible markings of a c/e-net, cases of a c/e-system: the configurations reachable from initial marking (case graph)

Page 12: Petri Nets

12

An interlude on time

• timed automata measure time with a global clock (x happens later than y)

An ancient philosophical question: intervals or instances? The net answer: both!• events roughly correspond to instances, conditions to open intervals• all choices left to the modeller, continuity possible without real-valued time

• nets replace global time by local causal dependencies (x happens after y)

• time and actions proceed along two separate dimensions actions do not change time, sequences of actions can happen at the same time

• communication is synchronous by default• execution of actions are assumed to be totally ordered (interleaving semantics)

• implied total synchronisation of all local clocks

• events have zero duration, but correspond to advances at least in local time no changes outside time, and time is only measured in terms of changes

• communication is asynchronous by default• only a partial order of event occurrences is assumed (concurrency possible)• global and local clocks can be modelled, but need to be synchronised explicitly

Page 13: Petri Nets

13

From automata to Petri nets, again, via Logic

• states in automata represent atomic propositions about system configurations• in condition/event-systems, complex propositions about system configurations can be expressed as well:

A

A

A B

“A”

“not A”

“A and B”

But valuations of propositions change dynamically, so..

In the current case, ..

Page 14: Petri Nets

15

The Calculus of Facts expressing system invariants in propositional logic

A

dead events (never enabled)

A

A

B

“not A”

“A”

“(not A) or B”

system invariants (facts)

Reasoning, in terms of transformations of fact-nets, is also possible:• expansion: adding conditions to facts

• resolution: eliminating bridges between facts

In all cases,..A B

“A and B”

Page 15: Petri Nets

18

2

3

From conditions to resources

• c/e-systems model the flow of information, at a fundamental level (true/false)

• a transition occurrence • consumes one token from each input place and • produces one token on each output place

(multiple arcs with the same source and target are abbreviated numerically)

• a transition is enabled if and only if• sufficient resources are available on all its input places• sufficient capacities are available on all its output places

• place/transition-nets are a suitable generalisation of c/e-systems:• state elements represent places where resources (tokens) can be stored• transition elements represent local transitions or transport of resources

• there are natural application areas for which the flow/transport of resources and the number of available resources is important (data flow, document-/workflow, production lines, communication networks, www, ..)

Page 16: Petri Nets

19

Lifts again, with place/transition-nets

Two lifts Three passengers

1

2

3

22

22

2

2

2

2max 2

max 2

two nets,folded in one

Page 17: Petri Nets

20

Numerical invariants, logically

• the logical approach can be carried over to place/transition-nets, using inequalities on the number of resources as elementary propositions

dead events (never enabled) system invariants (facts)

In all cases,..

• but more specific, numerical techniques can be more effective

A“#A < n”

n

A“|A| - #A < n”n

A B “(|A| - #A < n) and (|B| - #B < n)”

n m

A

B “(#A < n)or (|B| - #B < n)”

n

m

Page 18: Petri Nets

21

Numerical invariants, numerically

otherwise,0

to from arcs are thereif, to from arcs are thereif,

:, ptnntpnn

C tp

pnnmp placeon token are are thereif ,:

times fires n transitioif ,: ntnft

• incidence matrix C of a pure (no elementary loops) place/transition-net:

• marking vector m of a place/transition-net:

• firing vector f of a multi-set of transition occurrences (order not represented!):

• weight vector i of a place invariant: set of places with constant (weighted) token sum

''**)'(:', mimimimimmmm tp

ppp

pp

t

• necessary, though not sufficient condition for reachability:

00)'(' Cimmimimi tttt

t

pn

Contributionof t on p

'mfCm t

Page 19: Petri Nets

22

From propositions to predicates

Predicate/transition-nets:• individual tokens give the extension of predicates, which replace propositional conditions

P

Q

R

17

2

x

y

z

x+y=z

event-schemes

P

a condition-schemes b

Pa Pb

P

QR

1 7

2

1

2

27

3

9

• quantifiers and specifications in a predicate logic (+ some theory) permit the grouping of proposition-level events into predicate-level event-schemes

Page 20: Petri Nets

23

High-level Petri nets

• proposed around 1980, various forms known, including predicate/transition-nets (PrT-nets), and coloured Petri nets (CPN)

2’H

1’O

1’H2O

HeH

H

O

H2O

• multiplicity and individuality of tokens are orthogonal extensions:• for place/transition-nets, one might want to distinguish tokens• for PrT-nets, one might want indistinguishable tokens, replacing sets with multi-sets (bags) as the extension of predicates

• integration of graphical specifications and textual inscriptions enable transformation between both within a single formalism

• common features: individual tokens, net elements annotated in some textual inscription language (predicate logic, Standard ML, Java, ..), net semantics integrated with language semantics (variable bindings, guard predicates)

Page 21: Petri Nets

24

max 2

Lifts, yet again, with high-level nets

Two lifts Passengers

1

2

3

max 2

(l,ps)(l,ps)

(l,ps)(l,ps)

(l,ps)(l,ps)

(l,ps)(l,ps)

(lift1,{})(lift2,{})

“keen”

“able”

“quick”

(l,ps)(l,{p}ps)

p

p(l,ps)(l,{p}ps)

|ps|<2

p(l,ps)(l,{p}ps)

(l,ps)(l,{p}ps)

p

p(l,ps)(l,{p}ps)

(l,ps)(l,{p}ps)

p

|ps|<2

|ps|<2

Page 22: Petri Nets

25

max 2

Lifts, yet again, with high-level nets

Two lifts Passengers

1

2

3

max 2

(lift1,{})(lift2,{})

“keen”

“able”

“quick”

leave/enter

leave/enter

leave/enter

up/down

up/down graphicalabstraction

Page 23: Petri Nets

26

Chomsky hierarchy, machines and Petri nets “Talking to” versus “Talking about”

context-sensitive(type-1)

languages machines Petri nets

regular(type-3)

finite automata condition/event-systems

push-down automatacontext-free(type-2)

(type-0)

linear-boundedTuring machines

Turing machines High-level Petri nets

Place/transition-nets

PNCF

CFPN

LLLL

nor neither

talking to no thing

talking to a stack

talking to a linear-bounded tape

talking to an unbounded tape

talking about (validity of) propositions

talking about (distribution of) resources

talking about (distribution of) structured data

Page 24: Petri Nets

27

The world of Petri Nets

http://www.daimi.aau.dk/PetriNets/

http://www.informatik.uni-hamburg.de/TGI/mitarbeiter/profs/petri.html

The world of Petri nets (events, bibliographies, research groups, tools,..)

Carl Adam Petri’s home page (cv, bibliography, laudatio)

• a way of thinking about concurrent and communicating systems• straightforward generalisation of automata, but with concurrency in mind• “pre-formal” graphical notation: intuitive use of formal methods• good foundations in physics, engineering, logic, maths, theoretical CS• the usual conflict between expressiveness and predictability/analysis• wide range of applications, including communication networks in telecom and in computing, data-flow systems, workflow/office information systems,..• still more work needed, both in domain-specific modifications and in foundations

Try them!-)

Page 25: Petri Nets

28

References

The computer scientist as toolsmith II, Brooks F.P., Communications of the ACM 39(3):61-68, 1996 [ACM Allen Newell Award acceptance lecture]

Christopher Strachey’s Oxford PRG motto: http://web.comlab.ox.ac.uk/oucl/about/philosophy.htmlCarl Adam Petri’s homepage: http://www.informatik.uni-hamburg.de/TGI/mitarbeiter/profs/petri_eng.html

Nets, Time and Space, C.A.Petri,Theoretical Computer Science, Special Volume on Petri Nets, 1996, No. 1-2, Vol. 153, Pages: 3-48Concurrency and Continuity. Petri, C.A.; Smith, E., Lecture Notes in Computer Science Vol. 266: Advances in Petri Nets 1987 / Rozenberg, G. (ed.) --- Springer Verlag, 1987, Pages: 273-292

The Calculus of Facts. Genrich, H.J.; Thieler-Mevissen, G. Mathematical Foundations of Computer Science 1976,Mazurkiewicz, A.(ed.) --- Berlin, Heidelberg, New York: Springer-Verlag, 1976, Pages: 588-595Hierarchies in Coloured Petri Nets. Huber, P.; Jensen, K.; Shapiro, R.M. Lecture Notes in Computer Science, Vol. 483; Advances in Petri Nets 1990 / Rozenberg, G. (ed.) --- Berlin, Germany: Springer-Verlag, 1991, Pages: 313-341

Petri Net Theory and the Modeling of Systems J. L. Peterson, Prentice-Hall, N.J., 1981, ISBN: 0-13-661983-5 Petri Nets, An Introduction W. Reisig, EATCS, Monographs on Theoretical Computer Science, W.Brauer, G. Rozenberg, A.

Salomaa (Eds.), Springer Verlag, Berlin, 1985. Recommended Books and Papers on Coloured Petri Nets, Kurt Jensen, CPN Group, University of Aarhus, Denmark:http://www.daimi.au.dk/~kjensen/papers_books/rec_papers_books.html

Further references (including introductory material): http://www.daimi.au.dk/PetriNets/bibl/