Petri Nets Albert-Ludwigs-Universit at Freiburg January 27, 2018 - - PowerPoint PPT Presentation

petri nets
SMART_READER_LITE
LIVE PREVIEW

Petri Nets Albert-Ludwigs-Universit at Freiburg January 27, 2018 - - PowerPoint PPT Presentation

Introduction Definitions Language Acceptance Conclusion Petri Nets Albert-Ludwigs-Universit at Freiburg January 27, 2018 Slide 1 Albert-Ludwigs-Universit at Freiburg Proseminar Talk Petri Nets Introduction Definitions Language


slide-1
SLIDE 1

Introduction Definitions Language Acceptance Conclusion

Petri Nets

Albert-Ludwigs-Universit¨ at Freiburg

January 27, 2018

Slide 1 Albert-Ludwigs-Universit¨ at Freiburg Proseminar Talk Petri Nets

slide-2
SLIDE 2

Introduction Definitions Language Acceptance Conclusion

Introduction

◮ Concurrent computing: several computations are executed

concurrently and not sequentially.

◮ Many dependencies can exist in the system. ◮ A model is required to investigate these systems. ◮ DFA and NFA can grow very big.

Slide 2 Albert-Ludwigs-Universit¨ at Freiburg Proseminar Talk Petri Nets

slide-3
SLIDE 3

Introduction Definitions Language Acceptance Conclusion

Example for problem of concurrent computing

An example for a problem of concurrent computing is a shared resource:

◮ One resource is shared by several processes. ◮ Only one process should access the resource at the same time. ◮ Solution: mutex lock

Slide 3 Albert-Ludwigs-Universit¨ at Freiburg Proseminar Talk Petri Nets

slide-4
SLIDE 4

Introduction Definitions Language Acceptance Conclusion

Definitions

Definition

A Petri Net N consists of a tuple N = (P, T, F) where

◮ P is a finite, nonempty set of places ◮ T is a finite, nonempty set of transitions ◮ F ⊆ (P × T) ∪ (T × P) is a flow relation

Slide 4 Albert-Ludwigs-Universit¨ at Freiburg Proseminar Talk Petri Nets

slide-5
SLIDE 5

Introduction Definitions Language Acceptance Conclusion

p1 p4 p2 p3 t2 t1 t3 t4

P = {p1, p2, p3, p4} T = {t1, t2, t3, t4}

Slide 5 Albert-Ludwigs-Universit¨ at Freiburg Proseminar Talk Petri Nets

slide-6
SLIDE 6

Introduction Definitions Language Acceptance Conclusion

Pre- and postset

Given a Petri Net N = (P, T, F), it is defined for every transition t ∈ T

◮ the preset

  • t := {p ∈ P|(p, t) ∈ F}

◮ the postset

t• := {p ∈ P|(t, p) ∈ F} for every place p ∈ P

◮ the preset

  • p := {t ∈ T|(t, p) ∈ F}

◮ the postset

p• := {t ∈ T|(p, t) ∈ F}

Slide 6 Albert-Ludwigs-Universit¨ at Freiburg Proseminar Talk Petri Nets

slide-7
SLIDE 7

Introduction Definitions Language Acceptance Conclusion

p1 p4 p2 p3 t2 t1 t3 t4

  • t4 = {p2, p3}

t•

4 = {p4}

  • p2 = {t1, t3}

p•

2 = {t3, t4}

Slide 7 Albert-Ludwigs-Universit¨ at Freiburg Proseminar Talk Petri Nets

slide-8
SLIDE 8

Introduction Definitions Language Acceptance Conclusion

Markings and tokens

Definition

A marking of a Petri net N is a function m : P → N0 which assigns a number of tokens to every place. The set of all markings of a Petri net is M. Given p1, ..., pn, we write the marking as a vector of dimension n which is written ¯ m = (m1, ..., mn). Each marking mi ∈ ¯ m is the number of tokens that is assigned to place pi.

Slide 8 Albert-Ludwigs-Universit¨ at Freiburg Proseminar Talk Petri Nets

slide-9
SLIDE 9

Introduction Definitions Language Acceptance Conclusion

p1 p4 p2 p3 t2 t1 t3 t4

m(p1) = 1 m(p4) = 0 ¯ m = (1, 1, 0, 0)

Slide 9 Albert-Ludwigs-Universit¨ at Freiburg Proseminar Talk Petri Nets

slide-10
SLIDE 10

Introduction Definitions Language Acceptance Conclusion

Firing of a transition

Let m and m′ be a markings of a Petri Net N = (N, T, F) and t ∈ T. We define m ⊲t m′ if and only if ∀p ∈ •t : m(p) > 0 and ∀p ∈ P : m′(p) =      m(p) − 1 if (p ∈ •t ∧ p / ∈ t•) m(p) + 1 if (p / ∈ •t ∧ p ∈ t•) m(p) if (p / ∈ •t ∧ p / ∈ t•) ∨ (p ∈ •t ∧ p ∈ t•)

Slide 10 Albert-Ludwigs-Universit¨ at Freiburg Proseminar Talk Petri Nets

slide-11
SLIDE 11

Introduction Definitions Language Acceptance Conclusion

A transition t can be executed, if there is a token on every place in the preset of t. We call this firing of a transition or, t is fired. When a transition is fired, one token is removed from every place in the preset of t and one token is added to every place in the postset of t. If s transitions are fired sequentially, we call this a sequence of transitions of length s.

Slide 11 Albert-Ludwigs-Universit¨ at Freiburg Proseminar Talk Petri Nets

slide-12
SLIDE 12

Introduction Definitions Language Acceptance Conclusion

Example of a Petri net

p1 p4 p2 p3 t2 t1 t3 t4

Slide 12 Albert-Ludwigs-Universit¨ at Freiburg Proseminar Talk Petri Nets

slide-13
SLIDE 13

Introduction Definitions Language Acceptance Conclusion

Example of a Petri net

p1 p4 p2 p3 t2 t1 t3 t4

Slide 13 Albert-Ludwigs-Universit¨ at Freiburg Proseminar Talk Petri Nets

slide-14
SLIDE 14

Introduction Definitions Language Acceptance Conclusion

Mutex

P1 waiting P1 critical Mutex P2 critical P2 waiting s1 s2 s3 s4 s5 P1 enter P1 exit P2 enter P2 exit t1 t2 t3 t4

Graphic by Dominik Drexler Slide 14 Albert-Ludwigs-Universit¨ at Freiburg Proseminar Talk Petri Nets

slide-15
SLIDE 15

Introduction Definitions Language Acceptance Conclusion

Extension of definitions for language acceptance

Let N = (P, T, F) be a Petri net and M−, M+ be finite sets of initial and final markings with M− ⊆ M and M+ ⊆ M. Let be a finite set of symbols (alphabet) and ℓ : T → be a labeling function which assigns a symbol from the alphabet to every transition.

Slide 15 Albert-Ludwigs-Universit¨ at Freiburg Proseminar Talk Petri Nets

slide-16
SLIDE 16

Introduction Definitions Language Acceptance Conclusion

Extension of definitions for language acceptance

This modified Petri Net accepts a word w ∈ ∗ if there exists a firing sequence τ from m− ∈ M− to m+ ∈ M+ with ℓ(τ) = w with ℓ(τ) := ℓ(t1)...ℓ(tn). The set of all words accepted by N is denoted as L(N). L(N) is called the language of N.

Slide 16 Albert-Ludwigs-Universit¨ at Freiburg Proseminar Talk Petri Nets

slide-17
SLIDE 17

Introduction Definitions Language Acceptance Conclusion

Petri nets and regular languages

For every regular language L, there exists a Petri net N such that L = L(N). → Petri nets are at least as expressive as DFA/NFA.

Slide 17 Albert-Ludwigs-Universit¨ at Freiburg Proseminar Talk Petri Nets

slide-18
SLIDE 18

Introduction Definitions Language Acceptance Conclusion

Example for acceptance of contextfree language

L = {ancbn|n ≥ 0} m− = (1, 0, 0) m+ = (0, 0, 1) p1 p3 p2 a b c

Slide 18 Albert-Ludwigs-Universit¨ at Freiburg Proseminar Talk Petri Nets

slide-19
SLIDE 19

Introduction Definitions Language Acceptance Conclusion

Example for acceptance of contextsensitive language

L = {anbncn|n > 0} m− = (1, 0, 0, 0, 0, 0) m+ = (0, 0, 0, 0, 0, 1)

a b c a b c p1 p2 p3 p4 p5 p6

Slide 19 Albert-Ludwigs-Universit¨ at Freiburg Proseminar Talk Petri Nets

slide-20
SLIDE 20

Introduction Definitions Language Acceptance Conclusion

Theorem

Theorem

The context-free mirror-language L = {wwR|w ∈ {a, b}∗} is not a Petri net language. Examples

◮ ∈ L: abba, aaaaaa ◮ /

∈ L: aababaa, aabb

Slide 20 Albert-Ludwigs-Universit¨ at Freiburg Proseminar Talk Petri Nets

slide-21
SLIDE 21

Introduction Definitions Language Acceptance Conclusion

Lemma

Lemma

For every Petri net recognizing L, the following applies: for a sufficiently large s, only less than 2s markings are reachable. Sketch of proof:

◮ Assume that the Petri net has got r transitions. ◮ We consider a sequence of s transitions. ◮ Let transition ti be fired ki times. ◮ We can reach as many markings as there are tuples (k1, ..., kr). ◮ Therefore, there are (s + 1)r such tuples.

The number of tuples reachable is polynomial in growth while 2s is exponential in growth.

Slide 21 Albert-Ludwigs-Universit¨ at Freiburg Proseminar Talk Petri Nets

slide-22
SLIDE 22

Introduction Definitions Language Acceptance Conclusion

Proof of Theorem

Theorem

The context-free mirror-language L = {wwR|w ∈ {a, b}∗} is not a Petri net language.

◮ We assume that there is a Petri net N with r transitions

accepting L.

◮ After reading s letters, there must be as many different

markings as words of length s which is 2s.

◮ There are words w and w′ which lead N to the same marking

which means that N can’t distinguish between wwR and w′wR. → Contradiction, L is not a Petri net language.

Slide 22 Albert-Ludwigs-Universit¨ at Freiburg Proseminar Talk Petri Nets

slide-23
SLIDE 23

Introduction Definitions Language Acceptance Conclusion Applied Automata Theory Script RWTH Aachen, Page 171 Slide 23 Albert-Ludwigs-Universit¨ at Freiburg Proseminar Talk Petri Nets

slide-24
SLIDE 24

Introduction Definitions Language Acceptance Conclusion

Source

◮ Applied Automata Theory Script RWTH Aachen.

  • Prof. Dr. Wolfgang Thomas. Accessed, November 11, 2017

Slide 24 Albert-Ludwigs-Universit¨ at Freiburg Proseminar Talk Petri Nets