<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Concurrency-aware Executable Domain-Specific Modeling Languages as Models of Concurrency</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Florent Latombe</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Xavier Cre´gut</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Marc Pantel</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Universite ́ de Toulouse</institution>
          ,
          <addr-line>IRIT Toulouse</addr-line>
          ,
          <country country="FR">France</country>
        </aff>
      </contrib-group>
      <fpage>12</fpage>
      <lpage>18</lpage>
      <abstract>
        <p>-To deal with the increasing complexity of mod- concerns based on a MoC formalism). The latter are captured ern highly-concurrent systems, the GEMOC approach for in the Semantic Rules, which extend the AS with the data and concurrency-aware eXecutable Domain-Specific Modeling Lan- operational concerns of the semantics. Both are connected by sgeumagaensti(cxsDmS ModLels,) tphreopcoosnecsutroremncaykecoenxpcelircnits, uinsinthge aopMeroadtieolnoafl a third model called the Communication Protocol. Concurrency (MoC). This separation of concerns enables re- The approach from [1], [2], [3] relies on the Event Structures finements (e.g., for sequential or parallel execution platforms) MoC [6], in which partial orders [7] are defined over a set and analyses (e.g., to assess behavioral properties like deadlock- of events. The language-level model, the MoCMapping, is freeness) of the concurrency concerns. This approach initially built using EventType Structures [8]. However, the use of tphreovbideesst ofintlyfoornealMlocoCn:cEurvreenntcSytrpuacrtaudriegsm.Bsuutstehdis inMoxCDSisMnLost, a particular MoC for an xDSML is an important decision: resulting in complex models which are difficult to maintain or it defines which formalism will be used to represent the analyze. Moreover, extending the approach with new MoCs is concurrent aspects of the executable models. Depending on complex: many elements must be integrated, and fit into the the MoC used, different concurrency-aware analyses (usually APIs used by the implementation. We propose to seamlessly relying on existing external tools) may be performed to assess odfefithnee caonndcuirnrteengcrya-taewnaerwe xMDoSCMsLtharpopurgohacah, reencaubrlsiinvge tdheefiunsiteioonf behavioral properties of the models. Moreover, not all MoCs previously-defined xDSMLs as MoCs. This allows xDSMLs to are good fits for all xDSMLs. Depending on the xDSML's always rely on an adequate MoC which also comes tooled with concurrency paradigm, MoCs may be more or less adequate. the generic execution and debugging facilities provided by the Providing only the Event Structures MoC effectively limits concurrency-aware approach. We illustrate this on the definition the approach, or complicates the modeling of some xDSMLs. woforfkUbMenLchi.n the GEMOC Studio, an Eclipse-based language Integrating new MoCs alongside Event Structures is complex, Index Terms-Domain-Specific Modeling Languages; Models since it requires modifying the language workbench in which of Concurrency; Executable Metamodeling the concurrency-aware approach is implemented. In this paper, our contribution consists in a recursive I. INTRODUCTION definition of the concurrency-aware xDSML approach, in Modern complex systems (e.g., Cyber-Physical Systems, which a previously-defined concurrency-aware xDSML can be Internet of Things, etc.) are highly-concurrent and executed used as the MoC of another xDSML, based on the composite on increasingly-parallel platforms (e.g., many-core CPUs, design pattern. This greatly reduces the complexity of defining GPGPU pipelines, etc.). eXecutable Domain-Specific Modeling and integrating new MoCs into the approach. Moreover, the Languages (xDSMLs) can be used to specify such systems, MoC can also benefit from any of the generic execution but in traditional executable metamodeling techniques, the con- and debugging facilities provided for free by the language currency concerns are spread throughout the whole semantics, workbench implementing the concurrency-aware approach. The making difficult its identification, refinement or analysis. A contribution to executable metamodeling techniques is thus novel concurrent executable metamodeling approach has been twofold: we extend the existing concurrency-aware xDSML proposed and refined in [1], [2], [3]: the GEMOC concurrency- approach with the possibility to define and integrate new MoCs, aware xDSML approach. It proposes to make explicit, in the effectively allowing xDSMLs to always rely on an adequate operational semantics of xDSMLs, the concurrency concerns MoC; and we bridge the gap between MoCs (usually defined using a Model of Concurrency (MoC) (e.g., Petri nets [4], the as formalisms dedicated to the modeling of concurrent systems) Actor model [5], Event Structures [6], etc.). In this approach, and software language engineering, effectively providing a comthe concurrency concerns are separated from the data concerns. mon interface to MoCs (i.e., as concurrency-aware xDSMLs). The former are captured in the Model of Concurrency Mapping The rest of this paper is organized as follows. First, (MoCMapping), which specifies how a MoC is systematically in Section II, we illustrate the concurrency-aware xDSML used for models conforming to the Abstract Syntax (AS) approach on an example language, fUML. In Section III, we of the language (i.e., it generates the model's concurrency first show the importance of the adequacy of a MoC for an</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>xDSML. We explain why directly integrating MoCs into the
approach is complex and time-consuming. We then describe
our recursive definition of the approach, illustrated by defining
a new xDSML that we will use as the MoC of fUML. The
upsides and limitations of our contribution are presented in
Section IV. Section V focuses on our implementation in the
GEMOC Studio’s Language Workbench. Finally, we discuss
related work in Section VI; then conclude and give perspectives
for future work in Section VII.</p>
    </sec>
    <sec id="sec-2">
      <title>II. CONCURRENCY-AWARE XDSMLS ILLUSTRATED</title>
    </sec>
    <sec id="sec-3">
      <title>We apply the seminal concurrency-aware xDSML ap</title>
      <p>
        proach [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] to the Foundational Subset for Executable
UML Models (fUML) [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]: an executable subset of UML
Activities.
      </p>
      <sec id="sec-3-1">
        <title>A. Structural Elements</title>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>In Model-Driven Engineering (MDE), a language’s Abstract</title>
      <p>Syntax is usually modeled as a metamodel enhanced with
static semantics, expressed using the Meta-Object Facilities
(MOF) and Object Constraint Language (OCL) from the OMG.
Figure 1 shows an example fUML Activity composed
of nodes (ActivityNode) of various natures, connected
by edges (ActivityEdge). This example models drinking
something while talking. The former consists in checking what
is available on the table (“CheckTableForDrinks” returns at
random “Coffee”, “Tea” or “Neither”), and then executing one
of the three branches depending on what was found on the table.
In this example, concurrency takes place in the branches of</p>
      <sec id="sec-4-1">
        <title>B. Separation of Concerns in the Semantics</title>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>The concurrency-aware approach introduces a separation of</title>
      <p>
        concerns in the operational semantics [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] models.
      </p>
      <p>The data and operational concerns are first captured in the
Semantic Rules. The Execution Data define the dynamic data
in the language (i.e., current state of an automaton, current
tokens in a place, current value of a variable, etc.) and how
they evolve during the execution (i.e., through fired transitions,
executed instructions, etc.). In fUML, Tokens are created
and consumed by the nodes. The Execution Data are thus the
reference currentTokens weaved in the fUML metamodel,
from the ActivityEdge concept to the Token concept. The
execution of nodes is performed by an Execution Function
weaved onto the ActivityNode concept, implemented by the
execute() operation.</p>
      <p>The concurrency concerns are then captured in the Model
of Concurrency Mapping. So far, the approach only supports
Event Structures so the MoCMapping is an EventType Structure
model. In fUML, the core of the MoCMapping essentially
consists in declaring an EventType representing the execution
of an ActivityNode, and in constraining it such that for every
ActivityEdge, its source is executed before its target. This
language-level model is unfolded for each fUML model to
generate the Model of Concurrency Application
(MoCApplication, in our case, an Event Structure) representing the model’s
concurrency concerns.</p>
      <p>
        Finally, both concerns are connected by another
languagelevel model called the Communication Protocol that maps the
MoCTriggers (i.e., the abstract actions of the MoCMapping, that
is the EventTypes of an EventType Structure) and the Execution
Functions of the Semantic Rules. It also includes the Feedback
Protocol, required in fUML for DecisionNodes, which was
motivated and illustrated in [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ].
      </p>
      <p>
        Figure 2 shows an overview of the approach we just
described, as a Class Diagram.
the ForkNode: the “Talk” node can be executed simultaneously
with, or interleaved with, any of the nodes of the drinking
part of the activity. Implementations usually hard code this
decision, or rely upon the underlying execution platform. With
the concurrency-aware approach, all the valid possibilities are
explicitly specified, thus enabling the use of concurrency-aware
analyses, allowing the management of semantic variations [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] or
the refinement of the language for specific execution platforms
(e.g., sequential, highly-parallel, etc.).
      </p>
    </sec>
    <sec id="sec-6">
      <title>III. DEFINING AND INTEGRATING ADDITIONAL MOCS</title>
    </sec>
    <sec id="sec-7">
      <title>This section first motivates the use of other MoCs besides</title>
      <p>
        Event Structures and shows why integrating new MoCs directly
into the approach is complex and time-consuming. Then, we
propose to define and seamlessly integrate new MoCs thanks
to a recursive definition of the concurrency-aware xDSML
approach. This proposal is illustrated by the use of a new MoC dard in both natural language and a reference implementation
based on the notion of Threads instead of Event Structures to in Java1. Neither description is particularly adapted to the
model fUML. use of Event Structures, so the resulting MoCMapping was
A. Adequacy of Models of Concurrency complex. Instead, Petri nets [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] can be considered, since it
originally inspired UML Activity Diagrams. Another practical
      </p>
      <p>
        Several criteria can be used to assess the adequacy of a alternative is to rely on the notion of Thread: a conceptual unit
MoC to model an xDSML’s concurrency concerns. First, there for computation, also known as green threads, or user threads,
is the conceptual proximity with the xDSML’s concurrency as opposed to the operating system’s threads (or kernel threads).
paradigm, or with the systems modeled with the xDSML. In The mapping between these two depends on the implementation
“Why Do Scala Developers Mix the Actor Model with Other of the runtime of the concurrency-aware xDSML approach.
Concurrency Models?” [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ], one of the reasons why a Scala This MoC is convenient for fUML because it corresponds to
code base integrates other MoCs besides the Actor model the MoC provided in Java by the threading API, used for its
promoted by Scala, is because of inadequacies of the actor reference implementation.
model. Using an inadequate MoC increases the chance of Let us detail how the MoCMapping of fUML can be specified
creating deadlocks and data races. Another important factor to using the notions of threads with a set of instructions, and the
account for is the language designer’s experience with MoCs. possibility for a thread to start another thread or to wait for
This was also one of the reasons in [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ] for the mixing of MoCs the end of another thread. An Activity is mapped to the main
in Scala code bases. This can lead to an antipattern known as thread in charge of the activity’s InitialNode and FinalNode.
the Golden Hammer: “if all you have is a hammer, everything The execution of nodes in sequence in an activity can be
looks like a nail”. These two criteria may complicate the use represented by a sequence of instructions in a thread. For
of a MoC, ultimately making the MoCMapping difficult to every ForkNode, one thread is created per branch. It is in
specify or maintain. charge of executing the associated branch’s nodes. Executing
      </p>
      <p>
        Moreover, one of the main benefits of the concurrency-aware the corresponding JoinNode is possible when all these threads
approach lies in being able to formally verify properties of have finished executing their instructions.
systems based on their MoCApplication. Which properties and
verification technologies remains at the discretion of the MoC Figure 3 shows the application of such a mapping on the
used. The formal method community has developed tools and example fUML Activity of Figure 1. The main thread consists
methods for such verifications, e.g., Petri nets [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] are commonly in executing the InitialNode and the ForkNode, which starts the
used for model-checking activities. This may be an important two sub-threads. It then waits for the sub-threads to complete,
factor in selecting which MoC to use, for instance if particular before allowing the execution of the JoinNode and FinalNode.
safety properties must be enforced (e.g., in critical systems). In the first sub-thread, corresponding to the drinking part of the
activity, the corresponding branch is executed as a sequence
B. Integration Cost of Models of Concurrency of instructions. After the DecisionNode and the evaluation of
      </p>
      <p>To integrate new MoCs into the concurrency-aware approach, the guards, depending on the results retrieved, only one of the
two metalanguages have to be considered. First, the MoC drinking nodes is executed before the MergeNode is executed.
itself, to which the MoCApplication is conforming, with its On the second sub-thread, there is just one node corresponding
editor, runtime, and possibly verification tools. Then, the to talking.</p>
      <p>MoCMapping formalism, to which the MoCMapping of an
xDSML is conforming, with its editor and generator (used to 1https://github.com/ModelDriven/fUML-Reference-Implementation
produce the MoCApplication). Besides the merely technical
difficulties of integrating these languages and their associated
tools (provided the language workbench used is even
opensource, or implemented with the abstractions permitting its
extension in the first place), the main issue is that the notion
of MoCMapping is the main novel artefact of the
concurrencyaware xDSML approach. This means that for existing MoCs,
the MoCMapping formalism has to be fully defined and tooled
before being integrated into the approach, which is complex
and time-consuming.</p>
      <p>To overcome these issues, we propose a generic approach to
define and seamlessly integrate new MoCs into the approach,
enabling the tailoring of the MoCs used in the definition of
concurrency-aware xDSMLs.</p>
      <sec id="sec-7-1">
        <title>C. A Thread-based MoC for fUML</title>
      </sec>
    </sec>
    <sec id="sec-8">
      <title>We illustrate our proposal with the definition and use of</title>
      <p>another MoC for fUML, whose semantics is given in the
stan</p>
      <sec id="sec-8-1">
        <title>D. Introducing a Recursive Definition of the Concurrency-aware xDSML Approach</title>
      </sec>
    </sec>
    <sec id="sec-9">
      <title>More generally, we propose to leverage a previously-defined</title>
      <p>concurrency-aware xDSML as the MoC for another xDSML.
This means that the concurrency concerns of a model are
expressed as a model conforming to another xDSML, more
appropriate to capture these concerns.</p>
      <p>At the language level, this means that the MoCMapping
as described in Section II is now a model transformation
from the xDSML to the xDSML used as MoC. The model
resulting from the transformation (the MoCApplication) is
however not semantically equivalent to the original model: it
only represents its concurrent aspects. The MoCTriggers are the</p>
      <sec id="sec-9-1">
        <title>Mappings (from the Communication Protocol) of the xDSML</title>
        <p>used as MoC. And since an element in a model may result in
several elements in the resulting model (e.g., ForkNodes are
transformed into several ”StartThread” instructions), we also
need to be able to exploit the trace of the transformation to
disambiguate the Communication Protocol of our xDSML.</p>
        <p>More formally, we consider two concurrency-aware xDSMLs,
LDomain and LMoC . We will detail our approach to specify
LDomain using LMoC as MoC, illustrated in the case where
the former is fUML and the latter is an xDSML capturing the
notions of threads and their instructions. LMoC is considered
as already defined, which means that it has been specified
either as shown in Section II, or as is being shown in this
section. Figure 4 gives an overview of our approach as a class
diagram. It relies on two additional models presented in the
“Concurrency-aware xDSML Recursive Definition” package of
the class diagram. The rest of this section focuses on these
two models.</p>
      </sec>
      <sec id="sec-9-2">
        <title>1) Abstract Syntax Transformation: The first one is</title>
        <p>a Transformation from LDomain to LMoC , denoted as
TDomain!MoC . It specifies how the concurrency concerns
of LDomain are represented using LMoC . It effectively
corresponds to the MoCMapping of LDomain, as it maps the AS of
LDomain to the structure of the formalism used as MoC. For
an input model MDomain, its output is MMoC .</p>
        <p>For our example, we must first consider the definition of a
concurrency-aware xDSML with the notion of Threads. In
such an xDSML, we define a ThreadSystem as composed
of Threads, with one of them considered as the main one.
Each Thread has a number of Tasks which can be of different
nature (execution, disjunction, conditional, etc.), in particular
they can consist in starting or joining other threads. Inside a
Thread, Tasks are executed sequentially. Threads are concurrent
by nature, so if several are running at the same time, they
can execute their instructions in parallel or in any form of
interleaving. Joining on another thread waits for the selected
thread to have all its instructions executed. Disjunctions
are tasks for which only one of the two operands (Tasks)
is executed, while Conditionals are executed if all their
conditions (other Tasks) have been executed previously. The
main Mapping of interest in the Communication Protocol
of this Threading xDSML pertains to the execution of a</p>
      </sec>
    </sec>
    <sec id="sec-10">
      <title>Task, denoted as ExecuteTask. Once we have designed</title>
      <p>this language using the concurrency-aware approach, we can
specify TfUML!T hreading. For our example model of Figure 1,
the resulting model corresponds to the right half of Figure 3.</p>
      <sec id="sec-10-1">
        <title>2) Trace of the AS Transformation: When a concept of</title>
        <p>LDomain is transformed into several concepts of LMoC , we
need a means to specify which one should be used as the
trigger for the execution of the LDomain concept. For instance,
a ForkNode is transformed into as many Tasks as it has
branches. We need to be able to define which Task’s execution
will be mapped to the ForkNode’s execution. In order to do
so, we thus need an additional language-level model, which
consists in an excerpt from the metamodel of the trace of
the AS Transformation. This excerpt is called the Projections
of LDomain, designated as PDomain!MoC . It specifies, for a
concept of LDomain, into which concept(s) of LMoC they
are transformed (through TDomain!MoC ) and with which
purpose(s), through labels. This allows us to specify, for
instance, that the execution of the ForkNode is mapped to
the execution of the first Task representing the execution of
one of its branches.</p>
        <p>This model is then used by the Communication Protocol of
LDomain, in order to generate its model-level counterpart
without ambiguities. This model, denoted as PfUML!T hreading
for fUML, as well as its use by the fUML Communication
Protocol model, are both illustrated in Section V using our
metalanguage implementations in the GEMOC Studio.</p>
      </sec>
    </sec>
    <sec id="sec-11">
      <title>IV. DISCUSSION</title>
    </sec>
    <sec id="sec-12">
      <title>We discuss our contribution’s benefits and drawbacks.</title>
      <sec id="sec-12-1">
        <title>A. Modularity</title>
      </sec>
    </sec>
    <sec id="sec-13">
      <title>The modularity of the initial approach is not disrupted. The</title>
      <p>data and concurrency concerns are still separated. In fact, it
even favors the reuse of the AS and Semantic Rules of an
xDSML by using different MoCs, for instance to compare two
MoCs for the same language. Reversely, concurrency-aware
xDSMLs can be reused as MoCs for other xDSMLs.</p>
      <sec id="sec-13-1">
        <title>B. Concurrency-aware Analyses</title>
        <p>
          Depending on the available tools, or expected behavioral
properties, the language designer may choose to use one or
another MoC for their xDSML. For instance, Petri nets [
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]
are commonly used to assess liveness or safety properties. Our
approach also remains ultimately rooted in Event Structures. By
transitivity, analyzing the concurrency concerns of a model can
also be done through its underlying Event Structure [
          <xref ref-type="bibr" rid="ref12">12</xref>
          ]. Our
contribution has thus provided an additional hook for potential
analyses of executable models.
        </p>
      </sec>
      <sec id="sec-13-2">
        <title>C. Facilitated MoCMapping Modeling</title>
      </sec>
    </sec>
    <sec id="sec-14">
      <title>By facilitating the integration of new MoCs defined as</title>
      <p>xDSMLs, we allow concurrency experts to provide a large
MoC library. Thus, we allow language designers to use the
most appropriate MoC for the xDSML being modeled. This is
similar to how DSLs are used for the dedicated abstractions they
propose: some formalisms are more adapted for the modeling
of some concurrency paradigms. This adequacy translates
into an overall simpler or more maintainable MoCMapping
model. Moreover, instead of having to learn and master an
additional metalanguage for the MoCMapping (e.g., EventType
Structures), the language designer now only has to learn the
Projections metalanguage (which is small and straightforward),
while using a model transformation for the MoCMapping.
Execution and debugging facilities of the concurrency-aware
approach are also made available for free for the xDSML used
as MoC.</p>
      <sec id="sec-14-1">
        <title>D. Unified Interface for MoCs</title>
        <p>
          MoCs are usually defined in many different manners,
but usually quite “informally”, either as “formalisms”, or
through language or framework constructs (e.g., Erlang
actors [
          <xref ref-type="bibr" rid="ref13">13</xref>
          ], Scala’s Akka actors [
          <xref ref-type="bibr" rid="ref14">14</xref>
          ]). Our contribution allows
any concurrency-aware xDSML to be used as MoC. MoCs are
thus all modelled as xDSMLs in a uniform way and it is the
use made of an xDSML that determines whether it corresponds
to a MoC or not. In other words, “MoC” is a role played by
an xDSML, not its nature.
        </p>
      </sec>
      <sec id="sec-14-2">
        <title>E. Comparison with translational semantics</title>
      </sec>
    </sec>
    <sec id="sec-15">
      <title>Our contribution bears resemblance with translational se</title>
      <p>mantics (i.e., a language’s execution semantics is defined by
a translation to another well-defined language). Indeed, we
propose to define a transformation from LDomain to LMoC :
TDomain!MoC . However, the purpose of this transformation
is very different from that of translational semantics. In
our approach, the source model (MDomain, conforming to
LDomain) and the target model (MMoC , conforming to LMoC )
are not semantically equivalent. MMoC is only a representation
of the concurrency concerns of MDomain, using LMoC as a
formalism; whereas in translational semantics, the intention
of the transformation is to produce a semantically equivalent
model. The data treatments done in the Semantic Rules of
LDomain are never translated in terms of concepts of LMoC ,
and only the concurrency concerns of LDomain are transformed
into LMoC . This is quite similar to the abstraction phase
done during the modeling of a system in order to assess the
correctness of the concurrency concerns using model checkers.</p>
    </sec>
    <sec id="sec-16">
      <title>V. IMPLEMENTATION</title>
      <p>Our proposal has been implemented in the GEMOC Studio2,
an EMF-based language workbench. The full execution of
the example fUML Activity is available as a video at http:
//gemoc.org/exe16/. An archive file also provides the GEMOC
Studio with our implementation of fUML based on Threads,
as well as the source files for these xDSMLs.</p>
      <sec id="sec-16-1">
        <title>A. Existing Elements</title>
      </sec>
    </sec>
    <sec id="sec-17">
      <title>The Abstract Syntax is captured as an Ecore metamodel.</title>
      <p>
        The Semantic Rules can be weaved into the AS by defining
aspects using the Kermeta 3 Action Language (K3AL) [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ].
EventType Structures are specified using a combination of
MoCCML [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ] and ECL [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]. The Communication Protocol is
specified using a dedicated metalanguage called the GEMOC
Events Language (GEL) [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ].
      </p>
    </sec>
    <sec id="sec-18">
      <title>2http://www.gemoc.org/studio</title>
      <p>B. Projections, Transformation and concurrency concerns are either embedded in the metalanguages
Communication Protocol provided by the approach used, or implicitly inherited from the</p>
      <p>To specify PDomain!MoC , we have designed a small dedi- underlying execution platform. In concurrency-aware xDSMLs,
cated metalanguage. Listing 1 shows the projections for fUML, they are made explicit at the language level through the use
PfUML!T hreading. fUML ActivityNodes are transformed into of a MoC.</p>
      <p>
        Tasks. When a Task is executable, then the corresponding Then, concurrency theory has studied Models of Concurrency
ActivityNode (if there is one) is also executable. In the same like Petri nets [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], the Actor model [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] or Event Structures [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]
manner, some Tasks correspond to the evaluation of the guard for a long time [
        <xref ref-type="bibr" rid="ref25">25</xref>
        ]. Different MoCs typically split a task in
of an ActivityEdge, while some others represent the fact that a different manners and the communication and collaboration
branch may or may not be executed, based on the result of its between the computing entities (e.g., threads, actors, etc.) is
guard (more details in [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]). done in different ways (i.e., in terms of data-sharing, scheduling,
cooperation, etc.). A unification of MoCs has been proposed
through the use of the “tagged signal” model [
        <xref ref-type="bibr" rid="ref26">26</xref>
        ] or of category
      </p>
      <p>
        Listing 1. fUML projections on Threading. theory [
        <xref ref-type="bibr" rid="ref27">27</xref>
        ], but they do not focus on defining and integrating
21 PLroajnegcutiaognesP:rojection Proj_Execution: new MoCs. For instance in Ptolemy3 [
        <xref ref-type="bibr" rid="ref28">28</xref>
        ], adding new MoCs
3 fuml.ActivityNode projected onto threaded.Task end (called “directors”) requires complex changes in its source
45 Lfanugmula.gAecPtroijvecittioynEdPgreojp_rEovjeaclteudatoinoton:threaded.Task end code.
6 LanguageProjection Proj_MayExecute: In “Why Do Scala Developers Mix the Actor Model with
87 Lfanugmula.gAecPtroijvecittioynEdPgreojp_rMoajeycNteodtEoxnetocutther:eaded.Task end Other Concurrency Models?” [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ], the authors analyze Scala
9 fuml.ActivityEdge projected onto threaded.Task end code-bases and interview their developers to determine how
10 end often and why the Actor MoC was not the only one used.
      </p>
      <p>Reasons were categorized into three groups: a) inadequacies of</p>
      <p>
        TDomain!MoC can be specified using any Model to the actor library, b) inadequacies of the MoC, and c) inadequate
Model (M2M) transformation language [
        <xref ref-type="bibr" rid="ref17">17</xref>
        ] and any general- developer experience. Concurrency-aware xDSMLs move a)
purpose programming languages relying on an appropri- and c) away from the system designer to the language designer,
ate model management library such as Java with EMF’s greatly reducing the number of users concerned with the correct
APIs. However, the transformation must not only transform uses of MoCs. Thanks to our contribution, b) is removed as
MDomain into a corresponding MMoC , but it must also any MoC can be used for any xDSMLs, as long as they have
generate the model-level models of PDomain!MoC , denoted been modeled as concurrency-aware xDSMLs. This enables
as PDomainModel!MoCModel, and used during the generation the language designer to use the best MoC for the concurrency
of the model-level Communication Protocol. Indeed, we have concerns of each xDSML.
extended GEL with the capacity to reference projections from Finally, we would like to point out the similarity of our
PDomain!MoC when defining the Mappings. Listing 2 shows proposal with the design pattern identified by Bran Selic as the
the Communication Protocol for our implementation of fUML. “Recursive Control” pattern in [
        <xref ref-type="bibr" rid="ref29">29</xref>
        ]. In our case, LMoC and its
runtime is the internal control for LDomain and its runtime.
      </p>
      <p>Since LMoC itself can be specified using another xDSML,
this effectively corresponds to an application of the “Recursive
Control” pattern.</p>
    </sec>
    <sec id="sec-19">
      <title>VII. CONCLUSION AND PERSPECTIVES</title>
      <p>
        Listing 2. Communication Protocol for fUML.
1 DSE ExecuteActivityNode:
2 upon event ExecuteTask with Proj_Execution
3 triggers ActivityNode.execute blocking end
4
5 DSE EvaluateGuard:
6 upon event ExecuteTask with Proj_Evaluation
7 triggers ActivityEdge.evaluateGuard returning bool
8 feedback: // Presented in more details in [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ].
9 [bool] =&gt; allow event ExecuteTask with Proj_MayExecute
10 default =&gt; allow event ExecuteTask with Proj_MayNotExecute
11 end
12 end
      </p>
      <p>The concurrency-aware xDSML approach advocates making
explicit, in the operational semantics, the concurrency concerns
using a Model of Concurrency. However, only one MoC,
namely Event Structures, was provided initially. We have shown
that not all MoCs are good fits for all concurrency paradigms,
and that manually integrating new MoCs into the approach is
complex and time-consuming as it requires two metalanguages
VI. RELATED WORK (for the language and model levels) as well as their tools.</p>
      <p>To ease this activity, we have proposed an extension</p>
      <p>The concurrency-aware xDSML approach we have extended which enables the use of previously-defined
concurrencybrings together two fields of research. aware xDSMLs as MoCs. This contribution relies on two</p>
      <p>
        First, language Workbenches [
        <xref ref-type="bibr" rid="ref18">18</xref>
        ], such as MPS [
        <xref ref-type="bibr" rid="ref19">19</xref>
        ] or main changes in the language models: an abstract syntax
MetaEdit+ [
        <xref ref-type="bibr" rid="ref20">20</xref>
        ] traditionally focus on the language syntaxes. transformation to specify how the xDSML’s concurrency
Executability of DSMLs is provided using “meta-programming” concerns are encoded in the xDSML used as MoC; and
like Rascal [
        <xref ref-type="bibr" rid="ref21">21</xref>
        ] or Spoofax [
        <xref ref-type="bibr" rid="ref22">22</xref>
        ]; or “executable metamodeling”
like xMOF [
        <xref ref-type="bibr" rid="ref23">23</xref>
        ] or the K Framework [
        <xref ref-type="bibr" rid="ref24">24</xref>
        ]. In both cases, the 3http://ptolemy.eecs.berkeley.edu/
the Projections, a part of the transformation metamodel, that
accounts for cases where an xDSML concept is transformed
into several MoC concepts. The former can be specified
using any classical model transformation languages, while
we have devised a dedicated metalanguage for the latter. Our
contribution has been implemented in the GEMOC Studio, an
Eclipse-based language workbench, and illustrated on fUML
defined using an xDSML capturing the notions of threads with
instructions. We have made available a video showing the
execution of an example fUML Activity, and the sources for
the two xDSMLs. By defining MoCs as concurrency-aware
xDSMLs, we give them a systematic structure, enabling their
use at the language-level for the modeling of other
concurrencyaware xDSMLs. In particular, it enables the use of the MoC
that is the best fit for the concurrency paradigm of the language
being developed. It also eases the development of an xDSML,
since the model-level application of the MoC is simply a model
conforming to an xDSML, that can be executed, debugged
and animated like a regular model. Moreover, different formal
behavioral properties can be assessed on executable models
depending on the MoC used by the language.
      </p>
      <p>
        Although any concurrency-aware xDSML can be used as
a MoC, the concurrency theory community has studied in
details a large number of MoCs such as the Actor Model [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]
or Petri nets [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. We plan to provide reference implementations
for these ones in a MoC standard library, including Event
Structures to bootstrap our approach. Afterwards, existing tools
around these formalisms, such as model-checking tools, can
be integrated seamlessly in our approach. Still, the approach
remains rooted in the seminal MoC (i.e., Event Structures), so
higher-order transformations could be used to verify domain
properties using the underlying MoC, while translating their
results back to the domain [
        <xref ref-type="bibr" rid="ref30">30</xref>
        ]. Finally, even though we have
considered concurrency-aware xDSMLs as language models
for the implementation of more efficient tools, we plan to study
how code generation or scheduler synthesis could be used to
generate more efficient implementations of concurrency-aware
xDSMLs.
      </p>
    </sec>
    <sec id="sec-20">
      <title>ACKNOWLEDGMENTS</title>
    </sec>
    <sec id="sec-21">
      <title>This work is partially supported by the ANR INS Project GEMOC (ANR-12-INSE-0011). REFERENCES</title>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>B.</given-names>
            <surname>Combemale</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Deantoni</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M. Vara</given-names>
            <surname>Larsen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Mallet</surname>
          </string-name>
          ,
          <string-name>
            <given-names>O.</given-names>
            <surname>Barais</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Baudry</surname>
          </string-name>
          , and R. France, “Reifying Concurrency for Executable Metamodeling,” in SLE'
          <volume>13</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>F.</given-names>
            <surname>Latombe</surname>
          </string-name>
          ,
          <string-name>
            <surname>X.</surname>
          </string-name>
          <article-title>Cre´gut</article-title>
          , J. Deantoni,
          <string-name>
            <given-names>M.</given-names>
            <surname>Pantel</surname>
          </string-name>
          , and
          <string-name>
            <given-names>B.</given-names>
            <surname>Combemale</surname>
          </string-name>
          , “
          <article-title>Coping with Semantic Variation Points in Domain-Specific Modeling Languages,” in EXE 2015</article-title>
          . Ottawa, Canada: CEUR,
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>F.</given-names>
            <surname>Latombe</surname>
          </string-name>
          , X. Cre´gut,
          <string-name>
            <given-names>B.</given-names>
            <surname>Combemale</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Deantoni</surname>
          </string-name>
          , and
          <string-name>
            <given-names>M.</given-names>
            <surname>Pantel</surname>
          </string-name>
          , “
          <source>Weaving Concurrency in eXecutable Domain-Specific Modeling Languages,” in 8th ACM SIGPLAN International Conference on Software Language Engineering (SLE</source>
          <year>2015</year>
          ),
          <year>2015</year>
          . [Online]. Available: https://hal.inria.fr/hal-01185911
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>T.</given-names>
            <surname>Murata</surname>
          </string-name>
          , “
          <article-title>Petri nets: Properties, analysis and applications</article-title>
          ,
          <source>” Proceedings of the IEEE</source>
          , vol.
          <volume>77</volume>
          , no.
          <issue>4</issue>
          ,
          <year>1989</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>G. A.</given-names>
            <surname>Agha</surname>
          </string-name>
          , “
          <article-title>Actors: A model of concurrent computation in distributed systems</article-title>
          .
          <source>” DTIC Document, Tech. Rep.</source>
          ,
          <year>1985</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>G.</given-names>
            <surname>Winskel</surname>
          </string-name>
          , “
          <article-title>Event structures,” in Petri Nets: Applications and Relationships to Other Models of Concurrency, ser</article-title>
          .
          <source>LNCS</source>
          ,
          <year>1987</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>V.</given-names>
            <surname>Pratt</surname>
          </string-name>
          , “
          <article-title>Modeling concurrency with partial orders</article-title>
          ,”
          <source>International Journal of Parallel Programming</source>
          , vol.
          <volume>15</volume>
          , no.
          <issue>1</issue>
          , pp.
          <fpage>33</fpage>
          -
          <lpage>71</lpage>
          ,
          <year>1986</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>J.</given-names>
            <surname>Deantoni</surname>
          </string-name>
          and
          <string-name>
            <given-names>F.</given-names>
            <surname>Mallet</surname>
          </string-name>
          , “
          <article-title>ECL: the event constraint language, an extension of OCL with events</article-title>
          ,
          <source>” Inria, Tech. Rep.</source>
          ,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9] OMG, “
          <source>fUML specification v1.1</source>
          ,”
          <year>2013</year>
          . [Online]. Available: http: //www.omg.org/spec/FUML/
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>G. D.</given-names>
            <surname>Plotkin</surname>
          </string-name>
          , “
          <article-title>The origins of Structural Operational Semantics,”</article-title>
          <source>The Journal of Logic and Algebraic Programming</source>
          ,
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>S.</given-names>
            <surname>Tasharofi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Dinges</surname>
          </string-name>
          , and R. E. Johnson, “
          <article-title>Why do scala developers mix the actor model with other concurrency models?</article-title>
          ”
          <source>in ECOOP 2013</source>
          . Springer,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>F.</given-names>
            <surname>Mallet and R. De Simone</surname>
          </string-name>
          , “Correctness Issues on MARTE/CCSL constraints,”
          <source>Science of Computer Programming</source>
          , vol.
          <volume>106</volume>
          , pp.
          <fpage>78</fpage>
          -
          <lpage>92</lpage>
          , Aug.
          <year>2015</year>
          . [Online]. Available: https://hal.inria.fr/hal-01257978
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <given-names>J.</given-names>
            <surname>Armstrong</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Virding</surname>
          </string-name>
          , C. Wikstro¨m, and
          <string-name>
            <given-names>M.</given-names>
            <surname>Williams</surname>
          </string-name>
          ,
          <article-title>Concurrent programming in ERLANG</article-title>
          . Citeseer,
          <year>1993</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14]
          <string-name>
            <given-names>M.</given-names>
            <surname>Gupta</surname>
          </string-name>
          ,
          <article-title>Akka essentials</article-title>
          .
          <source>Packt Publishing Ltd</source>
          ,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          [15]
          <article-title>DIVERSE-team, “Github for k3al</article-title>
          ,”
          <year>2016</year>
          . [Online]. Available: http://github.com/diverse-project/k3/
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          [16]
          <string-name>
            <given-names>J.</given-names>
            <surname>Deantoni</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Issa Diallo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Teodorov</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Champeau</surname>
          </string-name>
          , and
          <string-name>
            <given-names>B.</given-names>
            <surname>Combemale</surname>
          </string-name>
          , “
          <article-title>Towards a Meta-Language for the Concurrency Concern in DSLs</article-title>
          ,” in DATE,
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          [17] OMG, “QVT specification
          <year>v1</year>
          .2,”
          <year>2015</year>
          . [Online]. Available: http: //www.omg.org/spec/QVT/
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          [18]
          <string-name>
            <given-names>Language</given-names>
            <surname>Workbenches</surname>
          </string-name>
          <string-name>
            <surname>Challenge</surname>
          </string-name>
          , “
          <article-title>Comparing tools of the trade</article-title>
          ,”
          <year>2014</year>
          . [Online]. Available: http://www.languageworkbenches.net/
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          [19]
          <string-name>
            <given-names>M.</given-names>
            <surname>Voelter</surname>
          </string-name>
          and
          <string-name>
            <given-names>V.</given-names>
            <surname>Pech</surname>
          </string-name>
          , “
          <article-title>Language modularity with the MPS language workbench,” in ICSE</article-title>
          . IEEE,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          [20]
          <string-name>
            <given-names>S.</given-names>
            <surname>Kelly</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Lyytinen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Rossi</surname>
          </string-name>
          , and
          <string-name>
            <given-names>J. P.</given-names>
            <surname>Tolvanen</surname>
          </string-name>
          , “MetaEdit+ at the age of 20,” in CAiSE. Springer,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref21">
        <mixed-citation>
          [21]
          <string-name>
            <surname>T. Van Der Storm</surname>
          </string-name>
          , “The Rascal Language Workbench,”
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref22">
        <mixed-citation>
          [22]
          <string-name>
            <given-names>L. C.</given-names>
            <surname>Kats</surname>
          </string-name>
          and E. Visser, “
          <article-title>The spoofax language workbench: rules for declarative specification of languages and ides</article-title>
          ,” in ACM Sigplan Notices,
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref23">
        <mixed-citation>
          [23]
          <string-name>
            <given-names>T.</given-names>
            <surname>Mayerhofer</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Langer</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Wimmer</surname>
          </string-name>
          , and G. Kappel, “xMOF: Executable DSMLs based on fUML,” in SLE,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref24">
        <mixed-citation>
          [24]
          <string-name>
            <given-names>G.</given-names>
            <surname>Rosu</surname>
          </string-name>
          and
          <string-name>
            <given-names>T. F.</given-names>
            <surname>Serbanuta</surname>
          </string-name>
          ,
          <article-title>“K overview and simple case study,”</article-title>
          <source>in Proceedings of International K Workshop (K'11)</source>
          ,
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref25">
        <mixed-citation>
          [25]
          <string-name>
            <given-names>M.</given-names>
            <surname>Nielsen</surname>
          </string-name>
          , “
          <article-title>Models for concurrency,”</article-title>
          <source>in Mathematical Foundations of Computer Science</source>
          ,
          <year>1991</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref26">
        <mixed-citation>
          [26]
          <string-name>
            <given-names>E.</given-names>
            <surname>Lee</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Sangiovanni-Vincentelli</surname>
          </string-name>
          et al.,
          <article-title>“A framework for comparing models of computation,” Computer-Aided Design of Integrated Circuits and Systems</article-title>
          , IEEE Transactions on,
          <year>1998</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref27">
        <mixed-citation>
          [27]
          <string-name>
            <given-names>M.</given-names>
            <surname>Nielsen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Sassone</surname>
          </string-name>
          , and G. Winskel,
          <article-title>Relationships between models of concurrency</article-title>
          . Springer,
          <year>1994</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref28">
        <mixed-citation>
          [28]
          <string-name>
            <given-names>C.</given-names>
            <surname>Ptolemaeus</surname>
          </string-name>
          , System Design, Modeling, and
          <article-title>Simulation: Using Ptolemy II. Ptolemy</article-title>
          . org Berkeley, CA, USA,
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref29">
        <mixed-citation>
          [29]
          <string-name>
            <given-names>B.</given-names>
            <surname>Selic</surname>
          </string-name>
          , “
          <article-title>An architectural pattern for real-time control software</article-title>
          ,” in Workshop on Frameworks and Architectures, PLoP Conference,
          <year>1996</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref30">
        <mixed-citation>
          [30]
          <string-name>
            <given-names>F.</given-names>
            <surname>Zalila</surname>
          </string-name>
          ,
          <string-name>
            <surname>X.</surname>
          </string-name>
          <article-title>Cre´gut, and M. Pantel, “A transformation-driven approach to automate feedback verification results,” in Model and Data Engineering</article-title>
          . Springer,
          <year>2013</year>
          , pp.
          <fpage>266</fpage>
          -
          <lpage>277</lpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>