<!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>Specifing and Verifing Aspect-Oriented Systems in Rewriting Logic</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Amina BOUDJEDIR</string-name>
          <email>a.boudjedir@hotmail.fr</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Toufik BENOUHIBA1, Djamel MESLATI2</string-name>
          <email>1toufik.benouhiba@gmail.com</email>
          <email>2meslati_djamel@yahoo.com</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>LISCO Laboratory, Department of computer science, Badji Mokthar University.</institution>
          <addr-line>Annaba</addr-line>
          ,
          <country country="DZ">Algeria</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2014</year>
      </pub-date>
      <fpage>2</fpage>
      <lpage>4</lpage>
      <abstract>
        <p>- Aspect-oriented (AO) systems have to deal with an important problem which is the management of aspect interaction. In this paper, we introduce a first tool, known as AO-Maude, which is based on Maude language for the specification and the verification of the AO systems. The proposed tool relies on the reflection feature of rewriting logic that allows us to represent in the Meta-Level the structure of the base system, aspects and the weaver mechanism. The contributions of this paper are twofold. First, we provide a support for the specification of the AO systems in Maude language and thus discharge the user from the task of the definition of the weaver mechanism each time. Second, our extension offers a support to the AO systems in Maude while managing the aspect interaction problem in general and the scheduling problem in particular. The proposed tool is illustrated with a concrete case study.</p>
      </abstract>
      <kwd-group>
        <kwd>- Aspect-oriented system</kwd>
        <kwd>aspect interaction</kwd>
        <kwd>Aspect-UML</kwd>
        <kwd>rewriting logic</kwd>
        <kwd>Maude</kwd>
        <kwd>Meta-Level</kwd>
        <kwd>verification</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. INTRODUCTION</title>
      <p>
        Aspect-oriented (AO) systems have been
proposed to capture transversal preoccupations.
They are considered as a necessary
complementarity to the object oriented systems
[
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. Generally speaking, an AO application is
composed of two parts: Base system to
implement the system functions and Aspects to
implement the Cross-cutting concerns. An
Aspect also consists of two parts: pointcut and
advice. A pointcut is a set of many join points
where an advice should be executed. An advice
is the behavior of an aspect. It can be executed
before, after or around the join point that has
been selected by a pointcut. The AO weaver
ensures the integration of the base system and
aspects functionality.
      </p>
      <p>
        However, AO weaver can drastically change the
semantic of the base system (e.g. some
properties can be affected by the introduction of
some aspects [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]) and thus unexpected results
can emerge. In the AO, this issue is commonly
known as the aspect interaction problem [
        <xref ref-type="bibr" rid="ref1 ref3">1, 3</xref>
        ].
In fact, there are many kinds of aspect
interaction problem: dependence, scheduling,
redundancy, etc [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. For example, the
scheduling problem, which is the subject of this
paper, occurs when many independent aspects
are concerned by the same joint point. In this
case, the execution of these aspects may have
some undesirable effect on the base system if
they are executed in any order. Some of these
orders can interact badly with the properties of
the base system. In such circumstances, the
aspects interfere with each other in a potentially
undesired manner and they can be used in a
harmful way that invalidates desired properties
and thus change the semantic of the base
system. Note however that the presence of this
conflict does not lead necessarily to a violation
of base system properties.
      </p>
      <p>
        Many works have tried to tackle this problem in
different ways. By using the model-checking
technique, several approaches have been
proposed for the verification of aspect-oriented
systems. The authors of [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] define incremental
aspect model-checking which consisted to
modularize the verification of aspects (i.e. verify
properties against aspect without having access
to the program source). The authors of [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]
present an approach for modeling and verifying
aspect-oriented systems with finite state
machines. They define class and aspect models
with state machines. These models are then
composed and weaved into a final model via
weaving mechanism. Once the model that
represents the entire system is generated, they
proceed to verify the system against the desired
system properties by using the LTSA (Labelled
Transition System Analyser) model checker [6].
However, the weaving process was not
rigorously defined and the authors did not
consider the scheduling problem since they
suppose a predefined execution order. Another
attempt for the formal verification of the
aspectoriented systems exploits the techniques of
model checking. We can cite the proposed
approach of [7]. This approach builds the aspect
model and verifies the deadlock problem with
Spin model checker [8]. In a series of papers [9,
10, 11], Katz and his group have addressed
various issues of model checking
aspectoriented code. For instance in [11], the authors
suggest an assume-guarantee structure to
achieve modular and generic verification of AO
systems. They verify that for any base state
machine satisfying the assumptions of a given
aspect, the woven state machine is guaranteed
to satisfy the desired properties.
      </p>
      <p>
        Depending on the source-code level, several
works have been proposed in the area of the
static aspect analysis [
        <xref ref-type="bibr" rid="ref6 ref7">12, 13</xref>
        ] where aspect
conflict can be detected depending on pointcut
definitions. We can also cite the work of [
        <xref ref-type="bibr" rid="ref8">14</xref>
        ] in
which the authors present a language named
compAr in order to model aspects with around
advices. However, the complexity of the
sourcecode can be an important drawback of these
approaches. In addition, the aspect interaction
problem has to be detected and fixed in early
development stages in order to minimize
maintenance costs.
      </p>
      <p>
        Depending on the design level, different
approaches [
        <xref ref-type="bibr" rid="ref10 ref11 ref9">15, 16, 17,</xref>
        ] tried to integrate
aspects within abstract models to ensure early
detection of interaction problem. For instance,
we propose in [
        <xref ref-type="bibr" rid="ref11">17</xref>
        ] a rewriting system [
        <xref ref-type="bibr" rid="ref12">18</xref>
        ] in
order to verify and detect bad aspect interaction.
We used the Aspect-UML [
        <xref ref-type="bibr" rid="ref9">15</xref>
        ] which is a UML
profile that extends the classic UML use case
and class diagrams with different concepts of
AO. We translated the base system of the
Aspect-UML models into Maude [
        <xref ref-type="bibr" rid="ref13">19</xref>
        ]
specifications. Then the aspects and their
subsequent concepts are translated into Maude
specification. Finally, a weaving step is defined
in order to integrate the aspects into the base
system. Afterwards, all these specifications are
formally verified by the Maude tool in order to
detect possible conceptual errors concerning
aspect interactions. Although, the result of the
proposed approach helps us to detect bad
aspect interaction, the implementation of the
approach contains some messy code. In fact, in
the early proposed approach the user specifies
not only the aspect models, but also the aspect
composition and the weaver process. This later
makes the task very tedious to do it each time.
In this work, we aim to provide a support that
hides all the details of the weaver. The user thus
cares only about the specification of the base
system and aspect. This support is an extension
of the rewriting systems in general and of Maude
language in particular for the specification and
verification of Aspect-UML models. This
extension is realized as a first AO-Maude
support. This one relies on the reflection feature
of Maude system which allows us to represent in
the Meta-Level: the general form of base system
and aspects of the Aspect-UML models, the
processing of the aspect composition and the
weaver mechanism. The user represents only
the Aspect-UML models by base and aspect
modules. Afterward, he gives the task of the
composition and integration of the aspects within
the base system to the defined weaver. The
result of this composition and integration is
examined later in order to detect and verify
aspect interaction problem.
      </p>
      <p>This paper is organized as follows. In section 2,
we give an overview on the rewriting logic and
the reflective capabilities of the Maude system.
In section 3, we outline the main phases
adopted in the realization of our support. We
illustrate, in section 4, the proposed support in a
case study. Finally, section 5 concludes the
paper.
2. REWRITING LOGIC AND THE
META</p>
      <p>
        LEVEL OF MAUDE
Rewriting logic is introduced by José Méseguar
[
        <xref ref-type="bibr" rid="ref13">19</xref>
        ]. This logic is a reflective framework for
expressing a very wide range of concurrent
systems and languages. Thus, many languages
based on this logic (ASF+SDF [
        <xref ref-type="bibr" rid="ref14">20</xref>
        ], CafeOBJ
[
        <xref ref-type="bibr" rid="ref15">21</xref>
        ], Maude have been proposed.
      </p>
      <p>
        In this paper, we use Maude language which is
a specification and programming language. It
allows us to define data types by giving
signatures and equations. The behavior is
specified by the use of rewrite rules. Maude also
supports the modeling of object oriented
systems and integrates an LTL model-checker
that can be used to verify the required
properties. This modeling and verification is
supported in different ways. Currently, Maude
offers two ways (the Core Maude and Full
Maude) to support that. The two ways are
similar but are based on different levels of the
language. In addition, Maude language supports
some Meta-functionalities [
        <xref ref-type="bibr" rid="ref13">19</xref>
        ] that help us to
build new environments and languages by
implementing an extension of Maude. Full
Maude is the real example of the extension of
Maude. It endows the language with an even
more powerful and extensible module algebra
[
        <xref ref-type="bibr" rid="ref16">22</xref>
        ]. Full Maude itself can be used as a basis for
further extensions by adding new functionality. It
is possible both to change the syntax or the
behavior of existing features and to add new
features. In this way, many concurrent systems
have inspired extensions to different kinds of
systems via Full Maude specifications such as:
real-time system [
        <xref ref-type="bibr" rid="ref17">23</xref>
        ], probabilistic system [
        <xref ref-type="bibr" rid="ref18">24</xref>
        ],
etc. Thus, since Full Maude offers a way to
define new environments and tools; we agreed
to use its functionalities in order to provide an
attractive support for the modeling and the
verification of aspect-oriented systems by
rewriting systems. These features allow us to
define not only the weaver mechanism at the
Meta-Level, but also to avoid the
reimplementation of the code and thus take
advantage of the infrastructure provided.
      </p>
    </sec>
    <sec id="sec-2">
      <title>3. OVERVIEW ON THE AO-MAUDE</title>
      <p>The aim of our work is to define a support in
which all details of the aspect composition and
the weaver mechanism are hidden. This is done
by defining the syntax of each base model,
aspect model, aspect composition and the
weaver mechanism at the Meta-Level of the
AOMaude. The idea behind this definition is to rid
the user from the task of the definition of aspect
composition and weaver mechanism each time.
The user has only to represent the Aspect-UML
models by base and aspect modules. Afterward,
he gives the task of the composition and
integration of the aspects within the base system
to the defined weaver. As it is shown in Figure 1,
the AO-Maude is divided into two parts: what we
have defined in the Meta-level and what the user
should write. The specification of AO-Maude
follows the following steps:</p>
    </sec>
    <sec id="sec-3">
      <title>3.1. Definition of a useful module</title>
      <p>
        The aim of this step is to define a module that
specifies the different concepts of the aspect
model (i.e. aspect type/sort, attributes sort,
methods sort and general form of advices). All
these elements are an extension of other
concepts in Maude. The idea behind this
definition is to provide a generic module that can
be imported at any time by the user as well as
some other Maude module (likes the Nat module
for natural number, etc).
3.2. Definition of base/aspect modules’
syntax
Since the AO-Maude is a first proposed tool, we
agreed to specify all the declarations and
statements of base and aspect modules in the
same manner of Maude modules style (i.e. we
keep all the different concepts of these modules
such as: sorts, operators, equations, rules, etc).
This idea allows as not only to avoid the
reimplementation of the code (i.e. defining new
parser and compiler) and thus taking advantage
of the infrastructure provided, but also to rid the
user of the step of the learning of new syntax.
However, in order to make the deference
between the Maude modules and AO-Maude
(base and aspect) modules, we have enclosed
the base module body between the keywords
bmod and endbm and the aspect module body
between the keywords amod and endam.
3.3. Transformation of the base/aspect
modules into ordinary modules
The aim of our work is to provide a support that
allows the user to specify the aspect models and
detect aspect interaction. The detection of
aspect interaction is based essentially of the
analysis of the preservation or the violation of
the pre/postconditions of method/ advice. This
principle has been used in our previewed work
[
        <xref ref-type="bibr" rid="ref11">17</xref>
        ], where the user specifies the behavior of
each method/advice by two rewriting rules in
order to detection at the end aspect interaction.
The first rewriting rule is used in the case where
the method/advice preconditions are preserved
whereas the second rule is used when these
preconditions are violated. However, we think
that it would be better to unload the user from
AO-Maude
META-LEVEL
AO-Maude
OBJECT-LEVEL
      </p>
      <p>User</p>
      <p>Definition of predefined module
Specification of Aspect Modules’</p>
      <p>Syntax
Specification of Base Modules’</p>
      <p>Syntax
Specification of Command Syntax</p>
      <p>Writing Base and</p>
      <p>Aspect Modules
Writing Command
to check Aspect</p>
      <p>Interaction</p>
      <p>Transformation of
Base/Aspect Modules’
Concept to Ordinary</p>
      <p>Modules
Specification of
the Weaver</p>
      <p>Strategy
Base and
Aspect
Modules</p>
      <p>Command
this task because it becomes heavy and tedious
to do it especially when the number of aspect
(advices) and methods is important.</p>
      <p>
        Consequently, to ensure the detection of the
preservation or the violation of the
pre/postconditions of method/advice, we agreed
to define at the Meta-Level some functions that
handle the rules of each method/advice. These
functions transform each rule that represents the
behavior of each method/advice into two
rewriting rules. The first rewriting rule is used in
the case where the method/advice preconditions
are preserved. In this case the method/advice
can be executed with success whereas the
second rule corresponds to the case where the
method/advice preconditions are violated. As a
consequence, the execution of the
method/advice leads to an erroneous state.
3.4. Definition of the strategies of the weaver
The aim of this step is to discharge the user
from the task of the definition of the weaver
mechanism each time. Thus, all the messy code
of the weaver of [
        <xref ref-type="bibr" rid="ref10 ref11 ref9">15, 16, 17</xref>
        ] will be hidden in the
Meta-Level.
      </p>
      <p>When the user specifies the base system and
aspect modules in the first stage, he proceeds,
in the second stage, to the step of the
composition and the integration of these aspects
via the base system. This step is guaranteed via
the internal strategies of the defined weaver. In
a general way, the different steps of the defined
weaver are the following:
 Detecting the invoked joint point during
the execution of the base system. The
aim of this step is to detect among the
different base system methods, the method
that represents the join point which is
indicated
aspects.</p>
      <p>by
the
different
introduced
 Collecting the before and after advices
that share the detected join point. To
ensure the execution of the before and after
advices (note that only before and after
advices are considered in this paper), we
have used a set of functions that collect the
before and after advices in two different lists.
 Permuting the collected before and after
advices. We have used a set of equations
that helps us to get two lists of all possible
permutation of the before and after advices.
The idea behind that is to ensure, on one
hand, the non-deterministic composition of
all order of the conflicting advices and, on
the other hand, the detection of the
preservation or the violation of the
pre/postconditions of each advice in each
permutation.
 Composing and integrating the different
advices. We have used a set of functions to
compose and execute each advices
permutation. Thanks to the built-in functions,
each advice of each permutation is executed
in the Meta-Level. We have also used a set
of functions to switch between the base
system and the composed advices in order
to guarantee at the end the integration of the
aspect in the base system.
3.5. Definition of the command that ensure
the verification of aspect interaction
problem
The verification of the composition and the
integration of these advices in the base system
(which is known as the weaver mechanism) is
guaranteed via our defined command that
follows this principle:
Principle: Let adv1,…,advn be the advices to be
executed on a join point, pre(advi) be the
precondition of advi and post(advi) be the
postcondition of advi . Our proposed command
tries to ensure the following points:
Advice-Advice interaction. Our defined
command tries to ensure the interaction
between advices. The verification of the advices
ordering consists of verifying that the
postconditions of the advice advi should implies
the preconditions of the advi+1 as : post(advi)=&gt;
pre(advi+1) for every i.</p>
      <p>Base-Advice interaction. We aim that the
defined command ensures also the interaction
between the base system methods and the
advices. Thus, the command tries to verify that:
 The postconditions of the base system
method (it can be a join point) should implies
the preconditions of the first advice adv1 as :
post(base)=&gt; pre(adv1) or ;
 The postconditions of the last advice advn
should imply the preconditions of the base
system method (it can be a join point) as:
post(advn)=&gt; pre(base) .</p>
    </sec>
    <sec id="sec-4">
      <title>4. CASE STUDY</title>
      <p>
        To illustrate our work, we present an example
used in [
        <xref ref-type="bibr" rid="ref10">16</xref>
        ] which is a telephony application.
Figure 2 shows the Aspect-UML class diagram
of this example. The base system, modelled by
a set of classes, provides core functionalities to
simulate devices and connections. To these
basic functionalities, aspects can be added,
such as the interrupting callee and the call
forwarding features. These two aspects are
used to handling busy lines. They crosscut the
base system through the pointcut OpComplete
which concerns the join point Complete. Note
that this is a typical situation of aspects conflict
because two operations will be added before the
join point and executed in a given order. Figure
1 shows how both the aspects are added to
enrich the base class diagram.
4.1. Representation of the base system in
      </p>
      <p>AO-Maude
In the proposed work, the user writes only the
base and aspect modules in the same manner
as an ordinary Maude module. We present
below a part of connection class as:</p>
      <p>if
endbm
bmod CONNECTION is
pr CONFIGURATION .
op Connection : -&gt; Cid . ---1 ClassName
op C-Status: C-State -&gt;Attribute. --2 Attributes
op Origin: Oid -&gt; Attribute .
op Destination : Oid -&gt; Attribute .
op Complete : Oid -&gt; Msg . 3 Methods
...
crl : Complete(C1) ---4
&lt;D1 : Device | D-Status: Waiting &gt;
&lt;C1 : Connection | C-Status : State &gt;
&lt;D2 : Device | D-Status : Idle &gt;
=&gt;
&lt;D1 : Device | D-Status : Busy &gt; ---A
&lt;C1:Connection | C-Status :Connected &gt;
&lt;D2 : Device | D-Status : Busy &gt;
State == Disconnected. ---B
context Interrupting
pre : Destination. D-Status = Busy
post : Destination. D-Status = Idle
post : Destination.Current.C-Status = Interrupted</p>
      <p>Connection
+ C-Status: String
+ Origin : Device
+ Destination: Device
+ ActivateLigne()
+ Transmission (num: String)
+ Complete ()
+ Drop ()
opComplete: : Binding
ToJoinPoint: Connection. Complete
Binds: C Target
context Forwarding
pre :Destination. D-Status = Busy
pre : exists (D ) in forwardL
post : .Destination = D
&lt;&lt;Aspect&gt;&gt;</p>
      <p>Interrupting
+ interruptedC : ListOfConnection
before
opComplete (C :Connection)
&lt;&lt;PointCut&gt;&gt;
opComplete
+call Connection.Complete
+ opComplete (C )
&lt;&lt;Aspect&gt;&gt;</p>
      <p>Forwarding
+ forwardL : ListOfForwardedNum
before
opComplete (C :Connection)
Device
+ D-Status: String
+ Num : String
+ Current: Conenction
+ Pickup()
+ Hangup()
+ Tone ()
+ Dial (num: String)
+ Ring ()</p>
      <p>2
context Complete()
pre : C-Status = Disconnected
post : C-Status = Connected
post : Origin.D-Status = Disconnected
post : Destination.D-Status = Disconnected
The connection class is represented with a base
module. This module should import the
Configuration Maude module in order to
represent the main concepts of object-oriented
systems. The name of this class is represented
by an operator in mark 1. The attributes of this
class are represented with operators of sort
Attribute (mark 2). The methods (we take only
one method) are also represented by operators
as it is shown in mark 3. The behavior of each
method is represented by conditional rewriting
rule (mark 4). The left hand side of this rule
represents the object C1 of class connection
with the actual C-Status State. The Term
Complete() means that a message is sent to the
object C1 asking for the execution of Complete()
method. Whereas, the right hand side of this rule
shows the state of the behavior of the object
after executing the Complete() method. The pre
and postconditions of the method are
represented respectively by the marks B and A.
4.2. Representation of aspects in AO-Maude
We illustrate in the following a part of the
interrupting aspect of the figure 2. This aspect is
represented by an aspect module where it
should import the Asp&amp;Adv-Configuration
AOMaude module. It defines an operator to
represent the name of aspect (as it is shown in
mark 2). The attribute of this aspect is
represented in the mark 3. The name, the type
of this advice and the invoked join point are
represented with the term DefAdv in mark 4. The
specification of the behavior of the advice
InterruptAdvice is represented with a rewriting
rule. The pre and postconditions of this advice
are respectively represented with the condition
of the rule and the left hand side of this rule.
amod INTERRUPTING is
pr CONNECTION .
pr Asp&amp;Adv-Configuration . ---1
op Interrupting : -&gt; Aid . ---2 AspectName
Op InterruptedC: List{Oid} -&gt; AspAttribute.---3
Attribute
op InterruptAdvice: -&gt; AdvName . ---AdviceName
...
crl:
DefAdv</p>
      <p>&lt;InterruptAdvice,Before,Complete(C1)&gt; ---4
&lt;D1 : Device | D-Status : Waiting &gt;
&lt;C1:Connection | C-Status : Disconnected &gt;
&lt;D2 : Device | D-Status : State &gt;
&lt;C2 : Connection | C-Status : Connected &gt;
&lt;InterruptAdvice: Interrupting |I-Status : Idle&gt;
=&gt;
&lt;D1 : Device | D-Status : Waiting &gt;
&lt;C1:Connection | C-Status : Disconnected &gt;
&lt;C2 : Connection | C-Status : Interrupted &gt;
&lt;D2 : Device | D-Status : Idle , &gt;
&lt;InterruptAdvice : Interrupting|I-Status
:Interrupting &gt;
if State == Busy.
endam
...
4.3. Transformation of the base/aspects
modules into ordinary Maude modules
Once the user has defined the base and aspect
modules, the AO-Maude transforms each
module into an ordinary Maude module (as it is
shown in section 3 step(3)). Since each
introduced base or aspect module is similar to
the Maude module (i.e. all the different concepts
of these modules are kept), the AO-Maude
transforms only the behavior of each
method/advice (which is represented by one
rewriting rule) into two rewriting rules. Note that
this transformation is done in the Meta level and
with a transparent way to the user. We just
present how the connection class becomes (in
the same manner the different aspects are
transformed):
mod CONNECTION is ...
crl : Complete(C1)
&lt;D1 : Device | D-Status: Waiting &gt;
&lt;C1 : Connection | C-Status : State &gt;
&lt;D2 : Device | D-Status : Idle &gt;
=&gt;
&lt;D1 : Device | D-Status : Busy &gt;
&lt;C1:Connection | C-Status :Connected &gt;
&lt;D2 : Device | D-Status : Busy &gt;</p>
      <p>ResultExecution(Complete(C1),Success)
if State == Disconnected.
if
endm
crl : Complete(C1)
&lt;D1 : Device | D-Status: Waiting &gt;
&lt;C1 : Connection | C-Status : State &gt;
&lt;D2 : Device | D-Status : Idle &gt;
=&gt;
&lt;D1 : Device | D-Status : Busy &gt;
&lt;C1:Connection | C-Status :Connected &gt;
&lt;D2 : Device | D-Status : Busy &gt;
ResultExecution(Complete(C1),Error)</p>
      <p>State =/= Disconnected. ...</p>
      <p>Since all the concepts (class, attributes and
method name) are presented in the same way
as they were defined in the base module, this
module presents only the transformation of the
method Complete into two rewriting rules. The
first rule will be executed when the preconditions
of this method are preserved (the preconditions
should ensure that State is equal to
Disconnected), in this case the method is
executed with success. Otherwise, the second
rule will be execute and indicates an error
execution of method. We have used a term
ResultExecution(Complete(),Success/Error) to
show the successful /failure execution of the
method Complete.
4.4. Detection of aspect interaction with the
defined command
In this steps, the user proceeds to verify the
composition and the integration of the aspects in
the base system (the written classes).
Remember that our purpose consists of
ensuring the composition and the integration of
all possible advices order and checking if all pre
and postconditions of the advices and methods
are preserved. By using our defined command
CheckExecution, we can verify the composition
and the integration of aspects in the base
system as:
CheckExecution(
&lt;C1 : Connection | C-Status : Idle &gt;
&lt;D1 : Device | D-Status: Idle &gt;
&lt;D2 : Device | D-Status: Idle &gt; Pickup()
ASPECTs(
&lt; InterruptAdvice : Interrupting | I-Status : Idle
&gt;
&lt; ForwardAdvice : Forwarding | F-Status : Idle &gt;
))
The AO-Maude starts the verification from the
initial terms of the CheckExecution command. It
tests whether all possible orders of advices can
be executed with success. AO-Maude finds out
two possible solutions (since we have only two
advices). In the first solution, we have obtained
a failure execution of the InterruptAdvice. This
situation is due to the following: before executing
the join point Complete(), the AO-Maude starts
the composition of the advices by executing the
InterruptAdvice as the first advice. This advice
interrupts the current connection and changes
the status of destination to Idle. Once the
InterruptAdvice ends, the control flow is passed
to the ForwardAdvice. At that time a warning
message is printed by the fact that the
preconditions of this advice are not verified (pre:
Destination. D-Status = Busy, see figure 2).
Thus, the execution of the InterruptAdvice
before the ForwardAdvice leads to the violation
of the preconditions of ForwardAdvice. Note that
the violation of the pre and/or postconditions
does not mean necessarily that the base system
will be halted but we can say that the whole
system would be in an incoherent status, which
makes it impossible to predict its future states.
Thus, the execution of the ForwardAdvice
should hence be considered first as it was found
in the second solution.</p>
    </sec>
    <sec id="sec-5">
      <title>5. CONCLUSION</title>
      <p>In this paper, we have investigated the aspect
interaction problem in general and aspect
scheduling in particular. We have presented a
new tool for the modeling and the verification of
aspect-oriented systems in rewriting logic. In this
tool, reflection feature played a decisive role.
This tool, which name is AO-Maude, allowed us
to define in the Meta-Level the structure of base
and aspect modules, weaver mechanism and
new command that ensures the verification of
the composition and the integration of aspects in
the base system.</p>
      <p>By using the new command in a case study, it is
possible to check whether the interaction of
aspects affects either their properties or the
base system properties.</p>
      <p>The current tool can be improved in different
ways. The first idea is to extend this tool by
integrating the around advices and considering
more general kind of pointcuts by defining them
on aspects. We can also define other
commands that helps us to display the search
graph generated by the last search.</p>
    </sec>
    <sec id="sec-6">
      <title>6. REFERENCES</title>
      <sec id="sec-6-1">
        <title>Site: [6] LTSA Web http://www.doc.ic.ac.uk/ltsa/.</title>
        <p>[8] G.J Holzmann, “The model-checker SPIN”,
IEEE Transcripts on Software Engineering,
pp. 01-17, 1997.</p>
      </sec>
      <sec id="sec-6-2">
        <title>Languages</title>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>R.</given-names>
            <surname>Pawlak</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.P.</given-names>
            <surname>Retaillé</surname>
          </string-name>
          and
          <string-name>
            <given-names>L.</given-names>
            <surname>Seinturier</surname>
          </string-name>
          , “
          <article-title>Programmation orientée aspect pour Java/J2EE”</article-title>
          ,
          <string-name>
            <surname>First</surname>
            <given-names>Edition</given-names>
          </string-name>
          , Paris,
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>S.</given-names>
            <surname>Djoko</surname>
          </string-name>
          <string-name>
            <surname>Djoko</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Douence</surname>
          </string-name>
          and
          <string-name>
            <given-names>P.</given-names>
            <surname>Fradet</surname>
          </string-name>
          , “Aspects Preserving Properties”, ACM Press, Vol.
          <volume>3</volume>
          , pp.
          <fpage>393</fpage>
          -
          <lpage>422</lpage>
          ,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>K.</given-names>
            <surname>Tian</surname>
          </string-name>
          , k. Cooper,
          <string-name>
            <given-names>K.</given-names>
            <surname>Zhang</surname>
          </string-name>
          and
          <string-name>
            <given-names>H.</given-names>
            <surname>Yu</surname>
          </string-name>
          , “
          <article-title>A Classification of Aspect Composition Problems”</article-title>
          , IEEE International Conference SSIRI. Shanghai, pp.
          <fpage>101</fpage>
          -
          <lpage>109</lpage>
          ,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>S.</given-names>
            <surname>Krishnamurthi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Fisler</surname>
          </string-name>
          and
          <string-name>
            <given-names>M.</given-names>
            <surname>Greenberg</surname>
          </string-name>
          , “
          <article-title>Verifying aspect advice modularly”</article-title>
          ,
          <source>ACM SIGSOFT Symposium on Foundations of Software Engineering</source>
          , USA, pp.
          <fpage>137</fpage>
          -
          <lpage>146</lpage>
          ,
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>D.X.</given-names>
            <surname>Xu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>O.</given-names>
            <surname>El-Ariss</surname>
          </string-name>
          ,
          <string-name>
            <given-names>W.F.</given-names>
            <surname>Xu</surname>
          </string-name>
          , and
          <string-name>
            <given-names>L.Z.</given-names>
            <surname>Wang</surname>
          </string-name>
          , “
          <article-title>Aspect-Oriented Modeling and Verification with Finite State Machines”</article-title>
          ,
          <source>Journal of computer science and technology</source>
          , pp.
          <fpage>949</fpage>
          -
          <lpage>961</lpage>
          ,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>R.</given-names>
            <surname>Douence</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Fradet</surname>
          </string-name>
          , and
          <string-name>
            <given-names>M.</given-names>
            <surname>Sudholt</surname>
          </string-name>
          , “
          <article-title>Composition, reuse and interact analysis of stateful aspects”</article-title>
          , International Conference AOSD, pp.
          <fpage>141</fpage>
          -
          <lpage>150</lpage>
          ,
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [13]
          <string-name>
            <given-names>M.</given-names>
            <surname>Störzer</surname>
          </string-name>
          and
          <string-name>
            <given-names>J.</given-names>
            <surname>Krinke</surname>
          </string-name>
          , “
          <article-title>Interference analysis for AspectJ”</article-title>
          .
          <source>Workshops on Foundations of Aspect-Oriented Languages</source>
          ,
          <year>2003</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [14]
          <string-name>
            <given-names>R.</given-names>
            <surname>Pawlak</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Duchien</surname>
          </string-name>
          and
          <string-name>
            <given-names>L.</given-names>
            <surname>Seinturier</surname>
          </string-name>
          , “CompAr: Ensuring Safe Around Advice Composition”,
          <source>International Conference on Formal Methods for Open Object-Based Distributed Systems</source>
          , France,
          <year>2005</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [15]
          <string-name>
            <given-names>F.</given-names>
            <surname>Mostefaoui</surname>
          </string-name>
          , “
          <article-title>Un cadre formel pour le développement orienté aspect : modélisation et vérification des interactions dues aux aspects”</article-title>
          ,
          <source>PhD thesis</source>
          , Canada,
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [16]
          <string-name>
            <given-names>F.</given-names>
            <surname>Mostefaoui</surname>
          </string-name>
          and
          <string-name>
            <given-names>J.</given-names>
            <surname>Vashon</surname>
          </string-name>
          , “
          <article-title>Design-level Detection of Interactions in Aspect UML models using Alloy”</article-title>
          ,
          <source>Journal of Object Technology</source>
          , vol.
          <volume>6</volume>
          , pp
          <fpage>137</fpage>
          -
          <lpage>165</lpage>
          ,
          <year>2007</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [17]
          <string-name>
            <given-names>A.</given-names>
            <surname>Boudjedir</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.</given-names>
            <surname>Benouhiba</surname>
          </string-name>
          and
          <string-name>
            <given-names>D.</given-names>
            <surname>Meslati</surname>
          </string-name>
          , “
          <article-title>Verification of aspect composition and integration using rewriting systems”</article-title>
          ,
          <source>the International Symposium on Modelling and Implementation of Complex Systems</source>
          , pp.
          <fpage>138</fpage>
          -
          <lpage>148</lpage>
          . Algeria ,
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [18]
          <string-name>
            <given-names>N.</given-names>
            <surname>Dershowitz</surname>
          </string-name>
          and
          <string-name>
            <given-names>J.P.</given-names>
            <surname>Jouannaud</surname>
          </string-name>
          , “Rewrite Systems”,
          <source>Formal Models and Semantics</source>
          , North-Holland, pp.
          <fpage>243</fpage>
          -
          <lpage>320</lpage>
          ,
          <year>1990</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [19]
          <string-name>
            <given-names>M.</given-names>
            <surname>Clavel</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Durán</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Eker</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Lincoln</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Marti-Oliet</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Meseguer</surname>
          </string-name>
          and
          <string-name>
            <given-names>C.</given-names>
            <surname>Talcott</surname>
          </string-name>
          . “
          <source>Maude Manual (Version</source>
          <volume>2</volume>
          .6)”, SRI,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [20]
          <string-name>
            <given-names>A.V.</given-names>
            <surname>Deursen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Heering</surname>
          </string-name>
          and
          <string-name>
            <given-names>P.</given-names>
            <surname>Klint</surname>
          </string-name>
          , “
          <article-title>Language Prototyping: An Algebraic Specification Approach”</article-title>
          , W. Scientific,
          <year>1996</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          [21]
          <string-name>
            <given-names>K.</given-names>
            <surname>Futatsugi</surname>
          </string-name>
          and
          <string-name>
            <given-names>R.</given-names>
            <surname>Diaconescu</surname>
          </string-name>
          , “CafeOBJ Report”, W.Scientific,
          <year>1998</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          [22]
          <string-name>
            <given-names>F.</given-names>
            <surname>Duran</surname>
          </string-name>
          , “
          <article-title>A Reflective Module Algebra with Applications to the Maude Language”</article-title>
          ,
          <source>PhD thesis</source>
          , University of Malaga, Spain,
          <year>1999</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          [23]
          <string-name>
            <given-names>P.C.</given-names>
            <surname>Olveczky</surname>
          </string-name>
          , “
          <article-title>Specification and Analysis of Real-Time and Hybrid Systems in Rewriting Logic”</article-title>
          ,
          <source>Thesis</source>
          ,
          <year>2000</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          [24]
          <string-name>
            <given-names>G.</given-names>
            <surname>Agha</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Meseguer</surname>
          </string-name>
          and
          <string-name>
            <given-names>K.</given-names>
            <surname>Sen</surname>
          </string-name>
          , “
          <article-title>PMaude: Rewrite-based specification language for probabilistic object systems”</article-title>
          .
          <source>Workshop on Quantitative Aspects of Programming Languages</source>
          ,
          <year>2005</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>