<!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>Analyzing Dynamic Models using a Data- ow based Approach</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Christian Saad</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>University of Augsburg</institution>
        </aff>
      </contrib-group>
      <abstract>
        <p>Meta modeling as a method allows to devise languages suited for speci c application domains, e.g. for describing the structural or behavioral aspects of software systems. As meta models constitute an abstract syntax (often enriched with static semantics) there exist obvious similarities to the area of formal languages. The research e ort described in this paper is intended to examine to what extent and to what bene t compiler construction concepts, namely the data- ow analysis method, can be transferred to the modeling domain in order to validate static semantics and perform abstract interpretations on models.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Motivation</title>
      <p>language which is mainly intended to be used to validate constraints by
performing static queries on a model's elements, OCL does not contain semantics which
would enable a xed-point analysis since, in the case of cyclic dependencies this
would require a continuous reevaluation the DFA's equation system. Finally,
complex navigation statements make OCL rules very prone to be invalidated if
the structure of the underlying meta model changes, often requiring extensive
adjustments.</p>
      <p>Since models comprise a graph structure, de ning and calculating
information ow enables an advanced analysis of a model's properties. These may either
be properties of the graph structure itself, e.g. strongly connected component
regions, or semantic attributes, e.g. the availability of a resource created at one
point in a control- ow model in some other part of the model, This research is
dedicated to adapting the data- ow analysis (DFA) approach commonly used in
compiler construction for deriving optimizations from a program's control- ow
graph, to modeling, thus enabling a xed-point analysis on (meta) models.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Related</title>
    </sec>
    <sec id="sec-3">
      <title>Work</title>
      <p>Since the de nition of static semantics is a vital step when developing formal
languages, many di erent techniques have been considered for this purpose.</p>
      <p>
        The OCL can be considered a comparatively simple language for
requirements exceeding syntactic expressiveness and by design is very well-integrated
into the modeling domain. A critical evaluation of its expressive power can be
found in [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ], with emphasis on di culties in calculating transitive closures.
      </p>
      <p>
        Approaches considering the use of formal semantics include graph
transformations, abstract state machines or rst order logic (cf. [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]).
      </p>
      <p>
        Several authors use DFA-based methods to derive information from models.
In [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ], a xed-point calculation is used on executable models to derive def/use
relationships between actions while the authors of [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] propose the use of
controlow information to improve software testing.
      </p>
      <p>The focus in these cases is, however, directed towards implementing a speci c
case study. To the best of our knowledge, there is no other research e ort with the
goal of applying the concept of a xed-point based DFA calculation to models.
3</p>
    </sec>
    <sec id="sec-4">
      <title>Approach for Model-based Data- ow Analysis</title>
      <p>Both meta models and (context-free) grammars operate on di erent layers of
abstraction. For grammars, these usually consist of EBNF, CFGs and language
expressions. In the widely-used MOF one distinguishes between meta-meta (M3),
meta (M2) and model (M1) layer. Because of conceptual similarity, both
techniques can be aligned according to their levels of abstraction. This alignment
requires that data- ow equations are attached to language artefacts (i.e. M2
meta classes) and instantiated/executed for expressions, i.e. M1 objects.</p>
      <p>Since attribute grammars are a well-proven extension of this design, it was
decided that this strategy will also be employed in the de nition of data- ow
equations: An attribute de nition consisting of an identi er and a data-type can
be bound to several meta model classes through the use of attribute occurrences.
Semantic rules (corresponding to data- ow equations) are assigned to attribute
de nitions and attribute occurrences to calculate initialization and iteration
values, respectively. Data- ow between attributes occurs if a semantic rule requests
the value of another attribute as input.</p>
      <p>(a) Data- ow analysis meta model
(b) Calculate predecessors
To stay consistent with the notion of modeling and to minimize frictional
losses between di erent techniques, it is desirable to represent DFAs themselves
as models, i.e. to provide a meta model which in the described alignment
hierarchy acts as an extension of the M3 layer (cf. Figure 1(a)).</p>
      <p>To calculate a DFA for a given model, attribute occurrences assigned to meta
classes need to be instantiated for model elements derived from these classes.
While the instantiation process is straightforward, it has to be noted that this
must happen in compliance with principles like generalization, i.e. if de ned for
a super class, attributes must be inherited by instances of sub classes.</p>
      <p>An example is shown in Figure 1(b) which calculates the transitive closure
of predecessor nodes in a simple control- ow graph. The class node has an
assigned attribute occurrence of the type all predecessors. The associated rule,
which is repeatedly executed for all nodes, recursively creates the union of direct
predecessors and the value of all predecessors at preceding nodes.</p>
      <p>The xed-point calculation signi cant di ers from traditional DFA
techniques: Since semantic rules may request the value of arbitrary attributes as
input when they are executed, there exists neither an inherent ow direction nor
any prior knowledge about output relationships between attribute instances.
Since the commonly used worklist algorithm depends on this information, it is
not applicable in this context. To accomodate for this, an algorithm has been
developed that dynamically records input/output relationships by executing the
rules recursively to create a dependency graph which can then be used as a basis
to derive a nearly optimal execution order, thus minimizing the amount of rule
executions.</p>
    </sec>
    <sec id="sec-5">
      <title>Research</title>
      <p>The research e ort described in this abstract has to cover the following issues:
De nition and Alignment To transfer the method of DFA to the modeling
domain, similarities and di erences between both application areas must be
identi ed and a new de nition language has to be devised and aligned with
the modeling techniques.</p>
      <p>DFA Algorithms Suitable algorithms for calculating DFA equation systems
have to be devised and proven to be correct.</p>
      <p>Complexity and Performance The practical and theoretical performance of
di erent DFA solving algorithms has to be evaluated.</p>
      <p>Tooling and Use Cases To prove the feasability of this approach, a tooling
environment has to be provided alongside the implementation of several use
cases which need to be evaluated against implementations based on
alternative theoretical foundations.</p>
      <p>While e orts for DFA de nition and integration into modeling are well
advanced (as described in the previous section), a formalization of these results is
still in order. The same goes for the DFA solving algorithm which has proven
to perform very well in comparison to adaptions of conventional algorithms like
the work list method.</p>
      <p>The Model Analysis Framework (MAF2) is a fully functional prototype
providing tooling support for the described concepts. It is built upon Eclipse
modeling techniques, namely the Eclipse Modeling Framework (EMF), an
implementation of the MOF standard. Once all artefacts required for an analysis (i.e.
meta models, models and attributions based on the meta model shown in
Figure 1(a)) are loaded into the respective repositories, the de ned attributes are
instantiated for the model's elements and handed to the selected evaluation
algorithm. First experiments have shown that the developed algorithm preforms
much better in calculating the result values than a traditional worklist algorithm
that has been enhanced with the ability to handle dynamically discovered output
dependencies.</p>
      <p>
        Currently implemented case studies (which are available from the code
repository) include: Calculating properties of control- ow graphs like transitive
predecessor/successor sets and strongly connected components (SCC), de nition/use
relationships in work ows and the hierarchical subdivision of control- ows into
its Single-Entry-Single-Exit (SESE) components using a token- ow algorithm
(cf. [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]) which has been reimplemented using DFA. In the future, additional
applications areas are planned like clone detection, validating modeling guidelines
and generating test models for model-based testing approaches.
2 http://code.google.com/p/model-analysis-framework/
      </p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Aho</surname>
            ,
            <given-names>A.V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lam</surname>
            ,
            <given-names>M.S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sethi</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ullman</surname>
            ,
            <given-names>J.D.</given-names>
          </string-name>
          : Compilers: Principles, Techniques, and
          <string-name>
            <surname>Tools (2nd Edition). Addison Wesley</surname>
          </string-name>
          (
          <year>August 2006</year>
          ), http://www.amazon.ca/ exec/obidos/redirect?tag=
          <fpage>citeulike09</fpage>
          -
          <lpage>20</lpage>
          \&amp;amp;path=ASIN/0321486811
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Garousi</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bri</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Labiche</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          :
          <article-title>Control Flow Analysis of UML 2.0 Sequence Diagrams (</article-title>
          <year>2005</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Georg</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bieman</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          , France, R.:
          <article-title>Using Alloy and UML/OCL to specify run-time con guration management: a case study</article-title>
          .
          <source>Practical UML-Based Rigorous Development Methods-Countering or Integrating the eXtremists 7</source>
          (
          <year>2001</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4. Gotz,
          <string-name>
            <given-names>M.</given-names>
            ,
            <surname>Roser</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            ,
            <surname>Lautenbacher</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            ,
            <surname>Bauer</surname>
          </string-name>
          ,
          <string-name>
            <surname>B.</surname>
          </string-name>
          :
          <article-title>Token Analysis of Graph-Oriented Process Models</article-title>
          . New Zealand Second International Workshop on Dynamic and
          <article-title>Declarative Business Processes (DDBP), in conjunction with the 13th IEEE International EDOC Conference (EDOC</article-title>
          <year>2009</year>
          ) (
          <year>September 2009</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Mandel</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Cengarle</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>On the expressive power of the Object Constraint Language OCL</article-title>
          . Available on the World Wide Web: http://www. fast. de/projeckte/forsoft/ocl (
          <year>1999</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Ober</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          :
          <article-title>An ASM Semantics of UML Derived from the Meta-Model and</article-title>
          Incorporating Actions pp.
          <volume>356</volume>
          {
          <issue>371</issue>
          (
          <year>2003</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7. Object Management Group:
          <article-title>Object Constraint Language</article-title>
          . http://www.omg.org/spec/OCL/2.0/ (Mai
          <year>2006</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Varro</surname>
            ,
            <given-names>D.:</given-names>
          </string-name>
          <article-title>A formal semantics of UML Statecharts by model transition systems</article-title>
          . Graph Transformation pp.
          <volume>378</volume>
          {
          <issue>392</issue>
          (
          <year>2002</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Waheed</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Iqbal</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Malik</surname>
            ,
            <given-names>Z.</given-names>
          </string-name>
          :
          <article-title>Data Flow Analysis of UML Action Semantics for Executable Models</article-title>
          .
          <source>Lecture Notes in Computer Science</source>
          <volume>5095</volume>
          ,
          <issue>79</issue>
          {
          <fpage>93</fpage>
          (
          <year>2008</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>