Behior Composition in the Presene of Filure Sestin Srdin RMIT Uniersity, Melourne, Austrli Fio Ptrizi & Giuseppe De Giomo Spienz Uni. 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
Behior omposition s Plnning Plnning Opertors: tomi Gol: desired stte of ffir Finite gme: ompose opertor sequentilly so s to reh the gol Plying strtegy: pln Behior omposition Opertors : ille trnsition systems Gol : trget trnsition system Infinite gme: ompose ille trnsition systems onurrently so s to ply the trget trnsition systems Plying strtegy: omposition ontroller Behior omposition Gien: - set of ille ehiors B 1,,B n - trget ehior 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 oer time Behior omposition: synthesis of the ontroller 4
5 Exmple,2,3,2,1,1,2,1,1,2,2,3,2,3,3,2,2 5 Exmple,2,3,2,1,1,2,1,1,2,2,3,2,3,3,2,2
5 Exmple,2,3,2,1,1,2,1,1,2,2,3,2,3,3,2,2 5 Exmple,2,3,2,1,1,2,1,1,2,2,3,2,3,3,2,2
5 Exmple,2,3,2,1,1,2,1,1,2,2,3,2,3,3,2,2 5 Exmple,2,3,2,1,1,2,1,1,2,2,3,2,3,3,2,2
6 Exmple,2,3,2,1,1,2,1,1,2,2,3,2,3,3,2,2 6 Exmple,2,3,2,1,1,2,1,1,2,2,3,2,3,3,2,2
6 Exmple,2,3,2,1,1,2,1,1,2,2,3,2,3,3,2,2 6 Exmple,2,3,2,1,1,2,1,1,2,2,3,2,3,3,2,2
6 Exmple,2,3,2,1,1,2,1,1,2,2,3,2,3,3,2,2 6 Exmple,2,3,2,1,1,2,1,1,2,2,3,2,3,3,2,2
7 Exmple,2,3,2,1,1,2,1,1,2,2,3,2,3,3,2,2 7 Exmple,2,3,2,1,1,2,1,1,2,2,3,2,3,3,2,2
7 Exmple,2,3,2,1,1,2,1,1,2,2,3,2,3,3,2,2 7 Exmple,2,3,2,1,1,2,1,1,2,2,3,2,3,3,2,2
7 Exmple,2,3,2,1,1,2,1,1,2,2,3,2,3,3,2,2 7 Exmple,2,3,2,1,1,2,1,1,2,2,3,2,3,3,2,2
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 ehiors 8 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 ehiors 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 Gien 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 (,..,sn) of C suh tht: (t,,..,sn)! R implies tht # si " s i in Bi for ll t " t exists Bi! C s.t. $ si " s i in Bi % (t,,..,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 oindutie definition
Simultion reltion Gien 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 (,..,sn) of C suh tht: (t,,..,sn)! R implies tht # si " s i in Bi for ll t " t exists Bi! C s.t. $ si " s i in Bi % (t,,..,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 oindutie definition Exmple,2,2,3,3,2,2,1,1,1,1,2,3,3,2,2,2 11
Rehility reltion (Plnning) A inry reltion R is rehility-like reltion iff: (s,s)! R if #. s. s " s & (s,s )! R then (s,s )! R A stte sg of trnsition system S is rehle-from stte s0 iff for ll rehility-like reltions R we he (s0, sg)! R. rehle-from is (i) rehility-like reltion itself; (ii) the smllest rehility-like reltion. Rehle-from is indutie definition! Rehility reltion (Plnning) A inry reltion R is rehility-like reltion iff: (s,s)! R if #. s. s " s & (s,s )! R then (s,s )! R A stte sg of trnsition system S is rehle-from stte s0 iff for ll rehility-like reltions R we he (s0, sg)! R. rehle-from is (i) rehility-like reltion itself; (ii) the smllest rehility-like reltion. Rehle-from is indutie definition!
Simultion reltion (ont.) Algorithm Compute (ND-)simultion Input: trget ehior T = <A, ST, t 0,!T, FT> nd (Crt. prod. of) ille ehiors 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,,..,sn) # t " t in T & $ Bi. # s " s in Bi ) # si " s i in Bi & (t,,..s i,..sn) *! R } } return R End Simultion reltion (ont.) Algorithm Compute (ND-)simultion Input: trget ehior T = <A, ST, t 0,!T, FT> nd (Crt. prod. of) ille ehiors 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,,..,sn) # t " t in T & $ Bi. # s " s in Bi ) # si " s i in Bi & (t,,..s i,..sn) *! R } } return R End
Computing omposition i simultion Let S1,...,Sn e the TSs of the ille ehiors. The Aille ehiors TS C = < A, S C, s 0 C,! C, F C > is the synhronous produt of S1,...,Sn where: A is the set of tions SC = S1 (...( Sn sc 0 = (s 0 1,..., s 0 m)! C + S C ( A ( S C is defined s follows: ( (...( sn) " (s 1 (...( s n) iff # i. si " s i!!i $ j"i. s j = sj 14 Using simultion for omposition Gien the lrgest simultion R of T y C, we n uild eery omposition through the ontroller genertor (CG). CG = < A, [1,,n], Sr, sr 0,!, #> with A : the tions shred y the ehiors [1,,n]: the identifiers of the ille ehiors 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,,..,sn, ) = { i Bi n do nd remin in R}! + Sr ( A ( [1,,n] " Sr : the stte trnsition funtion, defined s follows (t,,..,si,..,sn)",i (t,,..,s i,..,sn) iff i! #(t,,..,si,..,sn, ) 15
Exmple,2,2,3,3,2,2,1,1,1,1,2,3,3,2,2,2 16 Exmple 16,3,2,2,3,2,2,1,1 W(,,),2 = {1,2} W(,,) = {2},1,3 W(,,) = {2} W(,,) = {2} W(,,),1 = {3} W(,,) = {1,3} W(,,) = {2} W(,,) = {2} W(,,) = {1} W(,,) = {2} W(,,) = {1,3} W(,,) = {2},3,2,2,2
Results for simultion Thm: Choosing t eh point ny lue in! gies us orret ontroller for the omposition. Thm: Eery ontroller tht is omposition n e otined y hoosing, t eh point, suitle lue 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 ille ehiors. 17 Behior filures Components my eome unexpetedly unille for rious resons. We onsider four kinds of ehior filures: A ehior temporrily freezes; it will eentully resume in the sme stte it ws in; A ehior (or the enironment) unexpetedly nd ritrrily (i.e., without respeting its trnsition reltion) hnges its urrent stte; A ehior dies - it eomes permnently unille. A ded ehior unexpetedly omes lie gin (this is n opportunity more thn filure).
Just-in-time omposition One we he the ontroller genertor...... we n oid hoosing ny prtiulr omposition priori...... nd use diretly! to hoose the ille ehior to whih delegte the next tion. We n e lzy nd mke suh hoie just-in-time, possily dpting retiely to runtime feedk. 19 Retie filure reoery with CG CG lredy soles: Temporry freezing of n ille ehior B i - In priniple: wit for Bi - But with CG: stop seleting Bi until it omes k! - - - Unexpeted ehior (enironment) 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!! 20
Prsimonious filure reoery Algorithm Computing (ND-)simultion - prmetrized ersion 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,,..,sn) # t " t in T & $ Bi. # s " s in Bi ) # si " s i in Bi & (t,,..s i,..sn) *! Q! Rsure } } return Q! Rsure 21 End Prsimonious filure reoery (ont.) Let [1,.., n] = W! F e the ille ehiors. Let R = RW!F e the simulted-y reltion of trget y ehiors W! F. Then the following hold: RW "!W(RW!F) -!W(RW!F) is not simultion in generl - Behiors F die: ompute RW with Rrw =!W(RW!F)! RW " F " RW!F - RW " F is simultion of trget y ehiors W! F - Ded ehiors F ome k: ompute RW!F with Rsure = RW " F! 22
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 i simultion. Also LTL-sed syntesis tools, like TLV, n e used for (indiretly) omputing omposition i simultion [Ptrizi PhD08] We re urrently foussing on the seond pproh. 23 Behior omposition: n infinite gme. Simultion sed omposition tehniques llow for filure tolerne! It relies on ontroller genertor: kind of stteful uniersl pln genertor for omposition. Full oserility of ille ehior sttes is ruil for CG to work properly. But... Prtil oserility ddressle y mnipulting knowledge sttes! [work in progress] Conlusion All tehniques re for finite sttes. Wht out deling with infinite sttes? Very diffiult, ut lso ruil when mixing proesses nd dt! 24