Gergely Varró, Frederik Deckwerth, Martin Wieber, Andy Schürr
{gergely.varro,frederik.deckwerth,martin.wieber,andy.schuerr}@es.tu-darmstadt.de
10. April 2023 | Real-Time Systems Lab | Prof. Dr. Andy Schürr | Dr. Gergely Varró | 1
An Algorithm for GeneratingModel-Sensitive Search Plans for EMF Models
10. April 2023 | Real-Time Systems Lab | Prof. Dr. Andy Schürr | Dr. Gergely Varró | 2
Railway Systems and Safety Requirements
Developed in the MOGENTES project [www.mogentes.eu]
ro:Route
d:defines
sp:SwPos sw1:Switch
o1:observes
Model
se1:Sensors1:sensors
sw2:Switch
o2:observes
se2:Sensor
i:inPosition
s2:sensors[2]
[1]
Route
defines
SwPos Switch
observes
Sensorsensors
inPosition
Metamodel
{ordered}
sw1 sw2
sp
ro
se1 se2
Ordered reference navigable in one direction
Acknowledgements to Benedek Izsó, István Ráth and Dániel Varró (TU Budapest) for the example.
10. April 2023 | Real-Time Systems Lab | Prof. Dr. Andy Schürr | Dr. Gergely Varró | 3
Ensuring Safety Requirements at Runtime by Pattern Matching
Which sensors, switches and positions must be checked for a route?
ro:Route
d:defines
sp:SwPos sw1:Switch
o1:observes
Model
se1:Sensors1:sensors
sw2:Switch
o2:observes
se2:Sensor
i:inPosition
s2:sensors
RO:Route
defines
SWP:SwPos SW:Switch
observes
SE:Sensorsensors
inPosition
Pattern IDX:Integer[2]
[1]
Route
defines
SwPos Switch
observes
Sensorsensors
inPosition
Metamodel
{ordered}
sensors(RO,IDX,SE)
observes(SE,SW)
inPosition(SW,SWP)
defines(RO,SWP)
ConstraintsRO,IDX,SE,SW,SWP
Variables
Non-binary constraint
Pattern matching
sw1 sw2
sp
ro
se1 se2
10. April 2023 | Real-Time Systems Lab | Prof. Dr. Andy Schürr | Dr. Gergely Varró | 4
Motivation
Pattern matcher application scenarios On-the-fly consistency validation
Ensuring safety requirements at runtime Application condition checks in rule-based model transformation tools
Transformation rules with several elements on the source side Bidirectional model synchronization …
Pattern matcher requirements in an industrial context Efficiency Scalability Standard compliance
Goal Improve the runtime performance of pattern matching Run the pattern matcher on top of EMF models
Search plan: a sequence of operations
10. April 2023 | Real-Time Systems Lab | Prof. Dr. Andy Schürr | Dr. Gergely Varró | 5
Search Plan Driven Pattern Matching I.
ro:Route
d:defines
sp:SwPos sw1:Switch
o1:observes
Model
se1:Sensors1:sensors
sw2:Switch
o2:observes
se2:Sensor
i:inPosition
s2:sensors
RO:Route
defines
SWP:SwPos SW:Switch
observes
SE:Sensorsensors
inPosition
Pattern IDX:Integer
roRO
IDX
SE
SW
SWP
B
F
F
F
F
roRO
IDX
SE
SW
spSWP
B
F
F
F
B
roRO
IDX
SE
sw1SW
spSWP
B
F
F
B
B
roRO
1IDX
se1SE
sw1SW
spSWP
B
B
B
B
B
BB
B
F
F
F
F
[2][1]
Adornment: binding information for all variablesOperation: navigation along a defines edge from a Route to a SwPosOperation adornment: binding preconditionRO and SWP must be bound and free, respectively
Free variable SWP gets bound by the operation
BFFFF sensors(RO,IDX,SE) BFFBFFBBBFFFB BBBBBBFdefines(RO,SWP) inPosition(SW,SWP) FB
observes(SE,SW)
(Initial) partial match
Variable RO is Bound (mapped) to ro.Variables IDX, SE, SW and SWP are Free (unmapped).
Pattern matcher performs 4 steps (i.e., traverses 4 matches)
10. April 2023 | Real-Time Systems Lab | Prof. Dr. Andy Schürr | Dr. Gergely Varró | 6
Search Plan Driven Pattern Matching II.
ro:Route
d:defines
sp:SwPos sw1:Switch
o1:observes
Model
se1:Sensors1:sensors
sw2:Switch
o2:observes
se2:Sensor
i:inPosition
s2:sensors
RO:Route
defines
SWP:SwPos SW:Switch
observes
SE:Sensorsensors
inPosition
Pattern IDX:Integer
roRO
IDX
SE
SW
SWP
B
F
F
F
F
roRO
1IDX
se1SE
SW
spSWP
B
B
B
F
B
roRO
1IDX
se1SE
sw1SW
spSWP
B
B
B
B
B
roRO
2IDX
se2SE
SW
spSWP
B
B
B
F
B
roRO
2IDX
se2SE
sw2SW
spSWP
B
B
B
B
B
roRO
IDX
SE
SW
spSWP
B
F
F
F
B
[2][1]
BFFFF sensors(RO,IDX,SE) BFFBFFBBBFFFB BBBBB
observes(SE,SW) BFBBBFB
BFdefines(RO,SWP) inPosition(SW,SWP) FB
sensors(RO,IDX,SE) BFF
Pattern matcher performs 6 steps with the second search plan.
BacktrackingThe number of pattern matching steps is influenced by the used search plan.
Perform search plan optimization (before pattern matching) to reduce the number of steps(during pattern matching)
10. April 2023 | Real-Time Systems Lab | Prof. Dr. Andy Schürr | Dr. Gergely Varró | 7
Search Plan Optimization Space
Each path (from BFFFF to BBBBB) represents a search plan Which is the best one?
Quantitative characterization needed Weights for operations Costs for partial search plans (i.e., path prefixes) Goal: weights and costs characterize the pattern matching traversal process
Algorithm needed (search plan generation algorithm) Goal: find the best search plan (w.r.t. the cost)
BFFFF
observes(SE,SW)
sensors(RO,IDX,SE) BFF
FB
BBBFF
BFFBBBFFFB BBBBB
BBBBF inPosition(SW,SWP) BF
BFdefines(RO,SWP)
inPosition(SW,SWP) FB
BBBFB
BFBBB
sensors(RO,IDX,SE) BFF
BFdefines(RO,SWP) inPosition(SW,SWP) FB
sensors(RO,IDX,SE) BFF
observes(SE,SW) BF
BFdefines(RO,SWP)
observes(SE,SW) BF
10. April 2023 | Real-Time Systems Lab | Prof. Dr. Andy Schürr | Dr. Gergely Varró | 8
Search Plan Generation Approaches
Domain-specific (DS) approaches Operation weights and search plan costs
From the metamodel: type and multiplicity information Independent from the model
Always the same search plan for all models Model-sensitive (MS) approaches
Operation weights and search plan costs From model statistics: number of objects/links of a certain type
Different search plans for different models
BFFFF
observes(SE,SW)
sensors(RO,IDX,SE) BFF
FB
BBBFF
BFFBBBFFFB BBBBB
BBBBF inPosition(SW,SWP) BF
BFdefines(RO,SWP)
inPosition(SW,SWP) FB
BBBFB
BFBBB
sensors(RO,IDX,SE) BFF
BFdefines(RO,SWP) inPosition(SW,SWP) FB
sensors(RO,IDX,SE) BFF
observes(SE,SW) BF
BFdefines(RO,SWP)
observes(SE,SW) BF
10. April 2023 | Real-Time Systems Lab | Prof. Dr. Andy Schürr | Dr. Gergely Varró | 9
Model-Sensitive Search Plan Generation Approaches
[1] Giese, Hildebrandt, Seibel: Improved Flexibility and Scalability by Interpreting Story Diagrams
[2] Geiß, Batz, Grund, Hack, Szalkowski: GrGen: A Fast SPO-Based Graph Rewriting Tool
[3] Varró, Varró, Friedl: Adaptive Graph Pattern Matching for Model Transformations Using Model-Sensitive Search Plans
Binary
Cost functionSupported constraints
Model representation
Search plan generation algorithm
GrGen [2]
VIATRA [3]
Fujaba [1]
Simple (product)Own Graph
BinarySimple (sum)Own Graph
Current approach
BinaryN/AEMFBuilt-in greedy
ArbitraryComplex
(pluggable)EMF
(pluggable) Dynamic
programming
4 3 2 1 0
10. April 2023 | Real-Time Systems Lab | Prof. Dr. Andy Schürr | Dr. Gergely Varró | 10
Dynamic Programming Based Search Plan Generation Algorithm
Dynamic programming Table is filled out iteratively
Columns: number of free variables in the initial adornment (+1)
BFFFF
observes(SE,SW)
sensors(RO,IDX,SE) BFF
FB
BBBFF
BFFBBBFFFB BBBBB
BBBBF inPosition(SW,SWP) BF
BFdefines(RO,SWP)
inPosition(SW,SWP)
observes(SE,SW) BF
FB
BBBFB
BFBBB
sensors(RO,IDX,SE) BFF
BFdefines(RO,SWP) inPosition(SW,SWP) FB
sensors(RO,IDX,SE) BFF
observes(SE,SW) BF
BFdefines(RO,SWP)
4 3 2 1 0
BFFFF has 4 free variables
4 3 2 1 0
10. April 2023 | Real-Time Systems Lab | Prof. Dr. Andy Schürr | Dr. Gergely Varró | 11
Algorithmic Problems I.
Exponential number of adornments (25) Store only a limited number of adornments in each column Limit
User-defined parameter of the algorithm (e.g., k=2 in our example) Trade-off between efficiency and optimality Number of rows defined by k
BFFFF
observes(SE,SW)
sensors(RO,IDX,SE) BFF
FB
BBBFF
BFFBBBFFFB BBBBB
BBBBF inPosition(SW,SWP) BF
BFdefines(RO,SWP)
inPosition(SW,SWP)
observes(SE,SW) BF
FB
BBBFB
BFBBB
sensors(RO,IDX,SE) BFF
BFdefines(RO,SWP) inPosition(SW,SWP) FB
sensors(RO,IDX,SE) BFF
observes(SE,SW) BF
BFdefines(RO,SWP)
4 3 2 1 0
1
2
10. April 2023 | Real-Time Systems Lab | Prof. Dr. Andy Schürr | Dr. Gergely Varró | 12
Algorithmic Problems II.
Unnecessary recalculations in case of shared path suffixes Store only the best of those path prefixes that end at the same adornment Adornment check required when inserting into the table
BFFFF
observes(SE,SW)
sensors(RO,IDX,SE) BFF
FB
BBBFF
BFFBB BBBBB
BBBBF inPosition(SW,SWP) BF
BFdefines(RO,SWP)
inPosition(SW,SWP) FB
BBBFB
BFBBB
sensors(RO,IDX,SE) BFF
BFdefines(RO,SWP) inPosition(SW,SWP) FB
sensors(RO,IDX,SE) BFF
observes(SE,SW) BF
BFdefines(RO,SWP)
4 3 2 1 0
observes(SE,SW) BF
BFFFB
1
2
4 3 2 1 0
10. April 2023 | Real-Time Systems Lab | Prof. Dr. Andy Schürr | Dr. Gergely Varró | 13
Algorithmic Problems III.
Best search plan Sorted columns in increasing order according to the search plan costs Search plan cost comparison required when inserting into the table
BFFFF
observes(SE,SW)
sensors(RO,IDX,SE) BFF
FB
BBBFF
BFFBBBFFFB BBBBB
BBBBF inPosition(SW,SWP) BF
BFdefines(RO,SWP)
inPosition(SW,SWP)
observes(SE,SW) BF
FB
BBBFB
BFBBB
sensors(RO,IDX,SE) BFF
BFdefines(RO,SWP) inPosition(SW,SWP) FB
sensors(RO,IDX,SE) BFF
observes(SE,SW) BF
BFdefines(RO,SWP)
4 3 2 1 0
1
2
4 3 2 1 0
10. April 2023 | Real-Time Systems Lab | Prof. Dr. Andy Schürr | Dr. Gergely Varró | 14
Algorithmic Problems IV.
Adornments without outgoing edges Reachability analysis required when inserting into the table
Not discussed now
BFFFF
observes(SE,SW)
sensors(RO,IDX,SE) BFF
FB
BBBFF
BFFBBBFFFB BBBBB
BBBBF inPosition(SW,SWP) BF
BFdefines(RO,SWP)
inPosition(SW,SWP)
observes(SE,SW) BF
FB
BBBFB
BFBBB
sensors(RO,IDX,SE) BFF
BFdefines(RO,SWP) inPosition(SW,SWP) FB
sensors(RO,IDX,SE) BFF
observes(SE,SW) BF
BFdefines(RO,SWP)
4 3 2 1 0
1
2
4 3 2 1 0
10. April 2023 | Real-Time Systems Lab | Prof. Dr. Andy Schürr | Dr. Gergely Varró | 15
Algorithm Data Structures
BFFFF
observes(SE,SW)
sensors(RO,IDX,SE) BFF
FB
BBBFF
BFFBBBFFFB BBBBB
BBBBF inPosition(SW,SWP) BF
BFdefines(RO,SWP)
inPosition(SW,SWP) FB
BBBFB
BFBBB
sensors(RO,IDX,SE) BFF
BFdefines(RO,SWP) inPosition(SW,SWP) FB
sensors(RO,IDX,SE) BFF
observes(SE,SW) BF
BFdefines(RO,SWP)
observes(SE,SW) BF
1
2
4 3 2 1 0
BF B***F 1
sensors(RO,IDX,SE)
defines(RO,SWP)
BFF BFF** 2
BFFFF 10
Adornment
Applicable operations
Operation weights(sorted in an increasing order)
Search plancost
Search plan(no operations applied yet)
State
10. April 2023 | Real-Time Systems Lab | Prof. Dr. Andy Schürr | Dr. Gergely Varró | 16
Algorithm Initialization
BFFFF
observes(SE,SW)
sensors(RO,IDX,SE) BFF
FB
BBBFF
BFFBBBFFFB BBBBB
BBBBF inPosition(SW,SWP) BF
BFdefines(RO,SWP)
inPosition(SW,SWP) FB
BBBFB
BFBBB
sensors(RO,IDX,SE) BFF
BFdefines(RO,SWP) inPosition(SW,SWP) FB
sensors(RO,IDX,SE) BFF
observes(SE,SW) BF
BFdefines(RO,SWP)
observes(SE,SW) BF
1
2
4 3 2 1 0
34
BF B***F 1
sensors(RO,IDX,SE)
defines(RO,SWP)
BFF BFF** 2
BFFFF 10
2
1
Initial state goes to the top-left field
34
10. April 2023 | Real-Time Systems Lab | Prof. Dr. Andy Schürr | Dr. Gergely Varró | 17
Algorithm
BF B***F 1
sensors(RO,IDX,SE)
defines(RO,SWP)
BFF BFF** 2
BFFFF 10
1
2
4 3 2 1 0
defines(RO,SWP) BF B***F 1
1 BFFFB 1
2
1 Iterative process On the columns in decreasing order On the rows in increasing order On the applicable operations in weight
increasing order Each iteration creates a new state
BFFFF
observes(SE,SW)
sensors(RO,IDX,SE) BFF
FB
BBBFF
BFFBBBFFFB BBBBB
BBBBF inPosition(SW,SWP) BF
BFdefines(RO,SWP)
inPosition(SW,SWP) FB
BBBFB
BFBBB
sensors(RO,IDX,SE) BFF
BFdefines(RO,SWP) inPosition(SW,SWP) FB
sensors(RO,IDX,SE) BFF
observes(SE,SW) BF
BFdefines(RO,SWP)
observes(SE,SW) BF
10. April 2023 | Real-Time Systems Lab | Prof. Dr. Andy Schürr | Dr. Gergely Varró | 18
Algorithm
BF B***F 1
sensors(RO,IDX,SE)
defines(RO,SWP)
BFF BFF** 2
4BFFFF 10
1
2
4 3 2 1 0
BF B***F 1
sensors(RO,IDX,SE)
defines(RO,SWP)
BFF BFF** 2
1 BFFFB 1
inPosition(SW,SWP) FB ***FB 1
The new state has 3 free variables
3
2
1
BFFFF
observes(SE,SW)
sensors(RO,IDX,SE) BFF
FB
BBBFF
BFFBBBFFFB BBBBB
BBBBF inPosition(SW,SWP) BF
BFdefines(RO,SWP)
inPosition(SW,SWP) FB
BBBFB
BFBBB
sensors(RO,IDX,SE) BFF
BFdefines(RO,SWP) inPosition(SW,SWP) FB
sensors(RO,IDX,SE) BFF
observes(SE,SW) BF
BFdefines(RO,SWP)
observes(SE,SW) BF
2
3
1
10. April 2023 | Real-Time Systems Lab | Prof. Dr. Andy Schürr | Dr. Gergely Varró | 19
Algorithm
4
1
2
4 3 2 1 0
BF B***F 1
sensors(RO,IDX,SE)
defines(RO,SWP)
BFF BFF** 2
BFFFF 1
BF B***F 1
sensors(RO,IDX,SE)
defines(RO,SWP)
BFF BFF** 2
1 BFFFB 10
inPosition(SW,SWP) FB ***FB 1
sensors(RO,IDX,SE) BFF BFF** 2
2 BBBFF 2
BF B***F 1defines(RO,SWP)
observes(SE,SW) BF **BF* 1
BFFFF
BBBFF
BFFBBBFFFBBFdefines(RO,SWP)
sensors(RO,IDX,SE) BFF
observes(SE,SW) BF
BFdefines(RO,SWP)
sensors(RO,IDX,SE) BFF
inPosition(SW,SWP) FB
2
2
1
10. April 2023 | Real-Time Systems Lab | Prof. Dr. Andy Schürr | Dr. Gergely Varró | 20
Algorithm
1
2
4 3 2 1 0
BF B***F 1
sensors(RO,IDX,SE)
defines(RO,SWP)
BFF BFF** 2
4BFFFF 10
3
BF B***F 1
sensors(RO,IDX,SE)
defines(RO,SWP)
BFF BFF** 2
1 BFFFB 1
inPosition(SW,SWP) FB ***FB 1
2
BF B***F 1
sensors(RO,IDX,SE)
defines(RO,SWP)
BFF BFF** 2
2 BBBFF 2
observes(SE,SW) BF **BF* 1
1
2
1
10. April 2023 | Real-Time Systems Lab | Prof. Dr. Andy Schürr | Dr. Gergely Varró | 21
Algorithm
3
1
2
4 3 2 1 0
BF B***F 1
sensors(RO,IDX,SE)
defines(RO,SWP)
BFF BFF** 2
1 BFFFB 1
inPosition(SW,SWP) FB ***FB 1 BF B***F 1
sensors(RO,IDX,SE)
defines(RO,SWP)
BFF BFF** 2
2 BBBFF 2
observes(SE,SW) BF **BF* 1
BF B***F 1
sensors(RO,IDX,SE)
defines(RO,SWP)
BFF BFF** 2
2 BFFBB 1
observes(SE,SW) FB **FB* 1
inPosition(SW,SWP) FB ***FB 1
2 1
Same adornment? NoBetter search
plan?No
0
2
1
10. April 2023 | Real-Time Systems Lab | Prof. Dr. Andy Schürr | Dr. Gergely Varró | 22
Algorithm
1
2
4 3 2 1
2
BF B***F 1
sensors(RO,IDX,SE)
defines(RO,SWP)
BFF BFF** 2
2 BBBFF 2
observes(SE,SW) BF **BF* 1
BF B***F 1
sensors(RO,IDX,SE)
defines(RO,SWP)
BFF BFF** 2
2 BFFBB 1
observes(SE,SW) FB **FB* 1
inPosition(SW,SWP) FB ***FB 1
3
BF B***F 1
sensors(RO,IDX,SE)
defines(RO,SWP)
BFF BFF** 2
1 BFFFB 1
inPosition(SW,SWP) FB ***FB 1
BF B***F 1
sensors(RO,IDX,SE)
defines(RO,SWP)
BFF BFF** 2
3 BBBFB 2
observes(SE,SW) BF **BF* 1
inPosition(SW,SWP) FB ***FB 1
10
2
2
1
10. April 2023 | Real-Time Systems Lab | Prof. Dr. Andy Schürr | Dr. Gergely Varró | 23
Algorithm
1
1
2
4 3 2 1 0
BF B***F 1
sensors(RO,IDX,SE)
defines(RO,SWP)
BFF BFF** 2
2 BBBFF 2
observes(SE,SW) BF **BF* 1
BF B***F 1
sensors(RO,IDX,SE)
defines(RO,SWP)
BFF BFF** 2
2 BFFBB 1
observes(SE,SW) FB **FB* 1
inPosition(SW,SWP) FB ***FB 1
BF B***F 1
sensors(RO,IDX,SE)
defines(RO,SWP)
BFF BFF** 2
3 BBBFB 2
observes(SE,SW) BF **BF* 1
inPosition(SW,SWP) FB ***FB 1
BF B***F 1
sensors(RO,IDX,SE)
defines(RO,SWP)
BFF BFF** 2
4 BBBFB 2
BF B***F 1
sensors(RO,IDX,SE)
defines(RO,SWP)
BFF BFF** 2
4 BBBBF 2
observes(SE,SW) BF **BF* 1
inPosition(SW,SWP) BF ***BF 1/2
0
Same adornment? YesBetter search
plan?No No
2
02
1
10. April 2023 | Real-Time Systems Lab | Prof. Dr. Andy Schürr | Dr. Gergely Varró | 24
Algorithm
1
1
2
4 3 2 1 0
BF B***F 1
sensors(RO,IDX,SE)
defines(RO,SWP)
BFF BFF** 2
2 BBBFF 2
observes(SE,SW) BF **BF* 1
BF B***F 1
sensors(RO,IDX,SE)
defines(RO,SWP)
BFF BFF** 2
2 BFFBB 1
observes(SE,SW) FB **FB* 1
inPosition(SW,SWP) FB ***FB 1
BF B***F 1
sensors(RO,IDX,SE)
defines(RO,SWP)
BFF BFF** 2
3 BBBFB 2
observes(SE,SW) BF **BF* 1
inPosition(SW,SWP) FB ***FB 1
BF B***F 1
sensors(RO,IDX,SE)
defines(RO,SWP)
BFF BFF** 2
4 BBBBF 2
observes(SE,SW) BF **BF* 1
inPosition(SW,SWP) BF ***BF 1/2
BF B***F 1defines(RO,SWP)
3 BFBBB 1
observes(SE,SW) FB **FB* 1
inPosition(SW,SWP) FB ***FB 1
BF B***F 1
sensors(RO,IDX,SE)
defines(RO,SWP)
BFF BFF** 2
4 BBBBB 2
observes(SE,SW) BB **BB*
inPosition(SW,SWP) FB ***FB 1
No valid continuation
2
02
1
10. April 2023 | Real-Time Systems Lab | Prof. Dr. Andy Schürr | Dr. Gergely Varró | 25
Algorithm
1
1
2
4 3 2 1 0
BF B***F 1
sensors(RO,IDX,SE)
defines(RO,SWP)
BFF BFF** 2
2 BBBFF 2
observes(SE,SW) BF **BF* 1
BF B***F 1
sensors(RO,IDX,SE)
defines(RO,SWP)
BFF BFF** 2
2 BFFBB 1
observes(SE,SW) FB **FB* 1
inPosition(SW,SWP) FB ***FB 1
BF B***F 1
sensors(RO,IDX,SE)
defines(RO,SWP)
BFF BFF** 2
3 BBBFB 2
observes(SE,SW) BF **BF* 1
inPosition(SW,SWP) FB ***FB 1
BF B***F 1
sensors(RO,IDX,SE)
defines(RO,SWP)
BFF BFF** 2
4 BBBBF 2
observes(SE,SW) BF **BF* 1
inPosition(SW,SWP) BF ***BF 1/2
BF B***F 1
sensors(RO,IDX,SE)
defines(RO,SWP)
BFF BFF** 2
4 BBBBB 2
observes(SE,SW) BB **BB*
inPosition(SW,SWP) FB ***FB 1
BF B***F 1
sensors(RO,IDX,SE)
defines(RO,SWP)
BFF BFF** 2
5 BBBBB 2
inPosition(SW,SWP) FB ***FB 1
BF B***F 1
sensors(RO,IDX,SE)
defines(RO,SWP)
BFF BFF** 2
5 BBBBB 2
observes(SE,SW) BF **BF* 1
sensors(RO,IDX,SE) BFF BFF** 2
5 BBBBF 1
observes(SE,SW) BF **BF* 1
inPosition(SW,SWP) BF ***BF 1/2
sensors(RO,IDX,SE) BFF BFF** 2
6 BBBBF 2
observes(SE,SW) BF **BF* 1
BF B***F 1defines(RO,SWP)
Same adornment?Better search plan?
No
Yes
0
1
10. April 2023 | Real-Time Systems Lab | Prof. Dr. Andy Schürr | Dr. Gergely Varró | 26
Algorithm
1
2
4 3 2 1 0
BF
sensors(RO,IDX,SE)
defines(RO,SWP)
BFF
observes(SE,SW) BB
inPosition(SW,SWP) FB
B***F 1
BFF** 2
4 BBBBB 2
**BB*
***FB 1
Algorithm returns the search plan in T[0][1]
10. April 2023 | Real-Time Systems Lab | Prof. Dr. Andy Schürr | Dr. Gergely Varró | 27
Measurement Results I.
Eager strategy (k=1) suffices in practical cases? Larger k can be better even for small patterns
10. April 2023 | Real-Time Systems Lab | Prof. Dr. Andy Schürr | Dr. Gergely Varró | 28
Measurement Results II.
Search plan cost function makes sense Good correlation between search plan cost and pattern matching steps
10. April 2023 | Real-Time Systems Lab | Prof. Dr. Andy Schürr | Dr. Gergely Varró | 29
Measurement Results III.
Model-sensitive (MS) search plans outperform domain-specific (DS) ones On all test models By nearly 400 steps in average When the pattern has many edges with arbitrary multiplicity
10. April 2023 | Real-Time Systems Lab | Prof. Dr. Andy Schürr | Dr. Gergely Varró | 30
Summary
Pattern matcher Improve runtime performance: reduced number of PM steps Fully implemented Flexible and embeddable into different tools
Model-sensitive search plans Operation weights from the model First such solution for EMF
Search plan generation algorithm General n-ary operations Complex cost functions (not only addition/multiplication) Parameterization: trade-off between efficiency and optimality Usable without the pattern matcher
Complex attribute manipulation in bidirectional transformation
Top Related