HAL Id: hal-00339740
https://hal.archives-ouvertes.fr/hal-00339740
Submitted on 25 Nov 2008
HAL
is a multi-disciplinary open access archive for the deposit and dissemination of sci- entific research documents, whether they are pub- lished or not. The documents may come from teaching and research institutions in France or
L’archive ouverte pluridisciplinaire
HAL, estdestinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des établissements d’enseignement et de recherche français ou étrangers, des laboratoires
From asynchronous to synchronous specification for distributed program synthesis
Julien Bernet, David Janin
To cite this version:
Julien Bernet, David Janin. From asynchronous to synchronous specification for distributed program
synthesis. SOFSEM, Jan 2008, Slovakia. pp.161-173. �hal-00339740�
Speiations for Distributed Program Synthesis
JulienBernetandDavid Janin
LaBRI,UniversitédeBordeauxI
351,oursdelaLibération
33405TaleneedexFRANCE
{bernet|janin}labri.fr
Abstrat. Distributed games[7℄ allowthe speiation ofvariousdis-
tributed program synthesis problems. In suh games, a team of Pro-
essplayersompeteagainstauniqueEnvironmentplayer,eahProess
playingonitsownarena,withoutexpliitommuniationswithitsteam-
mates.
Thestandarddenitionofdistributedgamesallowssomedegreeofasyn-
hrony :theEnvironmentanplayonlyonpartofthearenas,therefore
onealingtosomeProessplayersthattheplayisgoingon.Whilethis
is onvenient for modeling distributed problems(espeially those that
themselvesmakeuseofasynhrony),thesegamesare bynomeanseasy
tomanipulate,andtheexistingonstrutionsaremuhmoretedious.
In this paper, we provide a uniform redution of any nite state dis-
tributedgame,synhronousorasynhronous,toasynhronous onewith
thesamenumberofplayers.Thisredutionisshowntobeorretinthe
sensethat it preservestheexistene of nitestate distributed winning
strategiesfor theteamofProesses. Itisuniforminthesensethatitis
designedfor arbitraryinputdistributed gamewithout any priorknowl-
edge aboutitssatisability.Thesizeoftheresultingsynhronousgame
isalsolinearinthesizeoftheoriginalasynhronousoneand,moreover,
thereisnoblowup ofthe sizeof thewinningstrategies. Additionalex-
petedpreservationproperties(e.g.informationows)are studied.Sur-
prisingly, it seems that nosuh redution exists for arbitrary (innite
state)strategies.
Introdution
Asynhronyin adistributed environmentanbedened in anabstrat way as
theabilityofsomeproessesoragentstoperformsomeationinthedistributed
systemswhileotherproessesoragentsnotonlyperformnoationbutareeven
not aware that they are staying idle. In other words, in a model where every
event in a proess (e.g. a loal ation or an inomingor outgoing message)is
triggeredbythetikofaloallok,asynhronyourswhenthereisnoglobal
lokonwhihloalloksaresynhronized.
However,if thememory of adistributed systemhas nitely many possible
states,itisommonlyunderstoodthatsynhronousandasynhronousbehaviors
eventsbetweenanytwosynhronousevents anbe bounded bythe numberof
globalstates.Morepreisely,the(presumablyasynhronous)distributedsystem
anbemodeled(atamoreabstratlevel)byanequivalentsynhronousone.
For instane, within a distributed system with an asynhronous message
passing mehanism, if the number of messages that have been sent but not
yet reeived is bounded, there annot be an unbounded number of (relevant)
asynhronouseventsbetweenanytwosynhronizations.
Of ourse asynhrony makes a dierene at the implementation level. For
instaneommuniationprotoolsdohavetoopewithasynhronytobeorret.
However,atsomemoreabstrat level,provided theglobalmemoryofasystem
is nite, it seems that,in some sense,asynhronous and synhronous systems
havethesameomputationalpower.
Themain objetiveofthispaperisto substantiatethisintuition.Morepre-
isely,inthesettingofdistributedprogramsynthesisproblem,weaimatproving
that(1)whenthedistributedenvironmentisnitestateand(2)whenoneon-
sidersonly nitestateprograms, anysynhronousorasynhronousdistributed
programsynthesisproblem is equivalentto asynhronousdistributed program
synthesisproblem.
Animmediate diultyforthis taskishowevertondtheappropriatefor-
malism.
Infat,there exists plentyof models of distributed systemsand behaviors;
onsider for instane the diversity of models of ommuniations between pro-
essesoragents:fromommuniationviaglobalsharedmemorymehanismsto
manytypesofmessagepassingsystems.Fordistributedprogramsynthesisspe-
iation,whereonenotonlyaimsatmodelingasinglebehaviorbut afulllass
of behaviors that may, or may not, fulll the design objetives, there may be
evenmoreformalisms.SeeforinstanePnueliandRosner'snotionofdistributed
arhiteture[10,4℄orWonham etal.'sdistributedontrol theory[5,6℄.
Inthispaper,wehoosetostudytherelationshipbetweensynhronousand
asynhronousdistributed synthesisproblemsinafairlyabstratthoughgeneral
model: themodelofdistributedgames[7℄.
Thesegames,designedafterPetersonandReif'spartialinformationgames[9℄,
relyon anexpliit modeling ofthe loal information- projetionofthe global
state-available toeveryagent(orproess)forguiding itsownbehaviors.Asa
matteroffat,noexpliitommuniationismodeled,heneforthnoommitment
has to be done in favor of suh or suh ommuniationmehanism.Moreover,
mostdistributedsynthesisproblemanbeenodedandsolvedwithindistributed
gamesproblem[2,7℄.
Inadistributed game, ateam of Proessplayersompete againstaunique
Environmentplayer,eahProessplayingonitsownarena-withitsownproje-
tionoftheglobalstateofthesystem-whileEnvironmentplayerhasaomplete
knowledgeoftheglobalstate.
Communiations are impliitly modeled as follows. In a distributed game
denition, one may restrit Environment player. From a given global state -
to reah someglobalstateswith moreinformativeloal projetionsthan other
globalstates.
Asynhrony,that indues anextra layerof partial information -absene of
globallok-ismodeledasfollows:inadistributedgame,theEnvironmentmay
playonlyonpartofthearenas,thereforeonealingtosomeProessplayersthat
theplayisgoingonelsewhere.
Inthispaperweprovethat, asfar asnitesystemsand programsare on-
erned,asynhronydoesnotyieldextraexpressivepower.
Morepreisely,weprovidearedutionof anyasynhronousnite statedis-
tributed game to a synhronous one with the same number of players. This
redutionisshowntobeorretinthesensethatitpreservestheexisteneof-
nitestatedistributedwinningstrategiesfortheteamofProesses.Thesizeofthe
resultingsynhronousgameisalsolinearinthesizeoftheoriginalasynhronous
oneand,moreover,thereisnoblowupofthesizeofthewinningstrategies.Addi-
tionalexpetedpreservationproperties(e.g.informationows)arealsostudied.
For strategies with unbounded memory, it is onjetured that there is no
suh a redution. Still; onemay ask whether suh a result ould be extended
to moregenerallassesofprogramswithinnitememorysuh as,forinstane,
pushdownstrategies.Thisremainsanopenproblem.However,evendeidability
questionsare yetnotsettledforthesemoregeneralstrategies.
1 Notations
ForanynitealphabetA,aword overAisafuntionw:N→Awhosedomain
isaninitialsegmentofN.Theonlywordsuhwithemptydomainisalledthe emptyword,anddenotedbyǫ.
Thefollowingnotations are used : A∗ is theset of nite words(i.e. whose
domainis nite)overA, Aω istheset ofinnitewordsoverA, A∞=A∗∪Aω
is the set of niteand innite words overA, andA+ =A∗− {ǫ} is the set of
nitenon-emptywordsoverA.
Foranynite wordw, itslength |w| is theardinal ofits domain. Forany
wordsu∈ A∗ and v ∈Aω, thewordu·v is theonatenation ofwordsuand v.Foranyintegerk,theworduk isbuiltbyonatenatingkopiesofu.When u6=ǫ,theinniteworduωistheinniteonatenationofuwithitself.
Theseoperationsareextendedtothelanguages.GivenX ⊆A∗andY ⊆A∞,
weusethenotationsX·Y ={u·v : u∈X, v∈Y},X0={ǫ},Xk ={w·u : w∈Xk−1, u∈X}foranyk >0,X∗=S
k≥0Xk and,whenǫ /∈X,Xω forthe
set of all wordsthat an be dened asaninnite produt ofwordsof X. The
followingadditionalnotationsarealso used :X+Y =X∪Y, X−Y =X\Y
andX?={ǫ} ∪X.
Givennsets X1, . . . , Xn,onsider theirdiretprodutX =X1× · · · ×Xn.
For every set I = {i1, . . . , ik} ⊆ {1, . . . , n}, onsider the natural projetion πI : X → Xi1 × · · · ×Xik dened by πI((x1, . . . , xk) = (xi1, . . . , xik). For any x∈X,wealsousethemoreonvenientnotationx[I] =πI(x).
Followingthesameidea,for anyset Y ⊆X, denotebyY[I] theset πI(Y).
If R ⊆ Xm is a m-ary relation over X, we should also write use R[I] = {(x1[I], . . . , xm[I]) : (x1, . . . , xm)∈R}.WhenIinanintervalofintegersofthe
form[i, j]weusethenotationsx[i, j], Y[i, j], R[i, j].WheneverIisreduedtoa
singleintegeri,these notationssimplify tox[i], Y[i], R[i].
Moreover, these notations are extended to words and languages : for any
wordw=x0·x1· · · ∈X∞,thenw[I] =x0[I]·x1[I]· · ·.
2 Distributed games
An-proessdistributedarenaisagamearenabuiltfromsomeprodutofnloal
standardgamearena.
Denition. GivennarenasGi =hPi, Ei, TP,i, TE,iifori∈[1, n]with disjoint
sets of Proess position Pi, sets of Environment position Ei, sets of Proess
moves TP,i ⊆ Pi×Ei and sets of Environment moves TE,i ⊆ Ei ×Pi, an n-
Proess distributed game arena builtfrom theloal game arenas {Gi}i∈[1,n] is
anygamearenaG=hP, E, TP, TEisuhthat:
Environmentpositions:E=Q
i∈[1,n]Ei,
Proesses positions :P =Q
i∈[1,n](Ei∪Pi)−Q
i∈[1,n]Ei,
Proesses moves : TP is the set ofall pairs(p, e)∈ (P×E)suh that,for i∈[1, n]:
• eitherp[i]∈Pi and(p[i], e[i])∈TP,i (Proessi isativeinp),
• orp[i]∈Ei andp[i] =e[i](Proessiisinativein p),
andEnvironmentmoves:TE issome subsetoftheset ofallpairs(e, p)∈ (E×P)suhthat,fori∈[1, n]:
• eitherp[i]∈Pi and(e[i], p[i])∈TP,i(EnvironmentativatesProessi),
• orp[i]∈Ei andp[i] =e[i](EnvironmentkeepsProessiinative).
WhenthesetTEofEnvironmentmovesismaximal,weallsuhanarenathefree asynhronousprodutofarenas{Gi}i∈[1,n]anditiswrittenG1⊗G2⊗ · · · ⊗Gn.
Remark. The essential idea behind this denition is to get a denition of
a multiplayer game in whih a team of Proesses ompete against a unique
Environmentto ahievesomeinnitary goal. Thefollowing point isimportant
: thisdenition allowstheEnvironmentto playonlyonasubsetofthearenas,
therefore hidingthat the play is going on to theProesses on whih arenas it
doesnotplay.Thiswill bereferredin thefollowingasasynhronousmove,and
allowstoenodeneatlymanydistributedsynthesisproblemsfromtheliterature,
suhas[10,4℄or[5℄.
Indistributed games, asynhronyours when Environment playerdeides
to keeponeormoreProess playersinative.A synhronousdistributed arena
anthusbedenedasfollows.
Denition. Ann-proessdistributedarenaG=hP, E, TP, TEiisasynhronous
distributedarena whenTE⊆E×Q
i∈[1,n]P[i].
Sineadistributedarenaisbuiltuponnsimplearenas,weneedadenition
tospeakaboutitsloalomponents:
Denition. Given a distributed arena G = hP, E, TP, TEi as above, given a
non empty set I⊆[1, . . . , n] wedene theanonial projetion G[I] of GonI
asthearenaG[I] =hP′, E′, TP′, TE′igivenby:P′ =P[I]−E[I](possiblysmaller
thanP[I]!),E′=E[I],TP′ =TP[I]∩(P′×E′),andTE′ =TE[I]∩(E′×P′).
A distributed game arena is, at rst sight, a partiular ase of standard
disrete and turn base two player game arena. Standard notions of plays and
strategiesarestilldened.However,in ordertoavoidonfusionwithwhat may
happenintheloalarenaadistributed gameisbuild upon,weshallspeaknow
ofaglobalplayandglobalandloalstrategy.Partialinformationisthenaptured
bymeansofthenotionofloalview of play anddistributedstrategy.
Denition. Given an n-proess distributed arena G, a global play from an
initial position e ∈ E is dened as a path in G (seen as a bipartite graph)
emanatingfrompositionethatisbuiltalternativelybytheEnvironmentplayer andtheProessteam.
Morepreisely, from aurrentposition x∈ P ∪E, either x ∈ E and it is
Environment player turn to play by hoosing some position y ∈ P suh that (x, y) ∈ TE or x ∈ P and it is Proess team turn to play by hoosing some
positiony∈E suhthat(x, y)∈TP.
Aordingly,aglobal strategy fortheProessteam isapartial funtion σ : (E.P)+ → E suh that for every play of the form w.p ∈ dom(σ) with w ∈ E.(P.E)∗ andp∈P onehas(p, σ(w.p))∈TP.
A play w is said ompatible with strategy σ when, for everyintegern ≥0
suhthat w[n]∈P onehasw[n+ 1] =σ(w[0, n]) wherew[0, n] isthe prexof woflengthn+ 1.
Denition. A gameG=hP, E, TE, TP, e0,Wiis agame arenahP, E, TE, TPi
equipped with an extra initial position e0 ∈ E and a distinguished set W ⊆ (E+P)ωalled innitaryonditionfortheProessteam.
Wesaythatglobalstrategyσisawinningstrategy fortheProessteamfrom
positione0∈E withonditionW wheneverymaximalplaysstartingine0 and
ompatible withstrategyσiseither niteandendsin anenvironmentposition or isinniteandbelongstoW.
Astrategywith nitememory fortheProessteamisgivenasatupleM= hM, m0, µ: M ×(P∪E) → M, h: M ×P → Ei, where M is a nite set of
memory states, m0 is the initial memory, µ is the update funtion, and h is
the hint funtion.The indued strategy σM : (E·P)+ → E is then dened,
foranyplayw·p∈(E·P)+,byσM=h(µ∗(m0, w), p)(whereµ∗ is denedby µ∗(m, ǫ) =m,andµ∗(m, w·x) =µ(µ∗(m, w), x)foreverym∈M,w∈(E∪P)∗, x∈(E∪P)).
In distributed games, it is intended that, within the Proess team, every
proesshasonlyapartialviewofaglobalplay.Notonlyeveryproessonlysees
itsownprojetionofeveryglobalpositions,but,whenidle,aproessisevennot
awarethat theplayisgoingon.Thisintentionisformallydenedasfollows.
Denition. Theloalview Proessihasofaglobalplayinadistributedgame
G is givenby the map viewi : (E·P)∗·E? → (Ei·Pi)∗·Ei? dened in the
followingway:
viewi(ǫ) =ǫ
viewi(x) =x[i]
viewi(w·x·y) =
viewi(w·x)ifx[i] =y[i]
viewi(w·x)·y[i]otherwise.
A play w ∈ (E·P)+ is said to be ative for Proess i when w ends in a
positionp∈P suhthat p[i]∈P[i].
Remark. Observe that in a synhronousdistributed arena, asexpeted, for
every play w ∈ (E.P)∗.E? one has viewi(w) = w[i], i.e. the loal view of a
globalplayis justtheprojetionofthisplay.
Denition. A globalstrategy σfor theProess teamis adistributedstrategy when,foreveryi∈[1, n],thereisaproessstrategyσi : (E[i].P[i])+→E[i]in
the loalgame G[i], from nowonalled loal strategy forProess i, suhthat,
foranyplayoftheform w·p∈(E·P)+, giventhesetI ⊆ {1, . . . , n}of ative
proessesintheglobalProessespositionp,σ(w·p) =eifandonlyif
e[i] =σi(viewi(w)·p[i])fori∈I
e[i] =p[i]fori∈ {1, . . . , n} −I
Inthisase,wewriteσ1⊗σ2⊗ · · · ⊗σn forthedistributedstrategyσ.
Remark. Observethat when Gis synhronous, thedistributed strategy σ= σ1⊗ · · · ⊗σn ansimplybedenedforanyglobalplayw∈(E·P)∗ by:
σ(w) = (σ1(w[1]), . . . , σn(w[n]))
Remark. Globalstrategiesarenotalwaysdistributed.Inpartiular,thereare
distributed games where Proess team has a winning global strategy, but no
winning distributedstrategy.Formoredetails,thereaderanreferto[7℄.
3 From asynhronous game to synhronous game
Weproveherethatevery(asynhronous)distributedgameisequivalentinsome
senseto asynhronousdistributed game.Morepreisely:
Theorem1. There exists a mapping that maps every distributed game G to
existsadistributedgameGe suhthattheProessteamhaveadistributedwinning strategy with nite memory in G if and only if they have one in Ge. Moreover,
game Ge has the same numberof Proess players asgame Gwith only alinear
inreaseofnumberof positions.Moreover,thismappingisdeneduniformlyon
distributedgames, bethemwinning for theproessteamor not.
Theremainingofthissetionisdevotedtotheproofofthisresult.
Let G = hP, E, T, e0,Wi be a n-proesses distributed game. First, we are goingtodesribethesynhronousgameGe,thenwewillshowthatitisequivalent
toGin termsofdistributed strategieswithnitememory.
For any set Ei, dene cEi as an equipotent set, suh that Ei ∩cEi = ∅;
for any e ∈ Ei, denote by ebi its image in cEi. Let Eb = Q
i∈{1,...,n}cEi and let
Pb=Q
i∈{1,...,n}Pbi(i.e.werestrittorelevantproesspositionsinasynhronous
game:proesspositionswhereeveryproessisative).
ConsiderGe=hP ,e E,e T , ee 0,Wif,whosepositionsare:
Pei=Pi ∪ Eci ; Efi=Ei (foralli∈ {1, . . . n})
For any position x ∈ P ∪E, denote by xb the position of Pe obtained by
replaingin eeahomponentfrom Ei withtheirimageinEci ,i.e.:
b x[i] =
dx[i]ifx[i]∈Ei
x[i]ifx[i]∈Pi
The funtion that maps any x ∈ P ∪E to its image xb in Pe is triviallya
bijetion.ThemovesofGearedened asfollows:
TfiP =TiP∪ {(be, e) :e∈Ei}
TfE={(e,p)b ∈Ee×Pe|(e, p)∈TE}
∪ {(e,be) :e∈E}
Thefuntionanel(Ee·P)e ∗→(E·P)∗erasesanyasynhronousmovefroma globalplay:anel(ǫ) =ǫ,anel(w·e·p) =anel(w)·e·p,andanel(w·e·be) =
anel(w)(wherep∈P,e∈E).
This funtion is generalized to innite words by: anel(x0 ·x1 · · · ·) = limi→∞anel(x0· · ·xi)(it is aonverging sequene, in the sense of the prex
topologyoverwords,asdenedforinstanein [8℄).
Thewinning onditionofGe isthendened asfollows:
Wf=anel−1(W) ∪ (Ee·Pe)∗·(E·E)b ω
Remark. Theunderlying bipartitegraphofGisembedded intotheonefrom Ge. The graph of the arena of Ge is atually nothing more than the subgraph
induedbythisembedding,whereoneahpositionoftheenvironmentaloopof
size2hasbeenadded,orrespondingtoatotallyasynhronousmove.Moreover,
thewinning onditionWfisnotmuh moreompliated thanW :amongstthe
usualinnitary winningonditions(reahability,safety,parity,Muller,et....),
onlythesafetyonditioninnotpreservedbythis onstrution.
Lemma1 (From asynhronousto synhronous). Forany distributedand
winningstrategyfortheProessteaminG,thereisawinningdistributedstrategy for the Proess teamin Ge.
TheideaisatuallytoopythisstrategyonGe,ensuringintheproessthat
theProessplayersdonottaketheasynhronousmovesplayedontotheirarena
intoaount.
Foranyi∈ {1, . . . , n},letusdeneafuntionaneli: (fEi·Pei)∗→(Ei·Pi)∗
that erases the loal asynhronous moves: aneli(ǫ) = ǫ, aneli(w·e·p) =