Service Composition nd Synthesis The Romn Model Giuseppe De Gicomo SAPIENZA Università di Rom, Itly Joint work with Dniel Berrdi, Mssimilino de Leoni, Diego Clvnese, Fhim Cheikh, Rick Hull, Murizio Lenzerini, Mssimo Mecell, Fio Ptrizi, Antonell Poggi, Riccrdo Rosti, Sestin Srdin 1
Introduction The promise of Service Computing is to use services fundmentl elements for relizing distriuted pplictions/solutions. Services re processes tht export their strct specifiction When no ville service stisfies desired specifiction, one might check whether (prts of) ville services cn e composed nd orchestrted in order to relize the specifiction. Working t n strct level enle us to exploit results from utomtic verifiction nd synthesis to verify nd compose services. The prolem of utomtic composition ecomes especilly interesting in the presence of stteful (converstionl) services. Among the vrious frmeworks proposed in the literture, here we concentrte on the so clled ``Romn Model (nme y Rick Hull). 2
Dt Integrtion Client Client s query Glol view or domin ontology Mpping 1 Mpping 2 Mpping n Source 1 Source 2 Source n 3
Service integrtion/composition: Key points Trget service spec. of the desired service ehvior expressed in terms of virtul ctions Action ontology spec. of tomic processes nd dt Aville services spec. of the ehvior of ville service processes expressed in terms of the environment No ville process for the trget service Must relize trget service y delegting ctul ctions to ville services Aville services re stteful, hence must relize the trget using frgments of their computtions Actul ville processes 4
The Romn Model: sics Key points Trget service Expressed s Trnsition System spec. of the desired service ehvior Action ontology Shred Actions Environment expr. s Trnsition Systems spec. of tomic processes nd dt Aville services Ech expressed s Trnsition System spec. of the ehvior of ville service processes No ville process for the trget service Must relize trget service y delegting ctul ctions to ville services Aville services re stteful, hence must relize the trget using frgments of their computtions Actul ville processes 5
Romn Model s min ingredients The Romn Model exemplifies wht cn e chieved y composing converstionl services nd uncovers reltionships with utomted synthesis of rective processes in Verifiction nd AI Plnning. Romn Model s min ingredients Ech ville service is formlly specified s trnsition system tht cptures its possile converstions with generic client. Desired specifiction is trget service, descried itself s trnsition system. the im is to utomticlly synthesize orchestrtors tht relize the trget service y delegting its ctions to the ville services, exploiting frgments of their execution. 6
Trnsition systems We represent services s trnsition systems: A TS is tuple < A, S, s0, δ> where: A is the set shred of ctions S is the set of sttes s0 2 S is the set of initil sttes δ µ S A S is the trnsition reltion 7
Service composition Prolem of composition existence Given: - ville services B 1,,B n - trget service T over the sme environment (sme set of tomic ctions) Check whether T cn e relized y delegting ctions to B 1,,B n so s to mimic T over time (forever!) Composition synthesis synthesis of the orchestrtor tht does the delegtion 8
Service composition s gme There re t lest two kinds of gmes. One could e clled finite, the other infinite. A finite gme is plyed for the purpose of winning...... n infinite gme for the purpose of continuing the ply. Finite nd Infinite Gmes J. P. Crse, philosopher 9
Service composition s gme: Service composition vs Plnning Plnning Stteless service composition Opertors: tomic ctions Gol: desired stte of ffir Service composition Romn model Opertors: ville trnsition systems Gol: trget trnsition system Gme: finite! compose opertors sequentilly so s to rech the gol Plying strtegy: pln (progrm hving opertors invoction s tomic instructions) Gme: infinite! compose ville trnsition systems concurrently so s to ply the trget trnsition system Plying strtegy: orchestrtor (process tht delegte trget ctions to the ville service 10
Simple exmple of service composition trget service Devilish nondeterminism! service 1 T0 T1 S10 S11 orchestrtor service 2 S20 For simplicity we don t consider environment. 11
Simple exmple of service composition trget service service 1 T0 T1 S10 S11 orchestrtor service 2 S20 12
Simple exmple of service composition trget service service 1 T0 T1 S10 S11 orchestrtor service 2 S20 13
Simple exmple of service composition trget service service 1 T0 T1 oserve the ctul stte! S10 S11 orchestrtor service 2 S20 14
Simple exmple of service composition trget service service 1 T0 T1 oserve the ctul stte! S10 S11 orchestrtor service 2 S20 15
Simple exmple of service composition trget service service 1 T0 T1 oserve the ctul stte! S10 S11 orchestrtor service 2 S20 16
Simple exmple of service composition trget service service 1 T0 T1 S10 S11 Orchestrtor progrm is ny function P(h,) = i tht tkes history h nd n ction to execute nd delegtes to one of the ville services i orchestrtor A history is sequence tht lterntes sttes of the ville services with ctions performed: (s 1 0,s 2 0,,s n 0) 1 (s 1 1,s 2 1,,s n 1) k (s k 1,s 2 k,,s n k) S20 service 2 Oserve tht to tke decision P hs full ccess to the pst, ut no ccess to the future 17
Synthesizing compositions Techniques for computing compositions: Reduction to PDL SAT Simultion-sed LTL synthesis s model checking of gme structure (ll techniques re for finite stte services) 18
Simultion-sed technique Directly sed on... controlling the concurrent execution of ville services B 1,,B n so s to mimic the trget service T Thm: Composition exists iff the synchronous (Crtesin) product C of B 1,,B n cn (ND-)simulte T 19
Exmple of composition y simultion B1: B2: Given from ville nd trget service B3: T: 20
Computing composition vi simultion Let B1,,Bn e the TSs of the ville ehviors. The Aville ehviors TS C = < A, S C, s C 0, δ C,F C > is the synchronous product of B1,...,Bn where: A is the set of ctions SC = S1... Sn sc 0 = (s 0 1,..., s 0 m) δ C µ S C A S C is defined s follows: (s1... sn)! (s 1... s n) iff 9 i. si! s i 2 δi nd 8 j i. s j = sj 21
Exmple of composition y simultion B1: C : B2: B3: consider the synchronous product of the ville services 22 22
Simultion reltion Given trget service T nd (the synchronous product of) ville services C, (ND-)simultion is reltion R etween the sttes t 2 T n (s1,..,sn) of C such tht: (t, s1,..,sn) 2 R implies tht for ll t! t in T, exists Bi 2 C s.t. 9 si! s i in Bi Æ 8 si! s i in Bi ) (t, s1,..s i,..sn) 2 R If exists simultion reltion R (such tht (t 0, s1 0,..,sn 0 ) 2 R, then we sy tht or T is simulted y C (or C simultes T). Simulted-y is (i) simultion; (ii) the lrgest simultion. Simulted-y is coinductive definition 23
Simultion reltion (cont.) Algorithm Compute (ND-)simultion Input: trget ehvior T nd (sync. prod. of) ville ehviors C Output: the simulted-y reltion (the lrgest simultion) Body R = ; R = ST S1.. Sn while (R R ) { R := R R := R - {(t, s1,..,sn) 9 t! t in T Æ (9 si! s i in Bi Æ 8 si! s i in Bi ) (t, s1,..s i,..sn) 2 R )} } return R End 24
Exmple of composition y simultion B1: C : B2: B3: T: 25 25 compute ND-simultion
Using simultion for composition Given the lrgest simultion R of T y C, we cn uild every composition through the orchestrtor genertor (OG). OG = < A, [1,,n], Sr, sr 0, δr, ωr,> with A : the ctions shred y the ehviors [1,,n]: the identifiers of the ville services in the community Sr = ST S1... Sn : the sttes of the orchestrtor genertor sr 0 = (t 0, s 0 1,..., s 0 n) : the initil stte of the orchestrtor genertor ω: Sr Ar! 2 [1,,n] : the output function, defined s follows: ω(t, s1,..,sn, ) = { i 9 t!, t in T Æ 9 si!, si in Bi Æ (t, s1,..,s i,..,sn )2 R} δ µ Sr A [1,,n]! Sr : the stte trnsition function, defined s follows (t, s1,..., si,..., sn)!,i (t, s1,..., s i,..., sn) iff i 2 ω(t, s1,.., si,.., sn, ) 26
Exmple of composition y simultion compute the orchestrtor genertor B1: C : Orchestrtor Genertor B2: B3: T: W(t1,s1q1,) = {1,2} W(t1,s1q1,c) = {2} W(t1,s2q1,) = {2} W(t1,s2q1,c) = {2} W(t2,s1q1,) = {3} W(t2,s1q2,) = {2} W(t2,s2q1,) = {1,3} W(t2,s2q2,) = {2} W(t3,s1q1,) = {2} W(t3,s2q1,) = {2} W(t4,s1q1,) = {3} W(t4,s1q2,) = {2} W(t4,s2q1,) = {1,3} W(t4,s2q2,) = {2} 27
Results Thm: choosing t ech point ny vlue in returned y the orchestrtor genertor gives us composition. Thm: every composition cn e otined y choosing, t ech point suitle vlue mong those returned y the orchestrtor genertor. Note: there infinitely mny compositions ut only one orchestrtor genertor tht cptures them ll Thm: computing the orchestrtor genertor is EXPTIME, nd in fct exponentil only in the numer (nd not the size) of the ville ehviors. Composition in the Romn Model ws shown to e EXPTIME-hrd [Muscholl&Wlukiewicz07] 28
Just-in-time composition Once we hve the orchestrtor genertor...... we cn void choosing ny prticulr composition priori...... nd use directly ω to choose the ville ehvior to which delegte the next ction. We cn e lzy nd mke such choice just-in-time, possily dpting rectively to runtime feedck. Just-in-time compositions cn e used to rectively ct upon filures [KR08]! 29
Tools for computing composition sed on simultion Computing simultion is well-studied prolem (relted to computing isimultion key notion in process lger). Tools, like the Edinurgh Concurrency Workench nd its clones, cn e dpted to compute composition vi simultion. Also LTL-sed synthesis tools, like TLV, cn e used for (indirectly) computing composition vi simultion [Ptrizi PhD09] We re currently focusing on the second pproch. 30
Adding dt to the Romn Model Adding dt is crucil in certin contexts: Dt - rich description of the sttic informtion of interest. Behviors - rich description of the dynmics of the process But mkes the pproch extremely chllenging: We get to work with infinite trnsition systems Simultion cn still e used for cpturing composition But it cnnot e computed explicitly nymore. We present two orthogonl pproches to del with them. 31
The Romn Model: Americn twek with Rick Hull + Jinwen Su Trget service Expressed s Gurded TS with prmeters spec. of the desired service ehvior Aville services Ech expressed s Gurded TS with prmeters spec. of the ehvior of ville service processes Key points No ville process for the trget service Must relize trget service y delegting ctul ctions to ville services Aville services re stteful, hence must relize the trget using frgments of their computtions Actul ville processes 32
Dt-Awre Service Composition 33
Services ct on n integrted view of the world [BCDHM-VLDB05] Client (humn or mchine) Store Bnk Wre- House Rel World Actions my impct rel world modeled s FOL reltions Also ctions my e messges etween services 34
Service ehvior of s strct finite stte mchines tht query nd ct on the infinite stte world (pyby == CC) (price > 10) /! requestcccheck(crtnum)? replycccheck( pp roved) pproved == F /! replyorder( fil ) pproved == T / requestship( wh, ddr; oid,dte,sttus)!? requestorder( pyby,crtnum, ddr,price) (pyby == PREPAID) (price 10) / chrge(crtnum; pymentok) pymentok == F /! replyorder( fil ) pymentok == T / requestship(wh,ddr; oid,dte,sttus)! shipsttus( oid, dte,sttus) shipsttus( oid, dte,sttus)? requestshipsttus(oid) checkshipsttus( o id; dte,sttus) Locl store Edge conditions sed on locl store (nd incoming messge) Edge ctions Atomic Process cting on the world set the locl store Crete/send messge Red messge [BCDHM-VLDB05] 35
The Romn Model: Austrlin/Cndin twek with Sestin Srdin RMIT/UOT! Trget service Expressed s ConGolog Progrm spec. of the desired service ehvior Aville services Ech expressed s ConGolog Progrm spec. of the ehvior of ville service processes Key points No ville process for the trget service Must relize trget service y delegting ctul ctions to ville services Aville services re stteful, hence must relize the trget using frgments of their computtions Actul ville processes 36
Composition of ConGolog Progrms 37
Mixing dt nd service integrtion: A rel chllenge for the whole CS We hve ll the issues of dt integrtion ut in ddition Behvior: description of the dynmics of the process! Behvior should e formlly nd strctly descried: conceptul modeling of dynmics (not l OWL-S). Which? Workflows community my help Business process community my help Services community my help Process lgers community my help AI & Resoning out ctions community my help DB community my help my help Artifct-centric pproch promising! Techniques for nlysis/synthesis of services in presence of unounded dt cn come from different communities: Verifiction (CAV) community: strction to finite sttes AI (KR) community: working directly in FOL/SOL, e.g., SitClc 38
The Romn Model: Itlin drem Very preliminry ides in DL07 Trget service Expressed in conceptul process description lnguge spec. of the desired service ehvior Key points No ville process for the trget service Must relize trget service y delegting ctul ctions to ville services Aville services Ech expressed conceptul process description lnguge spec. of the ehvior of ville service processes Aville services re stteful, hence must relize the trget using frgments of their computtions Actul ville processes 39
References [ICSOC 03] Dniel Berrdi, Diego Clvnese, Giuseppe De Gicomo, Murizio Lenzerini, Mssimo Mecell: Automtic Composition of E- services Tht Export Their Behvior. ICSOC 2003 [WES 03] Dniel Berrdi, Diego Clvnese, Giuseppe De Gicomo, Murizio Lenzerini, Mssimo Mecell: A Foundtionl Vision of e- Services. WES 2003 [TES 04] Dniel Berrdi, Diego Clvnese, Giuseppe De Gicomo, Murizio Lenzerini, Mssimo Mecell: : A Tool for Automtic Composition ofservices Bsed on Logics of Progrms. TES 2004 [ICSOC 04] Dniel Berrdi, Giuseppe De Gicomo, Murizio Lenzerini, Mssimo Mecell, Diego Clvnese: Synthesis of underspecified composite e-services sed on utomted resoning. ICSOC 2004 [IJCIS 05] Dniel Berrdi, Diego Clvnese, Giuseppe De Gicomo, Murizio Lenzerini, Mssimo Mecell: Automtic Service Composition Bsed on Behviorl Descriptions. Int. J. Coopertive Inf. Syst. 14(4): 333-376 (2005) [VLDB 05] Dniel Berrdi, Diego Clvnese, Giuseppe De Gicomo, Richrd Hull, Mssimo Mecell: Automtic Composition of Trnsitionsed Semntic We Services with Messging. VLDB 2005 [ICSOC 05] Dniel Berrdi, Diego Clvnese, Giuseppe De Gicomo, Mssimo Mecell: Composition of Services with Nondeterministic Oservle Behvior. ICSOC 2005 [SWS 06] Fhim Cheikh, Giuseppe De Gicomo, Mssimo Mecell: Automtic we services composition in trustwre communities. Proceedings of the 3rd ACM workshop on Secure we services 2006. [AISC 06] Dniel Berrdi, Diego Clvnese, Giuseppe De Gicomo, Mssimo Mecell. Automtic We Service Composition: Servicetilored vs. Client-tilored Approches. In Proc. AISC 2006, Interntionl Workshop jointly with ECAI 2006. [FOSSACS 07] Anc Muscholl, Igor Wlukiewicz: A lower ound on we services composition. Proceedings FOSSACS, LNCS, Springer, Volume 4423, pge 274--287-2007. [ICWS07] Giuseppe De Gicomo, Mssimilino De Leoni, Mssimo Mecell, Fio Ptrizi.. Automtic Workflows Composition of Moile Services. ICWS 2007. [IJCAI 07] Giuseppe De Gicomo, Sestin Srdiñ: Automtic Synthesis of New Behviors from Lirry of Aville Behviors. IJCAI 2007. [AAAI 07] Sestin Srdiñ, Fio Ptrizi, Giuseppe De Gicomo: Automtic synthesis of glol ehvior from multiple distriuted ehviors. AAAI 2007. [DL07] Diego Clvnese, Giuseppe De Gicomo, Murizio Lenzerini, Riccrdo Rosti. Actions nd progrms over description logic ontologies. DL 2007. [IJFCS08] Dniel Berrdi, Fhim Cheikh, Giuseppe De Gicomo, Fio Ptrizi: Automtic Service Composition vi Simultion. IJFCS, 2008 [KR08] Sestin Srdiñ, Fio Ptrizi, Giuseppe De Gicomo: Behvior composition in the presence of filure. KR 2008. 40 [ICAPS08] Sestin Srdiñ, Giuseppe De Gicomo: Relizing Multiple Autonomous Agents through Scheduling of Shred Devices. ICAPS 2008.