21
Eclipsecon 2015 Budapest University of Technology and Economics Department of Measurement and Information IncQuery Labs Ltd. EMF-IncQuery gets Sirius: faster and better diagrams Ákos Horváth, Ábel Hegedüs, Zoltán Ujhelyi IncQuery Labs Ltd. Ádám Lengyel, István Ráth, Dániel Varró Budapest University of Technology and Economics

IncQuery gets Sirius: faster and better diagrams

Embed Size (px)

Citation preview

Page 1: IncQuery gets Sirius: faster and better diagrams

Eclipsecon 2015 Budapest University of Technology and EconomicsDepartment of Measurement and Information Systems

IncQuery Labs Ltd.

EMF-IncQuery gets Sirius:faster and better diagrams

Ákos Horváth, Ábel Hegedüs, Zoltán UjhelyiIncQuery Labs Ltd.

Ádám Lengyel, István Ráth, Dániel VarróBudapest University of Technology and Economics

Page 2: IncQuery gets Sirius: faster and better diagrams

Eclipsecon 2015 2

Outline of the talkMotivation and backgroundSirius and queries

Interpreter based integration• Overview• Demo and evaluation

Query-based viewpoint definition• Overview• Demo and evaluation

Conclusion• Current status• Future work

Main Contributorso Ádám Lengyelo Ábel Hegedüso Zoltán Ujhelyio István Rátho Ákos Horváth

Page 3: IncQuery gets Sirius: faster and better diagrams

Eclipsecon 2015 3

Introduction??

I don’t need all that information

Can I define a simplified model?

Can I define a viewpoint

to visualize it?

Maintanence• Incrementally• Immediately

Maintenance:• Incrementally• Immediately

Viewpoint:• Different view of

underlying model• Abstraction hides

complexity

Page 4: IncQuery gets Sirius: faster and better diagrams

Eclipsecon 2015 4

Motivating scenario: CONCERTO EU-ECSEL project (started in 2013)

o General MDD toolchain for safety-critical systems• Analysis and code generation for component based systems• UML based modeling• Non-modifiable PSM

Simplified Example

FAM_PilotControl : Function

FAM_Navigation : Function

FAM_FMS : Function

FAM_EMS : Function

nav2ems:InformationLink

provider

consumer

subFunctions

provider

consumer

PilotControl

SubS1

Navigation

FMS

SubS2

EMS

tag: func

tag: func

tag: func

tag: func

EMS: Engine Management System FMS: Flight Management SystemInPort/OutPort

nav2fms:InformationLink

SimulinkConcerto Component models

(UML + profiles)

Id

Id Other SubSystem without tag

Function SubSystem with "func" tag)

Port Blocks

id:Function id:InformationLink

View

More details on Matlab Simulink and Eclipse integration: https://github.com/FTSRG/massif

Page 5: IncQuery gets Sirius: faster and better diagrams

Eclipsecon 2015 5

Background: Sirius Sirius

o Custom concrete syntax for visualization• Tree, table, graph, etc.

o Provides viewpoint definition over EMF modelso Abstraction can be defined using interpreted

expressions• MTL – Acceleo Model-to-Text language• OCL- Object Constraint language• AQL (recommended as of 3.1) – Acceleo Query Language

o Supports several viewpoints over the same abstract syntax

More details on Sirius: https://eclipse.org/sirius/

Page 6: IncQuery gets Sirius: faster and better diagrams

Eclipsecon 2015 6

Background: EMF-IncQuery EMF-IncQuery

o Incremental model query engineo Own query language = IQPL• declarative• graph pattern based

Query Model

Updated results Result deltas

Evaluator

Model change

Efficient change propagation

Always up-to-date results without model re-traversal

Track changes of your model in terms of queries

More details on EMF-IncQuery integration: http://www.eclipse.org/incquery/

Page 7: IncQuery gets Sirius: faster and better diagrams

Eclipsecon 2015

IncQuery as a query language in Sirius

Page 8: IncQuery gets Sirius: faster and better diagrams

Eclipsecon 2015 8

VSM Render

Overview: IQPL as query language for Sirius Sirius provides API to provide custom expression

interpretero org.eclipse.sirius.common.expressionInterpretero org.eclipse.sirius.common.proposalProvider

4. UI updates

EMF Model

B. ChangeNotificationsA. Model

Modification

Live QueriesLive

Queries

2. Get queries

3. Query results

1. UI refresh

Page 9: IncQuery gets Sirius: faster and better diagrams

Eclipsecon 2015

DEMO

9

Same model query written in oMTLo AQLo IncQuery

Using IncQuery in Sirius

Master:AppType

SM1: State Machine

S1: State

S2: State

sendSignal()

:HostInstance

:Master

Slave:AppType

SM1: State Machine

SA: State

SB: State

receiveSignal()

:HostInstance

:Slave

communicates

allocatedTo allocatedTo

instanceOf instanceOf

Page 10: IncQuery gets Sirius: faster and better diagrams

Eclipsecon 2015 10

Evaluation: Interpreted expression

MTL AQL EIQ MTL AQL EIQ MTL AQL EIQSmall Medium Large

0

5000

10000

15000

20000

25000

30000

35000First Execution

Recalculation

Model Size

Exec

ution

Tim

e [M

s]

Models EObjects EReferences EAttributes Diagram nodes Diagram edgesSmall 3550 34222 9471 12 17Medium 6994 124708 22129 17 13Large 63580 1233581 457230 167 6154

Profiler was used to isolate query execution time

AQL o provides good

performanceo Low memory

profile IncQuery

o Recalculations < 50 ms

o Requires up to 2x memory• Large ~1.2 Gb

Page 11: IncQuery gets Sirius: faster and better diagrams

Eclipsecon 2015

Query-based resource

Viewpoints as separate EMF resources

Page 12: IncQuery gets Sirius: faster and better diagrams

Eclipsecon 2015

EVM

VIEW MODELS AND SIRIUS

DerivedModel

EMF Model

A. Model Modification

B. ChangeNotifications

Live QueriesLive

Transformation

Live QueriesLive

TransformationDerivedModel

C. Delta updates

C. Delta updates

D. UI refresh

D. UI refreshB. ChangeNotifications

More details on EVM: http://wiki.eclipse.org/EMFIncQuery/DeveloperDocumentation/EventDrivenVM

VSM + Render

Page 13: IncQuery gets Sirius: faster and better diagrams

Eclipsecon 2015

More matches can appear at the same timeo Ordered execution schema (priority for rules)

Internal traceability for created objectso Explicit definition

Configuration model hides underlying EVM rule definitionso Predefined set of manipulation rules available

In summary: One way incremental synchronization arbitrary transformation

Execution of motivating example

11

FAM_PilotControl : Function

FAM_Navigation : Function

FAM_FMS : Function

subFunctions

consumer

PilotControl

SubS1

Navigation

FMS

tag: func

tag: func

tag: func

Simulink CCM

subFunctions

Query results Traceability

functionf_1

f_2

f_3

Trace

Trace

Trace

a 2 3appear create add

Query results

functionIdentifierf_1 i_1

f_2 i_2

f_3 i_3

subFunctionf_1 i_1

f_2 i_2

b appear 4 set

Page 14: IncQuery gets Sirius: faster and better diagrams

Eclipsecon 2015 14

Updating derived models Initial setup of derivation rules

o EClassifiers, EStructuralFeatures Query result deltas

o Delta = (Found, Lost, Updated) Based on EMF-IncQuery Event-Driven Virtual machine Integration

architecture

Source model

Live transformation

rules

Query engine

IncQuery- EVM Derived model

Change notifications Match set delta

Application

Model manipulation ConfigurationModel manipulation

1

23

4

Sirius

UI update5

Page 15: IncQuery gets Sirius: faster and better diagrams

Eclipsecon 2015

DEMO

15

Standard Sirius domaino Family representationo Incremental synchronization• On-the-fly

Concerto EMF-UML2o Viewpoint for simplified representation

Using IncQuery in Sirius

Page 16: IncQuery gets Sirius: faster and better diagrams

Eclipsecon 2015 16

Evaluation - Concerto First time

execution

9+16 81+160 201+400 401+800 601+1200 801+1600 1201+24000

5000

10000

15000

20000

25000

30000

35000

Transformation Transformation + Sirius

Size of target (view) model (elements + references)

Runti

me

[Ms]

Models EObjects EReferences Diagram nodes Diagram edges9+16 38 89 9 1681+160 371 890 81 160201+400 926 2225 201 400401+800 1851 4450 401 800601+1200 2776 6675 601 1200801+1600 3701 8900 801 16001201+2400 5551 13350 1201 2400 10+

derivation rules Transformation

~33% of overall runtime

Memory consumption ~3.5x of original model

Page 17: IncQuery gets Sirius: faster and better diagrams

Eclipsecon 2015 17

Evaluation - Concerto Incremental

recalculation

9+16 81+160 201+400 401+800 601+1200 801+1600 1201+24000

200

400

600

800

1000

1200

Deletion Deletion + Sirius

Size of target (view) model (elements + references)Runti

me

[ms]

Models EObjects EReferences Diagram nodes Diagram edges9+16 38 89 9 1681+160 371 890 81 160201+400 926 2225 201 400401+800 1851 4450 401 800601+1200 2776 6675 601 1200801+1600 3701 8900 801 16001201+2400 5551 13350 1201 2400 Transformation

re-execution < 50 ms

Refreshing < 1 s

Refreshing is also faster

Page 18: IncQuery gets Sirius: faster and better diagrams

Eclipsecon 2015

Conclusions

What we have done and where to move forward

Page 19: IncQuery gets Sirius: faster and better diagrams

Eclipsecon 2015 19

Conclusions Proof-of-concept version is available

o IncQuery does well as expected in incremental recalculationso Incremental refreshing is not available

• Would be nice to have explicit API o Usage requires deep knowledge of both Sirius and IncQueryo Common base with new EMF-IncQuery Viewers

Experienceo Concerto EU-ECSEL project

• Works with Papyrus and EMF-UML2!o Aimed application scenario

• Viewpoint definition directly for EMF models (one-to-one mapping)• Online synchronization

Page 20: IncQuery gets Sirius: faster and better diagrams

Eclipsecon 2015 20

Final points The examples and more details are available form

o https://github.com/FTSRG/iq-sirius-integrationo Contributors: • Main: BME-FTSRG, IncQuery Labs Ltd.• Supporting projects: Concerto (EU-Artemis)• (Hopefully) future partner: Obeo

Your contributions (feedback, forum posts, ideas, patches) are very welcome!o To what direction should we enhance this approach?

Page 21: IncQuery gets Sirius: faster and better diagrams

Eclipsecon 2015