EMF-IncQuery gets Sirius: faster and better diagrams kos Horvth , - - PowerPoint PPT Presentation

emf incquery gets sirius
SMART_READER_LITE
LIVE PREVIEW

EMF-IncQuery gets Sirius: faster and better diagrams kos Horvth , - - PowerPoint PPT Presentation

EMF-IncQuery gets Sirius: faster and better diagrams kos Horvth , bel H egeds , Zoltn Ujhelyi IncQuery Labs Ltd. dm Lengyel, Istvn Rth , Dniel Varr Budapest University of Technology and Economics Budapest University of


slide-1
SLIDE 1

Eclipsecon 2015 Budapest University of Technology and Economics Department of Measurement and Information Systems 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

slide-2
SLIDE 2

Eclipsecon 2015

Outline of the talk

2

Motivation and background

Sirius and queries

Interpreter based integration

  • Overview
  • Demo and evaluation

Query-based viewpoint definition

  • Overview
  • Demo and evaluation

Conclusion

  • Current status
  • Future work
  • Main Contributors
  • Ádám Lengyel
  • Ábel Hegedüs
  • Zoltán Ujhelyi
  • István Ráth
  • Ákos Horváth
slide-3
SLIDE 3

Eclipsecon 2015

Introduction

3

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

slide-4
SLIDE 4

Eclipsecon 2015

Motivating scenario: CONCERTO

  • EU-ECSEL project (started in 2013)
  • General MDD toolchain for safety-critical systems
  • Analysis and code generation for component based systems
  • UML based modeling
  • Non-modifiable PSM
  • Simplified Example

4 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 System InPort/OutPort nav2fms :InformationLink Simulink Concerto 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

slide-5
SLIDE 5

Eclipsecon 2015

Background: Sirius

  • Sirius
  • Custom concrete syntax for visualization
  • Tree, table, graph, etc.
  • Provides viewpoint definition over EMF models
  • 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
  • Supports several viewpoints over

the same abstract syntax

5

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

slide-6
SLIDE 6

Eclipsecon 2015

Background: EMF-IncQuery

  • EMF-IncQuery
  • Incremental model query engine
  • Own query language = IQPL
  • declarative
  • graph pattern based

6

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/

slide-7
SLIDE 7

Eclipsecon 2015

IncQuery as a query language in Sirius

slide-8
SLIDE 8

Eclipsecon 2015

VSM Render

Overview: IQPL as query language for Sirius

  • Sirius provides API to provide custom expression

interpreter

  • org.eclipse.sirius.common.expressionInterpreter
  • org.eclipse.sirius.common.proposalProvider

8

  • 4. UI updates

EMF Model

  • B. Change

Notifications

  • A. Model

Modification Live Queries Live Queries

  • 2. Get

queries

  • 3. Query results
  • 1. UI refresh
slide-9
SLIDE 9

Eclipsecon 2015

DEMO

  • Same model query written in
  • MTL
  • AQL
  • IncQuery

Using IncQuery in Sirius

9

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

slide-10
SLIDE 10

Eclipsecon 2015

Evaluation: Interpreted expression

10 5000 10000 15000 20000 25000 30000 35000 MTL AQL EIQ MTL AQL EIQ MTL AQL EIQ Small Medium Large EXECUTION TIME [MS] MODEL SIZE First Execution Recalculation

Models EObjects EReferences EAttributes Diagram nodesDiagram edges Small

3550 34222 9471 12 17

Medium

6994 124708 22129 17 13

Large

63580 1233581 457230 167 6154

  • Profiler was used to

isolate query execution time

  • AQL
  • provides good

performance

  • Low memory

profile

  • IncQuery
  • Recalculations

< 50 ms

  • Requires up to

2x memory

  • Large ~1.2 Gb
slide-11
SLIDE 11

Eclipsecon 2015

Query-based resource

Viewpoints as separate EMF resources

slide-12
SLIDE 12

Eclipsecon 2015

EVM

VIEW MODELS AND SIRIUS

Derived Model EMF Model

  • A. Model

Modification

  • B. Change

Notifications Live Queries Live Transformation Live Queries Live Transformation Derived Model

  • C. Delta

updates

  • C. Delta

updates

  • D. UI refresh
  • D. UI refresh
  • B. Change

Notifications

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

VSM + Render

slide-13
SLIDE 13

Eclipsecon 2015

  • More matches can appear at the same time
  • Ordered execution schema (priority for rules)
  • Internal traceability for created objects
  • Explicit definition
  • Configuration model hides underlying EVM rule definitions
  • Predefined set of manipulation rules available
  • In summary: One way incremental synchronization  arbitrary transformation

Execution of motivating example

1 1

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 function

f_1 f_2 f_3 Trace Trace Trace

a 2 3

appear create add

Query results functionIdentifier

f_1 i_1 f_2 i_2 f_3 i_3

subFunction

f_1 i_1 f_2 i_2

b

appear

4 set

slide-14
SLIDE 14

Eclipsecon 2015

Updating derived models

  • Initial setup of derivation rules
  • EClassifiers, EStructuralFeatures
  • Query result deltas
  • Delta = (Found, Lost, Updated)
  • Based on EMF-IncQuery Event-Driven Virtual machine
  • Integration

architecture

14

Source model Live transformation rules Query engine IncQuery- EVM Derived model

Change notifications Match set delta

Application

Model manipulation Configuration Model manipulation

1 2 3 4

Sirius

UI update

5

slide-15
SLIDE 15

Eclipsecon 2015

DEMO

  • Standard Sirius domain
  • Family representation
  • Incremental synchronization
  • On-the-fly
  • Concerto EMF-UML2
  • Viewpoint for simplified representation

Using IncQuery in Sirius

15

slide-16
SLIDE 16

Eclipsecon 2015

Evaluation - Concerto

  • First time

execution

16

5000 10000 15000 20000 25000 30000 35000

9+16 81+160 201+400 401+800 601+1200 801+1600 1201+2400 RUNTIME [MS] SIZE OF TARGET (VIEW) MODEL (ELEMENTS + REFERENCES) Transformation Transformation + Sirius

Models EObjects EReferences Diagram nodes Diagram edges

9+16 38 89 9 16 81+160 371 890 81 160 201+400 926 2225 201 400 401+800 1851 4450 401 800 601+1200 2776 6675 601 1200 801+1600 3701 8900 801 1600 1201+2400 5551 13350 1201 2400

  • 10+

derivation rules

  • Transformation

~33% of overall runtime

  • Memory

consumption ~3.5x of original model

slide-17
SLIDE 17

Eclipsecon 2015

Evaluation - Concerto

  • Incremental

recalculation

17

200 400 600 800 1000 1200

9+16 81+160 201+400 401+800 601+1200 801+1600 1201+2400 RUNTIME [MS] SIZE OF TARGET (VIEW) MODEL (ELEMENTS + REFERENCES) Deletion Deletion + Sirius

Models EObjects EReferences Diagram nodes Diagram edges

9+16 38 89 9 16 81+160 371 890 81 160 201+400 926 2225 201 400 401+800 1851 4450 401 800 601+1200 2776 6675 601 1200 801+1600 3701 8900 801 1600 1201+2400 5551 13350 1201 2400

  • Transformation

re-execution < 50 ms

  • Refreshing

< 1 s

  • Refreshing is also

faster

slide-18
SLIDE 18

Eclipsecon 2015

Conclusions

What we have done and where to move forward

slide-19
SLIDE 19

Eclipsecon 2015

Conclusions

  • Proof-of-concept version is available
  • IncQuery does well as expected in incremental recalculations
  • Incremental refreshing is not available
  • Would be nice to have explicit API 
  • Usage requires deep knowledge of both Sirius and IncQuery
  • Common base with new EMF-IncQuery Viewers
  • Experience
  • Concerto EU-ECSEL project
  • Works with Papyrus and EMF-UML2!
  • Aimed application scenario
  • Viewpoint definition directly for EMF models (one-to-one mapping)
  • Online synchronization

19

slide-20
SLIDE 20

Eclipsecon 2015

Final points

  • The examples and more details are available form
  • https://github.com/FTSRG/iq-sirius-integration
  • 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!

  • To what direction should we enhance this approach?

20

slide-21
SLIDE 21

Eclipsecon 2015