EMF-IncQuery gets Sirius: faster and better diagrams Ákos Horváth , Ábel H egedüs , Zoltán Ujhelyi IncQuery Labs Ltd. Ádám Lengyel, István Ráth , Dániel Varró Budapest University of Technology and Economics Budapest University of Technology and Economics IncQuery Labs Ltd. Eclipsecon 2015 Department of Measurement and Information Systems
Outline of the talk Main Contributors Motivation and background o Ádám Lengyel Sirius and queries o Ábel Hegedüs o Zoltán Ujhelyi Interpreter based integration o István Ráth • Overview • Demo and evaluation o Ákos Horváth Query-based viewpoint definition • Overview • Demo and evaluation Conclusion • Current status • Future work Eclipsecon 2015 2
Introduction ?? Viewpoint: I don’t need all • Different view of that information underlying model • Abstraction hides Can I define a simplified model? complexity Can I define a viewpoint to visualize it? Maintanence Maintenance: • Incrementally • Incrementally • Immediately • Immediately Eclipsecon 2015 3
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 Concerto Component models Simulink (UML + profiles) FAM_EMS FAM_PilotControl tag: func PilotControl : Function : Function SubS1 SubS2 subFunctions consumer EMS Navigation FAM_Navigation nav2ems provider tag: func tag: func : Function :InformationLink FMS View consumer tag: func FAM_FMS provider nav2fms : Function :InformationLink Id id:Function id:InformationLink Function SubSystem with "func" tag) Id Other SubSystem without tag EMS: Engine Management System FMS: Flight Management System InPort/OutPort Port Blocks More details on Matlab Simulink and Eclipse integration: https://github.com/FTSRG/massif Eclipsecon 2015 4
Background: Sirius Sirius o Custom concrete syntax for visualization • Tree, table, graph, etc. o Provides viewpoint definition over EMF models o 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/ Eclipsecon 2015 5
Background: EMF-IncQuery EMF-IncQuery o Incremental model query engine o Own query language = IQPL • declarative • graph pattern based Model change Always up-to-date results Query Model without model re-traversal Efficient change Evaluator propagation Track changes of your model in terms of queries Updated results Result deltas More details on EMF-IncQuery integration: http://www.eclipse.org/incquery/ Eclipsecon 2015 6
IncQuery as a query language in Sirius Eclipsecon 2015
Overview: IQPL as query language for Sirius Sirius provides API to provide custom expression interpreter o org.eclipse.sirius.common.expressionInterpreter o org.eclipse.sirius.common.proposalProvider Live B. Change Live Queries A. Model Queries Notifications 1. UI refresh Modification 3. Query results 2. Get queries Render VSM EMF Model 4. UI updates Eclipsecon 2015 8
Using IncQuery in Sirius DEMO Same model query written in o MTL receiveSignal() sendSignal() SA: SB: S1: S2: o AQL State State State State o IncQuery SM1: State Machine SM1: State Machine Slave:AppType Master:AppType instanceOf instanceOf :Slave :Master allocatedTo allocatedTo :HostInstance :HostInstance communicates Eclipsecon 2015 9
Evaluation: Interpreted expression Models EObjects EReferences EAttributes Diagram nodesDiagram edges Profiler was used to 3550 34222 9471 12 17 Small 6994 124708 22129 17 13 isolate query Medium 63580 1233581 457230 167 6154 Large execution time AQL 35000 First Execution o provides good 30000 Recalculation performance 25000 o Low memory 20000 profile IncQuery 15000 o Recalculations 10000 EXECUTION TIME [MS] < 50 ms 5000 o Requires up to 2x memory 0 MTL AQL EIQ MTL AQL EIQ MTL AQL EIQ • Large ~1.2 Gb Small Medium Large MODEL SIZE Eclipsecon 2015 10
Query-based resource Viewpoints as separate EMF resources Eclipsecon 2015
V IEW MODELS AND S IRIUS C. Delta updates Live D. UI refresh B. Change Live Derived Queries Notifications Transformation Model A. Model Modification VSM + Render Live EMF Model Live Derived Queries Transformation Model D. UI refresh B. Change C. Delta Notifications updates EVM More details on EVM : http://wiki.eclipse.org/EMFIncQuery/DeveloperDocumentation/EventDrivenVM Eclipsecon 2015
Execution of motivating example More matches can appear at the same time o Ordered execution schema (priority for rules) Internal traceability for created objects o Explicit definition Configuration model hides underlying EVM rule definitions o Predefined set of manipulation rules available In summary: One way incremental synchronization arbitrary transformation Query results Simulink Query results Traceability CCM FAM_PilotControl : Function function subFunction PilotControl tag: func f_1 Trace f_1 i_1 subFunctions SubS1 f_2 Trace f_2 i_2 FAM_Navigation Navigation : Function f_3 Trace functionIdentifier tag: func consumer subFunctions f_1 i_1 FAM_FMS FMS f_2 i_2 : Function tag: func f_3 i_3 a 2 3 b 4 set appear create add appear 1 1 Eclipsecon 2015
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 Live transformation Sirius Application rules 1 Configuration UI update Model manipulation 5 Model manipulation Source model IncQuery- EVM Derived model 4 Match set delta Change notifications 3 2 Query engine Eclipsecon 2015 14
Using IncQuery in Sirius DEMO Standard Sirius domain o Family representation o Incremental synchronization • On-the-fly Concerto EMF-UML2 o Viewpoint for simplified representation Eclipsecon 2015 15
Evaluation - Concerto Models EObjects EReferences Diagram nodes Diagram edges First time 9+16 38 89 9 16 81+160 371 890 81 160 201+400 926 2225 201 400 execution 401+800 1851 4450 401 800 601+1200 2776 6675 601 1200 801+1600 3701 8900 801 1600 10+ 1201+2400 5551 13350 1201 2400 derivation rules 35000 Transformation ~33% of overall 30000 Transformation Transformation + Sirius runtime 25000 Memory 20000 consumption ~3.5x of original 15000 model 10000 RUNTIME [MS] 5000 0 9+16 81+160 201+400 401+800 601+1200 801+1600 1201+2400 SIZE OF TARGET (VIEW) MODEL (ELEMENTS + REFERENCES) Eclipsecon 2015 16
Evaluation - Concerto Models EObjects EReferences Diagram nodes Diagram edges Incremental 9+16 38 89 9 16 81+160 371 890 81 160 201+400 926 2225 201 400 recalculation 401+800 1851 4450 401 800 601+1200 2776 6675 601 1200 801+1600 3701 8900 801 1600 Transformation 1201+2400 5551 13350 1201 2400 re-execution 1200 < 50 ms Refreshing Deletion Deletion + Sirius 1000 < 1 s 800 Refreshing is also faster 600 400 200 RUNTIME [MS] 0 9+16 81+160 201+400 401+800 601+1200 801+1600 1201+2400 SIZE OF TARGET (VIEW) MODEL (ELEMENTS + REFERENCES) Eclipsecon 2015 17
Conclusions What we have done and where to move forward Eclipsecon 2015
Conclusions Proof-of-concept version is available o IncQuery does well as expected in incremental recalculations o Incremental refreshing is not available • Would be nice to have explicit API o Usage requires deep knowledge of both Sirius and IncQuery o Common base with new EMF-IncQuery Viewers Experience o 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 Eclipsecon 2015 19
Final points The examples and more details are available form o https://github.com/FTSRG/iq-sirius-integration o 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? Eclipsecon 2015 20
Eclipsecon 2015
Recommend
More recommend