<!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>MocOCL: A Model Checker for CTL-Extended OCL Specifications?</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Robert Bill</string-name>
          <email>bill@big.tuwien.ac.at</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Sebastian Gabmeyer</string-name>
          <email>gabmeyer@big.tuwien.ac.at</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Petra Kaufmann</string-name>
          <email>kaufmann@big.tuwien.ac.at</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Martina Seidl</string-name>
          <email>martina.seidl@jku.at</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Business Informatics Group Vienna University of Technology</institution>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Institute for Formal Models and Verification JKU Linz</institution>
        </aff>
      </contrib-group>
      <abstract>
        <p>We present the model checker MocOCL, a tool for model checking software models. The design rationale behind MocOCL is to close the gap between formal verification based on model checking and model-based engineering. Our approach avoids conversions that translate the software models into a format that a model checker can process. To this end, we implemented an explicit state model checker that directly processes the software model and verifies them against a specification formulated in a temporal extension of the constraint language OCL. MocOCL offers a web interface that interacts with the Eclipse Modeling Framework.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        We present the model checker MocOCL [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] which verifies whether a behavioral
software model satisfies its specification. In contrast to other model checking
approaches, MocOCL does not translate the software model to a formal
representation processable by an off-the-shelf model checker, but performs the
verification directly on the modeling level. Consequently, the results of the verification
are presented at the level of the original model and not on a conversion of the
models produced by the underlying verification engine.
      </p>
      <p>
        The specifications are expressed in cOCL [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], an OCL extension enriched
with temporal operators. With cOCL it is possible to define assertions for the
current state of the system and, in addition, formulate requirements that have
to hold in some or all future states. By using OCL we allow the modelers to
formulate specifications at the modeling layer and in their common working
environment.
      </p>
      <p>The input for our MocOCL tool are hence an Ecore model that represents
the static structure of the modeled system, graph transformations that specify
its behavior, an instance model conforming to the Ecore model that captures
? This work was partially funded by the Vienna Science and Technology Fund
(WWTF) under grant ICT10-018.
(Always|Exists) (Next | Globally | Eventually |
Until |
the system’s initial state, and a specification formulated with cOCL. For the
evaluation of such an expression, MocOCL implements an enumerative model
checking approach that represents states explicitly. The results of the evaluation
are then visualized in an informative user interface.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Running Example</title>
      <p>For the tool demonstration, we use a variation of the well–known Pacman game.
The game is played with a single Pacman and zero or more ghosts on a game
board consisting of several fields, some of which host a treasure. At each turn,
either Pacman or a ghost move to an adjacent field. The order of moves is not
restricted, i.e., Pacman might move multiple times before a ghost moves. Pacman
loses if he gets killed by a ghost, i.e., if both of them share the same field. Pacman
wins if he finds a treasure without being killed by a ghost. Figure 1 depicts an
initial state of the Pacman game.</p>
      <p>Any implementation of this game should fulfill cer- 1 2
tain properties. The rules of the game require, for
example, that the game is over if Pacman reaches a
treasure. Other properties enforce that Pacman must not get
trapped or that Pacman is able to reach a treasure (ini- 3 4
tially). In the following, we will show how these properties
are expressed using cOCL and how MocOCL evaluates
these cOCL expressions on a certain initial state given
as input model to find erroneous behavior. Fig. 1: Initial state
3</p>
    </sec>
    <sec id="sec-3">
      <title>Using the MocOCL Framework</title>
      <p>In this section we discuss our temporal, CTL-based extension of OCL, called
cOCL, and the verification workflow of MocOCL using the running example
presented in the previous section.</p>
      <p>The cOCL extension. We extend the OCL standard with operators from the
branching-time logic CTL. As shown in Fig. 2, '; are either Boolean OCL
expressions or cOCL expressions, each of which evaluates to a Boolean value
as well. In general CTL formulas are evaluated over sequences of states. In our
case, the states correspond to Ecore model instances.</p>
      <p>The semantics of these CTL operations are as follows. The path quantifier
Always (Exists) requires the following temporal operator to evaluate to true
in all (at least one) path(s) starting from the current state. The temporal
operators Next, Globally, Eventually, Until, and Unless specify
conditions on the path: Next requires to hold in the next state, Globally
requires to hold in all states, Eventually requires to hold in at least one
state and Until requires to hold eventually and holding before that,</p>
      <p>
        Unless requires to hold forever or before holds. For a more detailed
overview on the cOCL language and property evaluation we kindly refer to [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ].
Input preparation. The MocOCL framework verifies models of a system
specified as an Ecore3 model, an initial model instance, and graph transformations
specified in Henshin.4 Graphical editors are available for Henshin, and all Ecore
models and instances thereof. In our Pacman game, we use two Henshin graph
transformations as shown in Fig. 3 to describe the moves of Pacman and the
ghost, respectively. The game is over if no more rules can be applied.
      </p>
      <p>To verify the system, we need to formulate the system specification in cOCL.
For example, to express that the game is over if Pacman is on a treasure we
have to specify that in every state of the game if Pacman is on a treasure, there
is no next state. This may be expressed in cOCL with Always Globally
self.pacman.on.treasure implies (Always Next false) where the
context of the expression is, by default, set to the root object of the initial model,
that is, the Game class in this case.</p>
      <p>The requirement that Pacman does not get trapped is equivalent to Pacman
might always change its position provided that the game is not over. Thus, it
may be expressed as cOCL property Always (let x = pacman.on in
Exists Next x &lt;&gt; pacman.on) Unless (Always Next false).</p>
      <p>The requirement that it is possible that Pacman reaches all treasure fields at
some point in time is expressed as fields-&gt;select(treasure)-&gt;forAll(f
| Exists Eventually f = pacman.on).</p>
      <p>Usage. Once the input is prepared, MocOCL5 loads the Ecore model, the initial
model and the set of graph transformations as shown in Fig. 4. The prepared
input files are selected via the respective input fields (1), (2), and (3). If necessary,
only a subset of the rules defined in the Henshin file can be selected in (6a) and
3 http://www.eclipse.org/modeling/emf/?project=emf
4 https://www.eclipse.org/henshin/
5 Available for download at http://modelevolution.org/prototypes/
mococl/ with a simplified version for the Pacman example for Google Chrome
being usable online at http://modelevolution.org/mococl/
nreoibghhgbioernitdre:a:sFuiereld:1false neniegihgbhobror
State 4 to state 7 by movePacman
15
12
2 movePacman
on</p>
      <p>itdre:a:sFuiereld:3false
11
movePacman
4mnoaveP
mcaacm
Pevaonm2
4 movePacm1an3
7 ε 14
7 moveGhost</p>
      <p>12
itdre:a:sFuiereld:2false 16
on
17</p>
      <p>:Pacman
:Ghost
nreoigbhhbgioern
itdre:a:Fsuiereld:4true
(6b). Moreover, the user may choose to hide the Ecore model’s root container
(4). The tool’s verbose output is useful for understanding verification result (see
below), yet, its generation might consume a lot of memory. Thus, the user may
opt to restrict the tool’s output to a simple message that reports whether the
property is fulfilled or not by deselecting checkbox (5). After the user has entered
the cOCL expression into input field (8) and clicked on the Evaluate button (9),
all files and the expression are sent to the MocOCL server which evaluates the
expression and sends back the result to the Web GUI.</p>
      <p>The verification result (9) is displayed next to the Evaluate button together
with some performance information. The tree view (10) to the left of the output
(9) shows the verification result together with its cause. The cause explains why
the expression evaluated to either true or false. The cause of a CTL expression
consists of the states leading to the result. If a counter example trace is generated,
the cause consists of the last state of the trace. The cause of a state consists of
the expressions evaluated in the state and predecessor and successor states. Note
that due to the iterative state space exploration strategy, some states not relevant
for the result are omitted. The state space is represented in two different views
displayed in the right part of Fig. 4. The first view, the partial state space view
(11), shows all states occurring in the evaluation tree together with all known
transitions among these states. In the second view, the trace view (12), the states
of the evaluation tree are visualized as a trace leading from the initial to the final
states.</p>
      <p>Initial states, i.e., states without incoming transitions, are highlighted in
green. Final states, i.e., states without outgoing transitions, are highlighted
in orange. Transitions between two states that result from evaluating a sub–
expression are displayed semi-transparent and are connected to its immediate
parent–level expression using –transitions to differentiate between relevant parts
of the parent- and its sub–expressions. If the size of the displayed state space
together with all sub–expression transitions grows too large, these transitions
can be hidden by changing the setting (7) from Connected to none.</p>
      <p>Upon selecting a state or transition in the state space or trace view, the state
or transition is highlighted (13) and its model instance is displayed in the state–
visualization area (15). There, those parts of the model instance that occur
in sub–expressions are highlighted in purple (16). Associations in red (green)
indicate that these associations are deleted (added) (17) when transitioning from
the source to the target state.</p>
      <p>The result of the verification can be interpreted as follows. Recall that we
wanted to ensure that the game is over if Pacman has found the treasure. The
highlighted transition indicates that Pacman has really found the treasure, but
the ghost is still able to move. In fact, our moveGhost transition only forbids
the ghost from moving if he has killed Pacman, but not if Pacman has won the
game.
4</p>
    </sec>
    <sec id="sec-4">
      <title>Related Work</title>
      <p>
        Several model checkers for graph-based languages have been proposed in the
literature. CheckVML verifies systems defined by UML-like class diagrams
whose behavior is captured by a set of graph transformations against safety
properties provided as property graphs [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]. Groove [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] models the static
structure of a system with attributed, typed graphs and, like CheckVML and
MocOCL, defines the system’s operations with graph transformations.
Desirable properties are expressed with graph constraints which can be embedded in
CTL or LTL specifications. Because Groove does not support quantifiers some
temporal specifications defined in Groove grow linearly with the size of the
model or require additional constructs to track the existence of model elements.
Recently, neighborhood-based abstraction techniques have been implemented in
Groove to reduce the size of the generated state space [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. Henshin [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], an
Eclipse plugin to build graph transformations for Ecore models, produces the
state space starting from a user-provided initial model by applying a set of graph
transformations recursively to the initial and all subsequently derived models. It
supports the verification of safety properties specified as OCL invariants.
Systems with infinitely many states can be verified with Augur2 [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. It applies
abstraction techniques and produces a so-called Petri graph that
overapproximates the set of reachable states. Augur2 models systems with hypergraphs.
      </p>
      <p>
        The SOCLe tool verifies systems that are specified by a class diagram and
a set of state machines, which describe the behavior of each class, against an
EOCL specification [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. Like cOCL, EOCL extends OCL with CTL operators
but its formal semantics are not aligned with those of OCL. Al Lail et al. [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]
present a bounded model checker for specifications written in the LTL-inspired
OCL extension TOCL [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ].
In this paper we present MocOCL, a model checker for specifications formulated
in cOCL, an CTL–extension of OCL [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ].We showcase the concrete syntax of
cOCL and the verification workflow of MocOCL.
      </p>
      <p>Similar to Groove, where the system’s model and its specification are
described with attributed graphs, MocOCL allows its users to express the
verification problem at the level of the models that capture structure and behavior
of a system. This and the fact that cOCL extends OCL, which is presumably
well-known to modelers, lead to our conjecture that MocOCL bridges the gap
between model checking and model-based engineering. The validation of this
conjecture is subject to a future user study. In contrast to more mature tools
the performance of MocOCL requires improvements. For example, MocOCL
asserts that Pacman can win the game on a board with 32 fields and 2 ghosts
after 33,65 seconds while Groove requires only 21,65 seconds on a i5-2410M
machine with 2.3 GHz and 8 GB ram.</p>
      <p>In future work we plan to switch to an incremental evaluation algorithm
for cOCL specifications and remove expensive isomorphism checks currently
necessary during the exploration of the state space. Further, the integration of
MocOCL into Eclipse and an improved user interface are work in progress.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Arendt</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Biermann</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Jurack</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Krause</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Taentzer</surname>
          </string-name>
          , G.:
          <article-title>Henshin: Advanced Concepts and Tools for In-Place EMF Model Transformations</article-title>
          .
          <source>In: Model Driven Engineering Languages and Systems. LNCS</source>
          , vol.
          <volume>6394</volume>
          , pp.
          <fpage>121</fpage>
          -
          <lpage>135</lpage>
          . Springer (
          <year>2010</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Bill</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gabmeyer</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          , Kaufmann,
          <string-name>
            <given-names>P.</given-names>
            ,
            <surname>Seidl</surname>
          </string-name>
          ,
          <string-name>
            <surname>M.:</surname>
          </string-name>
          <article-title>OCL meets CTL: Towards CTLExtended OCL Model Checking</article-title>
          .
          <source>In: Proceedings of the MODELS 2013 OCL Workshop. CEUR Workshop Proceedings</source>
          , vol.
          <volume>1092</volume>
          , pp.
          <fpage>13</fpage>
          -
          <lpage>22</lpage>
          . CEUR-WS.org (
          <year>2013</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Kastenberg</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rensink</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>Model Checking Dynamic States in GROOVE</article-title>
          .
          <source>In: Model Checking Software. LNCS</source>
          , vol.
          <volume>3925</volume>
          , pp.
          <fpage>299</fpage>
          -
          <lpage>305</lpage>
          . Springer (
          <year>2006</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>König</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kozioura</surname>
          </string-name>
          , V.:
          <article-title>Augur2 - A New Version of a Tool for the Analysis of Graph Transformation Systems</article-title>
          .
          <source>Electr. Notes Theor. Comput. Sci</source>
          .
          <volume>211</volume>
          ,
          <fpage>201</fpage>
          -
          <lpage>210</lpage>
          (
          <year>2008</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Lail</surname>
            ,
            <given-names>M.A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Abdunabi</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          , France,
          <string-name>
            <given-names>R.</given-names>
            ,
            <surname>Ray</surname>
          </string-name>
          ,
          <string-name>
            <surname>I.</surname>
          </string-name>
          :
          <article-title>An Approach to Analyzing Temporal Properties in UML Class Models</article-title>
          .
          <source>In: Proceedings of the 10th International Workshop on Model Driven Engineering</source>
          , Verification and Validation (MoDeVVa
          <year>2013</year>
          ).
          <source>CEUR Workshop Proceedings</source>
          , vol.
          <volume>1069</volume>
          , pp.
          <fpage>77</fpage>
          -
          <lpage>86</lpage>
          . CEUR-WS.org (
          <year>2013</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Mullins</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Oarga</surname>
          </string-name>
          , R.:
          <article-title>Model Checking of Extended OCL Constraints on UML Models in SOCLe</article-title>
          . In:
          <article-title>Formal Methods for Open Object-Based Distributed Systems</article-title>
          . LNCS, vol.
          <volume>4468</volume>
          , pp.
          <fpage>59</fpage>
          -
          <lpage>75</lpage>
          . Springer (
          <year>2007</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Rensink</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zambon</surname>
          </string-name>
          , E.:
          <article-title>Neighbourhood Abstraction in GROOVE</article-title>
          .
          <source>ECEASST 32</source>
          ,
          <issue>13</issue>
          (
          <year>2010</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Schmidt</surname>
          </string-name>
          , Á.,
          <string-name>
            <surname>Varró</surname>
            ,
            <given-names>D.:</given-names>
          </string-name>
          <article-title>CheckVML: A Tool for Model Checking Visual Modeling Languages</article-title>
          . In:
          <article-title>UML 2003 - The Unified Modeling Language and Applications</article-title>
          . LNCS, vol.
          <volume>2863</volume>
          , pp.
          <fpage>92</fpage>
          -
          <lpage>95</lpage>
          . Springer (
          <year>2003</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Ziemann</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gogolla</surname>
            ,
            <given-names>M.:</given-names>
          </string-name>
          <article-title>OCL Extended with Temporal Logic</article-title>
          .
          <source>In: Perspectives of Systems Informatics. LNCS</source>
          , vol.
          <volume>2890</volume>
          , pp.
          <fpage>351</fpage>
          -
          <lpage>357</lpage>
          . Springer (
          <year>2003</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>