A Constraint-based Method to Compute Semantics of Channel-based Coordination Models Behnaz Changizi, Natallia Kokash Leiden Institute of Advanced Computer Science (LIACS) Leiden, The Netherlands b.changizi@umail.leidenuniv.nl, nkokash@liacs.nl Farhad Arbab Centrum Wiskunde & Informatica (CWI) Amsterdam, The Netherlands farhad.arbab@cwi.nl Abstract—Reo is an exogenous channel-based coordination language that acts as glue code to tie together software components and services. The building blocks of Reo models are connectors that impose constraints on the data-flow in component or service-based architectures in terms of data syn- chronization, buffering, mutual exclusion, etc. Several semantic models have been introduced to formalize the behavior of Reo. These models differ in terms of expressiveness, computation complexity and purposes that they serve. In this paper, we present a method and a tool for building formal automata- based semantics of Reo that unifies various aspects of existing semantics. We express the behavior of a Reo network as a mixed system of Boolean and numerical constraints constructed compositionally by conjuncting the assertions for its constituent parts. The solutions of this system are found with the help of off-the-shelf constraint solvers and are used to construct the constraint automaton with state memory that gives the sound and complete semantics of Reo with respect to existing models. Our approach is more efficient compared to the existing methods for generating formal semantics of Reo connectors. Keywords-formal semantics; Reo; constraint automata; col- oring semantics; constraint solving. I. I NTRODUCTION Service-oriented architecture [1] (SOA) is an indispens- able solution for many of todays’ problems. The SOA implementation depends on a mesh of functionality units, called services. Services are loosely coupled and do not invoke or communicate with each other directly. Instead, they employ a pre-defined protocol, which specifies the way they can exchange messages amongst themselves. As a result, the correctness of a SOA implementation relies not only on the correctness of its involved services but also on the properness of its communication protocol. Coordination languages and models provide dedicated frameworks to study the communication protocols as sepa- rate concerns. They define the “glue code” that ties together the services to enable the message passing among the involved services. Some recent coordination models include: i) a Calculus for Orchestration of Web Services (COWS) [2], which specifies the combination of service-oriented ap- plications and models their dynamic behavior; ii) Orc [3], a process calculus for distributed and concurrent programming which provides uniform access to computational services, including distributed communication and data manipulation; and iii) Reo [4], an exogenous coordination language that realizes the coordination patterns in terms of its complex connectors, also called networks, that are built out of simple primitives called channels. In the sequel, we focus on Reo. Each channel in Reo defines a form of coordination in terms of synchronizing, buffering, retaining data, etc., along with constraining its input and output data items. Reo allows hierarchical modeling where arbitrarily complex connectors can be formed out of simpler networks. In our previous work [5] [6], we have presented the suitability of Reo to model behavioral patterns describable by business process models. We have also developed tools for automatic transformation of these models into Reo [6]. This enables the use of Reo analysis methods and tools on the coordination protocols that originally were not expressed in Reo. To perform formal analysis on Reo networks, formal semantics of these models are necessary. Several operational semantics have been proposed for Reo [7] with various styles of I/O streams [4], automata, coloring [8] and constraints [9]. The most basic automata-based semantics of Reo is Con- straint Automata (CA) [10]. An advantage of CA and its extensions is their support for data-constraints that are part of the coordination primitives in Reo. This is in contrast with the coloring semantics that abstracts data-flow and expresses the behavior of a connector only in terms of existence or lack of data-flow. Constraint Automata with State Memory (CASM) [11] is an extension of CA that due to its state abstraction and data- awareness, is suitable as a more compact semantic model for Reo in model checking. In this paper, we present a constraint-based technique and a tool to generate CASMs from Reo networks in a compositional manner. A shortcoming of earlier work stems from its lack of support for data-dependent behavior. We overcome this shortcoming in the work we present in this paper. Our tool is a necessary step for providing fully automated model checking for data-aware and context-dependent composition of services coordinated by Reo. The rest of this paper is organized as follows. In Section 2, we explain the basics of Reo. In Section 3, we introduce 530 Copyright (c) IARIA, 2012. ISBN: 978-1-61208-230-1 ICSEA 2012 : The Seventh International Conference on Software Engineering Advances