concurrency reification in the xdsml with moccml

14
17/03/2016 1 Joël Champeau (Lab-STICC – ENSTA Bretagne) [email protected] Concurrency reification in the xDSML with MoCCML Gemoc Final Workshop, March 17 th , 2016

Upload: benoit-combemale

Post on 16-Jan-2017

212 views

Category:

Software


2 download

TRANSCRIPT

Page 1: Concurrency reification in the xDSML with MoCCML

17/03/2016

1

Joël Champeau (Lab-STICC – ENSTA Bretagne)[email protected]

Concurrency reification in the xDSML with MoCCMLGemoc Final Workshop, March 17 th, 2016

Page 2: Concurrency reification in the xDSML with MoCCML

17/03/2016

2

The MoCCML approach

Gemoc Final Workshop - 2

DSE

Page 3: Concurrency reification in the xDSML with MoCCML

17/03/2016

3

import 'platform:/resource/org.gemoc.sigpmldomain/model/si gpmldomain.ecore'--import './sigpmldomain.ecore'

ECLimport "platform:/resource/org.gemoc.sigpmltuto.mocc/mocc/SigpmlTuto.moccml"--ECLimport "./xSigpml.moccml"ECLimport "platform:/plugin/fr.inria.aoste.timesquare.ccslkernel.model/ccsllibrary/kernel.ccslLib" ECLimport "platform:/plugin/fr.inria.aoste.timesquare.ccslkernel.model/ccsllibrary/CCSL.ccslLib"

package sigpml

context Block def : execute : Event = self.execute()

context Connectorinv ConnectorComputing:

let capacity : Integer = self.oclAsType(Connector).capacity inlet inRate : Integer = self.itsInputPort.oclAsType(Port).rate inlet outRate : Integer = self.itsOutputPort.oclAsType(Port).rate inlet currentSize : Integer = self.oclAsType(Connector).currentSize in

Relation ConnectorSDF_PAM (self.itsOutputPort.oclAsType(OutputPort).owner.oclAsType (Block).execute,self.itsInputPort.oclAsType(InputPor

DSE definition and MoCCML Libraries

Gemoc Final Workshop - 3

Focus on DSE and MoCCML specifications

• Domain Model with Execution Function and Data

• DSE = Event definition on EF

• MoCCML definition = Declarative constraints on events

MoCCML LibraryDSE DefinitionExecution Function

Execution Data

Page 4: Concurrency reification in the xDSML with MoCCML

17/03/2016

4

DSE declaration

Gemoc Final Workshop - 4

import 'platform:/resource/org.gemoc.sigpmldomain/model/si gpmldomain.ecore'

ECLimport "platform:/resource/org.gemoc.sigpmltuto.mocc/mocc/SigpmlTuto.moccml"

ECLimport "platform:/plugin/fr.inria.aoste.timesquare.ccslkernel.model/ccsllibrary/kernel.ccslLib"

ECLimport "platform:/plugin/fr.inria.aoste.timesquare.ccslkernel.model/ccsllibrary/CCSL.ccslLib"

package sigpml

context Block

def : execute : Event = self.execute()

context Connector

inv ConnectorSynchronization:

Relation Coincides( self.itsOutputPort.oclAsType(OutputPort).owner.oclAsType(Block).execute,

self.itsInputPort.oclAsType(InputPort).owner.oclAsType(Block).execute )

endpackage

Page 5: Concurrency reification in the xDSML with MoCCML

17/03/2016

5

DSE declaration

Gemoc Final Workshop - 5

context Block

def : execute : Event = self.execute()

context Connector

inv ConnectorComputing:

let capacity : Integer = self.oclAsType(Connector).capacity in

let inRate : Integer = self.itsInputPort.oclAsType(Port).rate in

let outRate : Integer = self.itsOutputPort.oclAsType(Port).rate in

let currentSize : Integer = self.oclAsType(Connector).currentSize in

Relation MoccSDFLike (

self.itsOutputPort.oclAsType(OutputPort).owner.oclAsType (Block).execute,

self.itsInputPort.oclAsType(InputPort).owner.oclAsType(B lock).execute,

capacity,

inRate,

outRate,

currentSize )

endpackage

Page 6: Concurrency reification in the xDSML with MoCCML

17/03/2016

6

MoCCML meta-language

Gemoc Final Workshop - 6

MoCCML language

• Declarative language dedicated to concurrency definition

• Clock-based approach

• Formally defined

• MoCCML = Declarative operators and state machine constraints

MoCCML in Gemoc

• Concurrency definition at meta-level

• Constraints the model events

• Enables simulation and state-space analysis

Towards a Meta-Language for Concurrency Concern in DSLsJulien Deantoni, Papa Issa Diallo, Ciprian Teodorov, Joël Champeau, Benoit Combemale, In Design, Automation and Test in Europe Conference and Exhibition (DATE 2015), 2015

Page 7: Concurrency reification in the xDSML with MoCCML

17/03/2016

7

MoCCML language

Gemoc Final Workshop - 8

MoCCML usage

• Declarative predefined operators in DSE definition

• Reusable and parametric library definitions

Page 8: Concurrency reification in the xDSML with MoCCML

17/03/2016

8

MoCCML language

Gemoc Final Workshop - 9

MoCCML state machine intuitive semantics

• Triggers as Clocks

• Guards as Condition expressions on integer variables

• Action as assignment and arithmetic operators on variables

Page 9: Concurrency reification in the xDSML with MoCCML

17/03/2016

9

MoCCML language

Gemoc Final Workshop - 10

MoCCML models define

• MoCCML relations as a set of constraints on the model events

• The semantics defines a state space with the associated

value of the events

• The acceptable schedules are a set of stepsstep = set of possible occurring events

• Adding MoCCML relation reduces the execution possibilities

Page 10: Concurrency reification in the xDSML with MoCCML

17/03/2016

10

MoCCML language

Gemoc Final Workshop - 11

MoCCML metamodel

Page 11: Concurrency reification in the xDSML with MoCCML

17/03/2016

11

MoCCML model instantiation

• A MoCCML relation is instantiated for each model element

• The execution model is interpreted by the solver

MoCCML instantiation process

Gemoc Final Workshop - 12

ConcurrentExecution

Engine

EF + ED

EF + ED

EF + ED

EF + ED

Page 12: Concurrency reification in the xDSML with MoCCML

17/03/2016

12

Backward DSE Mapping

Gemoc Final Workshop - 13

Feedback Protocol

• How a value returned by an Execution Function influences the decision of the execution engine?

• For language constructs whose control flow depends on runtime data available only at runtime (e.g. DecisionNode).

Page 13: Concurrency reification in the xDSML with MoCCML

17/03/2016

13

Feedback DSE extension

Gemoc Final Workshop - 14

DSE EvaluateGuard:upon evaluateGuardtriggers ActivityEdge.EvaluateGuardreturning resultfeedback:[result] => allow MayExecuteTargetdefault => allow MayNotExecuteTarget

endend

Weaving Concurrency in eXecutable Domain-Specific Modeling Languages (Florent Latombe, Xavier Crégut, Benoît Combemale, Julien Deantoni, Marc Pantel), In 8th ACM SIGPLAN International Conference on Software Language Engineering (SLE 2015), ACM, 2015.

Page 14: Concurrency reification in the xDSML with MoCCML

17/03/2016

14

Concurrency reification in Gemoc

Gemoc Final Workshop - 15

Concurrency specification

• DSE specification including feedback protocol

• MoCCML language− Textual and graphical syntax

− Declarative operators and state machine relations

• MoCCML relations for architecture model to add constraints

related to the mapping

• Relation instantiation at model level to simulate the xDSML in

the Gemoc Studio (Demo ArduinoDesigner)

• Coupled with a state space analysis tooling as an extension of

the Gemoc Studio (Demo ArduinoDesigner)