- 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.

Slides:



Advertisements
Similar presentations
Peter Marwedel TU Dortmund, Informatik 12
Advertisements

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,
5.1 Real Vector Spaces.
Petri Nets Jian-Jia Chen (slides are based on Peter Marwedel)
Techniques to analyze workflows (design-time)
Data-Flow Analysis II CS 671 March 13, CS 671 – Spring Data-Flow Analysis Gather conservative, approximate information about what a program.
Lecture 19: Parallel Algorithms
An Introduction to Petri Nets
1 A camera is modeled as a map from a space pt (X,Y,Z) to a pixel (u,v) by ‘homogeneous coordinates’ have been used to ‘treat’ translations ‘multiplicatively’
A university for the world real R © 2009, Chapter 3 Advanced Synchronization Moe Wynn Wil van der Aalst Arthur ter Hofstede.
Based on: Petri Nets and Industrial Applications: A Tutorial
A Novel Method For Fast Model Checking Project Report.
IE 469 Manufacturing Systems
Elementary Linear Algebra Anton & Rorres, 9th Edition
- 1 -  P. Marwedel, Univ. Dortmund, Informatik 12, 05/06 Universität Dortmund Hardware/Software Codesign.
10/11/2001Random walks and spectral segmentation1 CSE 291 Fall 2001 Marina Meila and Jianbo Shi: Learning Segmentation by Random Walks/A Random Walks View.
Introduction to Computability Theory
10. Petri Nets Prof. O. Nierstrasz. Roadmap  Definition: —places, transitions, inputs, outputs —firing enabled transitions  Modelling: —concurrency.
Petri Nets Overview 1 Definition of Petri Net C = ( P, T, I, O) Places P = { p 1, p 2, p 3, …, p n } Transitions T = { t 1, t 2, t 3, …, t n } Input.
CS447/ECE453/SE465 Prof. Alencar University of Waterloo 1 CS447/ECE453/SE465 Software Testing Tutorial Winter 2008 Based on the tutorials by Prof. Kontogiannis,
CP — Concurrent Programming 12. Petri Nets Prof. O. Nierstrasz Wintersemester 2005 / 2006.
FunState – An Internal Design Representation for Codesign A model that enables representations of different types of system components. Mixture of functional.
- 1 -  P. Marwedel, Univ. Dortmund, Informatik 12, 2003 Universität Dortmund Hoofdstuk 2 Systeemspecificatietechnieken 2.2 Specificatietalen Prof. dr.
Lecture 6 & 7 System Models.
Data Flow Analysis Compiler Design Nov. 8, 2005.
Data Flow Analysis Compiler Design Nov. 8, 2005.
Universität Dortmund  P. Marwedel, Univ. Dortmund, Informatik 12, 2003 Hardware/software partitioning  Functionality to be implemented in software.
- 1 -  P. Marwedel, Univ. Dortmund, Informatik 12, 2005/6 Universität Dortmund Specifications.
Graphs of Functions Defined by Expressions in a Linear Equation On a standard screen, graph the following functions, determined from the given linear equation:
 Row and Reduced Row Echelon  Elementary Matrices.
Elementary Operations of Matrix
System Models Hoang Huu Hanh, Hue University hanh-at-hueuni.edu.vn Lecture 6 & 7.
4 4.4 © 2012 Pearson Education, Inc. Vector Spaces COORDINATE SYSTEMS.
Evaluation and Validation Peter Marwedel TU Dortmund, Informatik 12 Germany 2013 年 12 月 02 日 These slides use Microsoft clip arts. Microsoft copyright.
Ch. 2. Specification and Modeling 2.1 Requirements Describe requirements and approaches for specifying and modeling embedded systems. Specification for.
Section 2.3 Properties of Solution Sets
Propositional Calculus CS 270: Mathematical Foundations of Computer Science Jeremy Johnson.
Programming Languages and Design Lecture 3 Semantic Specifications of Programming Languages Instructor: Li Ma Department of Computer Science Texas Southern.
Modelling by Petri nets
- 1 -  P. Marwedel, Univ. Dortmund, Informatik 12, 05/06 Universität Dortmund Validation - Formal verification -
CONFIDENTIAL1 Good Afternoon! Today we will be learning about Review of Expressions, Variables, equations & Functions Let’s warm up : 1) Simplify: 4 x.
CSCI1600: Embedded and Real Time Software Lecture 11: Modeling IV: Concurrency Steven Reiss, Fall 2015.
School of Computer Science & Software Engineering
1 Petri Nets Ina Koch and Monika Heiner. 2 Petri Nets(1962) Carl Adam Petri.
/faculteit technologie management PN-1 Petri nets refresher Prof.dr.ir. Wil van der Aalst Eindhoven University of Technology, Faculty of Technology Management,
Arab Open University Faculty of Computer Studies M132: Linear Algebra
4.8 Rank Rank enables one to relate matrices to vectors, and vice versa. Definition Let A be an m  n matrix. The rows of A may be viewed as row vectors.
High Performance Embedded Computing © 2007 Elsevier Lecture 4: Models of Computation Embedded Computing Systems Mikko Lipasti, adapted from M. Schulte.
Chapter 5 Chapter Content 1. Real Vector Spaces 2. Subspaces 3. Linear Independence 4. Basis and Dimension 5. Row Space, Column Space, and Nullspace 6.
Diagnostic Information for Control-Flow Analysis of Workflow Graphs (aka Free-Choice Workflow Nets) Cédric Favre(1,2), Hagen Völzer(1), Peter Müller(2)
1 Advanced Embedded Systems Lecture 3 Specification Languages.
7.3 Linear Systems of Equations. Gauss Elimination
Advantages of FSM Their simplicity make it easy for inexperienced developers to implement with little to no extra knowledge (low entry level)
Dr. Eng Amr T. Abdel-Hamid
2. Specification and Modeling
Clockless Computing COMP
Concurrent Systems Modeling using Petri Nets – Part II
CAP 4800/CAP 5805: Computer Simulation Concepts
CSCI1600: Embedded and Real Time Software
Introduction to Petri Nets (PNs)
Elementary Linear Algebra
CAP 4800/CAP 5805: Computer Simulation Concepts
Petri Net :Abstract formal model of information flow Major use:
Inequalities Some problems in algebra lead to inequalities instead of equations. An inequality looks just like an equation, except that in the place of.
Math review - scalars, vectors, and matrices
Elementary Linear Algebra Anton & Rorres, 9th Edition
CSCI1600: Embedded and Real Time Software
Petri Nets Laurie Frazier.
Presentation transcript:

- 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 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). 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).

- 2 -  P. Marwedel, Univ. Dortmund, Informatik 12, 05/06 Universität Dortmund Example: Synchronization at single track rail segment „Preconditions“

- 3 -  P. Marwedel, Univ. Dortmund, Informatik 12, 05/06 Universität Dortmund Playing the „token game“ use normal view mode!

- 4 -  P. Marwedel, Univ. Dortmund, Informatik 12, 05/06 Universität Dortmund Conflict for resource „track“

- 5 -  P. Marwedel, Univ. Dortmund, Informatik 12, 05/06 Universität Dortmund More complex example (1) Thalys trains between Cologne, Amsterdam, Brussels and Paris. [

- 6 -  P. Marwedel, Univ. Dortmund, Informatik 12, 05/06 Universität Dortmund 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!

- 7 -  P. Marwedel, Univ. Dortmund, Informatik 12, 05/06 Universität Dortmund Condition/event nets Def.: N=(C,E,F) is called a net, iff the following holds 1.C and E are disjoint sets 2.F  (C  E)  (E  C); is binary relation, („flow relation“) Def.: Let N be a net and let x  (C  E).  x := {y | y F x} is called the set of preconditions. x  := {y | x F y} is called the set of postconditions. Example: Def.: N=(C,E,F) is called a net, iff the following holds 1.C and E are disjoint sets 2.F  (C  E)  (E  C); is binary relation, („flow relation“) Def.: Let N be a net and let x  (C  E).  x := {y | y F x} is called the set of preconditions. x  := {y | x F y} is called the set of postconditions. Example: x xx xx

- 8 -  P. Marwedel, Univ. Dortmund, Informatik 12, 05/06 Universität Dortmund 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.

- 9 -  P. Marwedel, Univ. Dortmund, Informatik 12, 05/06 Universität Dortmund Simple nets Def.: A net is called simple if no two transitions t1 and t2 have the same sets of input and output places. Example (not a simple net): Def.: A net is called simple if no two transitions t1 and t2 have the same sets of input and output places. Example (not a simple net): Def.: Simple nets with no isolated elements meeting some additional restrictions are called condition/event nets (C/E nets). Def.: Simple nets with no isolated elements meeting some additional restrictions are called condition/event nets (C/E nets).

 P. Marwedel, Univ. Dortmund, Informatik 12, 05/06 Universität Dortmund Place/transition nets Def.: (P, T, F, K, W, M 0 ) is called a place/transition net iff 1.N=(P,T,F) is a net with places p  P and transitions t  T 2.K: P  ( ℕ 0  {  }) \{0} denotes the capacity of places (  symbolizes infinite capacity) 3.W: F  ( ℕ 0 \{0}) denotes the weight of graph edges 4.M 0 : P  ℕ 0  {  } represents the initial marking of places Def.: (P, T, F, K, W, M 0 ) is called a place/transition net iff 1.N=(P,T,F) is a net with places p  P and transitions t  T 2.K: P  ( ℕ 0  {  }) \{0} denotes the capacity of places (  symbolizes infinite capacity) 3.W: F  ( ℕ 0 \{0}) denotes the weight of graph edges 4.M 0 : P  ℕ 0  {  } represents the initial marking of places W M0M0 (Segment of some net) defaults: K =  W = 1

 P. Marwedel, Univ. Dortmund, Informatik 12, 05/06 Universität Dortmund Computing changes of markings „Firing“ transitions t generate new markings on each of the places p according to the following rules:

 P. Marwedel, Univ. Dortmund, Informatik 12, 05/06 Universität Dortmund 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).

 P. Marwedel, Univ. Dortmund, Informatik 12, 05/06 Universität Dortmund Shorthand for changes of markings Let   p  P: M´(p) = M(p)+ t(p) Slide 11: +: vector add  M´ = M+ t

 P. Marwedel, Univ. Dortmund, Informatik 12, 05/06 Universität Dortmund 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, M 0 ) is a complete representation of a net.

 P. Marwedel, Univ. Dortmund, Informatik 12, 05/06 Universität Dortmund Example: N = s

 P. Marwedel, Univ. Dortmund, Informatik 12, 05/06 Universität Dortmund Place -invariants For any transition t j  T we are looking for sets R  P of places for which the accumulated marking is constant: Example: More in-depth: Standardized technique for proving properties of system models

 P. Marwedel, Univ. Dortmund, Informatik 12, 05/06 Universität Dortmund Characteristic Vector Let:  Scalar product

 P. Marwedel, Univ. Dortmund, Informatik 12, 05/06 Universität Dortmund Condition for place invariants Accumulated marking constant for all transitions if Equivalent to N T c R = 0 where N T is the transposed of N

 P. Marwedel, Univ. Dortmund, Informatik 12, 05/06 Universität Dortmund 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,..)

 P. Marwedel, Univ. Dortmund, Informatik 12, 05/06 Universität Dortmund Application to Thalys example N T c R = 0, with N T = Solutions? Educated guessing: ∑ rows =0  1 linear dependency among rows  rank = 10-1 = 9 Dimension of solution space = 13 - rank = 4 4 components of (6, 11, 12, 13) of c R are independent  set one of these to 1 and others to 0 to obtain a basis for the solution space Solutions? Educated guessing: ∑ rows =0  1 linear dependency among rows  rank = 10-1 = 9 Dimension of solution space = 13 - rank = 4 4 components of (6, 11, 12, 13) of c R are independent  set one of these to 1 and others to 0 to obtain a basis for the solution space

 P. Marwedel, Univ. Dortmund, Informatik 12, 05/06 Universität Dortmund 1 st basis t 10 (s 10 ) b 1 (s 10 ) + t 10 (s 11 ) b 1 (s 11 ) + t 10 (s 13 ) b 1 (s 13 ) = 0  b 1 (s 10 ) = 0 t 9 (s 9 ) b 1 (s 9 ) + t 9 (s 10 ) b 1 (s 10 ) = 0  b 1 (s 9 )=0 … Set one of components (6, 11, 12, 13) to 1, others to 0.  1st basis b 1 : b 1 (s 6 )=1, b 1 (s 11 )=0, b 1 (s 12 )=0, b 1 (s 13 )=0 All components  {0, 1}  c R1 = b 1 b 1 = (1,1,1,1,1,1,0,0,0,0,0,0,0)

 P. Marwedel, Univ. Dortmund, Informatik 12, 05/06 Universität Dortmund Interpretation of the 1 st invariant Characteristic vector describes places for Cologne train. We proved that: the number of trains along the path remains constant. Characteristic vector describes places for Cologne train. We proved that: the number of trains along the path remains constant. s C R,1

 P. Marwedel, Univ. Dortmund, Informatik 12, 05/06 Universität Dortmund 2 nd basis t 10 (s 10 ) b 2 (s 10 ) + t 10 (s 11 ) b 2 (s 11 ) + t 10 (s 13 ) b 2 (s 13 ) = 0  b 2 (s 10 ) = 1 t 9 (s 9 ) b 2 (s 9 ) + t 9 (s 10 ) b 2 (s 10 ) = 0  b 2 (s 9 )=1 … Set one of components (6, 11, 12, 13) to 1, others to 0.  2nd basis b 2 : b 2 (s 6 )=0, b 2 (s 11 )=1, b 2 (s 12 )=0, b 2 (s 13 )=0 b 2 not a characteristic vector, but c R,2 =b 1 +b 2 is  c R,2 = (1,0,0,0,1,1,0,0,1,1,1,0,0) b 1 = (1, 1, 1, 1,1,1,0,0,0,0,0,0,0) b 2 = (0,-1,-1,-1,0,0,0,0,1,1,1,0,0)

 P. Marwedel, Univ. Dortmund, Informatik 12, 05/06 Universität Dortmund Interpretation of the 2 nd invariant We proved that: None of the Amsterdam trains gets lost (nice to know ). We proved that: None of the Amsterdam trains gets lost (nice to know ). s C R,2

 P. Marwedel, Univ. Dortmund, Informatik 12, 05/06 Universität Dortmund Setting b 3 (s 12 ) to 1 and b 4 (s 13 ) to 1 leads to an additional 2 invariants We proved that: the number of trains serving Amsterdam, Cologne and Paris remains constant. the number of train drivers remains constant. We proved that: the number of trains serving Amsterdam, Cologne and Paris remains constant. the number of train drivers remains constant. s C R,4 C R,3 C R,1 C R,2 end

 P. Marwedel, Univ. Dortmund, Informatik 12, 05/06 Universität Dortmund Applications Modeling of resources; modeling of of mutual exclusion; modeling of synchronization. Modeling of resources; modeling of of mutual exclusion; modeling of synchronization.

 P. Marwedel, Univ. Dortmund, Informatik 12, 05/06 Universität Dortmund 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. 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.

 P. Marwedel, Univ. Dortmund, Informatik 12, 05/06 Universität Dortmund 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). 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? How to model conflict for forks? How to guarantee avoiding starvation? 2 forks needed!

 P. Marwedel, Univ. Dortmund, Informatik 12, 05/06 Universität Dortmund Condition/event net model of the dining philosophers problem Let x  {1..3} t x : x is thinking e x : x is eating f x : fork x is available Let x  {1..3} t x : x is thinking e x : x is eating f x : fork x is available Model quite clumsy. Difficult to extend to more philosophers. Model quite clumsy. Difficult to extend to more philosophers. Normal view mode!

 P. Marwedel, Univ. Dortmund, Informatik 12, 05/06 Universität Dortmund 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. 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. p1 p3 p2 f1 f2 f3 Tokens: individuals. Semantics can be defined by replacing net by equivalent condition/event net. Tokens: individuals. Semantics can be defined by replacing net by equivalent condition/event net.

 P. Marwedel, Univ. Dortmund, Informatik 12, 05/06 Universität Dortmund Predicate/transition model of the dining philosophers problem (2) p1 p3p2 f1 f2 f3 Model can be extended to arbitrary numbers of people. use normal view mode! l(x) r(x) v xx u xx t e f

 P. Marwedel, Univ. Dortmund, Informatik 12, 05/06 Universität Dortmund 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. 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

 P. Marwedel, Univ. Dortmund, Informatik 12, 05/06 Universität Dortmund Summary Petri nets: focus on causal relationships Condition/event nets –Single token per place Place/transition nets –Multiple tokens per place –Place-invariants provide means for proving properties –Thalys used as an example Condition event nets –Tokens become individuals –Dining philosophers used as an example Extensions required to get around limitations Petri nets: focus on causal relationships Condition/event nets –Single token per place Place/transition nets –Multiple tokens per place –Place-invariants provide means for proving properties –Thalys used as an example Condition event nets –Tokens become individuals –Dining philosophers used as an example Extensions required to get around limitations