A Rewriting Logic Approach for Automatic Composition of Web Services

A Rewriting Logic Approach for Automatic Composition of Web Services

Nowadays, Web Services (WS) remain a main actor in the implementation of distributed applications. They represent a new promising paradigm for the development, deployment and integration of Internet applications. These services are in most cases unable to provide the required functionality; they must be composed to provide appropriate services, richer and more interesting for other applications as well as for human users. The composition of Web services is considered as a strong point, which allows answering complex queries by combining the functionality of multiple services within a same composition. In this work we showed how the formalism of graphs can be used to improve the composition of web services and make it automatic. We have proposed the rewriting logic and its language Maude as a support for a graph-based approach to automatic composition of web services. The proposed model has made possible the exploration of different composition schemas as well as the formal analysis of service compositions. The paper introduces a case study showing how to apply our formalization.


💡 Research Summary

The paper addresses the challenge of automatically composing Web Services (WS) by integrating a graph‑based representation with the formalism of rewriting logic, implemented in the Maude language. The authors begin by motivating the need for service composition: individual Web services typically expose limited functionality, and complex business processes require the orchestration of multiple services. Existing composition approaches often rely on manual expert design or on declarative orchestration languages such as BPEL combined with heuristic matchmaking, which limit automation and make formal verification difficult.

To overcome these limitations, the authors propose a two‑layer model. In the first layer, each Web service is abstracted as a node in a directed graph. The node carries a set of input parameters and a set of output parameters, together with QoS attributes (cost, latency, reliability, etc.). An edge from service A to service B is created when the output parameters of A are compatible with the input parameters of B. This graph captures the functional dependencies among services and enables the use of classic graph‑search algorithms (depth‑first, breadth‑first, shortest‑path, etc.) to enumerate candidate compositions.

The second layer formalizes the transformation of this service graph using rewriting logic. Maude is employed to encode rewrite rules that model composition operations. Three principal rule families are defined: (1) Composition rules that add an edge when a compatible pair of services is identified; (2) Elimination rules that prune redundant or dead‑end nodes; and (3) Normalization rules that restructure the graph to satisfy QoS optimization criteria. Because Maude’s rewriting engine is nondeterministic, a single initial graph can generate multiple concurrent rewrite sequences, each representing a distinct composition plan.

Verification is achieved through Maude’s built‑in simulation and model‑checking facilities. Desired properties—such as “total execution time ≤ 2 seconds”, “overall cost ≤ $100”, or “reliability ≥ 0.95”—are expressed in Linear Temporal Logic (LTL). The model checker exhaustively explores all reachable rewrite states to ensure that every generated composition satisfies the specified constraints. This formal analysis eliminates the need for ad‑hoc testing and provides provable guarantees about the quality of the composed service.

A concrete case study illustrates the methodology. The authors model a travel‑booking scenario involving three atomic services: flight‑search, hotel‑reservation, and car‑rental. Each service’s interface and QoS metrics are encoded as graph nodes. Maude rewrite rules automatically generate the composition “flight → hotel → car” as well as alternative orders such as “flight → car → hotel”. Model‑checking confirms that both alternatives meet the predefined QoS thresholds, demonstrating the approach’s ability to explore multiple viable compositions and to select the optimal one based on quantitative criteria.

The paper concludes by highlighting several contributions: (i) a clear mapping from Web‑service specifications to a graph structure that makes functional dependencies explicit; (ii) the use of rewriting logic to automate the construction, transformation, and pruning of composition graphs; (iii) the integration of formal verification to guarantee that generated compositions satisfy user‑defined quality constraints. The authors also outline future work, including handling dynamic service registration and deregistration, scaling the approach to large service repositories through graph reduction techniques, and extending the QoS model to support multi‑objective optimization. Overall, the presented framework advances the state of the art in automated, formally verified Web‑service composition.