tutorial - philadelphia university
TRANSCRIPT
![Page 1: Tutorial - Philadelphia University](https://reader031.vdocuments.site/reader031/viewer/2022012508/61853f639fff5875c2191f9b/html5/thumbnails/1.jpg)
Tutorial
![Page 2: Tutorial - Philadelphia University](https://reader031.vdocuments.site/reader031/viewer/2022012508/61853f639fff5875c2191f9b/html5/thumbnails/2.jpg)
1
![Page 3: Tutorial - Philadelphia University](https://reader031.vdocuments.site/reader031/viewer/2022012508/61853f639fff5875c2191f9b/html5/thumbnails/3.jpg)
Algebraic specifications of Abstract
Data Types Exceptional behavior on the erroneous
arguments
![Page 4: Tutorial - Philadelphia University](https://reader031.vdocuments.site/reader031/viewer/2022012508/61853f639fff5875c2191f9b/html5/thumbnails/4.jpg)
The Stack example
fmod STACK is sorts Stack NeStack Element . subsort NeStack < Stack . op emptystack : -> Stack . op push : Stack Element -> NeStack . op pop : NeStack -> Stack . op top : NeStack -> Element . var S : Stack . var X : Element . eq pop(push(S, X)) = S . eq top(push(S, X)) = X .
endfm
![Page 5: Tutorial - Philadelphia University](https://reader031.vdocuments.site/reader031/viewer/2022012508/61853f639fff5875c2191f9b/html5/thumbnails/5.jpg)
The List example
fmod LIST is sorts List NeList Element . subsort NeList < List . op nil : -> List . op _._ : Element List -> NeList . op head : NeList -> Element . op tail : NeList -> List . var L : List . var E : Element . eq head(E.L) = E . eq tail(E.L) = L .
endfm
![Page 6: Tutorial - Philadelphia University](https://reader031.vdocuments.site/reader031/viewer/2022012508/61853f639fff5875c2191f9b/html5/thumbnails/6.jpg)
The Queue example
fmod QUEUE is
sorts Queue NeQueue Element.
subsort NeQueue < Queue .
op emptyqueue : -> Queue .
op add : Queue Element -> NeQueue .
op remove : NeQueue -> Queue .
op front : NeQueue -> Element .
var X : Element .
var Q : Queue .
eq remove(add(Q, X)) = if Q == emptyqueue
then emptyqueue else add(remove(Q), X)
fi .
eq front(add(Q, X)) = if Q == emptyqueue
then X else front(Q)
fi .
endfm
![Page 7: Tutorial - Philadelphia University](https://reader031.vdocuments.site/reader031/viewer/2022012508/61853f639fff5875c2191f9b/html5/thumbnails/7.jpg)
Petri nets
• Definition
• Graphical structure
![Page 8: Tutorial - Philadelphia University](https://reader031.vdocuments.site/reader031/viewer/2022012508/61853f639fff5875c2191f9b/html5/thumbnails/8.jpg)
Definition Graphical structure
![Page 9: Tutorial - Philadelphia University](https://reader031.vdocuments.site/reader031/viewer/2022012508/61853f639fff5875c2191f9b/html5/thumbnails/9.jpg)
p1 p2
p3
p4
t1
t2
t3 t4
M1 = (1,0,0,1)
M2 = (0,1,0,1)
M3 = (0,0,1,0)
M4 = (0,0,0,1)
Source: The Petri Net Method, by Dr Chris Ling School of Computer Science & Software Engineering, Monash University
Reachability set
![Page 10: Tutorial - Philadelphia University](https://reader031.vdocuments.site/reader031/viewer/2022012508/61853f639fff5875c2191f9b/html5/thumbnails/10.jpg)
Reachability Graph
![Page 11: Tutorial - Philadelphia University](https://reader031.vdocuments.site/reader031/viewer/2022012508/61853f639fff5875c2191f9b/html5/thumbnails/11.jpg)
Matrix analysis
Source: System modelling with Petri nets, Andrea Bobbio, Istituto Elettrotecnico Nazionale Galileo Ferraris, Torino, Italy
![Page 12: Tutorial - Philadelphia University](https://reader031.vdocuments.site/reader031/viewer/2022012508/61853f639fff5875c2191f9b/html5/thumbnails/12.jpg)
II
![Page 13: Tutorial - Philadelphia University](https://reader031.vdocuments.site/reader031/viewer/2022012508/61853f639fff5875c2191f9b/html5/thumbnails/13.jpg)
Specification of data structures
• Algebraic specification
• Z notation
![Page 14: Tutorial - Philadelphia University](https://reader031.vdocuments.site/reader031/viewer/2022012508/61853f639fff5875c2191f9b/html5/thumbnails/14.jpg)
Z notation
• Full notation
– slides 20 – 21
• Short-hand notation (∆ schema)
– Slide 26
![Page 15: Tutorial - Philadelphia University](https://reader031.vdocuments.site/reader031/viewer/2022012508/61853f639fff5875c2191f9b/html5/thumbnails/15.jpg)
Recall State Schema
![Page 16: Tutorial - Philadelphia University](https://reader031.vdocuments.site/reader031/viewer/2022012508/61853f639fff5875c2191f9b/html5/thumbnails/16.jpg)
Operation Schema (full-notation)
![Page 17: Tutorial - Philadelphia University](https://reader031.vdocuments.site/reader031/viewer/2022012508/61853f639fff5875c2191f9b/html5/thumbnails/17.jpg)
Operation Schema (short-hand notation)
![Page 18: Tutorial - Philadelphia University](https://reader031.vdocuments.site/reader031/viewer/2022012508/61853f639fff5875c2191f9b/html5/thumbnails/18.jpg)
Z notation and Object-Z
• Writing Object-Z notation from Z notation and vice-versa
![Page 19: Tutorial - Philadelphia University](https://reader031.vdocuments.site/reader031/viewer/2022012508/61853f639fff5875c2191f9b/html5/thumbnails/19.jpg)
Z notation
Item is the formal generic parameter
Source: The Object-Z Specification Language, Graeme Smith, Software Verification Research Centre University of Queensland, with modification
![Page 20: Tutorial - Philadelphia University](https://reader031.vdocuments.site/reader031/viewer/2022012508/61853f639fff5875c2191f9b/html5/thumbnails/20.jpg)
Object-Z
Source: The Object-Z Specification Language, Graeme Smith, Software Verification Research Centre University of Queensland, with modification
![Page 21: Tutorial - Philadelphia University](https://reader031.vdocuments.site/reader031/viewer/2022012508/61853f639fff5875c2191f9b/html5/thumbnails/21.jpg)
Graph Transformations
• Graph rewrite rule
• Application of graph rewrite rule
– Slides 21-22, 25
![Page 22: Tutorial - Philadelphia University](https://reader031.vdocuments.site/reader031/viewer/2022012508/61853f639fff5875c2191f9b/html5/thumbnails/22.jpg)
![Page 23: Tutorial - Philadelphia University](https://reader031.vdocuments.site/reader031/viewer/2022012508/61853f639fff5875c2191f9b/html5/thumbnails/23.jpg)
![Page 24: Tutorial - Philadelphia University](https://reader031.vdocuments.site/reader031/viewer/2022012508/61853f639fff5875c2191f9b/html5/thumbnails/24.jpg)
Source:Bernhard Westfechtel Lehrstuhl für Informatik III, RWTH Aachen
![Page 25: Tutorial - Philadelphia University](https://reader031.vdocuments.site/reader031/viewer/2022012508/61853f639fff5875c2191f9b/html5/thumbnails/25.jpg)
Type Graph and Instance Graph
Account
balance
Bill
amount
Customer
name
To
Has
:Customer
name=C1
b1:Bill
amount=3
:Account
balance=5
:Account
balance=0
:Customer
name=C2
b2:Bill
amount=2
Pays
Pays Pays
To To
Has
Has
From From From
TG IG
These slides are strongly based on the paper entitled Graph Transformation and Visual Modeling Techniques by Reiko Heckel and Gregor Engels
![Page 26: Tutorial - Philadelphia University](https://reader031.vdocuments.site/reader031/viewer/2022012508/61853f639fff5875c2191f9b/html5/thumbnails/26.jpg)
Petri nets : mutual exclusion
![Page 27: Tutorial - Philadelphia University](https://reader031.vdocuments.site/reader031/viewer/2022012508/61853f639fff5875c2191f9b/html5/thumbnails/27.jpg)
Traffic light
Source: Petri nets, classical Petri nets: The basic model, prof.dr.ir. Will van der Aalst, Technische Universitat Eindoven, University of Technology
![Page 28: Tutorial - Philadelphia University](https://reader031.vdocuments.site/reader031/viewer/2022012508/61853f639fff5875c2191f9b/html5/thumbnails/28.jpg)
Petri nets: producer-consumer
![Page 29: Tutorial - Philadelphia University](https://reader031.vdocuments.site/reader031/viewer/2022012508/61853f639fff5875c2191f9b/html5/thumbnails/29.jpg)
Figure 5: Unbounded buffer
Source: System modelling with Petri nets, Andrea Bobbio, Istituto Elettrotecnico Nazionale Galileo Ferraris, Torino, Italy
Scenario: A token in p1 : P ready to produce Firing t1: P produces Firing t2: P sends produced object to buffer p5, ready to produce again A token in p3 : C ready to consume If an object is in p5, t3 fires and C consumes, C is then ready to consume again
![Page 30: Tutorial - Philadelphia University](https://reader031.vdocuments.site/reader031/viewer/2022012508/61853f639fff5875c2191f9b/html5/thumbnails/30.jpg)
Figure 6: Finite buffer
Source: System modelling with Petri nets, Andrea Bobbio, Istituto Elettrotecnico Nazionale Galileo Ferraris, Torino, Italy
The total number of tokens in p5 and p6 is constant and represents the total available buffer positions If a single token is assigned to p6: strictly sequential ordering of activities
![Page 31: Tutorial - Philadelphia University](https://reader031.vdocuments.site/reader031/viewer/2022012508/61853f639fff5875c2191f9b/html5/thumbnails/31.jpg)
III