[IEEE 2013 5th International Conference on Modeling, Simulation and Applied Optimization (ICMSAO...

7
Automatic Web Services Composition Using Maude Strategies LATRECHE FATEH, SEBIH HACENE and BELALA FAIZA LIRE Laboratory, Constantine 2 University Constantine, Algeria [email protected], [email protected], [email protected] . Abstract—Web services are modular, self-descriptive and loosely coupled applications; they provide a simple programming and deployment model. Besides, they are designed to interact with other services to form larger applications. From a software engineering point of view, the construction of new services by composing existing services raises a number of challenges. One of them is the ability to efficiently and effectively select and integrate inter-organizational and heterogeneous services on the Web at runtime. Recently, several formal methods, most of them with a semantics based on transition systems, have been used to guarantee correct service compositions without insisting on its automation. The main goal of this work is to propose a Rewriting Logic based framework in order to enhance automatic Web services composition. The proposed model execution allows to discover services automatically and guarantee the correct interaction of independent pieces of software in a transparent manner. Keywords— automatic Web services composition; rewriting logic; Maude strategies I. INTRODUCTION The ability to efficiently and effectively select and integrate inter-organizational and heterogeneous services on the Web at runtime is an important problematic in Service Oriented Architectures paradigm. In particular, composing services is to coordinate data exchange between services in order to accomplish the required functionalities. If no single Web service can satisfy the functionality required by the user, there should be a possibility to combine existing services together in order to fulfill the request. Composition in this case is classified into two approaches: orchestration and choreography. In orchestration, composition schemes are defined by specifying coordinator internal behavior. Whereas in choreography approach, all peers participate in composition scheme definition. Web services composition may be accomplished manually or semi-automatically by giving semantic suggestions that allow to effectively select services. On the other side, composition without human intervention is said automatic. It permits to efficiently select and integrate heterogeneous services on the Web at runtime, reducing thus costs and development time [1]. Formal specification aims at building dependable software by ensuring specific properties of the produced software, therefore, it may help to increase the correctness of services composition. Hence formal methods, with their tool support, are ideal for assisting designers and developers, since their use leads, on the one hand to increase confidence in the obtained services composition and on the other hand, to keep these interactions as transparent and automatic as possible. Recently several formal methods, most of them with a semantics based on transition systems (e.g. automata, Petri nets, process algebras), have been used in this context. However, most of them do not pay any attention to services automatic composition that needs to detect the updating at runtime and the decision to integrate functionalities of the individual services should be made based on the up to date information. Rewriting logic, introduced initially by Jose Meseguer [2, 3], is one of the most adopted and used formalism to describe concurrent and non-deterministic systems. This logic unifies several formal models. As well, it has several tools and operational environments; this encourages its use for systems prototyping and analysis. Maude system [4, 5] is one of the most known implementation language of rewriting logic. It is surrounded by several verification and checking tools as the Maude LTL model-checker. Another interesting feature of rewriting logic is that, thanks to its reflective capabilities, we can dene our own strategies to control system execution [6]. Our contribution in this work is to show how Maude strategies can be used to improve automatic Web services composition. More precisely, our goal is to formalize the automatic Web services composition approach proposed in [7]. Thus, the proposed model execution allows to discover services automatically and guarantee the correct interaction of independent pieces of software in a transparent manner. This paper is organized as follows. In section 2, we review the state of the art in Web services automatic composition. Section 3 describes briefly the fundamental concepts of rewriting logic. Then, we detail in section 4 our automatic composition approach, first we describe the formal model associated to services composition, then we show how integrating Maude strategies to achieve services discovering. Section 5 summarizes the paper and discusses future work. II. RELATED WORK Issue of composing automatically Web services has been tackled by several research works. The study of these works shows that automatic Web services composition is difficult by nature. The complexity, in general, comes from the following sources. First, the Web is dynamic and their functionalities are 978-1-4673-5814-9/13/$31.00 ©2013 IEEE

Transcript of [IEEE 2013 5th International Conference on Modeling, Simulation and Applied Optimization (ICMSAO...

Page 1: [IEEE 2013 5th International Conference on Modeling, Simulation and Applied Optimization (ICMSAO 2013) - Hammamet (2013.4.28-2013.4.30)] 2013 5th International Conference on Modeling,

Automatic Web Services Composition Using Maude Strategies

LATRECHE FATEH, SEBIH HACENE and BELALA FAIZA LIRE Laboratory, Constantine 2 University

Constantine, Algeria [email protected], [email protected], [email protected].

Abstract—Web services are modular, self-descriptive and

loosely coupled applications; they provide a simple programming and deployment model. Besides, they are designed to interact with other services to form larger applications. From a software engineering point of view, the construction of new services by composing existing services raises a number of challenges. One of them is the ability to efficiently and effectively select and integrate inter-organizational and heterogeneous services on the Web at runtime. Recently, several formal methods, most of them with a semantics based on transition systems, have been used to guarantee correct service compositions without insisting on its automation. The main goal of this work is to propose a Rewriting Logic based framework in order to enhance automatic Web services composition. The proposed model execution allows to discover services automatically and guarantee the correct interaction of independent pieces of software in a transparent manner.

Keywords— automatic Web services composition; rewriting logic; Maude strategies

I. INTRODUCTION The ability to efficiently and effectively select and integrate

inter-organizational and heterogeneous services on the Web at runtime is an important problematic in Service Oriented Architectures paradigm. In particular, composing services is to coordinate data exchange between services in order to accomplish the required functionalities. If no single Web service can satisfy the functionality required by the user, there should be a possibility to combine existing services together in order to fulfill the request. Composition in this case is classified into two approaches: orchestration and choreography. In orchestration, composition schemes are defined by specifying coordinator internal behavior. Whereas in choreography approach, all peers participate in composition scheme definition.

Web services composition may be accomplished manually or semi-automatically by giving semantic suggestions that allow to effectively select services. On the other side, composition without human intervention is said automatic. It permits to efficiently select and integrate heterogeneous services on the Web at runtime, reducing thus costs and development time [1].

Formal specification aims at building dependable software by ensuring specific properties of the produced software, therefore, it may help to increase the correctness of services composition. Hence formal methods, with their tool support,

are ideal for assisting designers and developers, since their use leads, on the one hand to increase confidence in the obtained services composition and on the other hand, to keep these interactions as transparent and automatic as possible.

Recently several formal methods, most of them with a semantics based on transition systems (e.g. automata, Petri nets, process algebras), have been used in this context. However, most of them do not pay any attention to services automatic composition that needs to detect the updating at runtime and the decision to integrate functionalities of the individual services should be made based on the up to date information.

Rewriting logic, introduced initially by Jose Meseguer [2, 3], is one of the most adopted and used formalism to describe concurrent and non-deterministic systems. This logic unifies several formal models. As well, it has several tools and operational environments; this encourages its use for systems prototyping and analysis. Maude system [4, 5] is one of the most known implementation language of rewriting logic. It is surrounded by several verification and checking tools as the Maude LTL model-checker. Another interesting feature of rewriting logic is that, thanks to its reflective capabilities, we can define our own strategies to control system execution [6].

Our contribution in this work is to show how Maude strategies can be used to improve automatic Web services composition. More precisely, our goal is to formalize the automatic Web services composition approach proposed in [7]. Thus, the proposed model execution allows to discover services automatically and guarantee the correct interaction of independent pieces of software in a transparent manner.

This paper is organized as follows. In section 2, we review the state of the art in Web services automatic composition. Section 3 describes briefly the fundamental concepts of rewriting logic. Then, we detail in section 4 our automatic composition approach, first we describe the formal model associated to services composition, then we show how integrating Maude strategies to achieve services discovering. Section 5 summarizes the paper and discusses future work.

II. RELATED WORK Issue of composing automatically Web services has been

tackled by several research works. The study of these works shows that automatic Web services composition is difficult by nature. The complexity, in general, comes from the following sources. First, the Web is dynamic and their functionalities are

978-1-4673-5814-9/13/$31.00 ©2013 IEEE

Page 2: [IEEE 2013 5th International Conference on Modeling, Simulation and Applied Optimization (ICMSAO 2013) - Hammamet (2013.4.28-2013.4.30)] 2013 5th International Conference on Modeling,

instable, thus the composition system needs to detect the updating at runtime and the decision should be made based on the up to date information. Second, the number of services available over the Web increases dramatically, so, a huge Web service repository has to be searched. Third, Web services are developed by different organizations, which use different specification languages; however, there is not a unique describing model for the Web services.

Several research works for this purpose have been proposed. Most of them fall in the realm of hybrid methods based on ontological, logical and AI planning techniques. In [8] authors propose encoding OWL-S atomic services by means of the Semantic Web Rules Language [9] (a language for the representation of Inputs, Outputs, Preconditions and Results models) and composing them using a backward search planning algorithm. In a similar work, authors of [10] provide a planning method for OWL-S Web services, more precisely available services are firstly translated into nondeterministic and partially observable state transition systems that describe dynamic interactions, then goals for the service to be automatically generated are represented in Extended Goal Language (EaGLe) [11] (a language supporting declarative definition of the temporally extended goals), as a final step a “Planning as Model Checking” approach is used to provide a solution. In the same context of AI planning methods, Zhijun Ding et al. propose in [12] Web services automatic composition using Predicate/Transition net model. First, based on OWL-S specification of inputs, outputs, preconditions and effects, a Predicate/Transition net model is constructed for a service composition plan. Then, this plan is effectively solved by a reachability algorithm.

All aforementioned automatic composition approaches are promising, they propose the use of services composition models that consist of service presentation, translation, process generation, evaluation and execution. But, they establish heterogonous solutions. Our approach is complementary to these approaches while using a unique semantic model that can be used for analysis. Particularly, in the present work we propose a unique semantic formalism, Rewriting Logic, to deal with specification of Web services composition and extraction of invocation service sequences according to specific discovering strategies. Besides, to the best of our knowledge, there is no approach making use of strategies for Web services automatic composition.

Our main contribution is to extend the work presented in [7] which proposes a type-based approach for automatic Web service composition, and integrate it in Rewriting Logic based formal semantic framework. This work adopts a graph framework for modeling the type associations between atomic services, then it gives a greedy algorithm to generate plans of services composition. Its attractive feature is the provided model for service syntax parameters, ignored by most composition approaches. Our extended model will consider other suitable parameters in the discovering process, not only restricted to affinity between services.

III. BASIC CONCEPTS

A. Rewriting logic Rewriting logic is a logic of change able to specify and

describe concurrent systems. It was introduced initially by Meseguer as a consequence of his work on general logics. Then, this logic has been widely used to specify and analyze systems of various application areas. Rewriting logic provides the required formal framework for specifying concurrent systems behavior. In fact, it allows reasoning on complex changes axiomatized by rewriting rules.

In rewriting logic static aspect of systems is specified thanks to an underlying sub-logic called membership equational logic, and dynamic aspect is represented by rewrite theories describing possible transitions between concurrent system states.

Theories of membership equational theories are typed; i.e. data are firstly classified by kind and then by sort. Atomic statements of this logic are either conditional and/or unconditional equations having the form: t = t '(if c), where t, t' are algebraic terms of the same sort, and c is a Boolean expression; or membership assertions of the form t: s (t is an algebraic term and s is a sort).

Rewrite theories are specified by a set R of rewriting rules. Each rewrite rule has the form t t’, where t and t’ are algebraic terms. These rules have two complementary reading: (1) Computational, where rules are interpreted as local transitions of the concurrent system; (2) Logical, where rules are interpreted as inference rule, so that we can infer formula from another formula.

Provable sentences are those obtained by finite application of following rules (see Fig. 1) [13]:

• Reflexivity. For each [t] T ∑, E(X), .

• Congruence. For each f ∑n, n ,

• Replacement. For each rule l:

in R,

• Transitivity.

Page 3: [IEEE 2013 5th International Conference on Modeling, Simulation and Applied Optimization (ICMSAO 2013) - Hammamet (2013.4.28-2013.4.30)] 2013 5th International Conference on Modeling,

Reflexivity t t

Congruence f

t’1 t’n

f

t1 tn

Replacement w1 w’1 wn w’n

l t t

Transitivity

t1 t3

t2

Fig. 1. Rewriting logic inference rules

B. Maude system Maude [4] is a specification and programming language

based on rewriting logic. Maude is simple, expressive and efficient. It offers few syntactic constructions and a well-defined semantics.

Maude can express with equal ease and naturalness deterministic computations, which lead to a unique final result, and concurrent, nondeterministic computations. The first kind is typically programmed with functional modules, and the second with system modules [5]. A functional module is declared in Maude as follow : “fmod <ModuleName> is <DeclarationsAndStatements> endfm .”, where “<DeclarationsAndStatements>” may include: importation of other functional modules, sort, subsort, operator declarations, equational and membership axioms. A system module is introduced in Maude with the following syntax: “mod <ModuleName> is <DeclarationsAndStatements> endm .”, where “<DeclarationsAndStatements>” can include rewirte rules.

By using Maude it is also possible to describe naturally various applications types. Maude is a system that supports rapid prototyping and is a programming language with competitive performance [14].

This language is greatly influenced by the language OBJ3, specifically the equational part of Maude include OBJ3 as a sub language. Maude has a collection of formal tools supporting various forms of logical reasoning, including:

• A Model-Checker to verify linear temporal logic properties of finite state systems;

• An Inductive Theorem Prover (ITP) for checking functional modules properties;

• A Church-Rosser (CRC) to check whether an equational specification complies or not the Church-Rosser property;

• Maude Termination Tool (MTT) to check termination of equational Maude specifications;

• Coherence Checker Maude (MCC) to check the consistency of system modules.

C. Strategies language An important issue in system modeling is the ability to

control its executions so that undesired behaviors are avoided. So, underlined formalisms and languages should provide mechanisms to control its implementation.

Rewriting logic specifications are generally divergent and not terminating, to extract individual path of execution, designer can use “rewrite” and “frewrite” commands. Also, a set of paths can be extracted thanks to “search” command. But, mostly we need further mechanisms to control rewriting process so it does not go in undesired directions. A first solution is to use conditional rewriting rules; as well we may use the rewriting logic strategy [15].

A number of rewriting logic implementations has made possible association of strategies to rewrite rules at meta-level. In order to make their use easy, under Maude strategies have been made available at the object level [6]. So, strategies are specified in separate strategy modules related to system modules. Basic strategies have the format “L[S]”, they have as role applying the rewriting rule L to a given term, after providing values for its variables by substitutions of S. If the rule is conditional, we can use strategies to indicate how the rewrite conditions have to be checked. Thus, “L[S]{E1,...,En}” denotes a basic strategy that tries to apply the rule L with the substitution S using the strategy expressions E1,..., En to check the n rewrite conditions of the conditional rule L.

There are strategies that work as tests to check a property of a term, by means of pattern matching. For instance, “match T s.t. C” is a strategy that matches only at the top, and such matching satisfies the condition C. Otherwise, it fails. Basic strategies can also be combined so that strategies are applied to execution paths. We can find combinators modeling: concatenation (; opertaor), union (| operator) and iteration (+ and * operators).

IV. AUTOMATIC AND GUIDED COMPOSITION OF WEB SERVICES

The automatic composition approach presented in this work consists of three main steps. First, the formalization step enables the formal description of the graph composition model as an equational theory of rewriting logic. Second, the service discovering phase uses the derived graph model to select services fulfilling particular goals, in this step we start from an initial node and a set of goals to be attained, then a type matching technique between required elements and nodes parameters is used. The final step is the guided selection of services using strategies of rewriting logic, for this step we choose the quality of service as discriminant if more than one service may be selected.

A. A running example To better present our proposed approach, we will use

through this section the collection of services "Meteo-Ws" as case study. "Meteo-Ws" is composed of four atomic Web services: S1, S2, S3 and S4. Input types, output types and quality of these services are shown in Table 1. With these services, traditional discovery approaches will generate

Page 4: [IEEE 2013 5th International Conference on Modeling, Simulation and Applied Optimization (ICMSAO 2013) - Hammamet (2013.4.28-2013.4.30)] 2013 5th International Conference on Modeling,

invocation sequences only according to functions fulfillment. For instance, to get weather situation (a required goal) from a client request, taking as starting node the service “S1”, The principle of any Web services composition approach is to select and combine some of these individual services and provide invocation sequences as, “S1 (S2 S3)”, “S1(S2 S4 )” and so on.

In our framework, discovering process is more precise, we select services according to the defined strategies as the maximal quality of services, the minimal number of invoked services and so on.

TABLE I. INPUTS AND OUTPUTS OF "METEO-WS" SERVICES

Services Input types Output types Quality

S1 request longitude, latitude, IP medium S2 longitude, latitude city high

S3 city weather high

S4 IP weather medium

B. The formalization step The graph composition model adopted in this work is taken

from [7], it describes possible associations between atomic services; in this model nodes represent invoked services and edges represent invocation sequences of services. Our contribution in this section consists into integrating this model in rewriting logic. We need first to define a well formed signature for the Web services and some operations to handle their corresponding sets (the module “SERVICE-SPEC” of Fig. 2). Then, we conceive from these services the graph composition model respecting some conditions (see the conditional equation of the module “GRAPH-MODEL”, Fig. 4).

Note that the imported module “QualityOfService” (not presented here due to lack of space) defines some given service quality metrics.

The most important operation of the “SERVICE-SPEC” module is: “ op `(_:_->_`,_`) : ServiceN TypeSet TypeSet QoS -> Service [ctor prec 23] .”, according to this operation a Web service is characterized by: its name (an algebraic term of sort “serviceN”), its input and output sets of types (represented by terms of sort “TypeSet”) and by its Quality. Also, the operation: “op _;_ : ServiceSet ServiceSet ->ServiceSet [ctor comm id: none prec 24 assoc] .” allows to model services set. Some required operations handling algebraic terms of sort “TypeSet” are declared too in this module.

In the case of our running example, the collection of services “Meteo-Ws” is defined through the Maude system module “METEO-WS” (see Fig. 3) extending the above “SERVICE-SPEC” module. Thus, we use algebraic terms constructor to identify: the services collection name (“weather-ws”), the atomic services names (S1, ..., S4) and the exchanged messages types (“request”,..., “weather”). The algebraic equation gathers all previously mentioned elements.

fmod SERVICE-SPEC is including QualityOfService . --- Declaring useful sorts and subsort relations sorts Service ServiceSet Type TypeSet ServiceN SetServiceN . subsort Type <TypeSet . subsort Service < ServiceSet . subsort ServiceN < SetServiceN . --- Defining services and set of services op __: TypeSet TypeSet ->TypeSet [ctor comm id: none prec 22 assoc]. op __:SetServiceN SetServiceN->SetServiceN [ctor id: noneS prec25] . op `(_:_->_`,_`) :ServiceN TypeSet TypeSet QoS ->Service [ctor prec 23] . op _;_ : ServiceSet ServiceSet ->ServiceSet [ctorcomm id: none prec 24 assoc] . --- Services operations op NameOf : Service -> ServiceN . op InputOf : Service -> TypeSet . op OutputOf : Service -> TypeSet . eq NameOf( ( servN : tsetI -> tsetO , qs ) ) = servN . eq InputOf( ( servN : tsetI -> tsetO , qs ) ) = tsetI . eq OutputOf( ( servN : tsetI -> tsetO , qs ) ) = tsetO . --- Operations on Sets op Intersect : TypeSet TypeSet -> TypeSet [ctor] . op Union : TypeSet TypeSet -> TypeSet [ctor] . op In : TypeSet TypeSet -> Bool [ctor] . op Remove : TypeSet TypeSet -> TypeSet [ctor] . eq Intersect( t1 st1 , t1 st2) = t1 Intersect ( st1 , st2 ) . eq Intersect( st1 , st2 ) = none [owise] . eq Union( t1 st1 , t1 st2 ) = t1 Union ( st1 , st2 ) . eq Union( t1 st1 , t2 st2 ) = t1 t2 Union ( st1 , st2 ) . eq Union( none , st2 ) = st2 .eq Union( st1 , none ) = st1 . eq Union( none , none ) = none . eq In ( st1 , st1 st2 ) = true . eq In ( st1 , st2 ) = false [owise] . eq Remove( t1 st1 , t1 st2 ) = Remove( st1 , st2 ) . eq Remove( st2 , none ) = st2 . eq Remove( st2 , st1 ) = st2 [owise] . endfm

Fig. 2. Signature of Web Service in Maude

fmod METEO-WS is extinding SERVICE-SPEC . ops request city longitude latitude IP weather : -> Type [ctor] . ops s1 s2 s3 s4 : -> ServiceN [ctor] . op Meteo-Ws : -> ServiceSet [ctor] . eq Meteo-Ws = ( s1 : request -> longitude latitude IP , medium ) ; ( s2 : longitude latitude -> city , medium ) ; ( s3 : city -> weather , high ) ; ( s4 : IP -> weather , medium ) . endfm

Fig. 3. "Meteo-Ws" services formalization

The functional module “GRAPH-MODEL”, presented in Fig. 4, defines the syntactic notation of the considered graph based model which combines the atomic Web services previously defined to obtain more sophisticated ones. This is essentially achieved thanks to the declared operation “op _&_ : ServiceSet Graph -> Cmp-Mod” which takes as arguments respectively the set of atomic services and an initial graph and gives as result the final composition graph-based model.

Page 5: [IEEE 2013 5th International Conference on Modeling, Simulation and Applied Optimization (ICMSAO 2013) - Hammamet (2013.4.28-2013.4.30)] 2013 5th International Conference on Modeling,

Each node in this graph based model represents the invoked service (defined by its name, the sets of its current input and output types and its quality). On the other hand, edge represents invocation sequence of services.

We notice here that this most important module imports the functional module “GRAPH” defining the algebraic structure of a given graph constructed from some nodes and edges.

The unique conditional equation declared in the module: “GRAPH-MODEL” mechanizes the graph derivation process. According to this equation, services fulfilling the same functionality cannot be included simultaneously. More precisely, conditions “Intersect( ts2 , ts3 ) =/= none” and “In ( ts4 , ts2) == false” means that service of name “sn2” can be invoked, and it achieves new functionalities.

fmod GRAPH is --- Declaring useful sorts and subsorts sorts Node Nodes Edge Edges Graph . subsort Node < Nodes . subsort Edge < Edges . --- Declaring basic constructors op niln : -> Node [ctor] . op nile : -> Edge [ctor] . --- Defining graph elements op link`(_._`) : Node Node -> Edge [ctorprec 22 ] . op __ : Nodes Nodes -> Nodes [ctor assoc comm id: niln prec 23 ] . op __ : Edges Edges -> Edges [assoccomm id: nileprec 23 ] . op |_`,_| : Nodes Edges -> Graph [ctorprec 24 ] . op addN : Graph Nodes -> Graph. op addE : Graph Edges -> Graph. --- Adding node or edge to graph. eq addN(| Ns , Es | , niln) = | Ns , Es | . eq addN(| Ns , Es | , n1 Nsp ) = if not ( n1 in Ns ) then addN(| n1 Ns , Es | , Nsp ) else addN(| Ns , Es | , Nsp ) fi . eq addE(| Ns , Es | , nile ) = | Ns , Es | . eq addE(| Ns , Es | , e1 Esp ) = addE( addN(| Ns , e1 Es | , source(e1) target(e1)), Esp). endfm fmod GRAPH-MODEL is including GRAPH . including SERVICE-SPEC . --- Declaring useful sorts and subsorts sorts NodeSer Cmp-Mod . subsort NodeSer < Node . --- Defining syntax of the composition model and its nodes op _&_ : ServiceSet Graph -> Cmp-Mod [ctorprec 25 ] . op <_`,_`,_`,_> : ServiceN TypeSet TypeSet QoS -> NodeSer [ctor prec 22 ] . --- Graph model derivation process ceq ( sn2 : ts3 -> ts4 , qs ) ; srvs1 & | < sn1 , ts1 , ts2 , qsp> nds , es | = ( sn2 : ts3 -> ts4 , qs ) ; srvs1 & addE( | < sn1 , ts1 , ts2 , qsp>nds , es | , link( < sn1 , ts1 , ts2 , qsp> . < sn2 , Union( ts1 , ts3 ) , Union(ts2 , ts4) , qs> ) ) if ( Intersect( ts2 , ts3 ) =/= none ) /\ ( In( ts4 , ts2) == false ) /\ (not ( link( < sn1 , ts1 , ts2 , qsp> . < sn2 , Union( ts1 , ts3 ) , Union(ts2 , ts4) , qs> ) in es) ) . endfm

Fig. 4. The functional Maude module GRAPH-MODEL

We consider again the collection of services “Meteo-Ws”, the command “reduce” depicted in Fig. 5 using the set of all services and the initial node, allows to generate the graph-based model associated to this collection.

reduce in GRAPH-MODEL : Meteo-Ws & | <s1, request, longitude latitude IP, medium>, nile | result Cmp-Mod :(s1: request -> IP latitude longitude, medium) ;(s2:latitude longitude->city,medium);(s3 : city->weather, high) ;(s4 :IP->weather,medium)&|<s1,request,IP latitude longitude ,medium> …<s4,IP latitude longitude request,IP city latitude longitude weather,

medium>,link(<s1,request,IP latitude longitude,medium>.<s2,latitude longitude request,IP city latitude longitude,medium>)...link(<s4,IP

request, IP latitude longitude weather,medium>.<s2, IP latitude

longitude request ,IP city latitude longitude weather, medium>)|

Fig. 5. The graph composition model of the “Meteo-Ws” services collection

As we have shown in this proposed approach phase of Web services automatic composition, and due to user-defined syntax feature offered by the rewriting logic formalism, the user has only to define its Web services using algebraic equations, then the process of composition model generation allows to check syntactic and semantic errors or inconsistencies of the used services and their possible interactions. The process model may consider the control flow and data flow among the set of selected atomic services.

C. Discovering step It is quite common that many services have the same or

similar functionalities. So, the main objective of this second phase of our composition approach is to show how the planer generates one composite service fulfilling the requirement. In that case, composite services are evaluated by their overall utilities.

Thus, the inputs of this step are the service graph model and a request having the form: “R.InputTypeList -> R.requiredTypeList” (we want to obtain “requiredTypeList” taking as input “R.InputTypeList”).

The system module "REQUEST-PLAN" presented in the following figure defines how to extract first and subsequent nodes and their corresponding services name thanks to the two rewriting rules “start” and “next”, by executing these rules requirements are decreased. Otherwise, at each execution step, output of discovered services participate in achieving a sub goal. First, when no service has been discovered, we execute the rule “start” to obtain a first service, and then we apply the “next” rule many times to obtain following services.

mod REQUEST -PLAN is ---Importing useful modules and sort declarations including GRAPH-MODEL-WS . sorts Request REQ-PLAN . --- Declaring request and request plan format op _->_ : TypeSet TypeSet -> Request [ctorprec 25] . op <<_`,_`,_`,_>> : Cmp-Mod Request Nodes SetServiceN->REQ-PLAN. --- Adding the first node and its service name rl [start] : <<serv ; srvs1 & |nd nds, es|, reqIn -> reqOut, niln, noneS>>=><<srvs1 & |nd nds , es| , reqIn -> Union(Remove(reqOut, OutputOf(serv)), InputOf(serv)), nd, NameOf( nd )>> . --- Adding subsequent nodes and their services name rl [next] : <<serv ; srvs1 & |nd nds , es| , reqIn -> reqOut , nds2 , invs >> =><<srvs1 & |nd nds, es| , reqIn->Union(Remove(reqOut, OutputOf(serv)),InputOf(serv)),nd nds2,NameOf(nd) invs>> . endm

Fig. 6. The system module REQUEST-PLAN

Page 6: [IEEE 2013 5th International Conference on Modeling, Simulation and Applied Optimization (ICMSAO 2013) - Hammamet (2013.4.28-2013.4.30)] 2013 5th International Conference on Modeling,

The rewriting rules of the “REQUEST-PLAN” system module are general; they do not make constraints on selected services and nodes at each discovering step. Thus, if we consider our running example and try to get weather situation from a client request, taking as starting node the service “S1” and by using the command: “search”, we obtain the three invocation sequences: “s1 (s2 s3)”, “s1(s2 s4 )” and “(s1 s4)”.

To make discovering procedure more precise, we propose to extend our approach of services automatic composition by integrating Maude strategies to the discovering and evaluating process definition.

D. Discovering process with strategies The generation model process considers a set of selected

atomic services decorated with weights for each non-functionality attributes and the best composite service is the one who is ranked on top. To select a unique composite process, a frequently used strategy is to invoke services with the best quality. The following “EXT-REQUEST-PLAN” Maude module (Fig. 7) extends the “REQUEST-PLAN” module with operations to get first and subsequent nodes (services) with the maximal quality. Selection process of nodes according to these operations takes also into account affinity with the request.

mod EXT-REQUEST-PLAN is including REQUEST-PLAN . --- Cardinality operator eq Card( t1 ts1 ) = 1 + Card( ts1 ) . eq Card( none ) = 0 [owise] . --- Affinity function implementation eq aff(ts1->ts2,<sn1,ts3,ts4, qs1>)=Card(Intersect(ts2,ts4))/Card(ts2). --- Getting the first node having the best quality of service ceq FstNdMaxQos (<<serv ; srvs1 & | nd nds , es | , reqIn ->reqOut , niln , noneS>> ) = nd if In( reqIn , InPutOf( nd ) ) /\ aff( reqIn ->reqOut , nd ) == 1 /\ maxqds1( nd , nds , reqIn ->reqOut ) . --- Getting the first service having the best quality of service eq FstSrvMaxQos(<sn1,ts1,ts2,qs1>,<<( sn1: ts3-> ts4 , qs1); srvs1& | ndnds,es | , reqIn->reqOut , niln , noneS>>)=(sn1:ts3->ts4, qs1). --- Getting node of the last invoked service eq NdLstInkSrv( << srvs1 & | nds , es | , req , nd1 , invs>> ) = nd1 . eq NdLstInkSrv (<< srvs1 & | nds , link( nd1 . nd2) es | , req , nd1 nd2, invs>> ) = nd1 . eq NdLstInkSrv ( << srvs1 & | nds , link( nd1 . nd2 ) link( nd2 . nd3 ) es | , req , nd1 nd2 nd3 nds2 , invs>> ) = NdLstInkSrv ( << srvs1 & | nds , link( nd1 . nd3 ) es | , req , nd1 nd3 nds2 , invs>> ) . --- Getting the subsequent node having the best quality of service ceq SbqNdMaxQos( <<serv ; srvs1 & | ndnds , link( nd . nd1 ) es | , reqIn ->reqOut , nd1 nds2 , invs>> , nd1 ) = nd if In( reqIn , InPutOf( nd ) ) /\ aff( reqIn ->reqOut , nd ) == 1 /\ maxqds2( nd , nd1 , es , reqIn ->reqOut ) . ---Getting the subsequent service having the best quality of service eq SbqSrvMaxQos(< sn1,ts1,ts2,qs1> ,<<(sn1:ts3-> ts4,qs1);srvs1 & | nds ,es | , req, nds2, invs>> ) = ( sn1 : ts3 -> ts4 , qs1 ) . endm

Fig. 7. The system module “EXT-REQUEST-PLAN”

Given the system module “EXT-REQUEST-PLAN”, we can now write our strategies module “MAX-QOS-STRAT” (Fig. 8). We define in this module, thanks to the “matchrew” strategy constructor, two other strategies FstMaxQoS and SndMaxQoS to get nodes and services having maximal Quality, and so to define how applying the rules “start” and “next”.

smod MAX-QOS-STRAT is var RP : REQ-PLAN . var serv’ : Service . vars nd’ : Node . Strat FstMaxQoS : @ REQ-PLAN . sd FstMaxQoS := (matchrew RP s.t. nd’ := FstNdMaxQos ( RP ) /\ serv’ := FstSrvMaxQos( nd’ , RP ) by RP using start[ serv<- serv’ ; nd <- nd’ ] ) ! . Strat SndMaxQoS : @ REQ-PLAN . sd SndMaxQoS := (matchrew RP s.t. nd’ := SbqNdMaxQos ( RP , NdLstInkSrv ( RP ) ) /\ serv’:= SbqSrvMaxQos( nd’ , RP ) by RP using next[ serv<- serv’ ; nd<- nd’ ] ) ! . endsm

Fig. 8. The strategy modules “MAX-QOS-STRAT”

To show how discovering process of services in this case is undertaken using these defined strategies, we introduce example of Fig. 9. In this illustration, we want to discover services attaining the weather situation from a client request, we use for this example the strategic Maude rewrite command (“srew”) parameterized by the composite strategy (“FstMaxQoS ; SndMaxQoS” ) ; obtained results are shown in the same Figure. They identify that we have chosen at each discovering process step the service having the best quality. Evidently for this example, we get the best composite service having S1, S2 and S3 as atomic services.

Maude Strategy Language 2.6 =================

Maude> ( srew << weather-ws & | < s1 , request , longitude latitude IP , medium > , nile | , request -> weather , niln, noneS >> using (FstMaxQoS ; SndMaxQoS ) . )

================= rewrites: 41459 in 5893602666ms cpu (764ms real) (0 rewrites/second) rewrite with strategy : result REQ-PLAN : <<(s4 : IP-> weather, medium)& | < s1, request, IP latitude longitude, medium > ………< s4, IP latitude longitude request, IP city latitude longitude weather, medium >, link(< s1,request,IP latitude longitude, medium > . < s2, latitude longitude request, IP city latitude longitude, medium >)………link(< s4,IP request, IP latitude longitude weather, medium > . < s2, IP latitude longitude request, IP city latitude longitude weather, medium >)|,request -> request,< s1,request,IP latitude longitude, medium > <s2,latitude longitude request, IP city latitude longitude, medium > < s3,city latitude longitude request, IP city latitude longitude weather, high >,s1(s2 s3)>>

Fig. 9. A guided discovering process of services

We propose a general framework for automatic Web services composition. This framework is in high-level abstraction, without considering a particular composition language or platform. Besides, through the presented executable Maude modules, we note that our formalization is modular. It can be easily extended to add other operations, types, or even equations to specify different new syntactical and semantic concepts.

The aim of the framework is to give a solid theoretical basis for Web services definition and their automatic composition process, the Maude tool support that comes with it allows the simulation and verification of the behavior of a composition model at design time, thus enabling the detection and correction of errors as early as possible and in any case before implementation.

Page 7: [IEEE 2013 5th International Conference on Modeling, Simulation and Applied Optimization (ICMSAO 2013) - Hammamet (2013.4.28-2013.4.30)] 2013 5th International Conference on Modeling,

V. CONCLUSION Composition of Web services describes a set of interactions

between multiple Web services. It combines atomic Web services to obtain more sophisticated services. Indeed, several composition approaches aiming at efficient and effective automatic composition have been proposed, each offering complementary capabilities. In this work, we have presented a homogenous approach based on an unifying logical and semantic framework (rewriting logic) to specify graph-based model for automatic services composition. We have proposed to use the strategies language of Maude as a support of exploring and selecting invocations sequence of composite services. The proposed model has made possible exploration of different composition patterns with regard to a maximum quality of service strategy. It’s important to mention that extension of this work to implement other discovering strategies is possible. This can be done simply by declaring new strategies module. As future extension of this work, we aim at enhancing this wok to take into account stateful Web services by using Mop-ECATNets (Meta-Open Extended Concurrent Algebraic Term Nets), a high level Petri nets based model already proposed in [16] to deal with dynamic composition of Web services.

REFERENCES [1] S. Rabah, D. Ni, P. Jahanshahi, L.F. Guzman, “Current state and

challenges of automatic planning in Web services composition”, CoRR abs/1107.1932, 2011.

[2] J. Meseguer, "Conditional Rewriting as a Unified Model of Concurrency", Theoretical Computer Science 96, vol. 1, pp. 73-155, 1992.

[3] N. Marti-Oliet and J. Meseguer, “Rewriting logic as a logical and semantic framework”, Electronic Notes in Theoretical Computer Science, Vol. 4, pp.1-36, 1996.

[4] M. Clavel, F. Durán, S. Eker, P. Lincoln, N. Martí Oliet,J. Meseguer, and C. Talcott, “All About Maude - A High-Performance Logical

Framework: How to Specify, Program, and Verify Systems in Rewriting Logic”, Lecture Notes in Computer Science, vol. 4350, Springer ,2007.

[5] M. Clavel, F. Durán, S. Eker,P Lincoln, N. Martí Oliet,J. Meseguer, and C. Talcott, Maude Manual (Version2.6) , January 2011.

[6] S. Eker, N. Martí-Oliet, , J. Meseguer, and A. Verdejo, “Deduction, strategies, and rewriting”, Electronic Notes in Theoretical Computer Science (ENTCS), vol. 174, pp. 3-25, 2007.

[7] K. Yue, M. Yue, W. Liu and X. Li, “A Graph-Based Approach for Type Matching in Web Service Composition”, Journal of Computational Information Systems , pp. 6:72141-2149, 2010.

[8] R. Domenico, I. Luigi and R.P. Terry , “OWL-S Atomic services composition with SWRL rules”, In Proceedings of SWAP, 2007.

[9] I. Horrocks, P.F. Patel-Schneider, S. Bechhofer, D. Tsarkov, “OWL Rules: A Proposal and Prototype Implementation”, Journal of Web Semantic, vol. 3, pp. 23-40, 2005.

[10] P. Traverso and M. Pistore, “Automated Composition of Semantic Web Services into Executable Processes” , International Semantic Web Conference 04, pp.380-394, 2004.

[11] U.D. Lago, M. Pistore and P. Traverso, “Planning with a language for extended goals”, Eighteenth national conference on Artificial intelligence, pp. 447–454, 2002.

[12] Z.J. Ding, J.L. Wang, H. Song, “Al planning for Web service automatic composition using petri nets”, 11th International Conference on Computer Supported Cooperative Work in Design (CSCWD2007), Melbourne, Australia.pp. 519-524, 2007.

[13] N. Martí-Oliet, J. Meseguer, “Rewriting logic: roadmap and bibliography”, Theoretical Computer Science, 285, vol. 2, pp. 121-154 , 2002.

[14] M. Clavel, F. Durán , S. Eker , P. Lincoln , N. Martí-Oliet, J. Meseguer and J. F. Quesada, “Maude: Specification and programming in rewriting logic”, Theoretical Computer Science, 285, pp. 187–243, 2002.

[15] N. Martí-Oliet, M. Palomino and A. Verdejo, “Strategies and simulations in a semantic framework”, Journal of Algorithms: Algorithms in Cognition, Informatics and Logic, vol. 62, pp. 95-116, 2007.

[16] F. Latreche and F. Belala, “An Executable Model for Dynamic Web Services Composition”, submitted to International Journal of Service Oriented Computing and Applications, Springer Publisher.