Behvior Composition in the Presene of Filure Sestin Srdin RMIT University, Melourne, Austrli Fio Ptrizi & Giuseppe De Giomo Spienz Univ. Rom, Itly KR 08, Sept. 2008, Sydney Austrli Introdution There re t lest two kinds of gmes. One ould e lled finite, the other infinite. A finite gme is plyed for the purpose of winning...... n infinite gme for the purpose of ontinuing the ply. Finite nd Infinite Gmes J. P. Crse
Behvior omposition vs Plnning Plnning Opertors: tomi Gol: desired stte of ffir Finite gme: ompose opertor sequentilly so s to reh the gol Plying strtegy: pln Behvior omposition Opertors : ville trnsition systems Gol : trget trnsition system Infinite gme: ompose ville trnsition systems onurrently so s to ply the trget trnsition systems Plying strtegy: omposition ontroller Behvior omposition Given: - set of ville ehviors B 1,,B n - trget ehvior T we wnt to relize T y delegting tions to B 1,,B n i.e.: ontrol the onurrent exeution of B 1,,B n so s to mimi T over time Behvior omposition: synthesis of the ontroller 4
v q1 q2 s1 s2 5 B1: B2: B3: Exmple s1q1 s2q2 s1q2 s2q1,2,3,2,1,1,2,1,1,2,2,3,2,3,3,2,2 T: C : v q1 q2 s1 s2 6 B1: B2: B3: Exmple s1q1 s2q2 s1q2 s2q1,2,3,2,1,1,2,1,1,2,2,3,2,3,3,2,2 T: C :
Exmple B1: B2: B3: s1 q1 v s2 q2 C :,2,3 s1q1,2 s1q2,3,2,2,1,1,1,1,2,3 s2q1 s2q2,3,2,2,2 T: 7 Synthesizing omposition Tehniques for omputing ompositions: Redution to PDL SAT [IJCAI07, AAAI07, VLDB05, ICSOC03] Simultion-sed LTL synthesis s model heking of gme struture [ICAPS08] All tehniques re for finite stte ehviors 8
Diretly sed on Simultion-sed tehnique... ontrol the onurrent exeution of B 1,,B n so s to mimi T Note this is possile...... if the onurrent exeution of B 1,,B n n mimi T Thm: this is possile iff... the synhronous (Crtesin) produt C of B 1,,B n n (ND-)simulte T 9 Simultion reltion Given two trnsition systems T = < A,ST, t 0,!T> nd C = < A, SC, sc 0,! C > (ND-)simultion is reltion R etween the sttes t! T n (s1,..,sn) of C suh tht: (t, s1,..,sn)! R implies tht # si " s i in Bi for ll t " t exists Bi! C s.t. $ si " s i in Bi % (t, s1,..,s i,..,sn)! R If exists simultion reltion R suh tht (t0, s C 0 )! R, then we sy tht T is simulted y C. Simulted-y is (i) simultion; (ii) the lrgest simultion. Simulted-y is oindutive definition
Exmple B1: s1 s2 C : s1q1,3,2,1,1 s2q1,3,2 B2: B3: q1 v q2,2,3,2 s1q2,2,1,1,2,3 s2q2,2,2 T: 11 Simultion reltion (ont.) Algorithm Compute (ND-)simultion Input: trget ehvior T = <A, ST, t 0,!T, FT> nd (Crt. prod. of) ville ehviors C= <A, S C, s C 0,! C, F C > Output: the simulted-y reltion (the lrgest simultion) Body R = & R = ST ' S C while (R " R ) { R := R R := R - {(t, s1,..,sn) # t " t in T ( $ Bi. # s " s in Bi ) # si " s i in Bi ( (t, s1,..s i,..sn) *! R } } return R End
Using simultion for omposition Given the lrgest simultion R of T y C, we n uild every omposition through the ontroller genertor (CG). CG = < A, [1,,n], Sr, sr 0,!, #> with A : the tions shred y the ehviors [1,,n]: the identifiers of the ville ehviors Sr = ST' S1 '...' Sn : the sttes of the ontroller genertor sr 0 = (t 0, s 0 1,..., s 0 n) : the initil stte of the ontroller genertor #: Sr ' A " 2 [1,,n] : the output funtion, defined s follows:!(t, s1,..,sn, ) = { i Bi n do nd remin in R}! + Sr ' A ' [1,,n] " Sr : the stte trnsition funtion, defined s follows (t, s1,..,si,..,sn)",i (t, s1,..,s i,..,sn) iff i! #(t, s1,..,si,..,sn, ) 13 Exmple B1: B2: B3: T: s1 q1 v s2 q2 W(,s1q1,) = {1,2} W(,s2q1,) = {2} W(,s1q1,) = {2} W(,s2q1,) = {2} W(,s1q1,) = {3} W(,s1q2,) = {2} W(,s2q1,) = {1,3} W(,s2q2,) = {2} W(,s1q1,) = {2} W(,s2q1,) = {2} W(,s1q1,) = {3} W(,s1q2,) = {2} W(,s2q1,) = {1,3} W(,s2q2,) = {2} 14 C :,2,3 s1q1,2 s1q2,3,2,2,1,1,1,1,2,3 s2q1 s2q2,3,2,2,2
Results for simultion Thm: Choosing t eh point ny vlue in! gives us orret ontroller for the omposition. Thm: Every ontroller tht is omposition n e otined y hoosing, t eh point, suitle vlue in!. Thm: Computing the ontroller genertor is EXPTIME (omposition is EXPTIME-omplete [IJCAI07]) where the exponentil depends only on the numer (not the size) of the ville ehviors. 15 Behvior filures Components my eome unexpetedly unville for vrious resons. We onsider four kinds of ehvior filures: A ehvior temporrily freezes; it will eventully resume in the sme stte it ws in; A ehvior (or the environment) unexpetedly nd ritrrily (i.e., without respeting its trnsition reltion) hnges its urrent stte; A ehvior dies - it eomes permnently unville. A ded ehvior unexpetedly omes live gin (this is n opportunity more thn filure).
Just-in-time omposition One we hve the ontroller genertor...... we n void hoosing ny prtiulr omposition priori...... nd use diretly! to hoose the ville ehvior to whih delegte the next tion. We n e lzy nd mke suh hoie just-in-time, possily dpting retively to runtime feedk. 17 Retive filure reovery with CG CG lredy solves: Temporry freezing of n ville ehvior B i - In priniple: wit for Bi - But with CG: stop seleting Bi until it omes k! - - - Unexpeted ehvior (environment) stte hnge In priniple: reompute CG / simulted-y from new initil stte...... ut CG / simulted-y independent from initil stte! Hene: simply use old CG / simulted-y from the new stte!! 18
Prsimonious filure reovery Algorithm Computing (ND-)simultion - prmetrized version Input: trnsition system T = <A, T, t 0,!T, FT> nd trnsition system C= <A, S, s C 0,! C, F C > reltion Rrw inluding the simulted-y reltion reltion Rsure inluded the simulted-y reltion Output: the simulted-y reltion (the lrgest simultion) Body Q = & Q = Rrw - Rsure //Note R = (Q! Rsure) while (Q " Q ) { Q := Q Q := Q - {(t, s1,..,sn) # t " t in T ( $ Bi. # s " s in Bi ) # si " s i in Bi ( (t, s1,..s i,..sn) *! Q! Rsure } } return Q! Rsure 19 End Prsimonious filure reovery (ont.) Let [1,.., n] = W! F e the ville ehviors. Let R = RW!F e the simulted-y reltion of trget y ehviors W! F. Then the following hold: RW "!W(RW!F) -!W(RW!F) is not simultion in generl - Behviors F die: ompute RW with Rrw =!W(RW!F)! RW " F " RW!F - RW " F is simultion of trget y ehviors W! F - Ded ehviors F ome k: ompute RW!F with Rsure = RW " F! 20
Tools for omputing omposition sed on simultion Computing simultion is well-studied prolem (relted to isimultion, key notion in proess lger). Tools, like the Edinurgh Conurreny Workenh nd its lones, n e dpted to ompute omposition vi simultion. Also LTL-sed syntesis tools, like TLV, n e used for (indiretly) omputing omposition vi simultion [Ptrizi PhD08] We re urrently foussing on the seond pproh. 21 Conlusion Behvior omposition: n infinite gme. Simultion sed omposition tehniques llow for filure tolerne! It relies on ontroller genertor: kind of stteful universl pln genertor for omposition. Full oservility of ville ehvior sttes is ruil for CG to work properly. But... Prtil oservility ddressle y mnipulting knowledge sttes! [work in progress] All tehniques re for finite sttes. Wht out deling with infinite sttes? Very diffiult, ut lso ruil when mixing proesses nd dt! 22