Service-Oriented Logic Programming
SERVICE-ORIENTED LOGIC PROGRAMMING ∗ IONUT¸ T¸ UT¸ U a AND JOS´E LUIZ FIADEIRO ba Department of Computer Science, Royal Holloway University of LondonInstitute of Mathematics of the Romanian Academy, Research group of the project ID-3-0439 e-mail address : [email protected] b Department of Computer Science, Royal Holloway University of London e-mail address : jose.fi[email protected]
Abstract.
We develop formal foundations for notions and mechanisms needed to supportservice-oriented computing. Our work builds on recent theoretical advancements in thealgebraic structures that capture the way services are orchestrated and in the processesthat formalize the discovery and binding of services to given client applications by meansof logical representations of required and provided services. We show how the denota-tional and the operational semantics specific to conventional logic programming can begeneralized using the theory of institutions to address both static and dynamic aspects ofservice-oriented computing. Our results rely upon a strong analogy between the discoveryof a service that can be bound to an application and the search for a clause that can beused for computing an answer to a query; they explore the manner in which requests forexternal services can be described as service queries, and explain how the computation oftheir answers can be performed through service-oriented derivatives of unification and res-olution, which characterize the binding of services and the reconfiguration of applications. Introduction
Service-Oriented Computing.
Service-oriented computing is a modern computationalparadigm that deals with the execution of programs over distributed information-processinginfrastructures in which software applications can discover and bind dynamically, at runtime, to services offered by providers. Whereas the paradigm has been effectively in use fora more than a decade in the form of Web services [ACKM04] or Grid computing [FK04],research into its formal foundations has lagged somewhat behind, partly because of our lackof understanding of (or agreement on) what is really new about the paradigm, especially inrelation to distributed computing in general (see, for example, [Vog03]). [ Theory of computation ]: Logic — Constraint and logic programming; Semanticsand reasoning — Program reasoning — Program specifications; [
Information systems ]: World Wide Web— Web services — Service discovery and interfaces.
Key words and phrases:
Logic programming, Institution theory, Service-oriented computing, Orchestra-tion schemes, Service discovery and binding. ∗ A preliminary version of this work was presented at CALCO 2013 [T¸ F13].
LOGICAL METHODS l IN COMPUTER SCIENCE DOI:10.2168/LMCS-11(3:3)2015 c (cid:13)
I. ¸Tu¸tu and J.L. Fiadeiro CC (cid:13) Creative Commons
I. T¸ UT¸ U AND J. L. FIADEIRO
It is fair to say that significant advances have been made towards formalizing newforms of distributed computation that have arisen around the notion of service (e.g. chore-ography [SBFZ07]), notably through several variants of the π -calculus. However, service-oriented computing raises more profound challenges at the level of the structure of systemsdue to their ability to discover and bind dynamically, in a non-programmed manner, toother systems. The structure of the systems that we are now creating in the virtual spaceof computational networks is intrinsically dynamic, a phenomenon hitherto unknown. For-malisms such as the π -calculus do not address these structural properties of systems. Thisprevents us from fully controlling and developing trust in the systems that are now operat-ing in cyberspace, and also from exploiting the power of the paradigm beyond the way it iscurrently deployed.Towards that end, we have investigated algebraic structures that account for modu-larity (e.g. [FLB07, FS07]) – referring to the way services are orchestrated as compositestructures of components and how binding is performed through interaction protocols –and the mechanisms through which discovery can be formalized in terms of logical specifica-tions of required/provided services and constraint optimisation for service-level agreements(e.g. [FLB11, FL13b]). In the present paper, we take further this research to address theoperational aspects behind dynamic discovery and binding, i.e. the mechanisms throughwhich applications discover and bind, at run time, to services. Our aim is to develop anabstract, foundational setting – independent of the specific technologies that are currentlydeployed, such as soap for message-exchange protocols and uddi for description, discovery,and integration – that combines both the denotational and the operational semantics ofservices. The challenge here is to define an integrated algebraic framework that accountsfor ( a ) logical specifications of services, ( b ) the way models of those specifications captureorchestrations of components that may depend on externally provided services to be discov-ered, and ( c ) the way the discovery of services and the binding of their orchestrations toclient applications can be expressed in logical/algebraic terms. Logic Programming.
The approach that we propose to develop to meet this challengebuilds on the relational variant of (Horn-clause) logic programming – the paradigm thatepitomizes the integration of declarative and operational aspects of logic. In conventionallogic programming, clauses have a declarative semantics as universally quantified implica-tions that express relationships over a domain (the Herbrand universe), and an operationalsemantics that derives from resolution and term unification: definite clauses (provided bya given logic program) are used to resolve logic-programming queries (expressed as exis-tentially quantified conjunctions) by generating new queries and, through term unification,computing partial answers as substitutions for the variables of the original query.In a nutshell, the analogy between service-oriented computing and conventional logicprogramming that we propose to systematically examine in this paper unfolds as follows: • The Herbrand universe consists of those service orchestrations that have no dependencieson external services – what we refer to as ground orchestrations. • Variables and terms correspond to dependencies on external services that need to bediscovered and to the actual services that are made available by orchestrations. • Service clauses express conditional properties of services required or provided by orchestra-tions, thus capturing the notion of service module described in [FLB11]. Their declarativesemantics is that, when bound to the orchestrations of other service clauses that ensure
ERVICE-ORIENTED LOGIC PROGRAMMING 3 the required properties, they deliver, through their orchestration, services that satisfy thespecified properties. • Service queries express properties of orchestrations of services that an application requiresin order to fulfil its goal – what we describe in [FLB11] as activity modules. • Logic programs define service repositories as collections of service modules. • Resolution and term unification account for service discovery by matching required prop-erties with provided ones and the binding of required with provided services.
The structure of the paper.
Our research into the logic-programming semantics ofservice-oriented computing is organized in two parts. In Section 2 we present a new cate-gorical model of service orchestrations, called orchestration scheme , that enables us to treatorchestrations as fully abstract entities required to satisfy only a few elementary properties.This framework is flexible enough to accommodate, for example, orchestrations in the formof program expressions, as considered in [Fia12], or as asynchronous relational networkssimilar to those defined in [FL13a]. In our study, such schemes play an essential role inmanaging the inherent complexity of orchestrations whilst making available, at the sametime, the fundamental building blocks of service-oriented logic programming. In Section 3,we define a logical system of orchestration schemes over which we can express properties thatcan be further used to guide the interconnection of orchestrations. We recall from [T¸ F15]the algebraic structures that underlie institution-independent logic programming, in partic-ular the substitution systems that are characteristic of relational logic programming, andprove that the resulting logic of orchestration schemes constitutes a generalized substitutionsystem . This result is central to our work, not only because it provides the declarative se-mantics of our approach to service-oriented computing, but also because it gives a definitemathematical foundation to the analogy between service-oriented computing and conven-tional logic programming outlined above. Building on these results, we show how clauses,queries, unification and resolution can be defined over the generalized substitution systemof orchestration schemes, providing in this way the corresponding operational semantics ofservice-oriented computing.The work presented herein continues our investigation on logic-independent foundationsof logic programming reported in [T¸ F15]. As such, it is based on the theory of institutions ofGoguen and Burstall [GB92]; although familiarity with the institution-independent presen-tation of logic programming is not essential, some knowledge of basic notions of institutiontheory such as institution, (co)morphism of institutions, and also of the description of in-stitutions as functors into the category of rooms [Dia08, ST11] is presumed.2.
Orchestration Schemes
The first step in the development of the particular variant of logic programming that weconsider in this paper consists in determining appropriate categorical abstractions of thestructures that support service-oriented computing. These will ultimately allow us to de-scribe the process of service discovery and binding in a way that is independent of anyparticular formalism (such as various forms of automata, transition systems or processalgebras).Our approach is grounded on two observations: first, that orchestrations can be orga-nized as a category whose arrows, or more precisely, cospans of arrows, can be used to modelthe composition of service components (as defined, for example, in [FLB07, FLB11, FL13b]);
I. T¸ UT¸ U AND J. L. FIADEIRO second, that the discovery of a service to be bound to a given client application can be for-malized in terms of logical specifications of required and provided properties, ensuring thatthe specification of the properties offered by the service provider refines the specificationof the properties requested by the client application. To this end, we explore the model-theoretic notion of refinement advanced in [ST88], except that, in the present setting, thestructures over which specifications are evaluated are morphisms into ground orchestrations,i.e. into orchestrations that have no dependencies on external services. The motivation forthis choice is that, in general, the semantics of non-ground orchestrations is open: the (ob-servable) behaviour exhibited by non-ground orchestrations varies according to the externalservices that they may procure at run time. With these remarks in mind, we arrive at thefollowing concept of orchestration scheme.
Definition 2.1 (Orchestration scheme) . An orchestration scheme is a quadruple h O rc , Spec , G rc , Prop i consisting of • a category O rc of orchestrations and orchestration morphisms , • a functor Spec : O rc → S et that defines a set Spec( o ) of service specifications over o forevery orchestration o , • a full subcategory G rc ⊆ O rc of ground orchestrations , and • a functor Prop : G rc → S et that defines a natural subset Prop( g ) ⊆ Spec( g ) of properties of g (specifications that are guaranteed to hold when evaluated over g ) for every groundorchestration g .To illustrate our categorical approach to orchestrations, we consider two main runningexamples: program expressions as discussed in [Fia12] (see also [Mor94]), which providea way of constructing structured (sequential) programs through design-time discovery andbinding, and the theory of asynchronous relational networks put forward in [FL13a], whichemphasizes the role of services as an interface mechanism for software components that canbe composed through run-time discovery and binding.2.1. Program Expressions.
The view that program expressions can be seen as defining‘service orchestrations’ through which structured programs can be built in a compositionalway originates from [Fia12]. Intuitively, we can see the rules of the Hoare calculus [Hoa69] asdefining ‘clauses’ in the sense of logic programming, where unification is controlled throughthe refinement of pre/post-conditions as specifications of provided/required services, andresolution binds program statements (terms) to variables in program expressions. In Figure 1we depict Hoare rules in a notation that is closer to that of service modules, which also bringsout their clausal form: the specification (a pair of a pre- and a post-condition) on the left-hand side corresponds to the consequent of the clause (which relates to a ‘provides-point’ ofthe service), while those on the right-hand side correspond to the antecedent of the clause (i.e.to the ‘requires-points’ of the service) – the specifications of what remains to be discoveredand bound to the program expression (the ‘service orchestration’ inside the box) to producea program. In Figure 2, we retrace Hoare’s original example of constructing a program thatcomputes the quotient and the remainder resulting from the division of two natural numbersas an instance of the unification and resolution mechanisms particular to logic programming.We will further discuss these mechanisms in more detail in Subsection 3.3. By describing the set Prop( g ) as a natural subset of Spec( g ) we mean that the family of inclusions(Prop( g ) ⊆ Spec( g )) g ∈| G rc | defines a natural transformation from Prop to ( G rc ⊆ O rc) ; Spec.
ERVICE-ORIENTED LOGIC PROGRAMMING 5 skip ρ, ρ (empty statement) x := eρ ( e ) , ρ ( x )(assignment) ; pgm pgm ρ, ρ ′′ ρ, ρ ′ ρ ′ , ρ ′′ (sequence) if C then pgm else pgm endif ρ, ρ ′ ρ ∧ J C K , ρ ′ ρ ∧ ¬ J C K , ρ ′ (selection) while C do pgm done ρ, ρ ∧ ¬ J C K ρ ∧ J C K , ρ (iteration)Figure 1: Program modulesThe formal description of program expressions that we consider here follows the pre-sentation given in [GM96] of the algebraic semantics of programs except that, instead ofthe theory of many-sorted algebra, we rely on the theory of preordered algebra developedin [DF98], whose institution we denote by POA. In this context, signatures are ordinaryalgebraic signatures whose denotation is defined over the category of preorders rather thanthat of sets, with models interpreting the sorts as preordered sets and the operation symbolsas monotonic functions. The sentences are built as in first-order logic based on two kindsof atoms: equational atoms l = r and preorder atoms l → r , where l and r are terms of thesame sort; the latter are satisfied by a preordered algebra A if and only if the interpretationsof l and r in A belong to the preorder relation of the carrier of their sort.In order to fully define the orchestration scheme of program expressions we assume thatthe programming language we have chosen to analyse is specified through a many-sortedsignature h S, F i equipped with • a distinguished set of sorts S pgm ⊂ S corresponding to the types of executable expressionssupported by the language, and sorts State , Config ∈ S \ S pgm capturing the states of theprograms and the various configurations that may arise upon their execution, respectively; • operation symbols h i : State → Config and h , i : eXp State → Config for sorts eXp ∈ S pgm , which we regard as constructor operators for the sort Config ; • a (sortwise infinite) S pgm -indexed set Var of program variables, and state variables st , st ′ : State , used to refer to the states that precede or result from executions; and • a preordered h S, F i -algebra A that describes the semantics of the programming languagethrough the preorder relation associated with the sort Config . Example 2.2.
The premises that we consider within this subsection are weak enough toallow the proposed algebraic framework to accommodate a wide variety of programming Alternatively, one could use a theory presentation or a structured specification instead of the algebra A . I . T ¸ U T ¸ UAN D J . L . F I A D E I R O pgm SP ⊑ SP pgm ; pgm SP SP SP ⊑ pgm ; pgm SP SP SP ⊑ q := 0 SP ⊑ r := x SP ⊑ pgm while y ≤ r dodone SP SP ⊑ pgm ; pgm SP SP SP ⊑ q := q + 1 SP ⊑ r := r − y Figure 2: The derivation of a program that computes the quotient q and the remainder r obtained from the division of x by y SP : true , J x = q ∗ y + r K ∧ J r < y K SP : J x = q ∗ y + x K , J x = q ∗ y + r K SP : true , J x = q ∗ y + r K ∧ J r < y K SP : J x = q ∗ y + r K , J x = q ∗ y + r K ∧ ¬ J y ≤ r K SP : true , J x = q ∗ y + r K SP : J x = q ∗ y + r K ∧ J y ≤ r K , J x = q ∗ y + r K SP : J x = q ∗ y + r K , J x = q ∗ y + r K ∧ J r < y K SP : J x = ( q + 1) ∗ y + ( r − y ) K , J x = q ∗ y + r K SP : true , J x = q ∗ y + r K SP : J x = ( q + 1) ∗ y + ( r − y ) K , J x = q ∗ y + ( r − y ) K SP : true , J x = q ∗ y + x K SP : J x = q ∗ y + ( r − y ) K , J x = q ∗ y + r K SP : J x = q ∗ y + x K , J x = q ∗ y + r K SP : J x = ( q + 1) ∗ y + ( r − y ) K , J x = q ∗ y + ( r − y ) K SP : J x = 0 ∗ y + x K , J x = q ∗ y + x K SP : J x = q ∗ y + ( r − y ) K , J x = q ∗ y + r K ERVICE-ORIENTED LOGIC PROGRAMMING 7 languages. For instance, the program expressions underlying the modules depicted in Fig-ure 1 are simply terms of sort
Pgm that can be formed based on the following five operationsymbols (written using the mixfix notation of
CafeOBJ [DF98] and
Casl [Mos04]):(empty statement) skip : → Pgm , (assignment) := : Id AExp → Pgm , (sequence) ; : Pgm Pgm → Pgm , (selection) if then else endif : Cond Pgm Pgm → Pgm , (iteration) while do done : Cond Pgm → Pgm . To simplify our presentation, we omit the details associated with the sorts Id of iden-tifiers, AExp of arithmetic expressions and
Cond of conditions; we also tacitly assume thatthe signature under consideration declares the usual operation symbols associated with thenames of identifiers, the addition, subtraction and multiplication of arithmetic expressions,and with the atoms and Boolean connectives specific to conditions. Moreover, we assumethe essential sorts
State and
Config to be defined, as well as the operation symbols h i and h , i .Algebraic signatures having the aforementioned additional structure induce orchestra-tion schemes in a canonical way, as follows. Orchestrations.
The orchestrations are program expressions, that is h S, F ∪ Var i -terms pgm : eXp , usually denoted simply by pgm if there is no danger of confusion, such that eXp is a sort in S pgm . The arrows through which they are linked generalize the subtermrelations; in this sense, a morphism h ψ, π i between programs pgm : eXp and pgm : eXp consists of • a substitution ψ : var( pgm ) → var( pgm ), mapping the variables that occur in pgm toprogram expressions defined over the variables of pgm , together with • a position π in pgm , i.e. a sequence of natural numbers that precisely identifies a partic-ular occurrence of a subterm pgm ↾ π of pgm ,such that ψ tm ( pgm ) = pgm ↾ π . Their composition is defined componentwise, in a waythat ensures the commutativity of the following diagram. pgm : eXp h ψ ,π i / / @A BC h ψ ; ψ ,π · π i O O pgm : eXp h ψ ,π i / / pgm : eXp Specifications.
For each program expression pgm : eXp , a (program) specification is atriple of the form ι : [ ρ, ρ ′ ], where ι is a position in pgm indicating the ‘subprogram’ of pgm whose behaviour is being analysed, and ρ and ρ ′ are pre- and post-conditions associated with pgm ↾ ι , formalized as (quantifier-free) POA-sentences over the signature h S, F ∪ { st : State }i .The intuitive interpretation is the usual one:Whenever the program pgm ↾ ι is executed in an initial state that satisfiesthe pre-condition ρ , and the execution terminates, the resulting final statesatisfies the post-condition ρ ′ . Here, we let ψ tm denote the canonical extension of the substitution ψ from variables to terms. The first component of specifications may be encountered in the literature (e.g. in [Mor94]) with adifferent meaning: the set of identifiers whose values may change during the execution of the program.
I. T¸ UT¸ U AND J. L. FIADEIRO
Note, however, that specifications cannot be evaluated over arbitrary program expressionsbecause, due to the presence of program variables (from
Var ), some of the programs maynot support a well-defined notion of execution. We will address this aspect in Section 3by taking into account translations of specifications along morphisms whose codomainsare ground program expressions. For now, it suffices to mention that the translation of aprogram specification ι : [ ρ, ρ ′ ] of pgm : eXp along a morphism h ψ, π i : ( pgm : eXp ) → ( pgm : eXp ) is defined as the specification ( π · ι ) : [ ψ ( ρ ) , ψ ( ρ ′ )] of pgm : eXp . Ground orchestrations and properties.
As expected, ground program expressions arejust program expressions that do not contain variables: h S, F i -terms pgm : eXp whose sort eXp belongs to S pgm . Consequently, they have a well-defined operational semantics, whichmeans that we can check whether or not they meet the requirements of a given specification.A specification ι : [ ρ, ρ ′ ] is a property of a ground program expression pgm : eXp if andonly if the following satisfaction condition holds for the preordered algebra A : A (cid:15) POA ∀{ st , st ′ : State } · ( ρ ( st ) ∧ h pgm ↾ ι , st i → h st ′ i ) ⇒ ρ ′ ( st ′ ) . To keep the notation simple and, at the same time, emphasize the roles of st and st ′ , weused ρ ( st ) in the above POA-sentence as another name for ρ , while ρ ′ ( st ′ ) is the sentencederived from ρ ′ by replacing the variable st with st ′ . The same notational convention isused in Figure 1 to represent the specification attached to the assignment expression. Inthat case, ρ is assumed to be a sentence defined not only over st : State , but also over avariable v : AExp ; the sentences ρ ( e ) and ρ ( x ) are then derived from ρ by replacing v with e and x (regarded as an atomic arithmetic expression), respectively. Another notation used inFigure 1 (and also in Figure 2) is J C K , where C is a term of sort Cond ; this follows Iverson’sconvention (see [Ive62], and also [GKP94]), and corresponds to an atomic POA-sentencethat captures the semantics of the condition C .We conclude the presentation of orchestrations as program expressions with Proposi-tion 2.3 below, which guarantees that properties form natural subsets of the sets of specifi-cations; in other words, the morphisms of ground programs preserve properties. Proposition 2.3.
Let h ψ, π i : ( pgm : eXp ) → ( pgm : eXp ) be a morphism of groundprograms. For every property ι : [ ρ, ρ ′ ] of pgm : eXp , the specification Spec( ψ, π )( ι : [ ρ, ρ ′ ]) is a property of pgm : eXp .Proof. By the definition of the translation of specifications along morphisms of programexpressions, Spec( ψ, π )( ι : [ ρ, ρ ′ ]) is a property of pgm : eXp if and only if A (cid:15) POA ∀{ st , st ′ : State } · ( ψ ( ρ )( st ) ρ ( st ) ∧ h pgm ↾ π · ι pgm ↾ ι , st i → h st ′ i ) ⇒ ψ ( ρ ′ )( st ′ ) ρ ′ ( st ′ ) . To prove this, notice that all morphisms of ground program expressions share the sameunderlying substitution: the identity of ∅ . Therefore, ψ ( ρ ) = ρ , ψ ( ρ ′ ) = ρ ′ , and pgm ↾ π · ι = pgm ↾ π ↾ ι = ψ tm ( pgm ) ↾ ι = pgm ↾ ι , from which we immediately deduce that both the evalu-ation of ι : [ ρ, ρ ′ ] in pgm : eXp and that of Spec( ψ, π )( ι : [ ρ, ρ ′ ]) in pgm : eXp correspondto the satisfaction by A of the same POA-sentence. Formally, the sentences ρ ( st ) and ρ ′ ( st ′ ) are obtained by translating ρ and ρ ′ along the h S, F i -substitu-tions { st } → { st , st ′ } given by st st and st st ′ , respectively. ERVICE-ORIENTED LOGIC PROGRAMMING 9
Asynchronous Relational Networks.
Asynchronous relational networks as devel-oped in [FL13a] uphold a significantly different perspective on services: the emphasis isput not on the role of services in addressing design-time organisational aspects of complex,interconnected systems, but rather on their role in managing the run-time interactions thatare involved in such systems. In this paper, we consider a variant of the original theoryof asynchronous relational networks that relies on hypergraphs instead of graphs, and uses ω -automata [Tho90] (see also [PP04]) instead of sets of traces as models of behaviour.The notions discussed within this context depend upon elements of linear temporallogic, and are introduced through dedicated syntactic structures that correspond to specifictemporal signatures and signature morphisms. However, the proposed theory is largelyindependent of any logical framework of choice – similarly to the way in which programexpressions can be defined over a variety of algebraic signatures – and can be easily adaptedto any institution for which1. the category of signatures is (finitely) cocomplete;2. there exist cofree models along every signature morphism, meaning that the reduct func-tors determined by signature morphisms admit right adjoints;3. the category of models of every signature has (finite) products;4. all model homomorphisms reflect the satisfaction of sentences.In addition to the above requirements, we implicitly assume, as is often done in insti-tutions (see, for example, [Dia08] and [ST11] for more details), that the considered logicalsystem is closed under isomorphisms, meaning that the satisfaction of sentences is invariantwith respect to isomorphisms of models. This property holds in most institutions; in partic-ular, it holds in the variant of temporal logic that we use here as a basis for the constructionof the orchestration scheme of asynchronous relational networks. Linear Temporal Logic.
In order to capture a more operational notion of service orches-tration, we work with an automata-based variant of the institution LTL of linear temporallogic [FC96]. This logical system, denoted a LTL, has the same syntax as LTL, which meansthat signatures are arbitrary sets of actions , and that signature morphisms are just func-tions. With respect to sentences, for any signature A , the set of A -sentences is defined as theleast set containing the actions in A that is closed under standard Boolean connectives andunder the temporal operators next ( (cid:7) ) and until ( U ). As usual, the derived temporalsentences ✸ ρ and ✷ ρ stand for true U ρ and ¬ ( true U ¬ ρ ), respectively.The semantics of a LTL is defined over (non-deterministic finite-state) Muller automata[Mul63] instead of the more conventional temporal models. This means that, in the presentsetting, the models of a signature A are Muller automata
Λ = h Q, P ( A ) , ∆ , I, F i , whichconsist of a (finite) set Q of states , an alphabet P ( A ), a transition relation ∆ ⊆ Q ×P ( A ) × Q ,a subset I ⊆ Q of initial states , and a subset F ⊆ P ( Q ) of (non-empty) final-state sets .The satisfaction relation is based on that of LTL: an automaton Λ satisfies a sentence ρ if and only if every trace accepted by Λ satisfies ρ in the sense of LTL. To be more precise,let us first recall that a trace over A is an (infinite) sequence λ ∈ P ( A ) ω , and that a run ofan automaton Λ defined as above on a trace λ is a state sequence ̺ ∈ Q ω such that ̺ (0) ∈ I and ( ̺ ( i ) , λ ( i ) , ̺ ( i + 1)) ∈ ∆ for every i ∈ ω . A run ̺ is said to be successful if its infinityset, i.e. the set of states that occur infinitely often in ̺ , denoted Inf( ̺ ), is a member of F . For convenience, we assume that disjunctions, denoted W E , and conjunctions, denoted V E , are definedover arbitrary finite sets of sentences E , and we abbreviate V { ρ , ρ } as ρ ∧ ρ and V ∅ as true . Then a trace λ is accepted by Λ if and only if there exists a successful run of Λ on λ . Finally,given a trace λ (that can be presumed to be accepted by Λ) and i ∈ ω , we use the notation λ ( i.. ) to indicate the suffix of λ that starts at λ ( i ). The satisfaction of temporal sentencesby traces can now be defined by structural induction, as follows: λ (cid:15) a if and only if a ∈ λ (0) ,λ (cid:15) ¬ ρ if and only if λ ρ,λ (cid:15) W E if and only if λ (cid:15) ρ for some ρ ∈ E,λ (cid:15) (cid:7) ρ if and only if λ (1 .. ) (cid:15) ρ, and λ (cid:15) ρ U ρ if and only if λ ( i.. ) (cid:15) ρ for some i ∈ ω, and λ ( j.. ) (cid:15) ρ for all j < i, where a is an action in A , ρ , ρ and ρ are A -sentences, and E is a set of A -sentences.One can easily see that the first of the hypotheses 1–4 that form the basis of thepresent study of asynchronous relational networks is satisfied by a LTL, as it corresponds toa well-known result about the existence of small colimits in S et. In order to check that theremaining three properties hold as well, let us first recall that a homomorphism h : Λ → Λ between Muller automata Λ = h Q , P ( A ) , ∆ , I , F i and Λ = h Q , P ( A ) , ∆ , I , F i (overthe same alphabet) is a function h : Q → Q such that ( h ( p ) , α, h ( q )) ∈ ∆ whenever( p, α, q ) ∈ ∆ , h ( I ) ⊆ I , and h ( F ) ⊆ F . We also note that for any map σ : A → A ′ ,i.e. for any signature morphism, and any Muller automaton Λ ′ = h Q ′ , P ( A ′ ) , ∆ ′ , I ′ , F ′ i , the reduct Λ ′ ↾ σ is the automaton h Q ′ , P ( A ) , ∆ ′ ↾ σ , I ′ , F ′ i with the same states, initial states andfinal-state sets as Λ ′ , and with the transition relation given by ∆ ′ ↾ σ = { ( p ′ , σ − ( α ′ ) , q ′ ) | ( p ′ , α ′ , q ′ ) ∈ ∆ ′ } .The following results enable us to use the institution a LTL as a foundation for the sub-sequent development of asynchronous relational networks. In particular, Proposition 2.4ensures the existence of cofree Muller automata along signature morphisms; Proposition 2.5allows us to form products of Muller automata based on a straightforward categorical in-terpretation of the fact that the sets of traces accepted by Muller automata, i.e. regular ω -languages, are closed under intersection; and finally, Proposition 2.6 guarantees that allmodel homomorphisms reflect the satisfaction of temporal sentences. Proposition 2.4.
For every morphism of a LTL -signatures σ : A → A ′ , the reduct functor ↾ σ : Mod a LTL ( A ′ ) → Mod a LTL ( A ) admits a right adjoint, which we denote by ( ) σ .Proof. According to a general result about adjoints, it suffices to show that for any automa-ton Λ over the alphabet P ( A ) there exists a universal arrow from ↾ σ to Λ.Let us thus consider a Muller automaton Λ = h Q, P ( A ) , ∆ , I, F i over P ( A ). We definethe automaton Λ σ = h Q, P ( A ′ ) , ∆ σ , I, F i over the alphabet P ( A ′ ) by∆ σ = { ( p, α ′ , q ) | ( p, σ − ( α ′ ) , q ) ∈ ∆ } . It is straightforward to verify that the identity map 1 Q defines a homomorphism of automataΛ σ ↾ σ → Λ: for any transition ( p, α, q ) ∈ ∆ σ ↾ σ , by the definition of the reduct functor ↾ σ ,there exists a set α ′ ⊆ A ′ such that σ − ( α ′ ) = α and ( p, α ′ , q ) ∈ ∆ σ ; given the definition ERVICE-ORIENTED LOGIC PROGRAMMING 11 above of ∆ σ , it follows that ( p, σ − ( α ′ ) , q ) ∈ ∆, and hence ( p, α, q ) ∈ ∆.Λ Λ σ ↾ σ Q o o Λ σ Λ ′ ↾ σh O O h a a ❇❇❇❇❇❇❇❇ Λ ′ h O O Let us now assume that h : Λ ′ ↾ σ → Λ is another homomorphism of automata, withΛ ′ = h Q ′ , P ( A ′ ) , ∆ ′ , I ′ , F ′ i . Then for any transition ( p ′ , α ′ , q ′ ) ∈ ∆ ′ , by the definition of thefunctor ↾ σ , we have ( p ′ , σ − ( α ′ ) , q ′ ) ∈ ∆ ′ ↾ σ . Based on the homomorphism property of h ,it follows that ( h ( p ′ ) , σ − ( α ′ ) , h ( q ′ )) ∈ ∆, which further implies, by the definition of ∆ σ ,that ( h ( p ′ ) , α ′ , h ( q ′ )) ∈ ∆ σ . As a result, the map h is also a homomorphism of automataΛ ′ → Λ σ . Even more, it is obviously the unique homomorphism Λ ′ → Λ σ (in the categoryof automata over P ( A ′ )) such that h ; Q = h in the category of automata over P ( A ). Proposition 2.5.
For any set of actions A , the category Mod a LTL ( A ) of Muller automatadefined over the alphabet P ( A ) admits (finite) products.Proof. Let (Λ i ) i ∈ J be a (finite) family of Muller automata over the alphabet P ( A ), with Λ i given by h Q i , P ( A ) , ∆ i , I i , F i i . We define the automaton Λ = h Q, P ( A ) , ∆ , I, F i by Q = Q i ∈ J Q i , ∆ = { ( p, α, q ) | ( p ( i ) , α, q ( i )) ∈ ∆ i for all i ∈ J } ,I = Q i ∈ J I i , and F = { S ⊆ Q | π i ( S ) ∈ F i for all i ∈ J } , where the functions π i : Q → Q i are the corresponding projections of the Cartesian product Q i ∈ J Q i . By construction, it immediately follows that for every i ∈ J , the map π i definesa homomorphism of automata Λ → Λ i . Even more, one can easily see that for any otherfamily of homomorphisms ( h i : Λ ′ → Λ i ) i ∈ J , with Λ ′ = h Q ′ , P ( A ′ ) , ∆ ′ , I ′ , F ′ i , the uniquemap h : Q ′ → Q such that h ; π i = h i for all i ∈ J defines a homomorphism of automata aswell. Therefore, the automaton Λ and the projections ( π i ) i ∈ J form the product of (Λ i ) i ∈ J . Proposition 2.6.
Let h : Λ → Λ be a homomorphism between automata defined over analphabet P ( A ) . Every temporal sentence over A that is satisfied by Λ is also satisfied by Λ .Proof. Suppose that Λ i = h Q i , P ( A ) , ∆ i , I i , F i i , for i ∈ { , } . Since the map h : Q → Q defines a homomorphism of automata, for every successful run ̺ ∈ Q ω of Λ on a trace λ ∈ P ( A ) ω , the composition ̺ ; h yields a successful run of Λ on λ . As a result, Λ acceptsall the traces accepted by Λ , which further implies that Λ satisfies all temporal sentencesthat are satisfied by Λ . Service Components.
Following [FL13a], we regard service components as networks of pro-cesses that interact asynchronously by exchanging messages through communication chan-nels. Messages are considered to be atomic units of communication. They can be groupedeither into sets of messages that correspond to processes or channels, or into specific struc-tures, called ports, through which processes and channels can be interconnected.
The ports can be viewed as sets of messages with attached polarities. As in [BZ83,BCT06] we distinguish between outgoing or published messages (labelled with a minussign), and incoming or delivered messages (labelled with a plus sign).
Definition 2.7 (Port) . A port M is a pair h M − , M + i of disjoint (finite) sets of published and delivered messages . The set of all messages of M is given by M − ∪ M + and is oftendenoted simply by M . Every port M defines the set of actions A M = A M − ∪ A M + , where • A M − is the set { m ! | m ∈ M − } of publication actions , and • A M + is the set { m ¡ | m ∈ M + } of delivery actions .Processes are defined by sets of interaction points labelled with ports and by automatathat describe their behaviour in terms of observable publication and delivery actions. Definition 2.8 (Process) . A process is a triple h X, ( M x ) x ∈ X , Λ i that consists of a (finite)set X of interaction points , each point x ∈ X being labelled with a port M x , and a Mullerautomaton Λ over the alphabet P ( A M ), where M is the port given by M ∓ = ] x ∈ X M ∓ x = { x.m | x ∈ X, m ∈ M ∓ x } . Example 2.9.
In Figure 3 we depict a process JP (for Journey Planner) that providesdirections from a source to a target location. The process interacts with the environmentby means of two ports, named JP and JP . The first port is used to communicate withpotential client processes – the request for directions (including the source and the target lo-cations) is encoded into the incoming message planJourney , while the response is representedby the outgoing message directions . The second port defines messages that JP exchangeswith other processes in order to complete its task – the outgoing message getRoutes canbe seen as a query for all possible routes between the specified source and target locations,while the incoming messages routes and timetables define the result of the query and thetimetables of the available transport services for the selected routes. JP Λ JPplanJourney + directions − JP − getRoutes + routes + timetablesJP Figure 3: The process JP The behaviour of JP is given by the Muller automaton depicted in Figure 4, whose final-state sets contain q whenever they contain q . We can describe it informally as follows:whenever the process JP receives a request planJourney it immediately initiates the searchfor the available routes by sending the message getRoutes ; it then waits for the delivery ofthe routes and of the corresponding timetables, and, once it receives both, it compiles thedirections and replies to the client. Remark 2.10.
To generalize Definition 2.8 to an arbitrary institution (subject to the fourtechnical assumptions listed at the beginning of the subsection), we first observe that everypolarity-preserving map θ between ports M and M ′ defines a function A θ : A M → A M ′ , i.e. In the graphical representation, transitions are labelled with propositional sentences, as in [AS87]; thismeans that there exists a transition for any propositional model (i.e. set of actions) of the considered sentence.
ERVICE-ORIENTED LOGIC PROGRAMMING 13 q q q q q q ¬ planJourney ¡ planJourney ¡ getRoutes ! ¬ routes ¡ ∧ ¬ timetables ¡ routes ¡ ∧ timetables ¡ ¬ routes ¡ ∧ timetables ¡ routes ¡ ∧ ¬ timetables ¡ routes ¡ ¬ routes ¡ timetables ¡ ¬ timetables ¡ ¬ directions ! directions ! Figure 4: The automaton Λ JP a morphism of a LTL-signatures, usually denoted simply by θ , that maps every publicationaction m ! to θ ( m )! and every delivery action m ¡ to θ ( m )¡. Moreover, for any process h X, ( M x ) x ∈ X , Λ i , the injections ( x. : A M x → A M ) x ∈ X define a coproduct in the categoryof a LTL-signatures. This allows us to introduce an abstract notion of process as a triple h X, ( ι x : Σ x → Σ) x ∈ X , Λ i that consists of a set X of interaction points , each point x ∈ X being labelled with a port signature Σ x , a process signature Σ together with morphisms ι x : Σ x → Σ for x ∈ X (usually defining a coproduct), and a model Λ of Σ.Processes communicate by transmitting messages through channels. As in [BZ83,FL13a], channels are bidirectional: they may transmit both incoming and outgoing mes-sages. Definition 2.11 (Channel) . A channel is a pair h M, Λ i that consists of a (finite) set M of messages and a Muller automaton Λ over the alphabet P ( A M ), where A M is given by theunion A − M ∪ A + M of the sets of actions A − M = { m ! | m ∈ M } and A + M = { m ¡ | m ∈ M } .Note that channels do not provide any information about the communicating entities.In order to enable given processes to exchange messages, channels need to be attached totheir ports, thus forming connections. Definition 2.12 (Connection) . A connection h M, Λ , ( µ x : M ⇀ M x ) x ∈ X i between the ports( M x ) x ∈ X consists of a channel h M, Λ i and a (finite) family of partial attachment injections ( µ x : M ⇀ M x ) x ∈ X such that M = S x ∈ X dom( µ x ) and for any point x ∈ X , µ − x ( M ∓ x ) ⊆ [ y ∈ X \{ x } µ − y ( M ± y ) . This notion of connection generalizes the one found in [FL13a] so that messages can betransmitted between more than two ports. The additional condition ensures in this casethat messages are well paired: every published message of M x , for x ∈ X , is paired witha delivered message of M y , for y ∈ X \ { x } , and vice versa. One can also see that forany binary connection, the attachment injections have to be total functions; therefore, anybinary connection is also a connection in the sense of [FL13a]. Example 2.13.
In order to illustrate how the process JP can send or receive messages, weconsider the connection C depicted in Figure 5 that moderates the flow of messages betweenthe port named JP and two other ports, named R and R . − getRoutes + routes + timetablesJP getRoutes + routes − R routes + timetables − R C Λ C Figure 5: The Journey Planner’s connectionThe underlying channel of C is given by the set of messages M = { g, r, t } together withthe automaton Λ C that specifies the delivery of all published messages without any delay;Λ C can be built as the product of the automata Λ m , for m ∈ M , whose transition map isdepicted in Figure 6, and whose sets of states are all marked as final. q q ¬ m ! m ! m ! ∧ m ¡ ¬ m ! ∧ m ¡ Figure 6: The automaton Λ m The channel is attached to the ports JP , R and R through the partial injections • µ JP : M → M JP given by g getRoutes , r routes and t timetables , • µ R : M → M R given by g getRoutes and r routes , and • µ R : M → M R given by r routes and t timetables .These injections specify the actual senders and receivers of messages. For instance, themessage g is delivered only to the port R (because µ R is not defined on g ), whereas r issimultaneously delivered to both JP and R .As already suggested in Examples 2.9 and 2.13, processes and connections have dualroles, and they interpret the polarities of messages accordingly. In this sense, processesare responsible for publishing messages (i.e. they regard delivered messages as inputs andpublished messages as outputs), while connections are responsible for delivering messages.This dual nature of connections can be made explicit by taking into account, for everyconnection h M, Λ , ( µ x : M ⇀ M x ) x ∈ X i , partial translations ( A µ x : A M ⇀ A M x ) x ∈ X of theactions defined by the channel into actions defined by the ports, as follows:dom( A µ x ) = { m ! | m ∈ µ − x ( M − x ) } ∪ { m ¡ | m ∈ µ − x ( M + x ) } ,A µ x ( m !) = µ x ( m )! for all messages m ∈ µ − x ( M − x ) ,A µ x ( m ¡) = µ x ( m )¡ for all messages m ∈ µ − x ( M + x ) . We usually designate the partial maps A µ x simply by µ x if there is no danger of confusion. Remark 2.14.
Just as in the case of processes, we can define connections based on anarbitrary logical system, without relying on messages. To achieve this goal, note that, in
ERVICE-ORIENTED LOGIC PROGRAMMING 15 a LTL, every connection h M, Λ , ( µ x : M ⇀ M x ) x ∈ X i determines a family of spans A M dom( µ x ) ⊇ o o µ x / / A M x indexed by points x ∈ X . Then we can consider connections more generally as triples h Σ , Λ , ( ι x : Σ ′ x → Σ , µ x : Σ ′ x → Σ x ) x ∈ X i in which the signature Σ and the model Λ of Σabstract the channel component, and the spans of signature morphisms ( ι x , µ x ) x ∈ X providethe means of attaching port signatures to the channel.We can now define asynchronous networks of processes as hypergraphs having verticeslabelled with ports and hyperedges labelled with processes or connections. Definition 2.15 (Hypergraph) . A hypergraph h X, E, γ i consists of a set X of vertices or nodes , a set E of hyperedges , disjoint from X , and an incidence map γ : E → P ( X ), definingfor every hyperedge e ∈ E a non-empty set γ e ⊆ X of vertices it is incident with.A hypergraph h X, E, γ i is said to be edge-bipartite if it admits a distinguished partitionof E into subsets F and G such that no adjacent hyperedges belong to the same part, i.e.for every e , e ∈ E such that γ e ∩ γ e = ∅ , either e ∈ F and e ∈ G , or e ∈ G and e ∈ F .Hypergraphs have been used extensively in the context of graph-rewriting-based ap-proaches to concurrency, including service-oriented computing (e.g. [BGLL09, FHL + Definition 2.16 (Asynchronous relational network – arn ) . An asynchronous relational net-work N = h X, P, C, γ, M, µ, Λ i consists of a (finite) edge-bipartite hypergraph h X, P, C, γ i of points x ∈ X , computation hyperedges p ∈ P and communication hyperedges c ∈ C , andof • a port M x for every point x ∈ X , • a process h γ p , ( M x ) x ∈ γ p , Λ p i for every hyperedge p ∈ P , and • a connection h M c , Λ c , ( µ cx : M c ⇀ M x ) x ∈ γ c i for every hyperedge c ∈ C . Example 2.17.
By putting together the process and the connection presented in Exam-ples 2.9 and 2.13, we obtain the arn
JourneyPlanner depicted in Figure 7. Its underlyinghypergraph consists of the points JP , JP , R and R , the computation hyperedge JP ,the communication hyperedge C , and the incidence map γ given by γ JP = { JP , JP } and γ C = { JP , R , R } . JP Λ JPplanJourney + directions − JP − getRoutes + routes + timetablesJP getRoutes + routes − R routes + timetables − R C Λ C Figure 7: The arn
JourneyPlanner
The Orchestration Scheme of Asynchronous Relational Networks.
Let us now focus on themanner in which arn s can be organized to form an orchestration scheme. We begin witha brief discussion on the types of points of arn s, which will enable us to introduce notionsof morphism of arn s and ground arn .An interaction point of an arn N is a point of N that is not bound to both computationand communication hyperedges. We distinguish between two types of interaction points,called requires- and provides-points, as follows. Definition 2.18 (Requires- and provides-point) . A requires-point of an arn N is a pointof N that is incident only with a communication hyperedge. Similarly, a provides-point of N is a point incident only with a computation hyperedge.For the arn JourneyPlanner depicted in Figure 7, the points R and R are requires-points(incident with the communication hyperedge C ), whereas JP is a provides-point (incidentwith the computation hyperedge JP ). Orchestrations.
In order to describe arn s as orchestrations we first need to equip themwith appropriate notions of morphism and composition of morphisms. Morphisms of arn scorrespond to injective homomorphisms between their underlying hypergraphs, and arerequired to preserve all labels, except those associated with points that, like the requires-points, are not incident with computation hyperedges.
Definition 2.19 (Homomorphism of hypergraphs) . A homomorphism h between hyper-graphs h X , E , γ i and h X , E , γ i consists of functions h : X → X and h : E → E such that for any vertex x ∈ X and hyperedge e ∈ E , x ∈ γ e if and only if h ( x ) ∈ γ h ( e ) . Definition 2.20 (Morphism of arn s) . Given two arn s N = h X , P , C , γ , M , µ , Λ i and N = h X , P , C , γ , M , µ , Λ i , a morphism θ : N → N consists of • an injective homomorphism θ : h X , P , C , γ i → h X , P , C , γ i between the underlyinghypergraphs of N and N such that θ ( P ) ⊆ P and θ ( C ) ⊆ C , and • a family θ pt of polarity-preserving injections θ pt x : M x → M θ ( x ) , for x ∈ X ,such that • for every point x ∈ X incident with a computation hyperedge, θ pt x = 1 M x , • for every computation hyperedge p ∈ P , Λ p = Λ θ ( p ) , and • for every communication hyperedge c ∈ C , M c = M θ ( c ) , Λ c = Λ θ ( c ) and the followingdiagram commutes, for every point x ∈ γ c . M c = M θ ( c ) µ ,cx / µ ,θ ( c ) θ ( x ) " ❊❊❊❊❊❊❊❊❊ M xθ pt x (cid:15) (cid:15) M θ ( x ) It is straightforward to verify that the morphisms of arn s can be composed in terms oftheir components. Their composition is associative and has left and right identities givenby morphisms that consists solely of set-theoretic identities. We obtain in this way the firstresult supporting the construction of an orchestration scheme of arn s. Proposition 2.21.
The morphisms of arn s form a category, denoted
ARN . To simplify the notation, we denote both the translation of vertices and of hyperedges simply by h . ERVICE-ORIENTED LOGIC PROGRAMMING 17
Specifications.
To define specifications over given arn s, we label their points with lineartemporal sentences, much in the way we used pre- and post-conditions as labels for positionsin terms when defining specifications of program expressions.
Definition 2.22 (Specification over an arn ) . For any arn N , the set Spec( N ) of N -speci-fications is the set of pairs h x, ρ i , usually denoted @ x ρ , where x is a point of N and ρ is an a LTL-sentence over A M x , i.e. over the set of actions defined by the port that labels x .The translation of specifications along morphisms of arn s presents no difficulties: forevery morphism θ : N → N ′ , the map Spec( θ ) : Spec( N ) → Spec( N ′ ) is given bySpec( θ )(@ x ρ ) = @ θ ( x ) Sen a LTL ( θ pt x )( ρ )for each point x of N and each a LTL-sentence ρ over the actions of x . Furthermore, it canbe easily seen that it inherits the functoriality of the translation of sentences in a LTL, thusgiving rise to the functor Spec :
ARN → S et that we are looking for. Ground orchestrations.
Morphisms of arn s can also be regarded as refinements, as theyformalize the embedding of networks with an intuitively simpler behaviour into networksthat are more complex. This is achieved essentially by mapping each of the requires-pointsof the source arn to a potentially non-requires-point of the target arn , a point which canbe looked at as the ‘root’ of a particular subnetwork of the target arn . To explain thisaspect in more detail we introduce the notions of dependency and arn defined by a point.
Definition 2.23 (Dependency) . Let x and y be points of an arn N . The point x is saidto be dependent on y if there exists a path from x to y that begins with a computationhyperedge, i.e. if there exists an alternating sequence x e x . . . e n y of (distinct) pointsand hyperedges of the underlying hypergraph h X, P, C, γ i of N such that x ∈ γ e , y ∈ γ e n , x i ∈ γ e i ∩ γ e i +1 for every 1 ≤ i < n , and e ∈ P . Definition 2.24 (Network defined by a point) . The arn defined by a point x of an arn N is the full sub- arn N x of N determined by x and the points on which x is dependent.One can now see that any morphism of arn s θ : N → N assigns to each requires-point x of the source network N the sub- arn N ,θ ( x ) of N defined by θ ( x ). Example 2.25.
In Figure 8 we outline an extension of the arn
JourneyPlanner discussed inExample 2.17 that is obtained by attaching the processes MS (for Map Services) and TS (forTransport System) to the requires-points R and R of JourneyPlanner . Formally, the linkbetween
JourneyPlanner and the resulting arn
JourneyPlannerNet is given by a morphism θ : JourneyPlanner → JourneyPlannerNet that preserves all the labels, points and hyperedgesof
JourneyPlanner , with the exception of the requires-points R and R , which are mappedto MS and TS , respectively.In this case, MS only depends on itself, hence the sub- arn of JourneyPlannerNet definedby MS , i.e. the arn assigned to the requires-point R of JourneyPlanner , is given by theprocess MS and its port MS . In contrast, the point JP depends on all the other points of JourneyPlannerNet , and thus it defines the entire arn
JourneyPlannerNet .In view of the above observation, we may consider the requires-points of networks ascounterparts of the variables used in program expressions, and their morphisms as substi-tutions. This leads us to the following definition of ground arn s. Definition 2.26 (Ground arn ) . An arn is said to be ground if it has no requires-points. JP Λ JPplanJourney + directions − JP − getRoutes + routes + timetablesJP getRoutes + routes − MS MS Λ MSroutes + timetables − TS TS Λ TS C Λ C Figure 8: The arn
JourneyPlannerNet
Properties.
The evaluation of specifications with respect to ground arn s relies on theconcepts of diagram of a network and automaton (i.e. a LTL-model) defined by a point,whose purpose is to describe the observable behaviour of a ground arn through one of itspoints. We start by extending Remarks 2.10 and 2.14 to arn s. Fact 2.27 (Diagram of an arn ) . Every arn N = h X, P, C, γ, M, µ, Λ i defines a diagram D N : J N → S ig a LTL as follows: • J N is the free preordered category given by the set of objects X ∪ P ∪ C ∪ {h c, x i N | c ∈ C, x ∈ γ c } and the arrows – { x → p | p ∈ P, x ∈ γ p } for computation hyperedges, and – { c ← h c, x i N → x | c ∈ C, x ∈ γ c } for communication hyperedges; • D N is the functor that provides the sets of actions of ports, processes and channels,together with the appropriate mappings between them. For example, given a communi-cation hyperedge c ∈ C and a point x ∈ γ c , – D N ( c ) = A M c , D N ( h c, x i N ) = dom( µ cx ), D N ( x ) = A M x , – D N ( h c, x i N → c ) = (dom( µ cx ) ⊆ A M c ), and – D N ( h c, x i N → x ) = µ cx .We define the signature of an arn by taking the colimit of its diagram, which is guaranteedto exist because the category S ig a LTL , i.e. S et, is finitely cocomplete. Definition 2.28 (Signature of an arn ) . The signature of an arn N is the colimiting cocone ξ : D N ⇒ A N of the diagram D N .The most important construction that allows us to define properties of ground arn s isthe one that defines the observed behaviour of a (ground) network at one of its points. Definition 2.29 (Automaton defined by a point) . Let x be a point of a ground arn G .The observed automaton Λ x at x is given by the reduct Λ G x ↾ ξ x , where • G x = h X, P, C, γ, M, µ, Λ i is the sub- arn of G defined by x , • ξ : D G x ⇒ A G x is the signature of G x , • Λ G x is the product automaton Q e ∈ P ∪ C Λ G x e , and • Λ G x e is the cofree expansion of Λ e along ξ e , for any hyperedge e ∈ P ∪ C . Example 2.30.
Consider once again the (ground) arn represented in Figure 8. Theautomaton defined by the point MS is just Λ MS ↾ A MS ; this follows from the observation ERVICE-ORIENTED LOGIC PROGRAMMING 19 that the arn defined by MS consists exclusively of the process MS and the port MS . Onthe other hand, in order to obtain the automaton defined by the provides-point JP oneneeds to compute the product of the cofree expansions of all four automata Λ JP , Λ C , Λ MS and Λ TS . Based on Propositions 2.4 and 2.5, the resulting automaton has to accept preciselythe projections to A M JP1 of those traces accepted by Λ JP that are compatible with tracesaccepted by Λ C , Λ MS and Λ TS , in the sense that together they give rise, by amalgamation,to traces over the alphabet of the network.We now have all the necessary concepts for defining properties of ground arn s. Definition 2.31 (Property of an arn ) . Let @ x ρ be a specification over a ground arn G .Then @ x ρ is a property of G if and only if the automaton Λ x observed at the point x in G satisfies (according to the definition of satisfaction in a LTL) the temporal sentence ρ .Λ x (cid:15) a LTL ρ Remark 2.32.
It is important to notice that not only the signature of an arn , but alsothe various cofree expansions and products considered in Definition 2.29 are unique onlyup to an isomorphism. Consequently, the automaton defined by a point of a ground arn is also unique only up to an isomorphism, which means that the closure of a LTL underisomorphisms plays a crucial role in ensuring that the evaluation of specifications withrespect to ground arn s is well defined.All we need now in order to complete the construction of the orchestration scheme of arn s is to show that the morphisms of ground arn s preserve properties. This result dependsupon the last of the four hypotheses we introduced at the beginning of the subsection: thereflection of the satisfaction of sentences by the model homomorphisms of the institutionused as foundation for the construction of arn s. Proposition 2.33.
For every morphism of ground arn s θ : G → G and every property @ x ρ of G , the specification Spec( θ )(@ x ρ ) is a property of G .Proof. Let G x and G x be the sub- arn s of G and G determined by x and θ ( x ) respectively,and let us also assume that G xi = h X i , P i , C i , γ i , M i , µ i , Λ i i and that ξ i : D G xi ⇒ A G xi is thesignature of G xi , for i ∈ { , } . Since @ x ρ is a property of G , we know that the automatonΛ x observed at the point x in G satisfies ρ . We also know that θ : G → G defines the a LTL-signature morphism θ pt x : A M ,x → A M ,θ ( x ) as the identity of A M ,x (because G isground); hence, the automaton Λ θ ( x ) observed at θ ( x ) in G is also a model of A M ,x .By Proposition 2.6, a LTL-model homomorphisms reflect the satisfaction of sentences;therefore, in order to prove that Λ θ ( x ) satisfies ρ – and in this way, that Spec( θ )(@ x ρ ) is aproperty of G – it suffices to determine the existence of a homomorphism Λ θ ( x ) → Λ x .Recall that Λ x and Λ θ ( x ) are the reducts Λ G x ↾ ξ x and Λ G x ↾ ξ θ ( x ) , where, for i ∈ { , } , • Λ G xi is the product Q e ∈ P i ∪ C i Λ G xi e , equipped with projections π ie : Λ G xi → Λ G xi e , and • Λ G xi e , for e ∈ P i ∪ C i , is the cofree expansion of Λ ie along ξ ie , for which we denote theuniversal morphism from ↾ ξ ie to Λ ie by ε ie : Λ G xi e ↾ ξ ie → Λ ie .According to the description of the arn s defined by given points, we can restrict θ to amorphism of arn s from G x to G x . Since G x is ground, we further obtain, based on this restriction, a functor F : J G x → J G x that makes the following diagram commutative. J G x D G x ( ( ❘❘❘❘❘❘ F (cid:15) (cid:15) S ig a LTL J G x D G x ❧❧❧❧❧❧ This allows us to define the derived cocone F · ξ : D G x ⇒ A G x , whose components aregiven, for example, by ( F · ξ ) x = ξ θ ( x ) . Since ξ is the colimit of D G x it follows that thereexists a (unique) morphism of cocones σ : ξ → F · ξ , i.e. an a LTL-signature morphism σ : A G x → A G x that satisfies, in particular, ξ e ; σ = ξ θ ( e ) for every hyperedge e ∈ P ∪ C .We obtain in this way, for every hyperedge e ∈ P ∪ C , the composite morphism π θ ( e ) ↾ ξ θ ( e ) ; ε θ ( e ) from Λ G x ↾ ξ θ ( e ) = Λ G x ↾ σ ↾ ξ e to Λ e = Λ θ ( e ) .Λ e = Λ θ ( e ) Λ G x e ↾ ξ e ε e o o Λ G x e Λ G x θ ( e ) ↾ ξ θ ( e ) ε θ ( e ) O O Λ G x ↾ ξ θ ( e ) = Λ G x ↾ σ ↾ ξ e h e ↾ ξ e O O π θ ( e ) ↾ ξ θ ( e ) o o Λ G x ↾ σh e O O Given that Λ G x e is the cofree expansion of Λ e along ξ e , we deduce that there exists a(unique) morphism h e : Λ G x ↾ σ → Λ G x e such that the above diagram is commutative. Thisimplies, by the universal property of the product Λ G x , the existence of a (unique) morphism h : Λ G x ↾ σ → Λ G x such that h ; π e = h e for every e ∈ P ∪ C .Λ e Λ G x π e o o Λ G x ↾ σh O O h e b b ❉❉❉❉❉❉❉❉❉ It follows that the reduct h ↾ ξ x is a morphism from Λ G x ↾ σ ↾ ξ x to Λ G x ↾ ξ x . Then, to completethe proof, we only need to notice that Λ G x ↾ σ ↾ ξ x = Λ G x ↾ ξ θ ( x ) = Λ θ ( x ) and Λ G x ↾ ξ x = Λ x .3. A Logical View on Service Discovery and Binding
Building on the results of Section 2, let us now investigate how the semantics of the ser-vice overlay can be characterized using fundamental computational aspects of the logic-programming paradigm such as unification and resolution. Our approach is founded upona simple and intuitive analogy between concepts of service-oriented computing like servicemodule and client application [FLB11], and concepts such as clause and query that arespecific to (the relational variant of) logic programming [Llo87]. In order to clarify thisanalogy we rely on the institutional framework that we put forward in [T¸ F15] to addressthe model-theoretic foundations of logic programming.
ERVICE-ORIENTED LOGIC PROGRAMMING 21
We begin by briefly recalling the most basic structure that underlies both the deno-tational and the operational semantics of relational logic programming: the substitutionsystem of (sets of) variables and substitutions over a given (single-sorted) first-order sig-nature. Its definition relies technically on the category R oom of institution rooms and corridors (see e.g. [Mos02]). The objects of R oom are triples h S, M , (cid:15) i consisting of a set S of sentences , a category M of models , and a satisfaction relation (cid:15) ⊆ | M | × S . Theyare related through corridors h α, β i : h S, M , (cid:15) i → h S ′ , M ′ , (cid:15) ′ i that abstract the change ofnotation within or between logics by defining a sentence-translation function α : S → S ′ and a model-reduction functor β : M ′ → M such that the following condition holds for all M ′ ∈ | M ′ | and ρ ∈ S : M ′ (cid:15) ′ α ( ρ ) if and only if β ( M ′ ) (cid:15) ρ. Definition 3.1 (Substitution system) . A substitution system is a triple h S ubst , G, Si , oftendenoted simply by S , that consists of • a category S ubst of signatures of variables and substitutions , • a room G of ground sentences and models , and • a functor S : S ubst → G / R oom, defining for every signature of variables X the corridor S ( X ) : G → G ( X ) from G to the room G ( X ) of X -sentences and X -models . Example 3.2.
In the case of conventional logic programming, every single-sorted first-ordersignature h F, P i determines a substitution system (cid:0) AFOL = (cid:1) h F,P i : S ubst h F,P i → AFOL = ( F, P ) / R oom where S ubst h F,P i is simply the category whose objects are sets of variables (defined over thesignature h F, P i ), and whose arrows are first-order substitutions. The room AFOL = ( F, P )accounts for the (ground) atomic sentences given by h F, P i , the models of h F, P i , as wellas the standard satisfaction relation between them. And finally, the functor (cid:0) AFOL = (cid:1) h F,P i maps every signature (i.e. set) of variables X to the corridor h α h F,P i ,X , β h F,P i ,X i , h Sen(
F, P ) , GF ED α h F,P i ,X (cid:15) (cid:15) Mod(
F, P ) , (cid:15) h F,P i i h Sen( F ∪ X, P ) , Mod( F ∪ X, P ) , BC@A β h F,P i ,X O O (cid:15) h F ∪ X,P i i where α h F,P i ,X and β h F,P i ,X are the translation of sentences and the reduction of modelsthat correspond to the inclusion of signatures h F, P i ⊆ h F ∪ X, P i .Substitution systems are particularly useful when reasoning about the semantics ofclauses and queries. For instance, the above substitution system can be used to define(definite) clauses over h F, P i as syntactic structures ∀ X · C ← H , also written C ←−− X H such that X is a signature of variables, C is sentence over h F ∪ X, P i , and H is a (finite) setof sentences over h F ∪ X, P i . The semantics of such a construction is given by the class Through AFOL = we refer to the institution that corresponds to the atomic fragment of the single-sortedvariant of first-order logic without equality. Note that, in relational logic programming, the variables are often distinguished from other symbolsthrough notational conventions; for this reason, the set X of variables is at times omitted. of models of h F, P i , i.e. of ground models of the substitution system, whose expansions to h F ∪ X, P i satisfy C whenever they satisfy all sentences in H – this reflects the usual inter-pretation of logic-programming clauses as universally quantified sentences ∀ X · V H ⇒ C .Similarly to institutions, the axiomatic approach to logic programming on which we relyin this paper is parameterized by the signature used. In categorical terms, this means thatthe morphisms of signatures induce appropriate morphisms between their correspondingsubstitution systems, and moreover, that this mapping is functorial. As regards our inquiryon the semantics of the service overlay, it suffices to recall that the category S ubst S ys ofsubstitution systems results from the Grothendieck construction [TBG91] for the functor[ → / R oom] : ( C at × R oom) op → C at that maps • every category S ubst and room G to the category of functors [ S ubst → G / R oom], • every functor Ψ : S ubst → S ubst ′ and corridor κ : G → G ′ to the canonical compositionfunctor Ψ ( κ / R oom) : [ S ubst ′ → G ′ / R oom] → [ S ubst → G / R oom].This allows us to introduce the next notion of generalized substitution system. Definition 3.3 (Generalized substitution system) . A generalized substitution system is apair h S ig , GSi given by a category S ig of signatures , and a functor GS : S ig → S ubst S ys.In order to provide a better understanding of the complex structure of generalized substi-tution systems, we consider the following notational conventions and terminology: − For every signature Σ of a generalized substitution system GS , we denote the (local)substitution system GS (Σ) by GS Σ : S ubst Σ → G Σ / R oom, and we refer to the objectsand morphisms of S ubst Σ as signatures of Σ -variables and Σ -substitutions . The room G Σ is assumed to comprise the set Sen(Σ) of ground Σ -sentences , the category Mod(Σ)of Σ -models , and the Σ -satisfaction relation (cid:15) Σ ⊆ | Mod(Σ) | ×
Sen(Σ). − On objects, GS Σ maps every signature of Σ-variables X to the corridor GS Σ ( X ) = h α Σ ,X , β Σ ,X i from G Σ to the room G Σ ( X ) = h Sen Σ ( X ) , Mod Σ ( X ) , (cid:15) Σ ,X i of X -sentences and X -models . α Σ ,X : Sen(Σ) → Sen Σ ( X ) β Σ ,X : Mod Σ ( X ) → Mod(Σ) − On arrows, GS Σ maps every Σ-substitution ψ : X → Y to the corridor GS Σ ( ψ ) = h Sen Σ ( ψ ) , Mod Σ ( ψ ) i from G Σ ( X ) to G Σ ( Y ), which satisfies, by definition, GS Σ ( X ) ; GS Σ ( ψ ) = GS Σ ( Y ). Sen(Σ) α Σ ,X ~ ~ ⑥⑥⑥⑥⑥⑥⑥⑥ α Σ ,Y ❆❆❆❆❆❆❆ Sen Σ ( X ) Sen Σ ( ψ ) / / Sen Σ ( Y ) Mod(Σ)Mod Σ ( X ) β Σ ,X < < ③③③③③③③③ Mod Σ ( Y ) β Σ ,Y a a ❉❉❉❉❉❉❉❉ Mod Σ ( ψ ) o o ERVICE-ORIENTED LOGIC PROGRAMMING 23 − With respect to signature morphisms, every ϕ : Σ → Σ ′ determines a morphism of substi-tution systems GS ϕ : GS Σ → GS Σ ′ in the form of a triple h Ψ ϕ , κ ϕ , τ ϕ i , where Ψ ϕ is a func-tor S ubst Σ → S ubst Σ ′ , κ ϕ is a corridor h Sen( ϕ ) , Mod( ϕ ) i : G Σ → G Σ ′ , and for every signa-ture of Σ-variables X , τ ϕ,X is a (natural) corridor h α ϕ,X , β ϕ,X i : G Σ ( X ) → G Σ ′ (Ψ ϕ ( X )).Sen(Σ) Sen( ϕ ) / / α Σ ,X (cid:15) (cid:15) Sen(Σ ′ ) α Σ ′ , Ψ ϕ ( X ) (cid:15) (cid:15) Sen Σ ( X ) α ϕ,X / / Sen Σ ′ (Ψ ϕ ( X )) Mod(Σ) Mod(Σ ′ ) Mod( ϕ ) o o Mod Σ ( X ) β Σ ,X O O Mod Σ ′ (Ψ ϕ ( X )) β Σ ′ , Ψ ϕ ( X ) O O β ϕ,X o o In addition, we adopt notational conventions that are similar to those used for institutions.For example, we may use superscripts as in S ubst GS Σ is order to avoid potential ambiguities;or we may drop the subscripts of (cid:15) Σ ,X when there is no danger of confusion. Also, we willoften denote the functions Sen( ϕ ), α Σ ,X and Sen Σ ( ψ ) by ϕ ( ), X ( ) and ψ ( ), respectively,and the functors Mod( ϕ ), β Σ ,X and Mod Σ ( ψ ) by ↾ ϕ , ↾ Σ and ↾ ψ . Example 3.4.
Relational logic programming is based upon the generalized substitutionsystem AFOL = of the atomic fragment of single-sorted first-order logic without equality.AFOL = : S ig AFOL = → S ubst S ysIn this case, the category S ig AFOL = is just the category of single-sorted first-order signatures.Every signature h F, P i is mapped to a substitution system (cid:0) AFOL = (cid:1) h F,P i as described inExample 3.2, while every signature morphism ϕ : h F, P i → h F ′ , P ′ i resolves to a morphismof substitution systems for which Ψ ϕ is the obvious translation of h F, P i -substitutions along ϕ , and κ ϕ is the corridor AFOL = ( ϕ ). A more detailed presentation of first-order generalizedsubstitution systems can be found in [T¸ F15].3.1. A Generalized Substitution System of Orchestration Schemes.
What is es-sential about orchestration schemes with respect to the development of the service-orientedvariant of logic programming is that they can be organized as a category OS from which thereexists a functor OrcScheme into S ubst S ys that allows us to capture some of the most ba-sic aspects of service-oriented computing by means of logic-programming constructs. Moreprecisely, orchestration schemes form the signatures of a generalized substitution systemOrcScheme : OS → S ubst S ysthrough which the notions of service module, application, discovery and binding emerge asparticular instances of the abstract notions of clause, query, unification and resolution. Inthis sense, OrcScheme and AFOL = can be regarded as structures having the same role inthe description of service-oriented and relational logic programming, respectively.Morphisms of orchestration schemes are, intuitively, a way of encoding orchestrations.In order to understand how they arise in practice, let us consider a morphism ϕ betweentwo algebraic signatures Σ and Σ ′ used in defining program expressions. For instance, wemay assume Σ to be the signature of structured programs discussed in Example 2.2, and ϕ : Σ → Σ ′ its extension with a new operation symbol repeat until : Pgm Cond → Pgm .Then, it is easy to notice that the translation of Σ-terms (over a given set of programvariables) along ϕ generalizes to a functor F between the categories of program expressions defined over Σ and Σ ′ . Moreover, the choice of ϕ enables us to define a second functor U , from program expressions over Σ ′ to program expression over Σ, based on the derivedsignature morphism (see e.g. [ST11]) Σ ′ → Σ that encodes the repeat until operationas the term 1 ; while not do done . The functor U is clearly a right inverse of F withrespect to ground program expressions, whereas in general, for every program expression pgm over Σ we actually obtain a morphism η pgm : pgm → U ( F ( pgm )) as a result of thepotential renaming of program variables; thus, the morphism η pgm accounts for translationof the program variables of pgm along F ; U . Furthermore, for every program expression pgm ′ over Σ ′ , the translation of Σ-sentences determined by ϕ extends to a map betweenthe specifications over U ( pgm ′ ) and the specifications over pgm ′ , which, as we will see,can be used to define a translation of the specifications over a program expression pgm (given by Σ) to specifications over F ( pgm ). With respect to the semantics, it is naturalto expect that every program expression pgm over Σ has the same behaviour as F ( pgm )and, even more, that every program expression pgm ′ over Σ ′ (that may be built using repeat until ), behaves in the same way as U ( pgm ′ ). These observations lead us to thefollowing formalization of the notion of morphism of orchestration schemes. Definition 3.5 (Morphism of orchestration schemes) . A morphism between orchestrationschemes h O rc , Spec , G rc , Prop i and h O rc ′ , Spec ′ , G rc ′ , Prop ′ i is a tuple h F, U, η, σ i , where O rc F , , O rc ′ U k k • F and U are functors as depicted above such that F ( G rc) ⊆ G rc ′ and U ( G rc ′ ) ⊆ G rc, • η is a natural transformation 1 O rc ⇒ F ; U such that η g = 1 g for every g ∈ | G rc | , and • σ is a natural transformation U ; Spec ⇒ Spec ′ such that for every ground orchestration g ′ ∈ | G rc ′ | and specification ρ ∈ Spec( U ( g ′ )), σ g ′ ( ρ ) ∈ Prop ′ ( g ′ ) if and only if ρ ∈ Prop( U ( g ′ )) . Example 3.6.
Let I = h S ig , Sen , Mod , (cid:15) i and I ′ = h S ig ′ , Sen ′ , Mod ′ , (cid:15) ′ i be two institutionssuitable for defining orchestration schemes of arn s (according to the hypotheses intro-duced in Subsection 2.2), and let h Υ , α, β i be a morphism of institutions I ′ → I such thatΥ : S ig ′ → S ig is cocontinuous and β : Mod ′ ⇒ Υ op ; Mod preserves cofree expansions andproducts. If Υ and β admit sections, that is if there exist a functor Φ : S ig → S ig ′ such thatΦ ; Υ = 1 S ig and a natural transformation τ : Mod ⇒ Φ op ; Mod ′ such that τ ; (Φ op · β ) = 1 Mod ,then h Υ , α, β i gives rise to a morphism h F, U, η, σ i between the orchestration schemes of arn s defined over I and I ′ . In particular, the functor F maps the diagram and the modelsthat label an arn defined over I to their images under Φ and τ ; similarly, U maps arn sdefined over I ′ according to Υ and β ; the natural transformation η is just an identity, and σ extends the α -translation of sentences to specifications. The additional properties of Υ and β are essential for ensuring that the observable behaviour of ground networks is preserved.One may consider, for instance, the extension of a LTL (in the role of I ) with newtemporal modalities such as previous and since , as in [KMWZ10]; this naturally leads to amorphism of orchestration schemes for which both Υ and β would be identities. Alterna-tively, one may explore the correspondence between deterministic weak ω -automata – whichform a subclass of Muller automata – and sets of traces that are both B¨uchi and co-B¨uchi In this context, 1 :
Pgm and 2 :
Cond are variables corresponding to the arguments of the derivedoperation.
ERVICE-ORIENTED LOGIC PROGRAMMING 25 deterministically recognizable – for which a minimal automaton can be shown to exist (seee.g. [MS97, L¨od01]). In this case, in the roles of I and I ′ we could consider variants of a LTL with models given by sets of traces and deterministic weak automata, respectively; Υ and α would be identities, β would define the language recognized by a given automaton,and τ would capture the construction of minimal automata.It it easy to see that the morphisms of orchestration schemes compose in a natural wayin terms of their components, thus giving rise to a category of orchestration schemes. Proposition 3.7.
The morphisms of orchestration schemes can be composed as follows: h F, U, η, σ i ; h F ′ , U ′ , η ′ , σ ′ i = h F ; F ′ , U ′ ; U, η ; ( F · η ′ · U ) , ( U ′ · σ ) ; σ ′ i . Under this composition, orchestration schemes and their morphisms form a category OS . The definition of the functor OrcScheme is grounded on two simple ideas:1. Orchestrations can be regarded as signatures of variables; they provide sentences in theform of specifications, and models as morphisms into ground orchestrations – whichcan also be seen, in the case of arn s, for example, as collections of ground networksassigned to the ‘variables’ of the considered orchestration. In addition, we can definea satisfaction relation between the models and the sentences of an orchestration basedof the evaluation of specifications with respect to ground orchestrations. In this way,every orchestration scheme yields an institution whose composition resembles that of theso-called institutions of extended models [SML04].2. There is a one-to-one correspondence between institutions and substitution systems de-fined over the initial room h∅ , , ∅i – the room given by the empty set of sentences, theterminal category , and the empty satisfaction relation. The effect of this is that aclause can be described as ‘correct’ whenever it is satisfied by the sole model of h∅ , , ∅i ;therefore, we obtain precisely the notion of correctness of a service module [FLB11]: allmodels of the underlying signature of variables, i.e. of the orchestration, that satisfy theantecedent of the clause satisfy its consequent as well.Formally, OrcScheme results from the composition of two functors, Ins : OS → co I ns andSS : co I ns → S ubst S ys, that implement the general constructions outlined above. OS Ins / / GF ED
OrcScheme (cid:15) (cid:15) co I ns SS / / S ubst S ysThe functor Ins carries most of the complexity of OrcScheme, and is discussed in de-tail in Theorem 3.8. Concerning SS, we recall from [T¸ F15] that the category co I ns ofinstitution comorphisms can also be described as the category [ → R oom] ♯ of functorsinto R oom, and that any functor G : K → K ′ can be extended to a functor [ → K ] ♯ → [ → K ′ ] ♯ that is given essentially by the right-composition with G . In particular, the iso-morphism R oom → h∅ , , ∅i / R oom that maps every room h S, M , (cid:15) i to the unique corri-dor h∅ , , ∅i → h S, M , (cid:15) i generates an isomorphism of categories between [ → R oom] ♯ , i.e.co I ns, and [ → h∅ , , ∅i / R oom] ♯ . The latter is further embedded into S ubst S ys, definingin this way, by composition, the required functor SS. To sum up, SS maps every institution Note that, to ensure that model reducts are well defined for deterministic automata, one may need torestrict signature morphisms to injective maps. I : S ig → R oom to the substitution system S : S ig → h∅ , , ∅i / R oom for which S (Σ), forevery signature Σ ∈ | S ig | , is the unique corridor between h∅ , , ∅i and I (Σ). Theorem 3.8.
The following map defines a functor
Ins : OS → co I ns . • For any orchestration scheme O = h O rc , Spec , G rc , Prop i , Ins( O ) is the institution whosecategory of signatures is O rc , sentence functor is Spec , model functor is / G rc , and whosefamily of satisfaction relations is given by ( δ : o → g ) (cid:15) o SP if and only if
Spec( δ )( SP ) ∈ Prop( g ) for every orchestration o , every o -model δ , i.e. every morphism of orchestrations δ : o → g such that g is ground, and every specification SP over o . • For any morphism of orchestration schemes h F, U, η, σ i : O → O ′ , with O as above and O ′ given by h O rc ′ , Spec ′ , G rc ′ , Prop ′ i , Ins(
F, U, η, σ ) is the comorphism of institutions h F, α, β i : Ins( O ) → Ins( O ′ ) defined by α o = Spec( η o ) ; σ F ( o ) β o = υ F ( o ) ; ( η o / G rc) for every orchestration o ∈ | O rc | , where υ : ( / G rc ′ ) ⇒ U op ; ( / G rc) is the naturaltransformation given by υ o ′ ( x ) = U ( x ) for every orchestration o ′ ∈ | O rc ′ | and everyobject or arrow x of the comma category o ′ / G rc ′ .Proof. For the first part, all we need to show is that the satisfaction condition holds; but thisfollows easily since for every morphism of orchestrations θ : o → o , every o -specification SP and every o -model δ : o → g , δ (cid:15) o Spec( θ )( SP ) if and only if Spec( θ ; δ )( SP ) ∈ Prop( g )if and only if ( θ / G rc)( δ ) = θ ; δ (cid:15) o SP . As regards the second part of the statement, let us begin by noticing that α and β arethe natural transformations ( η · Spec) ; ( F · σ ) and ( η op · ( / G rc)) ; ( F op · υ ), respectively.Then, in order to verify that h F, α, β i is indeed a comorphism Ins( O ) → Ins( O ′ ), consideran orchestration o in O rc, a model δ ′ : F ( o ) → g ′ of F ( o ), and a specification SP over o .Assuming that (cid:15) ′ is the family of satisfaction relations of Ins( O ′ ), we deduce that δ ′ (cid:15) ′ F ( o ) α o ( SP )iff Spec ′ ( δ ′ )( α o ( SP )) ∈ Prop ′ ( g ′ ) by the definition of (cid:15) ′ F ( o ) iff Spec ′ ( δ ′ )( σ F ( o ) (Spec( η o )( SP ))) ∈ Prop ′ ( g ′ ) by the definition of α o iff σ g ′ (Spec( η o ; U ( δ ′ ))( SP )) ∈ Prop ′ ( g ′ ) by the naturality of σ iff Spec( η o ; U ( δ ′ ))( SP ) ∈ Prop( U ( g ′ )) since Prop( U ( g ′ )) = σ − g ′ (Prop ′ ( g ′ ))iff η o ; U ( δ ′ ) (cid:15) o SP by the definition of (cid:15) o iff β o ( δ ′ ) (cid:15) o SP by the definition of β o . Finally, it is easy to see that Ins preserves identities. To prove that it also preservescomposition, let h F, U, η, σ i and h F ′ , U ′ , η ′ , σ ′ i be morphisms of orchestration schemes as Moreover, Ins( O ) is exact, because the functor / G rc : O rc op → C at is continuous (see e.g. [Mes89]). ERVICE-ORIENTED LOGIC PROGRAMMING 27 below, and suppose that Ins(
F, U, η, σ ) = h F, α, β i and Ins( F ′ , U ′ , η ′ , σ ′ ) = h F ′ , α ′ , β ′ i . h O rc , Spec , G rc , Prop i h F,U,η,σ i / / @A BC h F ; F ′ ,U ′ ; U,η ; ( F · η ′ · U ) , ( U ′ · σ ) ; σ ′ i O O h O rc ′ , Spec ′ , G rc ′ , Prop ′ i h F ′ ,U ′ ,η ′ ,σ ′ i / / h O rc ′′ , Spec ′′ , G rc ′′ , Prop ′′ i In addition, let υ : ( / G rc ′ ) ⇒ U op ; ( / G rc) and υ ′ : ( / G rc ′′ ) ⇒ U ′ op ; ( / G rc ′ ) bethe natural transformations involved in the definitions of β and β ′ , respectively. Basedon the composition of morphisms of orchestration schemes and on the definition of Ins,it follows that Ins( h F, U, η, σ i ; h F ′ , U ′ , η ′ , σ ′ i ) is a comorphism of institutions of the form h F ; F ′ , α ′′ , β ′′ i , where α ′′ and β ′′ are given by α ′′ o = Spec(( η ; ( F · η ′ · U )) o ) ; (( U ′ · σ ) ; σ ′ ) ( F ; F ′ )( o ) β ′′ o = ( υ ′ ; ( U ′ op · υ )) ( F ; F ′ )( o ) ; (( η ; ( F · η ′ · U )) o / G rc) . In order to complete the proof we need to show that α ′′ = α ; ( F · α ′ ) and β ′′ = ( F · β ′ ) ; β .Each of these equalities follows from a sequence of straightforward calculations that relieson the naturality of σ (in the case of α ′′ ), or on the naturality of υ (in the case of β ′′ ). α ′′ o = Spec( η o ) ; Spec( U ( η ′ F ( o ) )) ; σ ( F ; F ′ ; U ′ )( o ) ; σ ′ ( F ; F ′ )( o ) = Spec( η o ) ; σ F ( o ) ; Spec ′ ( η ′ F ( o ) ) ; σ ′ ( F ; F ′ )( o ) = α o ; α ′ F ( o ) β ′′ o = υ ′ ( F ; F ′ )( o ) ; υ ( F ; F ′ ; U ′ )( o ) ; ( U ( η ′ F ( o ) ) / G rc) ; ( η o / G rc)= υ ′ ( F ; F ′ )( o ) ; ( η ′ F ( o ) / G rc ′ ) ; υ F ( o ) ; ( η o / G rc)= β ′ F ( o ) ; β o Corollary 3.9.
The pair h OS , OrcScheme i defines a generalized substitution system. We recall from [T¸ F15] that, in order to be used as semantic frameworks for logic pro-gramming, generalized substitution systems need to ensure a weak model-amalgamationproperty between the models that are ground and those that are defined by signatures ofvariables. This property entails that the satisfaction of quantified sentences (and in particu-lar, of clauses and queries) is invariant under change of notation. In the case of OrcScheme,this means, for example, that the correctness property of service modules does not dependon the actual orchestration scheme over which the modules are defined.
Definition 3.10 (Model amalgamation) . A generalized substitution system GS : S ig → S ubst S ys has weak model amalgamation when for every signature morphism ϕ : Σ → Σ ′ andevery signature of Σ-variables X , the diagram depicted below is a weak pullback. | Mod(Σ) | |
Mod(Σ ′ ) | ↾ ϕ o o | Mod Σ ( X ) | ↾ Σ O O | Mod Σ ′ (Ψ ϕ ( X )) | ↾ Σ ′ O O β ϕ,X o o This means that for every model Σ ′ -model M ′ and every X -model N such that M ′ ↾ ϕ = N ↾ Σ there exists a Ψ ϕ ( X )-model N ′ that satisfies N ′ ↾ Σ ′ = M ′ and β ϕ,X ( N ′ ) = N . Proposition 3.11.
The generalized substitution system
OrcScheme : OS → S ubst S ys hasweak model amalgamation.Proof. Let ϕ be a morphism h F, U, η, σ i between orchestration schemes O and O ′ as inDefinition 3.5, and let o be an orchestration of O . Since orchestrations define substitutionsystems over the initial room h∅ , , ∅i , we can redraw the diagram of interest as follows: | | | | ↾ ϕ o o | o / G rc | ↾ O O O | F ( o ) / G rc ′ | ↾ O′ O O β ϕ, o o o It is easy to see that the above diagram depicts a weak pullback if and only if β ϕ, o issurjective on objects. By Theorem 3.8, we know that β ϕ, o ( δ ′ ) = η o ; U ( δ ′ ) for every object δ ′ : F ( o ) → g ′ in | F ( o ) / G rc ′ | . Therefore, for every δ : o → g in | o / G rc | we obtain β ϕ, o ( F ( δ )) = η o ; U ( F ( δ ))= δ ; η g by the naturality of η = δ because, by definition, η g is an identity . Remark 3.12.
In addition to model amalgamation, it is important to notice that, similarlyto AFOL = , in OrcScheme the satisfaction of sentences is preserved by model homomor-phisms. This is an immediate consequence of the fact that, in every orchestration scheme,the morphisms of ground orchestrations preserve properties: given an orchestration o , aspecification SP over o , and a homomorphism ζ between o -models δ and δ as depictedbelow, if Spec( δ )( SP ) is a property of g then Spec( δ )( SP ) = Spec( ζ )(Spec( δ )( SP )) is aproperty of g ; therefore, δ (cid:15) OrcScheme SP implies δ (cid:15) OrcScheme SP . o δ (cid:4) (cid:4) ✠✠✠✠✠✠✠ δ (cid:26) (cid:26) ✺✺✺✺✺✺✺ g ζ / / g The Clausal Structure of Services.
Given the above constructions, we can nowconsider a service-oriented notion of clause, defined over the generalized substitution sys-tem OrcScheme rather than AFOL = . Intuitively, this means that we replace first-ordersignatures with orchestration schemes, sets of variables with orchestrations, and first-ordersentences (over given sets of variables) with specifications. Furthermore, certain orches-tration schemes allow us to identify structures that correspond to finer-grained notionslike variable and term: in the case of program expressions, variables and terms have theirusual meaning (although we only take into account executable expressions), whereas in thecase of arn s, variables and terms materialize as requires-points and sub- arn s defined byprovides-points.The following notion of service clause corresponds to the concept of service modulepresented in [FLB11], and also to the concept of orchestrated interface discussed in [FL13a]. ERVICE-ORIENTED LOGIC PROGRAMMING 29
Definition 3.13 (Service clause) . A (definite) service-oriented clause over a given orches-tration scheme O = h O rc , Spec , G rc , Prop i is a structure ∀ o · P ← R , also denoted P ←− o R where o is an orchestration of O , P is a specification over o – called the provides-interface of the clause – and R is a finite set of specifications over o – the requires-interface of theclause.The semantics of service-oriented clauses is defined just as the semantics of first-orderclauses, except they are evaluated within the generalized substitution system OrcSchemeinstead of AFOL = . As mentioned before, this means that we can only distinguish whetheror not a clause is correct. Definition 3.14 (Correct clause) . A service-oriented clause ∀ o · P ← R is correct if forevery morphism δ : o → g such that g is a ground orchestration and Spec( δ )( R ) consistsonly of properties of g , the specification Spec( δ )( P ) is also a property of g .In other words, a service clause is correct if the specification given by its provides-interfaceis ensured by its orchestration and the specifications of its requires-interface. Example 3.15.
We have already encountered several instances of service clauses in theform of the program modules depicted in Figure 1. Their provides- and requires-interfacesare placed on the left- and right-hand side of their orchestrations, and are represented usingsymbolic forms that are traditionally associated with services.To illustrate how service modules can be defined as clauses over arn s, notice thatthe network
JourneyPlanner introduced in Example 2.17 can orchestrate a module namedJourney Planner that consistently delivers the requested directions, provided that the routesand the timetables can be obtained whenever they are needed. This can be described inlogical terms through the following (correct) service-oriented clause:@ JP ρ JP ←−−−−−−−−− JourneyPlanner (cid:8) @ R ρ JP , @ R ρ JP (cid:9) where ρ JP , ρ JP and ρ JP correspond to the a LTL-sentences ✷ ( planJourney ¡ ⇒ ✸ directions !), ✷ ( getRoutes ¡ ⇒ ✸ routes !) and ✷ ( routes ¡ ⇒ ✸ timetables !), respectively.Client applications are captured in the present setting by service-oriented queries. Theway they are defined is similar to that of service clauses, but their semantics is based on anexistential quantification, not on a universal one. Definition 3.16 (Service query) . A service-oriented query over an orchestration scheme O = h O rc , Spec , G rc , Prop i is a structure ∃ o · Q , also written o Q such that o is an orchestration of O , and Q is a finite set of specifications over o that definesthe requires-interface of the query. Definition 3.17 (Satisfiable query) . A service-oriented query ∃ o · Q is said to be satisfi-able if there exists a morphism of orchestrations δ : o → g such that g is ground and allspecifications in Spec( δ )( Q ) are properties of g . Example 3.18.
Figure 9 outlines the arn of a possible client application for the servicemodule Journey Planner discussed in Example 3.15. We specify the actual application,called Traveller, through the service query
Traveller (cid:8) @ R ρ T (cid:9) given by the a LTL-sentence ✷ ( getRoute ¡ ⇒ ✸ route !). T Λ T − getRoute + routeT getRoute + route − R C Λ C Figure 9: The arn
Traveller
Resolution as Service Discovery and Binding.
Let us now turn our attentionto the dynamic aspects of service-oriented computing that result from the process of ser-vice discovery and binding [FLB11].
Service discovery represents, as in conventional logicprogramming, the search for a module (service clause) that can be bound to a given ap-plication (service query) in order to take it one step closer to a possible solution, i.e. to a‘complete’ application capable of fulfilling its goal. From a technical point of view, bothdiscovery and binding are subject to matching the requires-interface of the application, ormore precisely, one of its specifications, with the provides-interface of the module underconsideration. This is usually achieved through a suitable notion of refinement of specifi-cations. For instance, in the case of program expressions, given specifications ι : [ ρ , ρ ′ ]and ι : [ ρ , ρ ′ ] over programs pgm : eXp and pgm : eXp , respectively, ι : [ ρ , ρ ′ ] refines ι : [ ρ , ρ ′ ] up to a cospan pgm : eXp h ψ ,π i / / pgm : eXp pgm : eXp h ψ ,π i o o if by translation we obtain specifications that refer to the same position of pgm : eXp , i.e. π · ι = π · ι , such that the pre-condition ψ ( ρ ) is weaker that ψ ( ρ ), and the post-condition ψ ( ρ ′ ) is stronger than ψ ( ρ ′ ), meaning that ψ ( ρ ) (cid:15) POA ψ ( ρ ) and ψ ( ρ ′ ) (cid:15) POA ψ ( ρ ′ ) . This notion of refinement reflects the rules of consequence introduced in [Hoa69] (seealso [Mor94], whence we also adopt the notation ι : [ ρ , ρ ′ ] ⊑ ι : [ ρ , ρ ′ ] used in Figure 2).In a similar manner, in the case of arn s, a specification @ x ρ over a network N isrefined by another specification @ x ρ over a network N up to a cospan of morphisms of arn s h θ : N → N , θ : N → N i when θ ( x ) = θ ( x ) and θ pt2 ,x ( ρ ) (cid:15) a LTL θ pt1 ,x ( ρ ) [T¸ F13].Both of these notions of refinement generalize to the following concept of unification. Definition 3.19 (Unification) . Let SP and SP be specifications defined over orchestra-tions o and o , respectively, of an arbitrary but fixed orchestration scheme. We say that theordered pair h SP , SP i is unifiable if there exists a cospan of morphisms of orchestrations o θ / / o o θ o o called the unifier of SP and SP , such that θ ( SP ) (cid:15) OrcScheme θ ( SP ). ERVICE-ORIENTED LOGIC PROGRAMMING 31
Therefore, h θ , θ i is a unifier of SP and SP if and only if, for every morphism of orches-trations δ : o → g such that g is a ground orchestration, if Spec( θ ; δ )( SP ) is a property of g then so is Spec( θ ; δ )( SP ).In conventional logic programming, the resolution inference rule simplifies the currentgoal and at the same time, through unification, yields computed substitutions that couldeventually deliver a solution to the initial query. This process is accurately reflected inthe case of service-oriented computing by service binding . However, unlike relational logicprogramming, in the case of services the emphasis is put not on the computed morphismsof orchestrations (i.e. on substitutions), but on the dynamic reconfiguration of the orches-trations (i.e. of the signatures of variables) that underlie the considered applications. Definition 3.20 (Resolution) . Let ∃ o · Q be a query and ∀ o · P ← R a clause definedover an arbitrary but fixed orchestration scheme. A query ∃ o · Q is said to be derived byresolution from ∃ o · Q and ∀ o · P ← R using the computed morphism θ : o → o when o Q P ←−− o R o θ ( Q \ { SP } ) ∪ θ ( R ) θ • θ can be extended to a unifier h θ , θ i of a specification SP ∈ Q and P , and • Q is the set of specifications given by the translation along θ and θ of the specificationsin Q \ { SP } and R . Example 3.21.
Consider the service query and the clause detailed in Examples 3.18and 3.15. One can easily see that the single specification @ R ρ T of the requires-interface ofthe application Traveller and the provides-interface @ JP ρ JP of the module Journey Plannerform a unifiable pair: they admit, for instance, the unifier h θ , θ i given by Traveller θ / / JourneyPlannerApp JourneyPlanner θ o o • the arn JourneyPlannerApp depicted in Figure 10, • the morphism θ that maps the point R to JP , the communication hyperedge C to CJP and the messages getRoute and route of M R to planJourney and directions , respectively,while preserving all the remaining elements of Traveller , and • the inclusion θ of JourneyPanner into
JourneyPlannerApp . T Λ T − getRoute + routeT planJourney + directions − JP JP Λ JP − getRoutes + routes + timetablesJP getRoutes + routes − R routes + timetables − R CJP Λ CJP C Λ C Figure 10: The arn
JourneyPlannerApp
It follows that we can derive by resolution a new service query defined by the network
JourneyPlannerApp and the requires-specifications @ R ρ JP and @ R ρ JP . Traveller (cid:8) @ R ρ T (cid:9) @ JP ρ JP ←−−−−−−−−− JourneyPlanner (cid:8) @ R ρ JP , @ R ρ JP (cid:9) JourneyPlannerApp (cid:8) @ R ρ JP , @ R ρ JP (cid:9) θ ❴❴❴❴❴❴❴❴❴❴❴❴❴❴❴❴❴❴❴❴❴❴❴❴❴❴❴❴❴❴❴❴❴❴❴❴❴❴❴❴❴❴❴❴❴❴❴❴❴❴❴❴❴❴❴❴❴❴❴❴❴❴❴❴❴❴❴❴ The logic-programming framework of services.
The crucial property of the abovenotions of service clause, query, and resolution is that, together with the generalized sub-stitution system OrcScheme used to define them, they give rise to a logic-programmingframework [T¸ F15]. The construction is to a great extent self-evident, and it requires littleadditional consideration apart from the fact that, from a technical point of view, in orderto define clauses and queries as quantified sentences, we need to extend OrcScheme byclosing the sets of sentences that it defines under propositional connectives such as impli-cation and conjunction. It should be noted, however, that the properties that guaranteethe well-definedness of the resulting logic-programming framework such as the fact thatits underlying generalized substitution system has weak model amalgamation (ensured byProposition 3.11), and also the fact that the satisfaction of specifications is preserved bymodel homomorphisms (detailed in Remark 3.12), are far from trivial, especially whentaking into account particular orchestration schemes (see e.g. Proposition 2.33).By describing service discovery and binding as instances of unification and resolution(specific to the logic-programming framework of services) we obtain not only a rigorouslydefined analogy between service-oriented computing and relational logic programming, butalso a way to apply the general theory of logic programming to the particular case ofservices. For example, we gain a concept of solution to a service query that reflects the ratherintuitive service-oriented notion of solution and, moreover, through Herbrand’s theorem, acharacterization of satisfiable queries as queries that admit solutions.
Definition 3.22 (Solution) . A solution , or correct answer , to a service-oriented query ∃ o · Q consists of a morphism of orchestrations ψ : o → o ′ such that o ′ has models, and every oneof them satisfies the ψ -translations of the specifications in Q . Proposition 3.23.
A service query is satisfiable if and only if it admits a solution.
Even more significant is the fact that logic programming provides us with a generalsearch procedure that can be used to compute solutions to queries. The search is triggeredby a query ∃ o · Q and consists in the iterated application of resolution, that is of servicediscovery and binding, until the requires-interface of the derived service query consistssolely of trivial specifications (tautologies); these are specifications whose translation alongmorphisms into ground orchestrations always gives rise to properties. Thus, whenever thesearch procedure successfully terminates we obtain a computed answer to the original queryby sequentially composing the resulting computed morphisms. This is the process that led,for example, to the derivation of the program that calculates the quotient and the remainderobtained on dividing two natural numbers illustrated in Figure 2. The computed answer isgiven in this case by the sequence of substitutions pgm pgm ; pgm ( pgm ; pgm ) ; pgm
7→ · · ·7→ ( q := 0 ; r := x ) ; while y ≤ r do q := q + 1 ; r := r − y done . ERVICE-ORIENTED LOGIC PROGRAMMING 33
In a similar manner, we can continue Example 3.21 towards the derivation of an answerto the Traveller application. To this purpose, we assume that Map Services and TransportSystem are two additional service modules that correspond to the processes MS and TS used in Example 2.25, and whose provides-interfaces meet the requires-specifications of themodule Journey Planner. We obtain in this way the construction outlined in Figure 11.The soundness of resolution, detailed in Proposition 3.24 below, entails that the searchfor solutions is sound as well, in the sense that every computed answer to ∃ o · Q is also asolution to ∃ o · Q . This fundamental result, originally discussed in [T¸ F15] in the contextof abstract logic programming, ensures, in combination with Proposition 3.23, that theoperational semantics of the service overlay given by discovery and binding is sound withrespect to the notion of satisfiability of a service query. Proposition 3.24.
Let ∃ o · Q be a service query derived by resolution from ∃ o · Q and ∀ o · P ← R using the computed morphism θ : o → o . If ∀ o · P ← R is correct then,for any solution ψ to ∃ o · Q , the composed morphism θ ; ψ is a solution to ∃ o · Q . Conclusions
We have shown how the integration of the declarative and the operational semantics of con-ventional logic programming can be generalized to service-oriented computing, thus offeringa unified semantics for the static and the dynamic aspects of this paradigm. That is, wehave provided, for the first time, an algebraic framework that accounts for the mechanismsthrough which service interfaces can be orchestrated, as well as for those mechanisms thatallow applications to discover and bind to services.The analogy that we have established is summarized in Table 1. Our approach tothe logic-programming semantics of services is based on the identification of the bindingof terms to variables in logic programming with the binding of orchestrations of servicesto those of software applications in service-oriented computing; the answer to a servicequery – the request for external services – is obtained through resolution using serviceclauses – orchestrated service interfaces – that are available from a repository. This departsfrom other works on the logic-programming semantics of service-oriented computing suchas [KBG07] that actually considered implementations of the service discovery and bindingmechanisms based on constraint logic programming.The theory of services that we have developed here is grounded on a declarative se-mantics of service clauses defined over a novel logical system of orchestration schemes. Thestructure of the sentences and of the models of this logical system varies according to theorchestration scheme under consideration. For example, when orchestrations are defined asasynchronous relational networks over the institution a LTL, we obtain sentences as linear-temporal-logic sentences expressing properties observed at given interaction points of anetwork, and models in the form of ground orchestrations of Muller automata. Other logics(with corresponding model theory) could have been used instead of the automata-basedvariant of linear temporal logic, more specifically any institution such that ( a ) the categoryof signatures is (finitely) cocomplete; ( b ) there exist cofree models along every signaturemorphism; ( c ) the category of models of every signature has (finite) products; and ( d ) modelhomomorphisms reflect the satisfaction of sentences. Moreover, the formalism used in defin-ing orchestrations can change by means of morphisms of orchestration schemes. We could I . T ¸ U T ¸ UAN D J . L . F I A D E I R O Traveller Journey Planner Map ServicesTransport System T Λ T − getRoute + routeT getRoute + route − R C Λ C @ R ρ T (cid:15) @ JP ρ JP planJourney + directions − JP JP Λ JP − getRoutes + routes + timetablesJP getRoutes + routes − R routes + timetables − R C Λ C @ R ρ JP @ R ρ JP @ MS ρ MS (cid:15) getRoutes + routes − MS MS Λ MS @ TS ρ TS (cid:15) routes + timetables − TS TS Λ TS Figure 11: The derivation of an answer to the Traveller application ρ T : ✷ ( getRoute ¡ ⇒ ✸ route !) ρ JP : ✷ ( routes ¡ ⇒ ✸ timetables !) ρ JP : ✷ ( planJourney ¡ ⇒ ✸ directions !) ρ MS : ✷ ( getRoutes ¡ ⇒ ✸ routes !) ρ JP : ✷ ( getRoutes ¡ ⇒ ✸ routes !) ρ TS : ✷ ( routes ¡ ⇒ ✸ timetables !) E R V I C E - O R I E N T E D L O G I C P R O G R A MM I N G Table 1: Correspondence between concepts of relational and service-oriented logic programmingRelational logic programming Service-oriented logic programmingConcept over a signature h F, P i over program expressions over asynchronous relational networksVariable pair ( x, F ) program variable pgm : eXp requires-point x ∈ X Term structure σ ( t , . . . , t n ) program statement while C do pgm done subnetwork determined by a point getRoutes + routes − MS MS Λ MS Clause universally quantifiedimplication C ←−− X H program module ; ρ, ρ ′′ ρ, ρ ′ ρ ′ , ρ ′′ service module JP C @ JP ρ JP @ R ρ JP @ R ρ JP Query existentially quantifiedconjunction X Q program query ρ, ρ ′ client application T C @ R ρ T Unificationandresolution term unification andfirst-order resolution program discovery and binding(see Figure 2) service discovery and binding(see Figure 11) consider, for instance, an encoding of the hypergraphs of processes and connections dis-cussed in this paper into graph-based structures similar to those of [FL13b]; or we couldchange their underlying institution by adding new temporal modalities (along the lines ofExample 3.6) or by considering other classes of automata, like the closed reduced B¨uchi au-tomata used in [AS87, FL13a]. This encourages us to further investigate aspects related tothe heterogeneous foundations of service-oriented computing based on the proposed logicalsystem of orchestration schemes.
Acknowledgements
The work of the first author has been supported by a grant of the Romanian NationalAuthority for Scientific Research, CNCS-UEFISCDI, project number PN-II-ID-PCE-2011-3-0439. The authors also wish to thank Fernando Orejas for suggesting the use of hypergraphs,Ant´onia Lopes for many useful discussions that led to the present form of this paper, andthe anonymous referees for their careful study of the original manuscript.
References [ACKM04] Gustavo Alonso, Fabio Casati, Harumi A. Kuno, and Vijay Machiraju.
Web Services: Concepts,Architectures and Applications . Data-Centric Systems and Applications. Springer, 2004.[AS87] Bowen Alpern and Fred B. Schneider. Recognizing safety and liveness.
Distributed Computing ,2(3):117–126, 1987.[BCT06] Boualem Benatallah, Fabio Casati, and Farouk Toumani. Representing, analysing and managingWeb service protocols.
Data & Knowledge Engineering , 58(3):327–357, 2006.[BGLL09] Roberto Bruni, Fabio Gadducci, and Alberto Lluch-Lafuente. A graph syntax for processes andservices. In Cosimo Laneve and Jianwen Su, editors,
Web Services and Formal Methods , volume6194 of
Lecture Notes in Computer Science , pages 46–60. Springer, 2009.[BZ83] Daniel Brand and Pitro Zafiropulo. On communicating finite-state machines.
Journal of the acm , 30(2):323–342, 1983.[DF98] R˘azvan Diaconescu and Kokichi Futatsugi.
CafeOBJ Report: The Language, Proof Techniques,and Methodologies for Object-Oriented Algebraic Specification , volume 6 of amast
Series inComputing . World Scientific, 1998.[Dia08] R˘azvan Diaconescu.
Institution-Independent Model Theory . Studies in Universal Logic.Birkh¨auser, 2008.[FC96] Jos´e L. Fiadeiro and Jos´e F. Costa. Mirror, mirror in my hand: a duality between specificationsand models of process behaviour.
Mathematical Structures in Computer Science , 6(4):353–373,1996.[FHL +
05] Gian Luigi Ferrari, Dan Hirsch, Ivan Lanese, Ugo Montanari, and Emilio Tuosto. Synchro-nised hyperedge replacement as a model for service oriented computing. In Frank S. de Boer,Marcello M. Bonsangue, Susanne Graf, and Willem P. de Roever, editors,
Formal Methodsfor Components and Objects , volume 4111 of
Lecture Notes in Computer Science , pages 22–43.Springer, 2005.[Fia12] Jos´e L. Fiadeiro. The many faces of complexity in software design. In Mike Hinchey and LorcanCoyle, editors,
Conquering Complexity , pages 3–47. Springer, 2012.[FK04] Ian T. Foster and Carl Kesselman.
The Grid 2: Blueprint for a New Computing Infrastructure .The Morgan Kaufmann Series in Computer Architecture and Design Series. Morgan Kaufmann,2004.[FL13a] Jos´e L. Fiadeiro and Ant´onia Lopes. An interface theory for service-oriented design.
TheoreticalComputer Science , 503:1–30, 2013.[FL13b] Jos´e L. Fiadeiro and Ant´onia Lopes. A model for dynamic reconfiguration in service-orientedarchitectures.
Software and Systems Modeling , 12(2):349–367, 2013.
ERVICE-ORIENTED LOGIC PROGRAMMING 37 [FLB07] Jos´e L. Fiadeiro, Ant´onia Lopes, and Laura Bocchi. Algebraic semantics of service componentmodules. In Jos´e L. Fiadeiro and Pierre-Yves Schobbens, editors,
Recent Trends in Algebraic De-velopment Techniques , volume 4409 of
Lecture Notes in Computer Science , pages 37–55. Springer,2007.[FLB11] Jos´e L. Fiadeiro, Ant´onia Lopes, and Laura Bocchi. An abstract model of service discovery andbinding.
Formal Aspects of Computing , 23(4):433–463, 2011.[FS07] Jos´e L. Fiadeiro and Vincent Schmitt. Structured co-spans: an algebra of interaction protocols.In Till Mossakowski, Ugo Montanari, and Magne Haveraaen, editors,
Algebra and Coalgebra inComputer Science , volume 4624 of
Lecture Notes in Computer Science , pages 194–208. Springer,2007.[GB92] Joseph A. Goguen and Rod M. Burstall. Institutions: abstract model theory for specificationand programming.
Journal of the acm , 39(1):95–146, 1992.[GKP94] Ronald L. Graham, Donald E. Knuth, and Oren Patashnik.
Concrete Mathematics: A Founda-tion for Computer Science . Addison-Wesley, second edition, 1994.[GM96] Joseph A. Goguen and Grant Malcolm.
Algebraic Semantics of Imperative Programs . Founda-tions of computing. mit
Press, 1996.[Hoa69] C. A. R. Hoare. An axiomatic basis for computer programming.
Communications of the acm ,12(10):576–580, 1969.[Ive62] Kenneth E. Iverson.
A Programming Language . Wiley, 1962.[KBG07] Srividya Kona, Ajay Bansal, and Gopal Gupta. Automatic composition of semantic Web services.In ieee
International Conference on Web Services , pages 150–158. ieee
Computer Society,2007.[KMWZ10] Alexander Knapp, Grzegorz Marczy´nski, Martin Wirsing, and Artur Zaw locki. A heterogeneousapproach to service-oriented systems specification. In Sung Y. Shin, Sascha Ossowski, MichaelSchumacher, Mathew J. Palakal, and Chih-Cheng Hung, editors, acm
Symposium on AppliedComputing , pages 2477–2484. acm , 2010.[Llo87] John W. Lloyd.
Foundations of Logic Programming . Symbolic computation: Artificial intelli-gence. Springer, 1987.[L¨od01] Christof L¨oding. Efficient minimization of deterministic weak ω -automata. Information Process-ing Letters , 79(3):105–109, 2001.[Mes89] Jos´e Meseguer. General logics. In Heinz-Dieter Ebbinghaus, Jos´e Fern´andez-Prida, Manuel Gar-rido, Daniel Lascar, and Mario Rodriquez-Artalejo, editors,
Logic Colloquium ’87 , volume 129of
Studies in Logic and the Foundations of Mathematics Series , pages 275–329. Elsevier, 1989.[Mor94] Carroll C. Morgan.
Programming from Specifications . Prentice Hall International series in com-puter science. Prentice Hall, second edition, 1994.[Mos02] Till Mossakowski. Comorphism-based Grothendieck logics. In Krzysztof Diks and Wojciech Ryt-ter, editors,
Mathematical Foundations of Computer Science 2002 , volume 2420 of
Lecture Notesin Computer Science , pages 593–604. Springer, 2002.[Mos04] Peter Mosses. casl
Reference Manual: The Complete Documentation Of The Common AlgebraicSpecification Language . Lecture Notes in Computer Science. Springer, 2004.[MS97] Oded Maler and Ludwig Staiger. On syntactic congruences for ω -languages. Theoretical Com-puter Science , 183(1):93–112, 1997.[Mul63] David E. Muller. Infinite sequences and finite machines. In th Annual Symposium on SwitchingCircuit Theory and Logical Design , pages 3–16. ieee
Computer Society, 1963.[PP04] Dominique Perrin and Jean-´Eric Pin.
Infinite Words: Automata, Semigroups, Logic and Games .Pure and Applied Mathematics. Elsevier Science, 2004.[SBFZ07] Jianwen Su, Tevfik Bultan, Xiang Fu, and Xiangpeng Zhao. Towards a theory of web servicechoreographies. In Marlon Dumas and Reiko Heckel, editors,
Web Services and Formal Methods ,volume 4937 of
Lecture Notes in Computer Science , pages 1–16. Springer, 2007.[SML04] Lutz Schr¨oder, Till Mossakowski, and Christoph L¨uth. Type class polymorphism in an institu-tional framework. In Jos´e L. Fiadeiro, Peter D. Mosses, and Fernando Orejas, editors,
RecentTrends in Algebraic Development Techniques , volume 3423 of
Lecture Notes in Computer Science ,pages 234–251. Springer, 2004.[ST88] Donald Sannella and Andrzej Tarlecki. Toward formal development of programs from algebraicspecifications: implementations revisited.
Acta Informatica , 25(3):233–281, 1988. [ST11] Donald Sannella and Andrzej Tarlecki.
Foundations of Algebraic Specification and Formal Soft-ware Development . Monographs in Theoretical Computer Science. An eatcs
Series. Springer,2011.[TBG91] Andrzej Tarlecki, Rod M. Burstall, and Joseph A. Goguen. Some fundamental algebraic toolsfor the semantics of computation. Part 3: Indexed categories.
Theoretical Computer Science ,91(2):239–264, 1991.[T¸ F13] Ionut¸ T¸ ut¸u and Jos´e L. Fiadeiro. A logic-programming semantics of services. In Reiko Heckeland Stefan Milius, editors,
Algebra and Coalgebra in Computer Science , volume 8089 of
LectureNotes in Computer Science , pages 299–313. Springer, 2013.[T¸ F15] Ionut¸ T¸ ut¸u and Jos´e L. Fiadeiro. From conventional to institution-independent logic program-ming.
Journal of Logic and Computation , in press.[Tho90] Wolfgang Thomas. Automata on infinite objects. In Jan van Leeuwen, editor,
Handbook ofTheoretical Computer Science, Volume B: Formal Models and Semantics , pages 133–192. Elsevierand mit
Press, 1990.[Vog03] Werner Vogels. Web services are not distributed objects. ieee
Internet Computing , 7(6):59–66,2003.
This work is licensed under the Creative Commons Attribution-NoDerivs License. To viewa copy of this license, visit http://creativecommons.org/licenses/by-nd/2.0/http://creativecommons.org/licenses/by-nd/2.0/