3. modelling dynamic behavior with petri...
TRANSCRIPT
![Page 1: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/1.jpg)
Fakultät Informatik - Institut Software- und Multimediatechnik - Softwaretechnologie – Prof. Aßmann - Softwaretechnologie II
3. Modelling Dynamic Behavior with Petri NetsProf. Dr. U. Aßmann
Technische Universität Dresden
Institut für Software- und Multimediatechnik
Lehrstuhl Softwaretechnologie
http://st.inf.tu-dresden.de/teaching/swt2
WS 2016-0.1, 19.10.16
1
1. Basics1. Elementary Nets2. Special Nets
2. Colored Petri Nets3. Patterns in Petri Nets4. Composability of Colored
Petri Net1. Parallel Composition with CPN
5. Application to modelling
![Page 2: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/2.jpg)
Softwaretechnologie II
Obligatory Readings
Ø Balzert 2.17 or Ghezzi. Chapter 5http://www.scholarpedia.org/article/Petri_net
Ø W. Reising, J. Desel. Konzepte der Petrinetze. Informatik Spektrum, vol 37(3), 2014, Springer.http://www.springerprofessional.de/konzepte-der-petrinetze/5120122.html
Ø W.M.P. van der Aalst and A.H.M. ter Hofstede. Verification of workflow task structures: A petri-net-based approach. Information Systems, 25(1): 43-69, 2000.
Ø Kurt Jensen, Lars Michael Kristensen and Lisa Wells. Coloured Petri Nets and CPN Tools for Modelling and Validation of Concurrent Systems. Software Tools for Technology Transfer (STTT). Vol. 9, Number 3-4, pp. 213-254, 2007.
Ø J. B. Jörgensen. Colored Petri Nets in UML-based Software Development – Designing Middleware for Pervasive Healthcare. www.pervasive.dk/publications/files/CPN02.pdf
Ø Web portal “Petri Net World” http://www.informatik.uni-hamburg.de/TGI/PetriNets
2
![Page 3: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/3.jpg)
Softwaretechnologie II
Further Literature
Ø K. Jensen. Colored Petri Nets. Lecture Slides http://www.daimi.aau.de/~kjensen
Ø www.daimi.aau.dk/CPnets the home page of CPN. Contains lots of example specifications. Very recommended
Ø K. Jensen. Colored Petri Nets. Vol. I-III. Springer, 1992-96. Book series on CPN.
Ø T. Murata. Petri Nets: properties, analysis, applications. IEEE volume 77, No 4, 1989.
Ø W. Reisig. Elements of Distributed Algorithms – Modelling and Analysis with Petri Nets. Springer. 1998.
Ø W. Reisig, G. Rozenberg. Lectures on Petri Nets I+II, Lecture Notes in Computer Science, 1491+1492, Springer.
Ø J. Peterson. Petri Nets. ACM Computing Surveys, Vol 9, No 3, Sept 1977Ø http://www.daimi.au.dk/CPnets/intro/example_indu.htmlØ EE Roubtsova, M Aksit. Extension of petri nets by aspects to apply the
model driven architecture approach. 2005• http://doc.utwente.nl/60828/1/aksit_1.pdf
3
![Page 4: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/4.jpg)
Softwaretechnologie II
Relationship of PN and other Behavioral Models
Ø P.D. Bruza, Th. P. van der Weide. The Semantics of Data-Flow Diagrams. Int. Conf. on the Management of Data. 1989http://citeseer.ist.psu.edu/viewdoc/summary?doi=10.1.1.40.9398
Ø E.E.Roubtsova, M. Aksit. Extension of Petri Nets by Aspects to Apply the Model Driven Architecture Approach. University of Twente, Enschede,the Netherlands
Ø Industrial language workflow languages:• ARIS: A.-W. Scheer. ARIS - Business Process Frameworks. Springer, Berlin, 1998. • ARIS 9.8: http://www.ariscommunity.com/university/downloads/aris-business-
architect• BPMN: http://www.bpmn.org/• BPMN at SAP http://scn.sap.com/docs/DOC-8051
§ http://subs.emis.de/LNI/Proceedings/Proceedings160/43.pdfØ Other courses at TU Dresden:
Entwurf und Analyse mit Petri-NetzenLehrstuhl Algebraische und logische Grundlagen der InformatikDr. rer. nat. W. Nauberhttp://wwwtcs.inf.tu-dresden.de/~nauber/eapn10add.html
4
![Page 5: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/5.jpg)
Softwaretechnologie II
Goals
Ø Understand Untyped (Page/Transition nets) and Colored Petri nets (CPN)Ø Understand that PN/CPN are a verifiable and automated technology for
safety-critical systemsØ Understand why PN are a good modeling language for parallel systems
simulating the real worldØ PN have subclasses corresponding to finite automata and data-flow graphsØ PN can be refined, then reducible graphs result
5
![Page 6: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/6.jpg)
Softwaretechnologie II
The Initial Problem
You work for PowerPlant Inc. Your boss comes in and says:“Our government wants a new EPR reactor, similarly, in the way Finland has it.”
How can we produce a verified control software? We need a good modelling language!
How do we produce software for safety-critical systems?
6
![Page 7: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/7.jpg)
Softwaretechnologie II
Projects with Safety-Critical, Parallel Embedded Software
Aerospace• The WITAS UAV unmanned autonomously flying helicopter from Linköping
http://www.ida.liu.se/~marwz/papers/ICAPS06_System_Demo.pdf
Automotive• Prometheus: driving in car queues on the motorway
http://www.springerlink.com/content/j06n312r36805683/
Trains• www.railcab.de Autonomous rail cabs• www.cargocab.de Autonomous cargo metro
http://www.cargocap.de/files/cargocap_presse/2005/2005_01_12%20kruse.pdf• http://www.rubin-nuernberg.de/ Autonomous mixed metro• The Copenhagen metro (fully autonomous)
§ Inauguration seminarhttp://www.cowi.com.pl/SiteCollectionDocuments/cowi/en/menu/02.%20Services/03.%20Transport/5.%20Tunnels/Other%20file%20types/Copenhagen%20Metro%20Inauguration%20Seminar.pdf
7
![Page 8: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/8.jpg)
Fakultät Informatik - Institut Software- und Multimediatechnik - Softwaretechnologie – Prof. Aßmann - Softwaretechnologie II
3.1 Basics of PN
Petri Net Classes• Predicate/Transition Nets: simple tokens, no hierarchy.• Place-Transition Nets: multiple tokens• High Level Nets: structured tokens, hierarchy• There are many other variants, e.g., with timing constraints
8
![Page 9: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/9.jpg)
Softwaretechnologie II
Petri Nets
Model introduced by Carl Adam Petri in1962, C.A. Petri. Ph.D. Thesis: ”Communication with Automata”.► Over many years developed within GMD (now Fraunhofer, FhG)► PNs specify diagrammatically:
► Infinite state systems, regular and non-decidable► Concurrency (parallelism) with conflict/non-deterministic choice► Distributed memory (“places” can be distributed)
► Modeling of parallelism and synchronization► Behavioral modeling, state modeling etc.
9
![Page 10: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/10.jpg)
Softwaretechnologie II10
Integer Place/Transition Nets
Place
Token
Transition
Arc P = {P1, P2}T = {T1}F = {(P1,T1), (T1,P2)}W = f(x) = 1 m0 = {P1}
1 1
Weight(if not present = 1)
P1 P2
T1
![Page 11: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/11.jpg)
Softwaretechnologie II11
Integer Place/Transition Nets
P1 P2T1
P1 P2T1
P1 P2T1
2
![Page 12: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/12.jpg)
Softwaretechnologie II12
Integer Place/Transition Nets
Enabled
2
Not Enabled
2
Enabled
Enabled
Not Enabled
![Page 13: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/13.jpg)
Softwaretechnologie II13
Integer Place/Transition Nets
2
2
FIRE
2
2
FIRE
2
2
![Page 14: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/14.jpg)
Softwaretechnologie II
Ex.: Department of a Train
Train arrived
embarkmentPassenger on train
Passenger at station
Train arrived
embarkmentPassenger on train
Passenger at station
14
![Page 15: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/15.jpg)
Softwaretechnologie II
Language Levels
Ø PN extend finite automata with indeterminismØ Asynchronous execution model (partial ordering)
CH-0 computable
CH-1 context sensitive
CH-2 context free
CH-3 regular
Petri Nets Algebraic Specifications
FiniteState
Machines
15
Process algebrae
Parallelwithout net
sequentialParallelwithfixed net
![Page 16: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/16.jpg)
Softwaretechnologie II
Elementary Nets: Predicate/Transition Nets
Ø A Petri Net (PN) is a directed, bipartite graph over two kinds of nodes• 1. Places (circles) • 2. Transitions (bars or boxes)
Ø A Integer PN is a directed, weighted, bipartite graph with integer tokens • Places may contain several tokens• Places may contain a capacity (bound=k)• k tokens in a place indicate that k items are available
16
![Page 17: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/17.jpg)
Softwaretechnologie II
Integer Place/Transitions-Nets
Ø An Elementary PN (boolean net, predicate/transition or condition/event nets) • Boolean tokens
One token per place (bound of place = 1)• Arcs have no weights • Presence of a token = condition or predicate is true• Firing of a transition = from the input the output predicates are concluded• Thus elementary PN can represent simple forms of logic
17
![Page 18: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/18.jpg)
Softwaretechnologie II
High-Level Nets
Ø A High-Level PN (Colored PN, CPN) allows for typed places and typed arcs• For types, any DDL can be used (e.g., UML-CD)
Ø High-level nets are modular• Places and transitions can be refined• A Colored Petri Net is a reducible graph
Ø The upper layers of a reducible CPN are called channel agency nets• Places are interpreted as channels between components
O
reactHH
H2O
18
![Page 19: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/19.jpg)
Softwaretechnologie II19
Receive Ack
Cookie Automaton with Counter
19
Send Packet Transmit Packet Receive Packet
Transmit Ack
Send(Int, Data)
(n,d)
(n,d)
Sender(Int, Data)
Receiver(Int, Data)
(n,d) (n,d) (n,d)
if n = k then delse null
k
if n = k then k+1else k
Next Packet(Int)
Receive(Data)
if n = k then k+1else k
nnn
n
n
Sender Ack(Int)
Next To Send(Int)
Receiver Ack(Int)
![Page 20: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/20.jpg)
Softwaretechnologie II
Application Areas of Petri Nets
Ø Reliable software (quality-aware software)• PetriNets can be checked on deadlocks, liveness, fairness, bounded resources
Ø Safety-critical software that require proofs• Control software in embedded systems or power plants
Ø Hardware synthesis• Software/Hardware co-design
Ø User interface software• Users and system can be modeled as parallel components
20
![Page 21: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/21.jpg)
Softwaretechnologie II
Application Area I: Behavior Specifications in UML
Ø Instead of describing the behavior of a class with a statechart, a CPN can be used• Statecharts, data flow diagrams, activity diagrams are subsets of CPNs
Ø CPN have several advantages:• They model parallel systems (with a fixed net) naturally
• They are compact and modular, they can be reducible
• They are suitable for aspect-oriented composition, in particular of parallel protocols
• They can be used to generate code, also for complete applications
Ø Informal: for CPN, the following features can be proven• Liveness: All parts of the net are reachable
• Fairness: All parts of the net are equally “loaded” with activity
• K-boundedness: The tokens, a place can contain, aber n-bounded
• Deadlock: The net cannot proceed but did not terminate correctly
• Deadlock-freeness: The net contains no deadlocks
21
![Page 22: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/22.jpg)
Softwaretechnologie II
Application Area II: Contract checking (Protocol Checking) for Components
Ø Petri Nets describe behavior of components (dynamic semantics)• They can be used to check whether components fit to each other
Ø Problem: General fit of components is undecidable• The protocol of a component must be described with a decidable language• Due to complexity, context-free or -sensitive protocol languages are required
Ø Algorithm:• Describe the behavior of two components with two CPN
• Link their ports
• Check on liveness of the unified CPN• If the unified net is not live, components will not fit to each other…
Ø Liveness and fairness are very important criteria in safety-critical systems
22
![Page 23: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/23.jpg)
Fakultät Informatik - Institut Software- und Multimediatechnik - Softwaretechnologie – Prof. Aßmann - Softwaretechnologie II
3.1.1 Elementary Nets (Predicate/Transition Nets)
23
![Page 24: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/24.jpg)
Softwaretechnologie II
Meaning of Places and Transitions in Elementary Nets
► Predicate/Transition (Condition/Event-, State/Transition) Nets:■ Places represent conditions, states, or predicates■ Transitions represent the firing of events:
n if a transition has one input place, the event fires immediately if a token arrives in that place
n If a transition has several input places, the event fires when all input places have tokens
► A transition has input and output places (pre- and postconditions)■ The presence of a token in a place is interpreted as the condition is true
24
![Page 25: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/25.jpg)
Softwaretechnologie II
Taking Up
Example of 2 Robots as Predicate/Transition Net
Ø [Balzert]Ø Cmp. BMW factory
in Leipzig withrobotmanufactoringcells for i3
Laying Down
Taking Up Laying Down
Piece moving Taking UpPiece available
Pieceready
Piece equipped
Piece equipped
Robot 1 free
Robot 2 free
25
![Page 26: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/26.jpg)
Softwaretechnologie II
Taking Up
Example of 2 Robots as Predicate/Transition Net
Ø Places represent predicatesØ Tokens show validity
Laying Down
Taking Up Laying Down
Piece moving Taking UpPiece available
Pieceready
Piece equipped
Robot 2 free
Piece equipped
Robot 1 free
26
![Page 27: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/27.jpg)
Softwaretechnologie II27
Taking Up
Example of 2 Robots as Predicate/Transition Net
27
Laying Down
Taking Up Laying Down
Piece moving Taking UpPiece available
Pieceready
Piece equipped
Robot 2 free
Piece equipped
Robot 1 free
![Page 28: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/28.jpg)
Softwaretechnologie II28
Taking Up
Example of 2 Robots as Predicate/Transition Net
28
Laying Down
Taking Up Laying Down
Piece moving Taking UpPiece available
Pieceready
Piece equipped
Robot 2 free
Piece equipped
Robot 1 free
![Page 29: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/29.jpg)
Softwaretechnologie II29
Taking Up
Example of 2 Robots as Predicate/Transition Net
29
Laying Down
Taking Up Laying Down
Piece moving Taking UpPiece available
Pieceready
Piece equipped
Robot 2 free
Piece equipped
Robot 1 free
![Page 30: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/30.jpg)
Softwaretechnologie II
Comparing PN to Automata
Petri Nets► Tokens encode parallel “distributed” global state► Can be switched “distributedly”
Automata► Sequential► One global state (one token)► Can only be switched “centrally”
30
![Page 31: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/31.jpg)
Fakultät Informatik - Institut Software- und Multimediatechnik - Softwaretechnologie – Prof. Aßmann - Softwaretechnologie II
3.1.2 Special Nets (Special Syntactic forms of PN)
31
![Page 32: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/32.jpg)
Softwaretechnologie II
3.1.2.a Marked Graphs (MG) are DFD with Distributed Memory
Ø A Marked Graph (MG) is a PN such that:
1. Each place has only 1 incoming arc2. Each place has only 1 outgoing arc• Then the places can be abstracted (identified with one flow edge)• Transitions may split and join, however• No shared memories between transitions (distributed memory)
Ø Marked Graphs correspond to a special class of data-flow graphs (Data flow diagrams with non-shared, distributed memory, dm-DFD)• MG provide deterministic parallelism without confusion• Transitions correspond to processes in DFD, places to stores• States can be merged with the ingoing and outcoming arcs → DFD without stores• Restriction: Stores have only one producer and consumer• But activities can join and split
Ø All theory for CPN holds for marked graph - DFD, too [BrozaWeide]
32
![Page 33: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/33.jpg)
Softwaretechnologie II
Taking Up
3.1.2.a Marked Graphs (MG)
Ø Is the production PN a MG ?
Laying Down
Taking Up Laying Down
Piece moving Taking UpPiece available
Pieceready
Piece equipped
Robot 2 free
Piece equipped
Robot 1 free
33
![Page 34: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/34.jpg)
Softwaretechnologie II
Taking Up
3.1.2.a Marked Graphs (MG)
Ø The production PN is no MG à Some places have more than 1 incoming/outgoing arc
Laying Down
Taking Up Laying Down
Piece moving Taking UpPiece available
Pieceready
Piece equipped
Robot 2 free
Piece equipped
Robot 1 free
34
![Page 35: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/35.jpg)
Softwaretechnologie II
Taking Up
3.1.2.a Marked Graphs (MG)
Ø However, the production robot PN is a MG
Laying Down
Piece moving Taking UpPiece available
Pieceready
Piece equipped
Robot 2 free
35
![Page 36: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/36.jpg)
Softwaretechnologie II
More General Data-Flow Diagrams
Ø General DFD without restriction can be modeled by PN, too. • However, places cannot be abstracted• They correspond to stores with 2 feeding or consuming processes
Ø Example: the full robot has places with 2 ingoing or outgoing edges, • They cannot be abstracted
36
![Page 37: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/37.jpg)
Softwaretechnologie II
For DFD, Many Notations Exist
Ø Notation from Structured Analysis [Balzert]
Pot
WaterGreenTea
TeaDrink
put teain pot
addboilingwater
Produce tea
Cup
wait
Process Data flow
Data
Store
37
![Page 38: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/38.jpg)
Softwaretechnologie II
3.1.2.b State Machines are PN with Cardinality Restrictions
Ø A Finite State Machine PN is an elementary PN such that:
1. Each transition has only 1 incoming arc2. Each transition has only 1 outgoing arc• Then, it is equivalent to a finite automaton or a statechart• From every class-statechart that specifies the behavior of a class, a State Machine
can be produced easily§ Flattening the nested states
• Transitions correspond to transitions in statecharts, states to states• Transitions can be merged with the ingoing and outcoming arcs• In a FSM there is only one token
Ø All theory for CPN holds for Statecharts, too
38
![Page 39: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/39.jpg)
Softwaretechnologie II
Taking Up Laying Down
Taking Up Laying Down
Piece moving Taking UpPiece available
Pieceready
Piece equipped
Robot 2 free
Piece equipped
Robot 1 free
3.1.2.b State Machines
Ø Is the production PN a FSM ?
39
![Page 40: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/40.jpg)
Softwaretechnologie II
Taking Up Laying Down
Taking Up Laying Down
Piece moving Taking UpPiece available
Pieceready
Piece equipped
Robot 2 free
Piece equipped
Robot 1 free
3.1.2.b State Machines
Ø The production PN is no FSMà Some transitions have more than 1 incoming/outgoing arc
40
![Page 41: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/41.jpg)
Softwaretechnologie II
Taking Up Laying Down
Piece equipped
Robot 2 free
3.1.2.b State Machines
Ø One Robot is a FSM but not with incoming/outgoing arc
41
![Page 42: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/42.jpg)
Softwaretechnologie II
Hierarchical StateCharts from UML
Ø States can be nested in StateChartsØ This corresponds to hierarchical StateMachine-PN, in which states can be
refined and nested
Autopilot
On
Autopilot
Autopilot
OnOffSwitchOn
SwitchOff
Controlling
Non Controlling
Move QuietOff
SwitchOff
SwitchOn
42
![Page 43: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/43.jpg)
Softwaretechnologie II
3.1.2.c Free-Choice Nets
Ø Two transitions are in conflict if the firing of one transition deactivates another
• R1: no conflicts (t1 and t3 activated) à in this example t1 fires• R2: t2 and t3 are in conflict à in this example t2 fires• R3: t3 is deactivated because of t2
t1 t2 t3s1 s2 s3
t1 t2 t3s1 s2 s3
t1 t2 t3s1 s2 s3
R1
R2
R3
43
![Page 44: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/44.jpg)
Softwaretechnologie II
3.1.2.c Free-Choice Nets
Ø Free-Choice Petri Net provides deterministic parallelism• Choice between transitions never influence the rest of the system („free choice“)• Rule conflicts out• AND-splits and AND-joins
Ø Keep places with more than one output transitions away from transitions with more than one input places (forbidden are “side actions”)• outdegree(place) à in(out(place)) = {place}
OK OK NOT OK
44
![Page 45: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/45.jpg)
Softwaretechnologie II45
3.1.2.d Extended FC Nets
Ø An EFC is a net in which theoutput transition sets of all pairs of places are eitherdisjoint or equal (nooverlapping output transitionsets)
Ø An asymmetric choice net(AC) is a net in which• If the output transition sets of
all pairs of places are not disjoint, they are including
45
NOT OKOK OK
![Page 46: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/46.jpg)
Softwaretechnologie II
Reduction of EFC to FC
46
Ø Reduction is possible because of the requirement of equality ofoutput-transition sets (symmetry)
![Page 47: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/47.jpg)
Softwaretechnologie II
3.1.2.d Workflow Nets
Ø In general, workflows are executable sequences of actions, sharing datafrom several repositories or communicating with streams.
Ø Workflow nets are Petri Nets with single sources and single sinks(single-entry/single-exit)• So that only reducible nets can be specified• They extend DFD with control flow and synchronization• They provide richer operators (AND, XOR, OR), inhibitor arcs, and
synchronization protocolsØ Workflow nets are compiled to Petri NetsØ Further, specialized workflow languages exist, such as
• ARIS workflow language• YAWL Yet another workflow language• BPMN Business Process Modeling Notation• BPEL Business Process Execution Language
47
![Page 48: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/48.jpg)
Softwaretechnologie II
Petri Net Syntactic Form
Marked Graph (simple DFD) State machine Free choice
net Workflow net
48
![Page 49: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/49.jpg)
Fakultät Informatik - Institut Software- und Multimediatechnik - Softwaretechnologie – Prof. Aßmann - Softwaretechnologie II
3.1.3 Colored Petri Nets as Example of High Level Nets
ModularityRefinementReusePreparing “reducible graphs”
49
![Page 50: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/50.jpg)
Softwaretechnologie II
Colored Petri Nets, CPN
Ø Colored (Typed) Petri Nets (CPN) refine Petri nets:• Tokens are typed (colored)• Types are described by data structure language
(e.g.,Java, ML, UML class diagrams, data dictionaries, grammars)• Concept of time can be added
Ø Full tool support• Fully automated code generation in Java and ML (in contrast to UML)
e.g., DesignCPN of Aarhus University http://www.daimi.aau.dk• Possible to proof features about the PN• Net simulator allows for debugging
Ø Much better for safety-critical systems than UML, because proofs can be done
50
![Page 51: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/51.jpg)
Softwaretechnologie II
Annotations in CPN
Ø Places are annotated by• Token types
(STRING x STRING)
• Markings of objects and the cardinality in which they occur:2'(“Uwe”,”Assmann”)
Ø Edges are annotated by• Type variables which are unified by unification against the token objects
(X,Y)
• Guards[ X == 10]
• If-Then-Else statementsif X < 20 then Y := 4 else Y := 7
• Switch statements• Boolean functions that test conditions
51
![Page 52: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/52.jpg)
Softwaretechnologie II
CPN are Modular
Ø A subnet is called a page (module)• Every page has ports • Ports mark in- and out-going transitions/places
Ø Transition page: interface contains transitions (transition ports)
Ø Place page (state page): interface contains place (place ports)
Ø Net class: a named page that is a kind of ”template” or ”class”• It can be instantiated to a net ”object”
Ø Reuse of pages and templates possible• Libraries of CPN ”procedures” possible
52
![Page 53: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/53.jpg)
Softwaretechnologie II53
Taking Up
Robots with Transition Pages, Coupled by Transition Ports
53
Laying Down
Taking Up Laying Down
Piece moving Taking UpPiece available
Pieceready
Robot 2 free
Robot 1 free
Transition Page
ReusedTransition Page
Transitions replicated
![Page 54: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/54.jpg)
Softwaretechnologie II54
Taking Up
Robots with Place (State) Pages, Coupled by Replicated State Ports
54
Laying Down
Taking Up Laying Down
Piece moving Taking UpPiece available
Pieceready
Robot 2 free
Robot 1 free
Place Page
ReusedPlace Page
Port states replicated
![Page 55: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/55.jpg)
Softwaretechnologie II
CPN are Hierarchical
► Places and transitions may be hierarchically refined■ Two pointwise refinement operations:
. Replace a transition with a transition page
. Replace a state with a state page■ Refinment condition: Retain the embedding (embedding edges)
► CPN can be arranged as hierarchical graphs (reducible graphs, see later)■ Large specifications possible, overview is still good■ Subnet stemming from refinements are also place or transition pages
55
![Page 56: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/56.jpg)
Softwaretechnologie II
Point-wise Refinement Example
Pointwise refinement:■ Transition refining page: refines a transition, transition ports■ Place refining page (state refining page):
refines a place, place ports
Law of syntactic refinement: The graph interface (attached edges) of a refined node must be retained by the refining page.
56
![Page 57: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/57.jpg)
Softwaretechnologie II
Point-wise Refinement Example
Hyperedge refinement:• Hyperedges and regions in PN can be refined
57
![Page 58: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/58.jpg)
Softwaretechnologie II
Modularity is Important for Scaling –Industrial Applications of CPN
► Large systems are constructed as reducible specifications■ They have 10-100 pages, up to 1000 transitions, 100 token types
► Example: ISDN Protocol specification■ Some page templates have more than 100 uses■ Corresponds to millions of places and transitions in the expanded, non-hierarchical
net■ Can be done in several person weeks
58
![Page 59: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/59.jpg)
Fakultät Informatik - Institut Software- und Multimediatechnik - Softwaretechnologie – Prof. Aßmann - Softwaretechnologie II
3.2 Patterns in and Transformations of Petri Nets
• Petri Nets have a real advantage whenparallel processes and synchronization must be modelled– Many concepts can be expressed as PN patterns or with PN complex operators
• Analyzability: Petri Nets can be analyzed for patterns (by pattern matching)
• Transformation: Petri Nets can be simplified by automatictransformations
59
![Page 60: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/60.jpg)
Softwaretechnologie II60
Simple PN Buffering Patterns
60
Reservoir PlaceDoes not generate objects
Permanently active transactionGenerates objects(Object source, Event source)
ArchiveStores objects
SinkDeletes/Destroys objects
ProcessSequential
Intermediate ArchiveBuffer
![Page 61: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/61.jpg)
Softwaretechnologie II
Patterns for Synchronization (Barrier)
Ø Coupling processes with parallel continuation
Both there?
61
![Page 62: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/62.jpg)
Softwaretechnologie II
Patterns for Synchronization (n-Barrier)
Ø Bridges: Transitions between phases
All there?
62
![Page 63: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/63.jpg)
Softwaretechnologie II
Adding Delays in Transitions by Feedback Loops
Ø Adding a delay tokenØ Behaves like a semaphore
(lock – unlock critical region)
63
![Page 64: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/64.jpg)
Softwaretechnologie II
Adding Delays in Transitions by Feedback Loops
Ø Adding a circular delay net Ø Behaves like a splitter
64
1
2
![Page 65: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/65.jpg)
Softwaretechnologie II
Simpler Specification with Special Operators (Transitions) in Workflow Nets
Ø In languages for Workflow nets, such as• ARIS workflow language• YAWL Yet another workflow language• BPMN Business Process Modeling Notation• BPEL Business Process Execution Language
Ø Specific transitions have been designed (specific operators) for simpler specification
65
![Page 66: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/66.jpg)
Softwaretechnologie II66
AND
XOR
OR
Complex Transition Operators in Workflow Nets: Join and Split Operators of YAWL
66
AND
XOR
OR
AND-JoinAll ingoing places are ready(conjuctive input)
XOR-JoinExactly one of n ingoing places is ready(disjunctive input)
OR-JoinAt least one of ningoing places is ready(selective input)
AND-SplitAll outgoing places
are filled(conjuctive output)
XOR-SplitExactly one of the outgoing
places are filled(disjunctive output)
OR-Split(IOR-Split)
Some of the outgoingplaces are filled
(selective output)
![Page 67: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/67.jpg)
Softwaretechnologie II
OR
BookFootballTickets
Simple YAWL example
Ø OR-Booking of travel activities
BookHotel
BookFlight
OR
67
![Page 68: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/68.jpg)
Softwaretechnologie II68
AND
OR
Parallelism Patterns – Transitional Operators
68
AND
OR
Joining ParallelismSynchronization BarrierAND-Join
Collecting ObjectsFrom parallel processesOR-Join
Replication and DistributionForking (AND-Split)
DecisionIndeterministically(OR-Split)
![Page 69: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/69.jpg)
Softwaretechnologie II
Example: Reduction Semantics of OR-Join Operator
Ø Complex operators refine to special pages with multiple transition ports
OR
69
![Page 70: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/70.jpg)
Softwaretechnologie II
Example: Reduction Semantics of XOR-Join Operator
Ø XOR-Join with bound state (only 1 token can go into a place)
XOR
1
70
![Page 71: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/71.jpg)
Softwaretechnologie II
Example: Reduction Semantics of XOR-Join Operator
Ø XOR-Join can be realized with inhibitor arcs(transition is activated when no token is in the place)
XOR
71
![Page 72: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/72.jpg)
Softwaretechnologie II
Parallelism Patterns – Transitional Operators (2)
OrderingANDJoin
Ordering Synchronization BarrierOrdering-AND-Join
72
2
1
![Page 73: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/73.jpg)
Softwaretechnologie II
Parallelism Patterns – Transitional Operators (2)
OrderingANDSplit
Output Ordering GeneratorOrdering-AND-Split
73
2
1
![Page 74: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/74.jpg)
Softwaretechnologie II
Patterns for CommunicationDirect Producer-Consumer
no message
message available
produce send
message
received message store
ready
receive
74
![Page 75: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/75.jpg)
Softwaretechnologie II
Patterns for CommunicationDirect Producer-Consumer
no message
message available
produce send
message
received message store
demand
receive
75
![Page 76: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/76.jpg)
Softwaretechnologie II
Patterns for CommunicationDirect Producer-Consumer
no message
message available
produce send
message
received message store
demand
receive
76
![Page 77: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/77.jpg)
Softwaretechnologie II
Patterns for CommunicationDirect Producer-Consumer
no message
message available
produce send
message
received message store
demand
receive
77
![Page 78: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/78.jpg)
Softwaretechnologie II
Patterns for CommunicationDirect Producer-Consumer
no message
message available
produce send
message
received message store
demand
receive
78
![Page 79: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/79.jpg)
Softwaretechnologie II
Patterns for Communication
Ø Producer Consumer with Buffer
no message
message available
produce send
bufferreceived message store
demand
receive
79
![Page 80: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/80.jpg)
Softwaretechnologie II
Patterns for Communication
Ø Producer Consumer with Buffer
no message
message available
produce send
bufferreceived message store
demand
receive
80
![Page 81: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/81.jpg)
Softwaretechnologie II
Patterns for Communication
Ø Producer Consumer with Buffer
no message
message available
produce send
bufferreceived message store
demand
receive
81
![Page 82: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/82.jpg)
Softwaretechnologie II
Patterns for Communication
Ø Producer Consumer with Buffer
no message
message available
produce send
bufferreceived message store
demand
receive
82
![Page 83: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/83.jpg)
Softwaretechnologie II
Patterns for Communication
Ø Producer Consumer with Buffer
no message
message available
produce send
bufferreceived message store
demand
receive
83
![Page 84: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/84.jpg)
Softwaretechnologie II
Patterns for Communication
Ø Producer Consumer with Buffer
no message
message available
produce send
bufferreceived message store
demand
receive
84
![Page 85: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/85.jpg)
Softwaretechnologie II
Patterns for Communication
Ø Producer Consumer with Buffer
no message
message available
produce send
bufferreceived message store
demand
receive
85
![Page 86: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/86.jpg)
Softwaretechnologie II
Patterns for Communication
Ø Producer Consumer with Buffer
no message
message available
produce send
bufferreceived message store
demand
receive
86
![Page 87: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/87.jpg)
Softwaretechnologie II
Patterns for Communication
Ø Producer Consumer with Buffer (size 1 message)
no message
message available
produce send
bufferreceived message store
demand
receive1
87
![Page 88: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/88.jpg)
Softwaretechnologie II
Patterns for Communication
Ø Producer Consumer with Buffer (size n message)
no message
message available
produce send
bufferreceived message store
demand
receiven
88
![Page 89: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/89.jpg)
Softwaretechnologie II
Patterns for Communication
Ø Producer Consumer with Bufferand indeterministic delivery
Ø OR Split
no message
message available
produce send
bufferreceived message store
demand
receive
received message store
demand
receive
89
![Page 90: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/90.jpg)
Softwaretechnologie II
Patterns for Communication
Ø Producer Consumer with Bufferand broadcast communication
Ø AND-Split
no message
message available
produce send
bufferreceived message store
demand
receive
received message store
demand
receive
90
![Page 91: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/91.jpg)
Softwaretechnologie II
Semaphores For Mutual Exclusion
Ø Binary or counting semaphores offer their lock and free operations astransitions
Ø Distinguished by the capacity of the semaphore place
Lock
Free Free
Lock
91
![Page 92: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/92.jpg)
Softwaretechnologie II
Semaphores For Mutual Exclusion
Ø Binary or counting semaphores offer their lock and free operations astransitions
Ø Distinguished by the capacity of the semaphore place
Lock
Free Free
Lock
92
![Page 93: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/93.jpg)
Softwaretechnologie II
Semaphores For Mutual Exclusion
Lock
Free Free
Lock
93
![Page 94: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/94.jpg)
Softwaretechnologie II
Semaphores For Mutual Exclusion
Lock
Free Free
Lock
94
![Page 95: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/95.jpg)
Softwaretechnologie II
Dining Philosophers (Shared Resources)
Lock
Free
Lock
Free
start eating
Getting hungry
eating
waiting for fork1 waiting for fork2
95
![Page 96: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/96.jpg)
Softwaretechnologie II
Advantage
► Patterns can be used to model specific requirements
► PN can be checked for patterns by Pattern Matching (context-free Graph Rewriting)■ Patterns can be restructured (refactorings)■ Patterns can be composed (composition)
■ PN can be simplified by graph transformation rules
► Further semantic analysis of PN: Parallel, indeterministic systems can be checked for■ Absence of deadlocks: will the parallel system run without getting stuck?■ Liveness: will all parts of the system work forever?■ Fairness: will all parts of the system be loaded equally?■ Bounded resources: will the system use limited memory, and how much?
(important for embedded systems)■ Whether predicates hold in certain states (model checking)
96
![Page 97: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/97.jpg)
Fakultät Informatik - Institut Software- und Multimediatechnik - Softwaretechnologie – Prof. Aßmann - Softwaretechnologie II
3.3 COMPOSABILITY OF CPN
How to increase scalability of CPN
97
![Page 98: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/98.jpg)
Softwaretechnologie II
Case Study for Composition: Pervasive Healthcare Middleware (PHM)
Ø In development at the Pervasive Computing Center, University of Aarhus• http://www.pervasive-computing.dk/
Ø Basic idea:• Specify the object net and the protocols of an application with UML• Specify the behavior of the object nets with CPN
à Describing the behavior of the classes/objects (object lifecycle)• Glue behavior together with page glueing mechanism
Ø Electronic patient records (EPR) replace the papers• First version in 2004, on stationary PC and PDA • Next versions for pervasive computing (Smartphone, tablet, wireless):
§ Hospital employees will have access to the patient's data whereever they go, from Xray to station to laboratories
§ Sessions everywhere- For instance, medication plans and statistic evaluations are available
immediately
98
![Page 99: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/99.jpg)
Softwaretechnologie II
Page B
Fusing Transition Pages
Ø If two transitions are named with the same global name, the CPN systemunifies (merges, fuses) them
Ø The resulting fused transition has an AND semantics, waiting for all inputsof all fused transitions
Ø With transition fuse, a net A can be extended with a net B constrainingsome transitions of A by fused transitions of B
99
CreateSession CreateSession
Page A
![Page 100: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/100.jpg)
Softwaretechnologie II
Page B
Fusing Place Pages
Ø If two places are named with the same global name, the CPN systemunifies (merges, fuses) them
Ø The resulting fused place has an OR semantics, waiting for some inputs ofall fused places
Ø With place fuse, a net A can be extended with a net B augmenting someplaces of A by fused places of B
100
Page A
![Page 101: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/101.jpg)
Softwaretechnologie II
The PHM Architecture
Ø A session is entered by several mobile devices that collaborate
Mobile Device
Controller
Viewer
Mobile Device
SessionManager
ComponentManager
NotificationManager
LookupManager
101
![Page 102: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/102.jpg)
Softwaretechnologie II
Session Manager Use Cases
Ø The session manager manages all mobile devices that collaborate in a certain scenario
SessionManager
Nurse
View Change Locking ConfigurationManagement
Create Session
Enter Session
LeaveSession
Show Status
New Session
DestroySession
Edit Request
Free
102
![Page 103: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/103.jpg)
Softwaretechnologie II
Class Diagram Session Manager and Context
SessionManager
nr: int
Session
*
1
nr: int
Device*inactive
* active
sessions
LockManager1
ConfigurationManager
ViewManager
1
1
103
![Page 104: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/104.jpg)
Softwaretechnologie II
SessionManager Device1:Device
Sequence Diagram Session Manager
Device2:Device
createSession()
shipDefaultController()
shipDefaultViewer()
joinSession()shipDefaultController()
shipDefaultViewer()
leaveSession()
acquireLock()
freeLock()
104
![Page 105: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/105.jpg)
Softwaretechnologie II
Session Manager Top-Level CPN
Ø Double arrows indicate that arrows run in both directions betweensubpages
Ø Basic Types• Session ::= SessionId DeviceList LockType
• ConfiguredDevice ::= Device Viewer Controller
ConfigurationManager
ViewManager
LockManager
Inactive:Device
Sessions:Session== Id x DeviceList x Lock
ActiveConfigs:ConfiguredDevice ==Device x Viewer x Controller
Transition subpages
105
![Page 106: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/106.jpg)
Softwaretechnologie II
Refined Configuration Manager Page
Ø Page is fused with top-level page along common names of nodes
CreateSession
LeaveSessionJoinSession
Inactive:Device
Sessions:Session
ActiveConfigs:ConfiguredDevice ==Device x Viewer x Controller
ConfigurationManager
NextId:int
sidsid+1
d
createSession(s,d)
leaveSession(d,s)joinSession(s,d)
(d,default viewer,default controller)
s == (d,default viewer,default controller) [leaveOK(d,s) ]
s s
detachViewCtr(d,v,c)
[joinOK(d,s) ]
s == (d,v,c)
guard
106
![Page 107: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/107.jpg)
Softwaretechnologie II
Set Lock ReleaseLock
Refined Lock Manager Page
Sessions:Session
ActiveConfigs:Device x Viewer x Controller
Lock Manager
setLock(session,device)
(device,viewer,controller)
releaseLock(session,device)[not(sessionLocked(session)
and not participant(device,session)]
[hasLock(session,device)]
(device,viewer,controller)
107
![Page 108: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/108.jpg)
Softwaretechnologie II108
DetachViewer
DetachController
Refined View Manager Page
108
ActiveConfigs:Device x Viewer x Controller
ViewManager
[hasViewer(d,c)
(d,v,c)(d,v,c)
detachViewer(d,v,c)
NoViewer:Device x Controller
AttachViewer
(d,attachViewer(d),c)(d,c)
[hasController(d,v)
detachController(d,v,c)
NoController:Device x Viewer
AttachController
(d,attachControllerr(v),v)(d,c)
![Page 109: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/109.jpg)
Softwaretechnologie II
Remarks
Ø The CPN pages are attached to UML classes, i.e., describe their behavior• States and transitions are marked by UML types
Ø Every subpage is coupled to other pages of classes (composed with other classes)• via common states (fusing/join states)
§ The union of the pages via join states is steered by OR, i.e., the pages add behavior, but do not destroy behavior of other pages
• Via common transitions (fusing/join transitions)§ The union of the pages via join transitions is steered by AND, i.e., the pages
add behavior and synchronize with transitions of other pages
Ø Transitions are interpreted as coarse-grain events• On the edges, other functions (actions) are called• Hence, CPN are open: if something is too complicated to model as a PN, put it into
functions
109
![Page 110: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/110.jpg)
Softwaretechnologie II
Coupling of Place and Transition Pages
Ø Port state coupling (or fuse, merge, composition): Place pages are coupled to other place pages via common states (port states)• The union of the pages is steered by OR, i.e., the pages add behavior, but do not
destroy behavior of other pages
Ø Port transition coupling: Transition pages are coupled to other transition pages via common transitions (port transitions)• The union of the pages is steered by AND, and every page changes the behavior of
other page• Events must be available on every incoming edge of a transition• The transitions of the combined net only fire if the transitions of the page
components fire
110
![Page 111: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/111.jpg)
Softwaretechnologie II111
Taking Up
Robots with Place (State) Pages, Coupled by Replicated State Ports
111
Laying Down
Taking Up Laying Down
Piece moving Taking UpPiece available
Pieceready
Robot 2 free
Robot 1 free
Place Page
ReusedPlace Page
Port states replicated
![Page 112: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/112.jpg)
Softwaretechnologie II
Taking Up
A Robot OR-composed View
Laying Down
Taking Up Laying Down
Piece moving
Taking Up
Piece available
Pieceready
Robot 2 free
Robot 1 free
Piece moving
Piece available
Robot gets pieace A or B
112
![Page 113: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/113.jpg)
Softwaretechnologie II
Taking Up
Robots with Transition Pages, Coupled by Transition Ports
Laying Down
Taking Up Laying Down
Piece moving Taking UpPiece available
Pieceready
Robot 2 free
Robot 1 free
113
![Page 114: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/114.jpg)
Softwaretechnologie II114
Taking Up
Fusing Several Transport NetsInto the Robots with Transition Pages, Coupled by Transition Ports
114
Laying Down
Taking Up Laying Down
Piece moving
Taking Up
Piece available
Pieceready
Robot 2 free
Robot 1 free
Piece moving Piece available
Robot gets pieace A and B
![Page 115: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/115.jpg)
Softwaretechnologie II
Advantages of CPN for the PHM
Ø The PHM is a distributed and mobile scenario• Devices can fail (battery empty, wireless broken, etc)• The resulting CPN can be checked on deadlock, i.e., will the PHM session manager
get stuck?
Ø Compact specification• Usually, CPN are much more compact than statecharts
Ø Variability• The pages are modular, i.e., can be exchanged for variants easily (e.g., other
locking scheme)
115
![Page 116: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/116.jpg)
Fakultät Informatik - Institut Software- und Multimediatechnik - Softwaretechnologie – Prof. Aßmann - Softwaretechnologie II
3.4 Parallel Composition of Colored Petri Nets
116
![Page 117: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/117.jpg)
Softwaretechnologie II
Parallel Composition of PN and Unforeseen Extension withSynchronization Protocol Pages
► Complex synchronization protocols can be abstracted to a pattern(als called transition page or a place page)
► Synchronization protocols can be overlayed to existing sequential specifications by joining synchronization transition pages
► Weaving Patterns for Synchronization Protocols with AND Composition
117
n Complex synchronization protocols can be abstracted to a transition page
n Weaving them with AND, they can be overlayed to existing sequential specifications
![Page 118: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/118.jpg)
Softwaretechnologie II
Semaphores For Mutual Exclusion Revisited
Ø The synchronization transition page forms a synchronisation aspect via ANDed Begin/Commit transaction transitions
Synchronization transition page(Transaction Page)
A:Begin Z:Commit
A Z
A Z
118
![Page 119: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/119.jpg)
Fakultät Informatik - Institut Software- und Multimediatechnik - Softwaretechnologie – Prof. Aßmann - Softwaretechnologie II
3.4.2 Extension of CPN
119
![Page 120: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/120.jpg)
Softwaretechnologie II
CPN can be Easily Extended
► By AND- and OR-composition, every CPN can be extended later■ Planned■ Unforeseen
► OR-composition retains the contracts of the original specification
► AND-composition restricts the original specification
Ø AND-Merge and OR-Merge of CPN are sufficient basic composition operatorsfor building complex extension tools• such as aspect weavers for workflow languages• product-line tools
120
AND-weaving for synchronization
OR-weaving for functional extension
![Page 121: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/121.jpg)
Softwaretechnologie II
Unforeseeable Extensible Workflows(Workflow Views)
Ø Workflows are described by Colored Petri Nets (CPN) or languages built on top of CPN:• YAWL language [van der Aalst]• Workflow nets
Ø CPN composition can be used to enriching a workflow core with a workflow aspect:• Place extension (State extension):
adding more edges in and out of a place§ OR-based composition: Core OR view: Core-place is ORed with Aspect-Place
• Transition extension (Activity extension):adding more edges in and out of a transition (activity)§ AND-based composition: Core-transition is ANDed with Aspect-transition
121
![Page 122: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/122.jpg)
Fakultät Informatik - Institut Software- und Multimediatechnik - Softwaretechnologie – Prof. Aßmann - Softwaretechnologie II
3.5 The Application to Modelling
122
![Page 123: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/123.jpg)
Softwaretechnologie II
Petri Nets Generalize UML Behavioral Diagrams
Activity Diagrams► Activity Diagrams are similar to Marked Graphs, but not formally grounded
■ Without markings■ No liveness analysis■ No resource consumption analysis with boundness■ No correspondence to UML-Statechart
► Difficult to prove something about activity diagrams and difficult to generate parallel code
Data-flow diagrams► DFD are special form of activity diagrams
► Non-shared-memory DFD correspond to Marked Graphs
Statecharts► Finite automata are restricted form of Petri nets► Hierarchical structuring in Statecharts is available in High-Level Petri Nets
(e.g., CPN)
123
![Page 124: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/124.jpg)
Softwaretechnologie II
Petri Nets Generalize UML Sequence Diagrams
Ø The life lines of a sequence diagram can be grouped into state such that a PN results
Ø All of a sudden, liveness conditions can be studied• Is there a deadlock in the sequence diagram?• Are objects treated fair?
Customer Service Station
Credit Card System Purchase Refuel
refuel()verify()
not okdenied
payCash()refuel()
124
![Page 125: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/125.jpg)
Softwaretechnologie II
Petri Nets Generalize UML Sequence Diagrams
Ø The life lines of a sequence diagram can be grouped into state such that a PN results
Ø All of a sudden, liveness conditions can be studied• Is there a deadlock in the sequence diagram?• Are objects treated fair?
Customer Service Station
Credit Card System Purchase Refuel
refuel()
verify()
not okdenied
payCash()
refuel()
125
![Page 126: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/126.jpg)
Softwaretechnologie II
A Simple Modelling Process for Safety-Critical Software withCPN
► Elaboration:1. Identify active and passive parts of the system
. Active become transitions, passive to places2. Find the relations between places and transitions3. How should the tokens look like: boolean? Integers? Structured data?
. Active become transitions, passive to places
► Restructure: Group out subnets to separate ”pages”
► Refactor: Simplify by reduction rules
► Verify: Analyse the specification on liveness, boundedness, reachability graphs, fairness. Use a model checker to verify the CPN
► Transform Representation: Produce views as statecharts, sequence, collaboration, and activity diagrams.
126
![Page 127: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/127.jpg)
Softwaretechnologie II
How to Solve the Reactor Software Problem?
► Specify the reactor core with UML and CPN► Map the static parts to the net► Map the flow of things to tokens► Map the state chances to token flow► Think about synchronizations► Specify in PN views
■ Verify it with a model checker■ Let a prototype be generated■ Test it■ Freeze the assembler
► Verify the assembler, because you should not trust the CPN tool nor the compiler■ Any certification agency in the world will require a proof of the assembler!
► However, this is much simpler than programming reactors by hand...
127
![Page 128: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/128.jpg)
Softwaretechnologie II
The Gloomy Future of PN
► PN will become the major tool in a future CASE tool or IDEs■ Different views on the PN: state chart view, sequence view, activity view,
collaboration view!
► Many isolated tools for PN exist, and the world waits for a full integration into UML
► CPN will be applied in scenarios where parallelism is required■ Architectural languages■ Web service langauges (BPEL, BPMN, ...)■ Workflow languages■ Coordination languages
128
![Page 129: 3. Modelling Dynamic Behavior with Petri Netsst.inf.tu-dresden.de/files/teaching/ws16/swt2/slides/03...Over many years developed within GMD (now Fraunhofer, FhG) PNs specify diagrammatically:](https://reader033.vdocuments.us/reader033/viewer/2022051823/5fed41c4a080a66c4a7646d3/html5/thumbnails/129.jpg)
Softwaretechnologie II
The End
Ø Thanks to Björn Svensson for help to summarize [Murata] in slidesØ Thanks to Dr. Sebastian Götz for drawings
129