<!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>xMOF: A Semantics Specification Language for Metamodeling</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Tanja Mayerhofer</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Philip Langer</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Manuel Wimmer</string-name>
          <email>wimmerg@big.tuwien.ac.at</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Business Informatics Group, Vienna University of Technology</institution>
          ,
          <country country="AT">Austria</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>While MOF constitutes a standardized and widely accepted language for formally defining a modeling language's abstract syntax, no standardized language for specifying its behavioral semantics exists. This impedes the efficient development of tools which build upon the behavioral semantics of modeling languages, such as model interpreters, debuggers, and testing environments. To address this shortcoming, we propose to adopt the standardized action language fUML as semantics specification language in metamodeling. In this paper we present tool support integrated with the EMF environment for specifying the behavioral semantics of modeling languages with fUML as well as for executing models based on these specifications. A teaser for the demonstration of this tool support can be found at http://www.youtube.com/watch?v= p4alBfqbjk8.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1 Introduction</title>
      <p>
        In model-driven engineering (MDE), models constitute the central artifacts in the
software development process. Thus, the success of MDE depends significantly on the
availability of adequate tool support for creating, exploring, analyzing, and utilizing
models. To develop such tools efficiently, modeling languages (i.e., their syntax and
semantics) have to be defined formally [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. MOF [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] constitutes a standardized and widely
accepted metamodeling language for formally defining the abstract syntax of modeling
languages and laid the ground for the emergence of a variety of tools building upon the
abstract syntax definition of a modeling language, such as techniques for deriving
modeling editors from a metamodel and generic components for model serialization and
comparison. Despite the fact that several approaches for formally specifying the
behavioral semantics of modeling languages have been proposed in the past (cf. [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]), none of
these approaches is widely adopted compared to metamodeling languages. This
hampers the efficient development of tools which build upon the behavioral semantics of a
modeling language, such as model interpreters, debuggers, and testing environments.
      </p>
      <p>
        Due to this lack of a standardized language for specifying the behavioral
semantics of modeling languages, we investigated whether the standardized action language
fUML [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] can be used as semantics specification language in metamodeling and how
it can be integrated with existing metamodeling methodologies and environments. This
investigation resulted in the metamodeling language executable MOF (xMOF)
integrating fUML with Ecore, which is the most prominent implementation of MOF and
employed in EMF [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. Furthermore, we elaborated a methodology for systematically
developing semantics specifications with xMOF and utilizing them for model execution. This
methodology integrates seamlessly with existing metamodeling methodologies and
environments which enabled us to implement conforming tool support for EMF1.
      </p>
      <p>In Section 2 we give an overview of our metamodeling language xMOF. In
Section 3 we present our methodology for developing semantics specifications and
executing models based on xMOF and its tool support in EMF. In Section 4 we give an
overview of the tool demonstration. Finally, in Section 5 we conclude this paper.
2</p>
      <p>
        Semantics Specification Language xMOF
fUML [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] is a subset of UML [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] comprising modeling concepts for defining UML
classes, as well as activities defining the classes’ behavior. Furthermore, fUML defines
the execution semantics of this UML subset in terms of a virtual machine (VM) capable
of executing compliant models. Because UML classes and MOF metaclasses differ only
in their intended usage (modeling of systems vs. modeling of languages), we argue that
fUML might be well suited for also defining the behavior of metaclasses. Furthermore,
as fUML is an object-oriented and imperative action language and well known in the
MDE community as it is a subset of UML, which is widely adopted in MDE, it might be
intuitive to use for specifying the behavioral semantics of modeling languages. As both
MOF and fUML are standardized by OMG, fUML may be considered as promising
candidate for becoming a standardized action language in metamodeling.
      </p>
      <p>
        For integrating fUML with existing metamodeling languages in order to enable
the specification of the behavioral semantics of modeling languages we identified two
strategies [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]: a transformation-based and an integration-based strategy. Because of the
better integration with existing metamodeling environments we decided to apply the
integration-based strategy. In this strategy, a metamodeling language is extended with
the behavioral part of fUML comprising modeling concepts for defining activities and
actions so that the behavior of metaclass operations defined in the metamodel of a
modeling language can be specified in terms of fUML activities. By applying this strategy
for integrating fUML with Ecore, which is the most prominent implementation of MOF,
we obtained a new metamodeling language which we called executable MOF (xMOF).
      </p>
      <p>The metamodel of xMOF is depicted in Figure 1. For integrating Ecore with the
behavioral part of fUML we introduced the metaclasses BehavioredEClassifier,
BehavioredEClass, MainEClass, and BehavioredEOperation. The metaclass BehavioredEClassifier
is a subclass of EClassifier and can own Behaviors in terms of Activities.
BehavioredEClass is a concrete subclass of BehavioredEClassifier and EClass and can therefore
own Activities. The class MainEClass is introduced to distinguish one BehavioredEClass
in a semantics specification as the main class controlling the execution of a model
conforming to the modeling language. We also introduced a subclass of EOperation called
BehavioredEOperation whose behavior can be defined by an Activity.
3</p>
    </sec>
    <sec id="sec-2">
      <title>Methodology for Developing xMOF Semantics Specifications</title>
      <p>With xMOF it is possible to define the abstract syntax and the behavioral semantics of
modeling languages. To foster the systematic and efficient development of behavioral
semantics specifications using xMOF, as well as the utilization of these specifications
1 The metamodel of xMOF, the source code of our tool support, as well as demos and case
studies can be found at our project website http://www.modelexecution.org.</p>
      <p>EClassifier</p>
      <p>EClass
eOperations
*</p>
      <p>EOperation
BehavioredClassifier</p>
      <p>BehavioredEClass</p>
      <p>MainEClass</p>
      <p>BehavioredEOperation
specification 0..1
ownedBehavior *
classifierBehavior 0..1</p>
      <p>Behavior</p>
      <p>* method
Activity
node *
edge *</p>
      <p>ActivityNode
ActivityEdge</p>
      <sec id="sec-2-1">
        <title>Ecore metaclasses (excerpt)</title>
      </sec>
      <sec id="sec-2-2">
        <title>Integration metaclasses fUML metaclasses (excerpt)</title>
        <p>for executing models, we elaborated a dedicated methodology which is accompanied
by EMF-based tool support. An overview of our methodology is depicted in Figure 2.</p>
        <p>In the semantics specification, the behavioral semantics of a modeling language
is developed starting from its Ecore-based metamodel. The behavioral semantics is
defined in an own artifact called xMOF-based configuration which is automatically
initialized. In this initialization one subclass (BehavioredEClass) of each metaclass defined
in the metamodel is generated. They are called configuration classes and can be
extended with additional attributes, references, operations, and activities for specifying
the behavioral semantics of the metaclasses. Also additional configuration classes can
be defined. Furthermore, one BehavioredEClass called Initialization is generated which
can be used to define supplementary data that is necessary as additional input for
executing models based on this semantics specification. This class can be extended with
attributes, references, and additional contained classes called initialization classes.</p>
        <p>In the model execution preparation, preparatory tasks for executing a model
according to the xMOF-based behavioral semantics specification of the used modeling
language are carried out. In EMF, models consist of instances of the metaclasses
defined in the Ecore-based metamodel of the used modeling language. As the semantics
of these metaclasses is defined by the operations introduced in the configuration classes,
the model to be executed has to be represented in terms of instances of the respective
configuration classes. This representation is called xMOF-based model and is generated
automatically. The supplementary data needed as input for executing a model defined
by the initialization classes has to be instantiated manually by the modeler.</p>
        <p>
          The xMOF-based model can be executed by leveraging the fUML VM (model
execution). Therefore, it is automatically converted into an fUML-based model conforming
to the format required by the fUML VM. During the execution the fUML VM interprets
the activities specifying the behavioral semantics of the modeling language and
manipulates the fUML-based model accordingly. The result of the execution consists of the
manipulated fUML-based model (fUML extensional values) representing the runtime
state of the executed model after the execution finished. For enabling its visualization
model annotations are generated for the executed model. For this we make use of EMF
Profiles [
          <xref ref-type="bibr" rid="ref2">2</xref>
          ] which is an mechanism for annotating EMF-based models.
        </p>
        <p>Semantics Specification
Ecore-based
Metamodel</p>
        <p>Generate
xMOF-based</p>
        <p>Configuration
Model Execution Preparation</p>
        <p>Model
Model Execution
xMOF-based</p>
        <p>Model
MCoodnefl MIonditel
xMOF-based
Configuration
[complete]
Conf Init
Classes Classes</p>
        <p>Tramsform
xMOF- to
fUMLbased Model
xMOF-based
Configuration</p>
        <p>[initial]
Conf Init
Classes Classes</p>
        <p>Specify
Semantics
xMOF-based
Configuration
[complete]
Conf Init</p>
        <p>Classes Classes
Instantiate
xMOF Conf
Classes
Instantiate
xMOF Init
Classes
xMOF-based</p>
        <p>Model
MCoodnefl MIonditel</p>
        <p>Caption:</p>
        <p>Artifact
Manual</p>
        <p>Task
Automated</p>
        <p>Task
in/out relation
fUML-based</p>
        <p>Model</p>
        <p>Execute
Model</p>
        <p>fUML
Extensional</p>
        <p>Values</p>
        <p>Transform
Execution
Result</p>
        <p>Execution</p>
        <p>Result
Annotations</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>4 Demonstration</title>
      <p>In the demonstration of our tool support for specifying the behavioral semantics of
modeling languages, we will develop a Petri Net modeling language (PNML) following the
methodology introduced in Section 3. We will showcase how the following tasks are
accomplished using our EMF-based tool support: (i) initialization of the xMOF-based
configuration from the Ecore-based metamodel of PNML, (ii) specification of the
behavioral semantics of PNML by extending the xMOF-based configuration, (iii)
execution of PNML models based on the xMOF-based configuration of PNML.</p>
      <p>The Ecore-based metamodel of PNML (cf. Figure 3a) defines that a Net consists of
Places and Transitions whereas a Transition is associated with at least one input and one
output Place. The xMOF-based configuration of PNML (cf. Figure 3b) consists of the
configuration classes NetConfiguration, PlaceConfiguration, and TransitionConfiguration
generated for the metaclasses of PNML. For the configuration class
TransitionConfiguration the operation fire() was introduced whose behavior is specified by the activity
depicted in Figure 3c. This activity specifies that for the output places of a transition the
operation addToken() is called while for the input places removeToken() is invoked.
Furthermore, the initialization class Token was introduced which has to be used for defining
the initial token distribution in the net to enable the executing of a PNML model.</p>
    </sec>
    <sec id="sec-4">
      <title>5 Conclusion</title>
      <p>We have presented the metamodeling language xMOF integrating fUML with Ecore.
It enables to define the behavioral semantics of modeling languages in an operational
way. Furthermore, we gave an overview about our methodology for developing
xMOFbased semantics specifications and utilizing them for model execution and we presented
accompanying tool support for EMF.</p>
      <p>To evaluate the applicability of our semantics specification approach, we carried
out several case studies in which we developed the behavioral semantics specifications
of distinct modeling languages and utilized these specifications to execute conforming
models using the implemented tool support. In summary, the case studies confirmed that
xMOF, its accompanying methodology, and its tool support are applicable for defining
the behavioral semantics of different kinds of modeling languages. Regarding the
suitability of fUML as semantics specification language, we come to the conclusion that
due to its object-oriented and imperative nature, fUML is highly suitable.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>B. R.</given-names>
            <surname>Bryant</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Gray</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Mernik</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P. J.</given-names>
            <surname>Clarke</surname>
          </string-name>
          , R. B. France, and
          <string-name>
            <given-names>G.</given-names>
            <surname>Karsai</surname>
          </string-name>
          .
          <article-title>Challenges and Directions in Formalizing the Semantics of Modeling Languages</article-title>
          .
          <source>Computer Science and Information Systems</source>
          ,
          <volume>8</volume>
          (
          <issue>2</issue>
          ):
          <fpage>225</fpage>
          -
          <lpage>253</lpage>
          ,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <given-names>P.</given-names>
            <surname>Langer</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Wieland</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Wimmer</surname>
          </string-name>
          , and
          <string-name>
            <surname>J. Cabot. EMF</surname>
          </string-name>
          <article-title>Profiles: A Lightweight Extension Approach for EMF Models</article-title>
          .
          <source>Journal of Object Technology</source>
          ,
          <volume>11</volume>
          (
          <issue>1</issue>
          ):
          <fpage>1</fpage>
          -
          <lpage>29</lpage>
          ,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>T.</given-names>
            <surname>Mayerhofer</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Langer</surname>
          </string-name>
          , and
          <string-name>
            <given-names>M.</given-names>
            <surname>Wimmer</surname>
          </string-name>
          . Towards xMOF:
          <article-title>Executable DSMLs based on fUML</article-title>
          .
          <source>In Proc. of the 12th Workshop on Domain-Specific Modeling</source>
          , pages
          <fpage>1</fpage>
          -
          <lpage>6</lpage>
          . ACM,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>Object</given-names>
            <surname>Management Group. OMG Meta Object Facility (MOF) Core</surname>
          </string-name>
          <string-name>
            <surname>Specification</surname>
          </string-name>
          ,
          <source>Version 2.4</source>
          .1,
          <year>August 2011</year>
          . Available at: http://www.omg.org/spec/MOF/2.4.1.
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5. Object Management Group.
          <article-title>OMG Unified Modeling Language (OMG UML)</article-title>
          ,
          <source>Superstructure, Version 2.4</source>
          .1,
          <year>August 2011</year>
          . Available at: http://www.omg.org/spec/UML/2.4.1.
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6. Object Management Group.
          <article-title>Semantics of a Foundational Subset for Executable UML Models (fUML), Version 1</article-title>
          .0,
          <year>February 2011</year>
          . Available at: http://www.omg.org/spec/ FUML/1.0.
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <given-names>D.</given-names>
            <surname>Steinberg</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Budinsky</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Paternostro</surname>
          </string-name>
          , and
          <string-name>
            <surname>E. Merks.</surname>
          </string-name>
          <article-title>EMF: Eclipse Modeling Framework</article-title>
          .
          <string-name>
            <surname>Addison-Wesley</surname>
            <given-names>Professional</given-names>
          </string-name>
          ,
          <source>2nd edition</source>
          ,
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>