Peter Marwedel TU Dortmund, Informatik 12

Slides:



Advertisements
Similar presentations
Technische universität dortmund fakultät für informatik informatik 12 Models of computation Peter Marwedel TU Dortmund Informatik 12 Graphics: © Alexandra.
Advertisements

Fakultät für informatik informatik 12 technische universität dortmund Optimizations - Compilation for Embedded Processors - Peter Marwedel TU Dortmund.
Mathematical Preliminaries
1 Concurrency: Deadlock and Starvation Chapter 6.
Fakultät für informatik informatik 12 technische universität dortmund Imperative model of computation Peter Marwedel TU Dortmund, Informatik 12 Graphics:
Technische universität dortmund fakultät für informatik informatik 12 Specifications and Modeling Peter Marwedel TU Dortmund, Informatik 12 Graphics: ©
Fakultät für informatik informatik 12 technische universität dortmund Petri Nets Peter Marwedel TU Dortmund, Informatik 12 Graphics: © Alexandra Nolte,
Fakultät für informatik informatik 12 technische universität dortmund Petri Nets Peter Marwedel TU Dortmund, Informatik 12 Graphics: © Alexandra Nolte,
Evaluation and Validation
Fakult ä t f ü r informatik informatik 12 technische universit ä t dortmund Data flow models Peter Marwedel TU Dortmund, Informatik 12 Graphics: © Alexandra.
Fakultät für informatik informatik 12 technische universität dortmund Specifications and Modeling Peter Marwedel TU Dortmund, Informatik 12 Graphics: ©
Fakultät für informatik informatik 12 technische universität dortmund SDL Peter Marwedel TU Dortmund, Informatik 12 Graphics: © Alexandra Nolte, Gesine.
Technische universität dortmund fakultät für informatik informatik 12 Discrete Event Models Peter Marwedel TU Dortmund, Informatik 12 Germany
Communicating finite state machines
Technische universität dortmund fakultät für informatik informatik 12 Specifications and Modeling Peter Marwedel TU Dortmund, Informatik
1 Vorlesung Informatik 2 Algorithmen und Datenstrukturen (Parallel Algorithms) Robin Pomplun.
Chapter 7 System Models.
Copyright © 2003 Pearson Education, Inc. Slide 1 Computer Systems Organization & Architecture Chapters 8-12 John D. Carpinelli.
Subspace Embeddings for the L1 norm with Applications Christian Sohler David Woodruff TU Dortmund IBM Almaden.
Copyright © 2011, Elsevier Inc. All rights reserved. Chapter 6 Author: Julia Richards and R. Scott Hawley.
Author: Julia Richards and R. Scott Hawley
1 Copyright © 2013 Elsevier Inc. All rights reserved. Chapter 3 CPUs.
Properties Use, share, or modify this drill on mathematic properties. There is too much material for a single class, so you’ll have to select for your.
UNITED NATIONS Shipment Details Report – January 2006.
1 RA I Sub-Regional Training Seminar on CLIMAT&CLIMAT TEMP Reporting Casablanca, Morocco, 20 – 22 December 2005 Status of observing programmes in RA I.
Properties of Real Numbers CommutativeAssociativeDistributive Identity + × Inverse + ×
Points, Vectors, Lines, Spheres and Matrices
Fakultät für informatik informatik 12 technische universität dortmund Classical scheduling algorithms for periodic systems Peter Marwedel TU Dortmund,
1 Outline relationship among topics secrets LP with upper bounds by Simplex method basic feasible solution (BFS) by Simplex method for bounded variables.
Solve Multi-step Equations
Discrete time Markov Chain
Discrete Math Recurrence Relations 1.
Copyright © Cengage Learning. All rights reserved.
Chapter 11: Models of Computation
Turing Machines.
Detection Chia-Hsin Cheng. Wireless Access Tech. Lab. CCU Wireless Access Tech. Lab. 2 Outlines Detection Theory Simple Binary Hypothesis Tests Bayes.
The Weighted Proportional Resource Allocation Milan Vojnović Microsoft Research Joint work with Thành Nguyen Microsoft Research Asia, Beijing, April, 2011.
EU market situation for eggs and poultry Management Committee 20 October 2011.
Chapter 4 Systems of Linear Equations; Matrices
Direct-Current Circuits
Basel-ICU-Journal Challenge18/20/ Basel-ICU-Journal Challenge8/20/2014.
1..
© 2012 National Heart Foundation of Australia. Slide 2.
Discrete Mathematics 3. MATRICES, RELATIONS, AND FUNCTIONS Lecture 5 Dr.-Ing. Erwin Sitompul
Splines I – Curves and Properties
6.4 Best Approximation; Least Squares
1 Using Bayesian Network for combining classifiers Leonardo Nogueira Matos Departamento de Computação Universidade Federal de Sergipe.
Chapter 2 Entity-Relationship Data Modeling: Tools and Techniques
Analyzing Genes and Genomes
Systems Analysis and Design in a Changing World, Fifth Edition
©Brooks/Cole, 2001 Chapter 12 Derived Types-- Enumerated, Structure and Union.
Intracellular Compartments and Transport
PSSA Preparation.
Essential Cell Biology
Energy Generation in Mitochondria and Chlorplasts
Petri Nets Jian-Jia Chen (slides are based on Peter Marwedel)
Technische universität dortmund fakultät für informatik informatik 12 Specifications, Modeling, and Model of Computation Jian-Jia Chen (slides are based.
(slides are based on Peter Marwedel)
technische universität dortmund fakultät für informatik informatik 12 Early design phases Jian-Jia Chen (slides are based on Peter Marwedel) TU Dortmund,
Technische universität dortmund fakultät für informatik informatik 12 Discrete Event Models Jian-Jia Chen (slides are based on Peter Marwedel) TU Dortmund,
State Variables.
The Pumping Lemma for CFL’s
ECE 530 – Analysis Techniques for Large-Scale Electrical Systems Prof. Hao Zhu Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign.
1 © R. Guerraoui The Limitations of Registers R. Guerraoui Distributed Programming Laboratory.
Fakultät für informatik informatik 12 technische universität dortmund Specifications - Session 5 - Peter Marwedel TU Dortmund Informatik 12 Germany Slides.
- 1 -  P. Marwedel, Univ. Dortmund, Informatik 12, 05/06 Universität Dortmund Petri nets Introduced in 1962 by Carl Adam Petri in his PhD thesis. Focus.
technische universität dortmund fakultät für informatik informatik 12 Early design phases Jian-Jia Chen (slides are based on Peter Marwedel) TU Dortmund,
2. Specification and Modeling
Presentation transcript:

Peter Marwedel TU Dortmund, Informatik 12 Petri Nets Graphics: © Alexandra Nolte, Gesine Marwedel, 2003 Peter Marwedel TU Dortmund, Informatik 12 2011/05/13 These slides use Microsoft clip arts. Microsoft copyright restrictions apply.

Models of computation considered in this course Communication/ local computations Shared memory Message passing Synchronous | Asynchronous Undefined components Plain text, use cases | (Message) sequence charts Communicating finite state machines StateCharts SDL Data flow (Not useful) Kahn networks, SDF Petri nets C/E nets, P/T nets, … Discrete event (DE) model VHDL*, Verilog*, SystemC*, … Only experimental systems, e.g. distributed DE in Ptolemy Von Neumann model C, C++, Java C, C++, Java with libraries CSP, ADA | * Classification is based on implementation of VHDL, Verilog, SystemC with central queue

Introduction Introduced in 1962 by Carl Adam Petri in his PhD thesis. Focus on modeling causal dependencies; no global synchronization assumed (message passing only). Key elements: Conditions Either met or no met. Events May take place if certain conditions are met. Flow relation Relates conditions and events. Conditions, events and the flow relation form a bipartite graph (graph with two kinds of nodes).

Example: Synchronization at single track rail segment “Preconditions“

Playing the “token game“ use normal view mode!

Conflict for resource “track“

More complex example (1) Thalys trains between Cologne, Amsterdam, Brussels and Paris. [http://www.thalys.com/be/en]

More complex example (2) s More complex example (2) Slightly simplified: Synchronization at Brussels and Paris, using stations “Gare du Nord” and “Gare de Lyon” at Paris use normal view mode!

Condition/event nets Def.: N=(C,E,F) is called a net, iff the following holds C and E are disjoint sets F  (C  E)  (E  C); is binary relation, (“flow relation“)

Pre- and post-sets Def.: Let N be a net and let x  (C  E). x := {y | y F x} is called the pre-set of x, (or preconditions if x  E) x := {y | x F y} is called the set of post-set of x, (or postconditions if x  E) Example: x x x

Loops and pure nets Def.: Let (c,e)  C  E. (c, e) is called a loop iff cFe  eFc. Def.: Net N=(C,E,F) is called pure, if F does not contain any loops.

Simple nets Def.: A net is called simple if no two nodes n1 and n2 have the same pre-set and post-set. Example (not simple nets): Def.: Simple nets with no isolated elements meeting some additional restrictions are called condition/event nets (C/E nets).

Place/transition nets Def.: (P, T, F, K, W, M0) is called a place/transition net iff N=(P, T, F) is a net with places p  P and transitions t  T K: P  (ℕ0  {}) \{0} denotes the capacity of places ( symbolizes infinite capacity) W: F (ℕ0 \{0}) denotes the weight of graph edges M0: P  ℕ0 {} represents the initial marking of places W (Segment of some net) M0 defaults: K =  W = 1

Computing changes of markings “Firing“ transitions t generate new markings on each of the places p according to the following rules:

Activated transitions Transition t is “activated“ iff Activated transitions can “take place“ or “fire“, but don‘t have to. We never talk about “time“ in the context of Petri nets. The order in which activated transitions fire, is not fixed (it is non-deterministic).

Shorthand for changes of markings Slide 14: Let   p  P: M´(p) = M(p)+ t(p)  M´ = M + t +: vector add

Matrix N describing all changes of markings Def.: Matrix N of net N is a mapping N: P T  ℤ (integers) such that  t  T : N(p,t)= t(p) Component in column t and row p indicates the change of the marking of place p if transition t takes place. For pure nets, (N, M0) is a complete representation of a net.

Example: N = s

Place - invariants Standardized technique for proving properties of system models For any transition tj  T we are looking for sets R  P of places for which the accumulated marking is constant: Example: tj

Characteristic Vector Let:  Scalar product

Condition for place invariants Accumulated marking constant for all transitions if Equivalent to NT cR = 0 where NT is the transposed of N

More detailed view of computations System of linear equations. Solution vectors must consist of zeros and ones. Equations with multiple unknowns that must be integers called diophantic ( Greek mathematician Diophantos, ~300 B.C.). Diophantic linear equation system more complex to solve than standard system of linear equations (actually NP-hard)) Different techniques for solving equation system (manual, ..)

Application to Thalys example NT cR = 0, with NT = ∑rows=0  1 linear dependency among rows  rank = 10-1 = 9 Dimension of solution space = 13 - rank = 4 Solutions? Educated guessing

Manually finding generating vectors for 4-dimensional space Set 1 of 4 components = 1 others = 0 to obtain generating vectors Find independent sets components in the matrix after deleting one row (7, 8, 12 easy to identify) or assume that a particular place is included in R (e.g. p6), whereas places along the path of other objects (e.g. p11, p12, p13) are not. 6=delete 1st row

1st basis vector Set one of components (6, 11, 12, 13) to 1, others to 0.  1st basis b1: b1(p6)=1, b1(p11)=0, b1(p12)=0, b1(p13)=0 t10(p10) b1(p10) + t10(p11) b1(p11) + t10(p13) b1(p13) = 0  b1(p10) = 0 t9(p9) b1(p9) + t9(p10) b1(p10) = 0  b1(p9)=0 … All components  {0, 1}  cR1 = b1 b1 = (1,1,1,1,1,1,0,0,0,0,0,0,0)

Interpretation of the 1st invariant Characteristic vector describes places for Cologne train. We proved that: the number of trains along the path remains constant . cR,1

2nd basis vector Set one of components (6, 11, 12, 13) to 1, others to 0.  2nd basis b2: b2(p6)=0, b2(p11)=1, b2(p12)=0, b2(p13)=0 t10(p10) b2(p10) + t10(p11) b2(p11) + t10(p13) b2(p13) = 0  b2(p10) = 1 t9(p9) b2(p9) + t9(p10) b2(p10) = 0  b2(p9)=1 … b2 not a characteristic vector, but cR,2=b1+b2 is  cR,2 = (1,0,0,0,1,1,0,0,1,1,1,0,0) b1 = (1, 1, 1, 1,1,1,0,0,0,0,0,0,0) b2 = (0,-1,-1,-1,0,0,0,0,1,1,1,0,0)

Interpretation of the 2nd invariant s cR,2 We proved that: None of the Amsterdam trains gets lost (nice to know ).

Setting b3(p12) to 1 and b4(p13) to 1 leads to an additional 2 invariants cR,4 cR,3 cR,1 cR,2 We proved that: the number of trains serving Amsterdam, Cologne and Paris remains constant. the number of train drivers remains constant.

Applications Modeling of resources; modeling of mutual exclusion; modeling of synchronization.

Predicate/transition nets Goal: compact representation of complex systems. Key changes: Tokens are becoming individuals; Transitions enabled if functions at incoming edges true; Individuals generated by firing transitions defined through functions Changes can be explained by folding and unfolding C/E nets,  semantics can be defined by C/E nets.

Example: Dining philosophers problem n>1 philosophers sitting at a round table; n forks, n plates with spaghetti; philosophers either thinking or eating spaghetti (using left and right fork). How to model conflict for forks? How to guarantee avoiding starvation? 2 forks needed!

Condition/event net model of the dining philosophers problem Let x  {1..3} tx: x is thinking ex: x is eating fx: fork x is available Use normal view mode to play the token game! Model quite clumsy. Difficult to extend to more philosophers. Normal view mode!

Predicate/transition model of the dining philosophers problem (1) Let x be one of the philosophers, let l(x) be the left spoon of x, let r(x) be the right spoon of x. Tokens: individuals. Semantics can be defined by replacing net by equivalent condition/event net. p2 p1 p3 f 1 f 2 f 3

Predicate/transition model of the dining philosophers problem (2) Model can be extended to arbitrary numbers of people. use normal view mode!

Evaluation Pros: Appropriate for distributed applications, Well-known theory for formally proving properties, Initially a quite bizarre topic, but now accepted due to increasing number of distributed applications. Cons (for the nets presented) : problems with modeling timing, no programming elements, no hierarchy. Extensions: Enormous amounts of efforts on removing limitations. back to full screen mode

UML Activity diagrams: Extended Petri nets Include decisions (like in flow charts). Graphical notation similar to SDL. © Cris Kobryn: UML 2001: A Standardization Odyssey, CACM, October, 1999 “swimlane“

Summary Petri nets: focus on causal dependencies Condition/event nets Single token per place Place/transition nets Multiple tokens per place Predicate/transition nets Tokens become individuals Dining philosophers used as an example Extensions required to get around limitations Activity diagrams in UML are extended Petri nets