Organization
ProgramCommittee
AndreasAbelGothenburgUniversity,Sweden ChristelBaierTUDresden,Germany
NathalieBertrandInria,France
MikolajBojanczykWarsawUniversity,Poland
UdiBokerInterdisciplinaryCenter(IDC)Herzliya,Israel
LuisCairesUniversidadeNOVAdeLisboa,Portugal
UgoDalLagoUniversityofBologna,Italy
YuxinDengEastChinaNormalUniversity,China
MariangiolaDezani-CiancagliniUniversità diTorino,Italy
IchiroHasuoNationalInstituteofInformatics,Japan
RadhaJagadeesanDePaulUniversity,UK
StefanKieferUniversityofOxford,UK
BarbaraKönigUniversitätDuisburg-Essen,Germany
DavidMonniauxCNRS,VERIMAG,France
AndrzejMurawskiTheUniversityofWarwick,UK
JoelOuaknineMaxPlanckInstituteforSoftwareSystems, Germany
CatusciaPalamidessiInria,France
KirstinPetersTUBerlin,Germany
DamienPousCNRS,ENSLyon,France
Jean-FrancoisRaskinUniversité LibredeBruxelles,Belgium HelmutSeidlTechnicalUniversityofMunich,Germany
AlexandraSilvaUniversityCollegeLondon,UK
AlexSimpsonUniversityofLjubljana,Slovenia
JiriSrbaAalborgUniversity,Denmark
Jean-MarcTalbotAix-MarseilleUniversité,France
ChristineTassonUniversité DenisDiderot,France
KazushigeTeruiKyotoUniversity,Japan
AdditionalReviewers
AlerTubella,Andrea Almagor,Shaull Asada,Kazuyuki Atkey,Robert Bacci,Giorgio Bacci,Giovanni
Bagnol,Marc Baldan,Paolo
Basold,Henning Bavera,Francisco Beffara,Emmanuel Benveniste,Albert
Beohar,Harsh Berardi,Stefano Bertolissi,Clara Berwanger,Dietmar Blondin,Michael Bocchi,Laura
Boreale,Michele Boulmé,Sylvain Bouyer,Patricia Brazdil,Tomas Brotherston,James Brunet,Paul Bruni,Roberto Bucchiarone,Antonio Busatto-Gaston,Damien Bønneland,FrederikM. Cabrera,Benjamin Cadilhac,Michaël Carayol,Arnaud Castellan,Simon Chen,Tzu-Chun Clouston,Ranald Cockx,Jesper Coppo,Mario Corbineau,Pierre Cristescu,Ioana Doumane,Amina Dubut,Jérémy Eberhart,Clovis Emmi,Michael Enea,Constantin Enevoldsen,Søren Enqvist,Sebastian Exibard,Léo Falcone,Ylies Feng,Yuan Figueira,Diego Fijalkow,Nathanaël Fournier,Paulin Fujii,Soichiro Galmiche,Didier Geeraerts,Gilles Genest,Blaise Gorogiannis,Nikos Graham-Lengrand, Stéphane Grellois,Charles Haar,Stefan Haase,Christoph Halfon,Simon Hartmann,Nico Hautem,Quentin
Hirschkoff,Daniel Hirschowitz,Tom Hsu,Justin Huang,Mingzhang Jacobs,Bart Jacquemard,Florent Jansen,Nils Jaskelioff,Mauro Jecker,Ismaël Junges,Sebastian Kakutani,Yoshihiko Kanovich,Max Kaufmann,Isabella Kerjean,Marie King,Andy Klein,Felix Klin,Bartek
Kołodziejczyk,Leszek Kretinsky,Jan Krivine,Jean Kupke,Clemens Kutsia,Temur Küpper,Sebastian Laarman,Alfons Laird,Jim Lanese,Ivan Lang,Frederic Lazic,Ranko Lefaucheux,Engel Leifer,Matthew Lepigre,Rodolphe Letouzey,Pierre Levy,PaulBlain Li,Xin Liang,Hongjin Licata,DanielR. Litak,Tadeusz Lohrey,Markus Lombardy,Sylvain Long,Huan Luttik,Bas López,HugoA. Mackie,Ian Madnani,Khushraj Maggi,FabrizioMaria Mallet,Frederic
Maranget,Luc Markey,Nicolas Martens,Wim Mayr,Richard Mazowiecki,Filip Mikučionis,Marius Milius,Stefan Mio,Matteo Moggi,Eugenio Monmege,Benjamin Muniz,Marco Nestmann,Uwe New,Max Nielsen,Mogens Nolte,Dennis NordvallForsberg, Fredrik Nyman,Ulrik Okudono,Takamasa Orchard,Dominic Oualhadj,Youssouf Padovani,Luca Panangaden,Prakash Pang,Jun Pavlovic,Dusko Perez,Guillermo Pitts,Andrew Plump,Detlef Pouly,Amaury Power,John Pruekprasert,Sasinee Ramsay,Steven Regnier,Laurent Rehak,Vojtech Roggenbach,Markus Rot,Jurriaan SacerdotiCoen,Claudio Sammartino,Matteo Sankur,Ocan Saurin,Alexis Schalk,Andrea Scherer,Gabriel Schmidt-Schauß,Manfred Selinger,Peter Shirmohammadi,Mahsa Sickert,Salomon
XOrganization
Sighireanu,Mihaela Sistla,A.Prasad Sojakova,Kristina Soloviev,Sergei Sozeau,Matthieu Sprunger,David Strassburger,Lutz Tang,Qiyi TorresVieira,Hugo Tsuiki,Hideki Tsukada,Takeshi
Turrini,Andrea Tzevelekos,Nikos Valencia,Frank Valiron,Benoît vanDitmarsch,Hans Varacca,Daniele Vial,Pierre Vicary,Jamie Vijayaraghavan, Muralidaran Villevalois,Didier
Waga,Masaki Wagner,Christoph Wojtczak,Dominik Wolff,Sebastian Worrell,James Yamada,Akihisa Yang,Pengfei Yoshimizu,Akira Yu,Tingting Zimmermann,Martin
OrganizationXI
Semantics
Non-angelicConcurrentGameSemantics..........................3 SimonCastellan,PierreClairambault,JonathanHayman, andGlynnWinskel
ATraceSemanticsforSystemFParametricPolymorphism.............20 GuilhemJaberandNikosTzevelekos
CategoricalCombinatoricsforNonDeterministicStrategies onSimpleGames..........................................39
ClémentJacqandPaul-André Melliès
ASyntacticViewofComputationalAdequacy......................71 MarcoDevesasCamposandPaulBlainLevy
Linearity
ANewLinearLogicforDeadlock-FreeSession-TypedProcesses.........91 OrnelaDardhaandSimonJ.Gay
ADoubleCategoryTheoreticAnalysisofGradedLinear ExponentialComonads......................................110 Shin-yaKatsumata
DependingonSession-TypedProcesses...........................128 BernardoToninhoandNobukoYoshida
InteroperabilityforMLandaLinearLanguage..............146 GabrielScherer,MaxNew,NickRioux,andAmalAhmed
Concurrency
AutomataforTrueConcurrencyProperties.........................165 PaoloBaldanandTommasoPadoan
ATheoryofEncodingsandExpressiveness(ExtendedAbstract)..........183 RobvanGlabbeek
AFrameworkforParameterizedMonitorability......................203 LucaAceto,AntonisAchilleos,AdrianFrancalanza, andAnnaIngólfsdóttir
Contents
LogicsforBisimulationandDivergence...........................221 XinxinLiu,TingtingYu,andWenhuiZhang
Lambda-CalculiandTypes
Call-by-Need,NeedednessandAllThat...........................241 DeliaKesner,AlejandroRíos,andAndrésViso
Fitch-StyleModalLambdaCalculi..............................258 RanaldClouston
RealizabilityInterpretationandNormalizationofTypedCall-by-Need k-calculuswithControl......................................276 ÉtienneMiqueyandHugoHerbelin
QuotientInductive-InductiveTypes..............................293 ThorstenAltenkirch,PaoloCapriotti,GabeDijkstra,NicolaiKraus, andFredrikNordvallForsberg
CategoryTheoryandQuantumControl
GuardedTracedCategories....................................313 SergeyGoncharovandLutzSchröder
ProperSemiringsandProperConvexFunctors......................331 AnaSokolovaandHaraldWoracek
FromSymmetricPattern-MatchingtoQuantumControl................348 AmrSabry,BenoîtValiron,andJulianaKaizerVizzotto
QuantitativeModels
TheComplexityofGraph-BasedReductionsforReachability inMarkovDecisionProcesses.................................367 StéphaneLeRouxandGuillermoA.Pérez
AHierarchyofSchedulerClassesforStochasticAutomata..............384 PedroR.D’Argenio,MarcusGerhold,ArndHartmanns, andSeanSedwards
SymbolicallyQuantifyingResponseTimeinStochasticModels UsingMomentsandSemirings.................................403 HugoBazille,EricFabre,andBlaiseGenest
ComparatorAutomatainQuantitativeVerification....................420 SugumanBansal,SwaratChaudhuri,andMosheY.Vardi
XIVContents
Non-angelicConcurrentGameSemantics
SimonCastellan1(B) ,PierreClairambault2 ,JonathanHayman3 , andGlynnWinskel3
1 ImperialCollegeLondon,London,UK simon@phis.me
2 UnivLyon,CNRS,ENSdeLyon,UCBLyon1,LIP,Lyon,France
3 ComputerLaboratory,UniversityofCambridge,Cambridge,UK
Abstract. The hiding operation,crucialinthecompositionalaspectof gamesemantics,removescomputationpathsnotleadingtoobservable results.Accordingly,gamesmodelsareusuallybiasedtowards angelic non-determinism:divergingbranchesareforgotten.
Wepresentherenewcategoriesofgames,notsufferingfromthis bias.Inourfirstcategory,weachievethisbyavoidinghidingaltogether; insteadmorphismsare uncovered strategies(withneutralevents)upto weakbisimulation.Then,weshowthatbyhidingonlycertainevents dubbed inessential wecanconsiderstrategiesupto isomorphism,and stillgetacategory–thispartialhidingremainssounduptoweakbisimulation,sowegetaconcreterepresentationsofprograms(asinstandard concurrentgames)whileavoidingtheangelicbias.Thesetechniquesare illustratedwithaninterpretationofaffinenondeterministicPCFwhich isadequateforweakbisimulation;andmay,mustandfairconvergences.
1Introduction
Gamesemanticsrepresentsprogramsasstrategiesfortwoplayergamesdeterminedbythetypes.Traditionally,astrategyissimplyacollectionofexecution traces,eachpresentedasaplay(astructuredsequenceofevents)onthecorrespondinggame.Beyondgivingacompositionalframeworkfortheformalsemanticsofprogramminglanguages,gamesemanticsprovedexceptionallyversatile, providingveryprecise(oftenfullyabstract)modelsofavarietyoflanguagesand programmingfeatures.Oneofitsrightlycelebratedachievementsistherealisationthatcombinationsofcertaineffects,suchasvariousnotionsofstateor control,couldbecharacterisedviacorrespondingconditionsonstrategies(innocence,wellbracketing, ...)inasingleunifyingframework.ThisledAbramskyto proposethe semanticcube programme[1],aimingtoextendthissuccesstofurtherprogrammingfeatures:concurrency,non-determinism,probabilities,etc... However,thiselegantpicturesoonshowedsomelimitations.Whileindeed thebasiccategoryofgameswassuccessfullyextendedtodealwithconcurrency [10, 13],non-determinism[11],andprobabilities[9]amongothers,theseextensions(althoughfullyabstract)areoftenincompatiblewitheachother,andreally, incompatibleaswellwiththecentralconditionofinnocence.Henceasemantic c TheAuthor(s)2018
C.BaierandU.DalLago(Eds.):FOSSACS2018,LNCS10803,pp.3–19,2018. https://doi.org/10.1007/978-3-319-89366-2 1
4S.Castellanetal.
hypercubeencompassingalltheseeffectsremainedoutofreach.Itisonlyrecently thatsomenewprogresshasbeenmadewiththediscoverythatsomeofthese effectscouldbereconciledinamorerefined,moreintensionalgamesframework. Forinstance,in[6, 16]innocenceisreconciledwithnon-determinism,andin[15] withprobabilities.In[7],innocenceisreconciledwithconcurrency.
Butsomethingisstillmissing:theworksabovedealingwithnon-deterministic innocenceconsideronly may-convergence ;theyignoreexecutionbranchesleadingtodivergence.Tosomeextentthisseemstobeafundamentallimitationof thegamesemanticsmethodology:attheheartofthecompositionofstrategies liesthe hiding operationthatremovesunobservableevents.Divergingpaths,by naturenon-observable,areforgottenbyhiding.Somemodelsofmust-testing doexistforparticularlanguages,notablyMcCuskerandHarmer’smodelfor non-deterministicIdealizedAlgol[11];themodelworksbyannotatingstrategies with stoppingtraces,recordingwheretheprogrammaydiverge.Butthisapproachagainmixespoorlywithotherconstructions(notablyinnocence),andmore importantly,istiedtomayandmustequivalences.Itisnotclearhowitcould beextendedtosupportrichernotionsofconvergence,suchas fair-testing [2].
Ouraimistopresentabasisfornon-deterministicgamesemanticswhich, besidesbeingcompatiblewithinnocence,concurrency, etc.,isnotbiasedtowards may-testing;itis non-angelic.Itshouldnotbebiasedtowardsmust-testing either;itshouldinfactbe agnostic withrespecttothetestingequivalence, andsupportthemall.Clearly,forthispurposeitisparamounttorememberthe non-deterministicbranchinginformation;indeedintheabsenceofthatinformation,notionssuchas fair-testing arelost.Infact,therehasbeenalotof activityinthepastfiveyearsorsoaroundgamesmodelthat do observethe branchinginformation.ItisafeatureofHirschowitz’sworkpresentingstrategies aspresheavesorsheavesoncertaincategoriesofcospans[12];ofTsukadaand Ong’sworkonnondeterministicinnocenceviasheaves[16];andofourownline ofworkpresentingstrategiesascertaineventstructures[5, 7, 14].
Butobservingbranchinginformationisnotsufficient.Oftheworksmentioned above,thoseofTsukadaandOngandourownpreviousworkarestillangelic, becausetheyrelyonhidingforcomposition.Ontheotherhand,Hirschowitz’s workgetsclosetoachievingourgoals;byrefrainingfromhidingaltogether, hismodelconstructsanagnosticandpreciserepresentationoftheoperational behaviourofprograms,onwhichhethenconsidersfair-testing.Butbynotconsideringhidinghedepartsfromthepreviousworkandmethodsofgamesemantics,andfromthemethodologyofdenotationalsemantics.Incontrast,wewould likeanagnosticgamesmodelthatstillhasthecategoricalstructureoftraditional semantics.Agamesmodelwithpartialhidingwasalsorecentlyintroducedby Yamada[18],albeitforadifferentpurpose:heusespartialhidingtorepresent normalizationsteps,whereasweuseittorepresentfine-grainednondeterminism.
Contributions. Inthispaper,wepresentthefirstcategoryofgamesandstrategiesequippedtohandlenon-determinism,butagnosticwithrespecttothe notionofconvergence(includingfairconvergence).Weshowcaseourmodel byinterpreting APCF+ ,anaffinevariantofnon-deterministicPCF:itisthe
simplestlanguagefeaturingthephenomenaofinterest.Weshowadequacywith respecttomay,mustandfairconvergences.Thereaderwillfindinthefirst author’sPhDthesis[3]correspondingresultsforfullnon-deterministicPCF (withdetailedproofs),andaninterpretationofahigher-orderlanguagewith sharedmemoryconcurrency.In[3],themodelisprovedcompatiblewithour earliernotionsofinnocence,byestablishingaresultoffullabstractionformay equivalence,fornondeterministicPCF.Wehaveyettoprovefullabstractionin thefairandmustcases;finitedefinabilitydoesnotsufficeanymore.
Outline. WebeginSect. 2 byintroducing APCF+ .Tosetthestage,wedescribe anangelicinterpretationof APCF+ inthecategory CG builtin[14]with strategiesuptoisomorphism,andhintatourtwonewinterpretations.InSect. 3, startingfromtheobservationthatthecauseof“angelism”ishiding,weomitit altogether,constructingan uncovered variantofourconcurrentgames,similar tothatofHirschowitz.Despitenothiding,whenrestrictingthelocationofnondeterministicchoicestointernalevents,wecanstillobtainacategoryupto weak bisimulation.Butweakbisimulationisnotperfect:itdoesnotpreservemusttesting,andisnoteasilycomputed.SoinSect. 4,wereinstatesomehiding:we showthatbyhidingallsynchronisedeventsexceptsomedubbed essential,we arriveatthebestofbothworlds.Wegetanagnosticcategoryofgamesand strategies uptoisomorphism,andweproveouradequacyresults.
2ThreeInterpretationsofAffineNondeterministicPCF
2.1SyntaxofAPCF+
Thelanguage APCF+ extendsaffinePCFwithanondeterministicboolean choice, choice.Itstypesare A,B ::= B | A B ,where A B representsaffine functionsfrom A to B .Thefollowinggrammardescribestermsof APCF+ : M,N ::= x | MN | λx.M | tt | ff | if MN1 N2 | choice |⊥
Typingrulesarestandard,weshowapplicationandconditionals.Asusual, aconditionaleliminatingtoarbitrarytypescanbedefinedassyntacticsugar.
Γ M : A BΔ N : A Γ,Δ MN : B Γ M : B Δ N1 : B Δ N2 : B Γ,Δ if MN1 N2 : B
Thefirstruleis multiplicative : Γ and Δ aredisjoint.Theoperational semanticsisthatofPCFextendedwiththe(only)twonondeterministicrules choice → tt and choice → ff.
2.2GameSemanticsandEventStructures
Gamesemanticsinterpretsanopenprogrambyastrategy,recordingthe behaviouroftheprogram(Player)againstthecontext(Opponent)ina2playergame.Usually,theexecutionsrecordedarerepresentedas plays, i.e. linear
Non-angelicConcurrentGameSemantics5
sequencesofcomputationaleventscalled moves ;astrategybeingthenasetof suchplays.Forinstance,thenondeterministicbooleanwouldberepresentedas the(even-prefixclosureofthe)setofplays {q · tt+ , q · ff+ } onthegamefor booleans.Intheplayq · tt+ ,thecontextstartsthecomputationbyaskingthe valueoftheprogram(q )andtheprogramreplies(tt+ ).Polarityindicatesthe origin(Program(+)orOpponent/Environment( ))oftheevent.
Beingbasedonsequencesofmoves,traditionalgamesemanticshandlesconcurrencyviainterleavings[10].Incontrast,inconcurrentgames[14],playsare generalisedtopartialorderswhichcanexpressconcurrencyasaprimitive.For instance,theexecutionofaparallelimplementationof and againstthecontext (tt, tt)givesthefollowingpartialorder:
Inthispicture,theusualchronologicallinearorderisreplacedbyanexplicit partialorderrepresenting causality.Movesareconcurrentwhentheyareincomparable(asthetwoPlayerquestionshere).Followingthelongstandingconventioningamesemantics,weshowwhichcomponentofthetypeacomputational eventcorrespondstobydisplayingitunderthecorrespondingoccurrenceof agroundtype.Forinstanceinthisdiagram,Opponentfirsttriggersthecomputationbyaskingtheoutputvalue,andthen and concurrentlyevaluateshis twoarguments.Theargumentshavingevaluatedto tt, and canfinallyanswer Opponent’sinitialquestionandprovidetheoutputvalue.
In[7],wehaveshownhowdeterministicpurefunctionalparallelprograms canbeinterpreted(ina fullyabstract way)usingsuchrepresentations.
Partial-OrdersandNon-determinism. Torepresentnondeterminisminthispartialordersetting,onepossibilityistousesetsofpartialorders[4].Thisrepresentationsuffershoweverfromtwodrawbacks:firstlyitforgetsthepointof non-deterministicbranching;secondly,onecannottalkofan occurrence ofa moveindependentlyofanexecution.Thoseissuesaresolvedbymovingto event structures [17],wherethenondeterministicbooleancanberepresentedas:
Thewigglyline( )indicates conflict :thebooleanvaluescannotcoexistinan execution.Togetherthisformsan eventstructure,definedformallylater.
6S.Castellanetal.
B ⇒ B ⇒ B q ✺✉✉✉ ✯❥❥❥❥❥❥❥❥ ( ) q q (+) tt ❚❚❚❚❚❚❚✔ tt ■■✠ ( ) tt (+)
B q ✷ ▲▲▲☞ ( ) tt ff (+)
2.3InterpretationsofAPCF+ withEventStructures
Letusintroduceinformallyourinterpretationsbyshowingwhicheventstructurestheyassociatetocertaintermsof APCF+ .
AngelicCoveredInterpretation. Traditionalgamesemanticsinterpretations ofnondeterminismareangelic(withexceptions,see e.g. [11]);theyonlydescribe whattermsmaydo,andforgetwheretheymightgetstuck.Theinterpretationof M =(λb. if b tt ⊥) choice forinstance,inusualgamesemanticsisthesameas thatof tt.Thisisduetothenatureofcompositionwhichtendstoforgetpaths thatdonotleadtoavalue.Considerthestrategyforthefunction λb. if b tt ⊥:
Theinterpretationof M arisesasthe composition ofthisstrategywith thenondeterministicboolean.Compositionisdefinedintwosteps:interaction (Fig. 1a)andthenhiding(Fig. 1b).Hidingremovesintermediatebehaviourwhich doesnotcorrespondtovisibleactionsintheoutputtypeofthecomposition. Hidingiscrucialinorderforcompositiontosatisfybasiccategoricalproperties(withoutit,theidentitycandidate,copycat,isnotevenidempotent).Strategiesoneventstructuresareusuallyconsidered uptoisomorphism,whichisthe strongestequivalencerelationthatmakessense.Withouthiding,thereisno hopetorecovercategoricallawsuptoisomorphism.However,itturnsoutthat, treatingeventsinthemiddleas τ -transitions(∗ inFig. 1a),weakbisimulation equatesenoughstrategiestogetacategory.Followingtheseideas,acategoryof uncovered strategiesupto weakbisimilarity isbuiltinSect. 3.
Non-angelicConcurrentGameSemantics7
B ⇒ B q ✱❧❧❧❧❧❧ ( ) q ✾②② ❊❊✆ (+) ff tt ❋❋✝ ( ) tt (+)
Fig.1. Threeinterpretationsof(λb. if b tt ⊥) choice
8S.Castellanetal.
InterpretationwithPartialHiding. However,consideringuncoveredstrategiesuptoweakbisimulationblurstheirconcretenature; causalinformation is lost,forinstance.Moreovercheckingforweakbisimilarityiscomputationally expensive,andbecauseoftheabsenceofhiding,atermevaluatingto skip may yieldaverylargerepresentative.However,thereisawaytocutdownthestrategiestoreachacompromisebetweenhiding no internalevents,orhiding all of themandcollapsingtoanangelicinterpretation.
Inourgamesbasedoneventstructures,havinganon-ambiguousnotionofan occurrenceofeventallowsustogiveasimpledefinitionoftheinternaleventswe needtoretain(Definition 9).Hidingotherinternaleventsyieldsastrategystill weaklybisimilartotheoriginal(uncovered)strategy,whileallowingustoget acategory uptoisomorphism.Theinterpretationof M inthissettingappears inFig. 1c.Asbefore,onlytheeventsundertheresulttype(notlabelled ∗)are now visible, i.e. observablebyacontext.Buttheeventscorrespondingtothe argumentevaluationareonlypartiallyhidden;thoseremainingareconsidered internal,treatedlike τ -transitions.Becauseoftheirpresence,thepartialhiding performedlosesnoinformation(w.r.t. theuncoveredinterpretation)uptoweak bisimilarity.Butwehavehiddenenoughsothattherequiredcategoricallaws betweenstrategieshold w.r.t. isomorphism.Themodelismorepreciseandconcretethanthatofweakbisimilarity,preservescausalinformationandpreserves must-convergence(unlikeweakbisimilarity).
Followingtheseideas,acategoryofpartiallycoveredstrategiesuptoiso(the targetofouradequacyresults)isconstructedinSect. 4.
3UncoveredStrategiesuptoWeakBisimulation
Wenowconstructacategoryof“uncoveredstrategies”,uptoweakbisimulation. Uncoveredstrategiesareveryclosetothe partialstrategies of[8],but[8]focused onconnectionswithoperationalsemanticsratherthancategoricalstructure.
3.1PreliminariesonEventStructures
Definition1. An eventstructure isatriple (E, ≤E , ConE ) where (E, ≤E ) is apartial-orderand ConE isanon-emptycollectionoffinitesubsetsof E called consistentsets subjecttothefollowingaxioms:
–If e ∈ E ,theset [e]= {e ∈ E | e ≤ e} isfinite, –Forall e ∈ E ,theset {e} isconsistent, –Forall Y ∈ ConE ,forall X ⊆ Y ,then X ∈ ConE . –If X ∈ ConE and e ≤ e ∈ X then X ∪{e} isconsistent.
Adown-closedsubsetofeventswhosefinitesubsetsareallconsistentiscalled a configuration.Thesetoffiniteconfigurationsof E isdenoted C (E ).If x ∈ C (E )and e ∈ x,wewrite x e −−⊂ x when x = x ∪{e}∈ C (E );thisisthe coveringrelation betweenconfigurations,andwesaythat e givesan extension of x.
Twoextensions e and e of x are compatible when x ∪{e,e }∈ C (E ), incompatible otherwise.Inthelattercase,wehavea minimalconflict between e and e incontext x (written e x e ).
Theseeventstructuresarebasedon consistentsets ratherthanthemore commonly-encounteredbinary conflict relation.Consistentsetsaremoregeneral, andmorehandymathematically,butthroughoutthispaper,eventstructures concretelyrepresentedindiagramswillonlyuse binaryconflict, i.e. therelation e x e doesnotdependon x,meaning e y e whenever y extendswith e, andwith e –inwhichcaseweonlywrite e e .Thenconsistentsetscanbe recoveredasthosefinite X ⊆ E suchthat ¬(e e )forall e,e ∈ X .Our diagramsdisplaytherelation ,alongwiththe Hassediagram of ≤E ,called immediatecausality anddenotedby E .Allthediagramsabovedenote eventstructures.Themissingingredientinmakingthediagramsformalisthe names accompanyingtheevents(q, tt, ff,... ).Thesewillariseasannotations byeventsfrom games,themselveseventstructures,representingthetypes.
The parallelcomposition E0 E1 ofeventstructures E0 and E1 hasfor events ({0}× E0 ) ∪ ({1}× E1 ).The causalorder isgivenby(i,e) ≤E0 E1 (j,e ) when i = j and e ≤Ei e ,and consistentsets bythosefinitesubsetsof E0 E1 thatprojecttoconsistentsetsinboth E0 and E1 .
A (partial)mapofeventstructures f : A B isa(partial)functionon eventswhich (1) mapsanyfiniteconfigurationof A toaconfigurationof B ,and (2) islocallyinjective:for a,a ∈ x ∈ C (A)and fa = fa (bothdefined)then a = a .Wewrite E forthecategoryofeventstructuresandtotalmapsand E⊥ forthecategoryofeventstructuresandpartialmaps.
An eventstructurewithpartialpolarities isaneventstructure A with amap pol : A →{−, +, ∗} (whereeventsarelabelled“negative”,“positive”,or “internal”respectively).Itisa game whennoeventsareinternal.Thedual A⊥ ofagame A isobtainedbyreversingpolarities.Parallelcompositionnaturally extendstogames.If x and y areconfigurationsofaneventstructurewithpartial polaritiesweuse x ⊆p y where p ∈{−, +, ∗} for x ⊆ y & pol (y \ x) ⊆{p}
Givenaneventstructure E andasubset V ⊆ E ofevents,thereisanevent structure E ↓ V whoseeventsare V andcausalityandconsistencyareinherited from E .Thisconstructioniscalledthe projection of E to V andisusedin[14] toperformhidingduringcomposition.
3.2DefinitionofUncoveredPre-strategies
Asin[14],wefirstintroduce pre-strategies andtheircomposition,andthen consider strategies,thosepre-strategieswell-behavedwithrespecttocopycat.
UncoveredPre-strategies. An uncoveredpre-strategy onagame A isa partialmapofeventstructures σ : S A.Eventsinthedomainof σ arecalled visible or external,andeventsoutside invisible or internal.Via σ ,visible eventsinheritpolaritiesfrom A.
Uncoveredpre-strategiesaredrawnjustliketheusualstrategiesof[14]:the eventstructure S hasitseventsdrawnastheirlabellingin A ifdefinedor ∗ if
Non-angelicConcurrentGameSemantics9
10S.Castellanetal.
undefined.ThedrawingofFig. 1aisanexampleofanuncoveredpre-strategy. Froman(uncovered)pre-strategy,onecangetapre-strategyinthesenseof [14]:for σ : S A,define S↓ = S ↓ dom(σ )wheredom(σ )isthedomain of σ .Byrestriction σ yields σ↓ : S↓ → A,calleda coveredpre-strategy.A configuration x of S canbedecomposedasthedisjointunion x↓ ∪ x∗ where x↓ isaconfigurationof S↓ and x∗ asetofinternaleventsof S . Apre-strategy fromagame A toagame B isa(uncovered)pre-strategy on A⊥ B .Animportantpre-strategyfromagame A toitselfisthe copycat pre-strategy.In A⊥ A,eachmoveof A appearstwicewithdualpolarity.The copycatpre-strategy ccA simplywaitsforthenegativeoccurrenceofamove a beforeplayingthepositiveoccurrence.See[5]foraformaldefinition.
Isomorphismofstrategies[14]canbeextendedtouncoveredpre-strategies: Definition2. Pre-strategies σ : S A,τ : T A are isomorphic (written σ ∼ = τ )ifthereisaniso ϕ : S ∼ = T s.t. τ ◦ ϕ = σ (equalityofpartialmaps).
InteractionofPre-strategies. Recallthatinthecoveredcase,composition isperformedfirstbyinteraction,thenhiding;whereinteractionofpre-strategies isdescribedastheirpullbackinthecategoryof totalmaps [14].Eventhough E⊥ haspullbacks,thosepullbacksareinadequatetodescribeinteraction.In[8], uncoveredstrategiesareseenastotalmaps σ : S → A N ,andtheirinteraction asapullbackinvolvingthese.Thismethodhasitsawkwardnessso,instead,here wegiveadirectuniversalconstructionofinteraction,replacingpullbacks.
Westartwiththesimplercaseofa closed interactionofapre-strategy σ : S A againstacounterpre-strategy τ : T A⊥ .Asin[5]wefirstdescribethe expected states oftheclosedinteractionintermsof securedbijections,fromwhich weconstructaneventstructure;beforecharacterisingthewholeconstructionvia auniversalproperty.
Definition3(Securedbijection). Let q, q bepartialordersand ϕ : q q beabijectionbetweenthecarriersets(nonnecessarilyorder-preserving).Itis secured whenthefollowingrelation ϕ onthegraphof ϕ isacyclic: (s,ϕ(s)) ϕ (s ,ϕ(s )) iff s q s ∨ ϕ(s) q ϕ
Ifso,theresultingpartialorder ( ϕ )∗ iswritten ≤ϕ .
)(1)
Let σ : S A and τ : T A bepartialmapsofeventstructures(we droppedpolarities,astheconstructioniscompletelyindependentofthem).A pair(x,y ) ∈ C (S ) × C (T )suchthat σ↓ x = τ↓ y ∈ C (A),inducesabijection
ϕx,y : x y∗ x ∗ y definedbylocalinjectivityof σ and τ :
ϕx,y (0,s)=(0,s)(s ∈ x ∗ )
ϕx,y (0,s)=(1,τ 1 (σs))(s ∈ x↓ )
ϕx,y (1,t)=(1,t)
Theconfigurations x and y haveapartialorderinheritedfrom S and T Viewing y∗ and x ∗ asdiscreteorders(theorderingrelationistheequality), ϕx,y
s
(
isabijectionbetweencarriersetsofpartialorders.An interactionstate of σ and τ is(x,y ) ∈ C (S ) × C (T )with σ↓ x = τ↓ y forwhich ϕx,y issecured.Asa result(thegraphof) ϕx,y isnaturallypartialordered.Write Sσ,τ forthesetof interactionstatesof σ and τ .Asusual[5],wecanrecoveraneventstructure:
Definition4(Closedinteractionofuncoveredpre-strategies). Let A be aneventstructure,and σ : S A and τ : T A bepartialmapsofevent structures.Thefollowingdatadefinesaneventstructure S ∧ T : – events: thoseinteractionstates (x,y ) suchthat ϕx,y hasatopelement, – causality:(x,y ) ≤S ∧T (x ,y ) iff x ⊆ x and y ⊆ y , – consistency: afinitesetofinteractionstates X ⊆ S ∧ T isconsistentiffits union X isaninteractionstatein Sσ,τ .
Thiseventstructurecomeswithpartialmaps Π1 : S ∧T S and Π2 : S ∧T T , analogoustotheusualprojectionsofapullback:for(x,y ) ∈ S ∧ T , Π1 (x,y ) isdefinedto s ∈ S wheneverthetop-elementof ϕx,y is((0,s),w2 )forsome w2 ∈ x ∗ y .Themap Π1 isundefinedonlyoneventsof S ∧ T correspondingto internaleventsof T (i.e. (x,y )withtopelementof ϕx,y oftheform((1,t), (1,t))). Themap Π2 isdefinedsymmetrically,andundefinedoneventscorrespondingto internaleventsof S .Wewrite σ ∧ τ for
2 : S ∧ T A
Lemma1. Let σ : S A and τ : T A bepartialmaps.Let (X,f : X S,g : X T ) beatriplesuchthatthefollowingoutersquarecommutes:
Ifforall p ∈ X with fp and gp defined, σ (fp)= τ (gp) isdefined,thenthere existsaunique f,g : X S ∧ T makingthetwouppertrianglescommute.
Fromthisclosedinteraction,wedefinetheopeninteractionasin[14].Given twopre-strategies σ : S → A⊥ B and τ : T → B ⊥ C ,theirinteraction τ σ :(S C ) ∧ (A T ) A⊥ C
isdefinedasthecompositepartialmap(S C ) ∧ (A T ) A B C A C , wherethe“pullback”isfirstcomputedignoringpolarities–thecodomainofthe resultingpartialmapis A⊥ C ,oncewereinstatepolarities.
Non-angelicConcurrentGameSemantics11
σ ◦ Π1
τ ◦ Π
=
X SS ∧ TT A f,g f g σ Π2 Π1 σ ∧τ τ
12S.Castellanetal.
WeakBisimulation. Tocompareuncoveredpre-strategies,wecannotuseisomorphismsasin[14],sinceashintedearlier, ccA σ comprisessynchronised eventsnotcorrespondingtothosein σ .Tosolvethis,weintroduceweakbisimulationbetweenuncoveredstrategies:
Definition5. Let σ : S A and τ : T A beuncoveredpre-strategies.A weakbisimulationbetween σ and τ isarelation R ⊆ C (S ) × C (T ) containing (∅, ∅),suchthatforall x R y ,wehave:
–If x s −−⊂ x suchthat s isvisible,thenthereexists y ⊆∗ y t −−⊂ y with σs = τt and x R y (andthesymmetricconditionfor τ )
–If x s −−⊂ x suchthat s isinternal,thenthereexists y ⊆∗ y suchthat x R y (andthesymmetricconditionfor τ )
Twouncoveredpre-strategies σ,τ areweaklybisimilar(written σ τ )when thereisaweakbisimulationbetweenthem.
Associativityofinteraction(uptoisomorphism,henceuptoweakbisimulation)followsdirectlyfromLemma 1.Moreover,itisstraightforwardtocheck thatweakbisimulationisacongruence(i.e. compatiblewithcomposition).
CompositionofCoveredStrategies. Frominteraction,wecaneasilydefine thecompositionofcoveredstrategies.If σ : S → A⊥ B and τ : T → B ⊥ C arecoveredpre-strategies,theircomposition(inthesenseof[14]) τ σ isdefined as(τ σ )↓ .Theoperation ↓ iswell-behavedwithrespecttointeraction:
Lemma2. For σ,τ composablepre-strategies, (τ σ )↓ ∼ = τ↓ σ↓ .
3.3ACompact-ClosedCategoryofUncoveredStrategies
Althoughwehaveanotionofmorphism(pre-strategies)betweengamesand anassociativecomposition,wedonothaveacategoryuptoweakbisimulation yet.Unlikein[14],racesinagamemaycausecopycatonthisgametonotbe idempotent(see[3]foracounterexample),whichisnecessaryforittobean identity.Toensurethat,werestrictourselvesto race-free games:thosesuch thatwheneveraconfiguration x canbeextendedby a1 ,a2 ofdistinctpolarities, theunion x ∪{a1 ,a2 } isconsistent.Fromnowon,gamesareassumedrace-free.
Lemma3. Forarace-freegame A, ccA ccA ccA .
Proof. ItwillfollowfromtheforthcomingLemma 4
UncoveredStrategies. Finally,wecharacterisethepre-strategiesinvariant undercompositionwithcopycat.Thetwoingredientsof[5, 14],receptivityand courtesy(called innocence in[14])areneeded,butthisisnotenough:weneed anotherconditionaswitnessedbythefollowingexample.
Considerthestrategy σ : ⊕1 ⊕2 onthegame A = ⊕1 ⊕2 playingnondeterministicallyoneofthetwomoves.Thentheinteraction ccA σ is:
Itisnotweaklybisimilarto σ : ccA σ cando ∗1 ,aninternaltransition,to which σ canonlyrespondbynotdoinganything.Then σ canstilldo ⊕1 and ⊕2 whereas ccA σ cannot:itiscommittedtodoing ⊕1 .Tosolvethisproblem, weneedtoforcestrategiestodecidetheirnondeterministicchoices secretly,by meansofinternalevents–so σ willnotbeavaliduncoveredstrategy,but ccA σ will.Indeed, ccA ( ccA σ )belowisindeedweaklybisimilarto ccA σ .
Definition6. An(uncovered)strategyisapre-strategy σ : S A satisfying: – receptivity: if x ∈ C (S ) issuchthat σx a −−⊂ with a ∈ A negative,thenthere existsaunique x s −−⊂ with σs = a – courtesy: if s s and s ispositiveor s isnegative,then σs σs . – secrecy: if x ∈ C (S ) extendswith s1 ,s2 but x ∪{s1 ,s2 } ∈ C (S ),then s1 and s2 areeitherbothnegative,orbothinternal.
Receptivityandcourtesyarestatedexactlyasin[14].Asaresult,hidingthe internaleventsofanuncoveredstrategyyieldsastrategy σ↓ inthesenseof[14].
Foranygame A, ccA isanuncoveredstrategy:itsatisfiessecrecyasitsonly minimalconflictsareinheritedfromthegameandarebetweennegativeevents.
TheCategoryCG . Ourdefinitionofuncoveredstrategydoesimplythat copycatisneutralforcomposition.
Lemma4. Let σ : S A beanuncoveredstrategy.Then ccA σ σ Theresultfollowsimmediately:
Theorem1. Race-freegamesanduncoveredstrategiesuptoweakbisimulation formacompact-closedcategory CG .
3.4InterpretationofAffineNondeterministicPCF
Fromnowon,strategiesarebydefaultconsidereduncovered.Wesketchthe interpretationof APCF+ inside CG .Asacompact-closedcategory, CG supportsaninterpretationofthelinear λ-calculus.However,theemptygame1 isnotterminal,astherearenonaturaltransformation A : A → 1in CG .
ThenegativecategoryCG .Wesolvethisissueasin[4],bylookingat negativestrategiesandnegativegames.
Non-angelicConcurrentGameSemantics13
14S.Castellanetal.
Definition7. Aneventstructurewithpartialpolaritiesis negative whenall itsminimaleventsarenegative.
Astrategy σ : S A isnegativewhen S is.Copycatonanegativegameis negative,andnegativestrategiesarestableundercomposition:
Lemma5. Thereisasubcategory CG of CG consistinginnegativeracefreegamesandnegativestrategies.Itinheritsamonoidalstructurefrom CG in whichtheunit(theemptygame)isterminal.
Moreover, CG hasproducts.The product A & B oftwogames A and B ,hasevents,causality,polaritiesasfor A B ,butconsistentsetsrestricted tothoseoftheform {0}× X or {1}× X with X consistentin A or B .The projections are A :CCA → (A & B )⊥ A,and B :CCB → (A & B )⊥ B
Finally,the pairing ofnegativestrategies σ : S A⊥ B and τ : T → A⊥ C istheobviousmap σ,τ : S & T A⊥ B & C ,andthelawsforthe cartesianproductaredirectverifications.
Wealsoneedaconstructiontointerpretthefunctionspace.However,for A and B negative, A⊥ B isnotusuallynegative.Tocircumventthis,weintroduce anegativevariant A B ,thelineararrow.Tosimplifythepresentation,we onlydefineitinaspecialcase.Agameis well-opened whenithasatmost oneinitialevent.When B iswell-opened,wedefine A B tobe1if B =1; andotherwise A⊥ B withtheexceptionthateverymovein A dependsonthe singleminimalmovein B .Asaresult preservesnegativity.Weget:
Lemma6. If B iswell-opened, A B iswell-openedandisanexponential objectof A and B
Inotherwords,well-openedgamesareanexponentialidealin CG .Weinterpret typesof APCF+ insidewell-openedgamesof CG :
B = A B
done+
InterpretationofTerms. Interpretationoftheaffine λ-calculusin CG followsstandardmethods.First,theprimitives tt, ff, ⊥, if areinterpretedas:
com
B
q ❈✄✄ ❀❀④
A
= run
=
tt+ ff+
Anon-standardpointistheinterpretationof ⊥:usuallyinterpretedingame semanticsbytheminimalstrategysimplyplaying q (aswillbedoneinthenext section),ourinterpretationherereflectsthefactthat ⊥ representsaninfinite computationthatneverreturns.Conditionalsareimplementedasusual:
if MNN = if ( M N , N )
SoundnessandAdequacy. Wenowproveadequacyforvariousnotionsof convergence.First,webuildanuncoveredstrategyfromtheoperationalsemantics.
Definition8(Theoperationaltree). Let M beaclosedtermoftype B.We definethepre-strategy t(M ) on B asfollows:
Events: Aninitialevent ⊥ plusoneeventperderivation M →∗ M
Causality: ⊥ isbelowotherevents,andderivationsareorderedbyprefix
Consistency: Asetofeventsisconsistentwhenitseventsarecomparable.
Labelling: ⊥ haslabelq,aderivation M →∗ b where b ∈{tt, ff} islabelledby b.Otherderivationsareinternal.
Asaresult, t(M )isatree.Ourmainresultofadequacycannowbestated:
Theorem2. Foraterm M : B, t(if M ttff) and M areweaklybisimilar.
Weneedtoconsider t(if M ttff)andnotsimply t(M )toensuresecrecy. Fromthistheorem,adequacyresultsformayandfairconvergencesarise:
Corollary1. Foranyterm M : B,wehave:
May: M →∗ tt ifandonlyif M containsapositivemove
Fair: Forall M →∗ M , M canconverge,ifandonlyifallfiniteconfigurations of M canbeextendedtocontainapositivemove.
However,wecannotconcludeadequacyformustequivalencefromTheorem 2. Indeed,mustconvergenceisnotgenerallystableunderweakbisimilarity:for instance,(thestrategiesrepresenting) tt andY(λx. ifchoicett x)areweakly bisimilarbutthelatterisnotmustconvergent.Toaddressthisinthenextsection wewillrefinetheinterpretationtoobtainacloserconnectionwithsyntax.
4EssentialEvents
Themodelpresentedintheprevioussectionisveryoperational;configurations of M canbeseenasderivationsforanoperationalsemantics.Theprice, however,isthatbesidesthefactthattheinterpretationgrowsdramaticallyin size,wecanonlygetacategoryuptoweakbisimulation,whichcanbetoo coarse(forinstanceformustconvergence).Wewouldliketoremoveallevents thatarenotrelevanttothebehaviouroftermsuptoweakbisimulation.Inother words,wewantanotionof essentialinternalevents that (1) sufficestorecover allbehaviourwithrespecttoweakbisimulation,butwhich (2) isnotanobstacle togettingacategoryuptoisomorphism(whichamountsto ccA ◦ σ ∼ = σ ).
Non-angelicConcurrentGameSemantics15
4.1DefinitionofEssentialEvents
Asshownbefore,thelossofbehaviourswhenhidingisduetothedisappearance ofeventsparticipatinginaconflict.Aneutraleventmaynothavevisibleconsequencesbutstillberelevantifinaminimalconflict;sucheventsare essential.
Definition9. Let σ : S A beanuncoveredpre-strategy.An essentialevent of S isanevent s whichiseithervisible,or(internaland)involvedinaminimal conflict(thatissuchthatwehave s x s forsome s ,x).
Write ES forthesetofessentialeventsof σ .Anypre-strategy σ : S A induces anotherpre-strategy E (σ ): E (S )= S ↓ ES A called theessentialpart of σ
Thefollowingprovesthatourdefinitionsatisfies (1) :nobehaviourislost.
Lemma7. Anuncoveredpre-strategy σ : S A isweaklybisimilarto E (σ ).
Thisinducesanewnotionof(associative)compositiononlykeepingtheessentialevents.For σ : A⊥ B and τ : B ⊥ C ,let τ σ = E (τ σ ).Weobserve that E (τ σ ) ∼ = E (τ ) E (σ ).
Whichpre-strategiescomposewellwithcopycatwiththisnewcomposition?
4.2EssentialStrategies
Wenowcanstateproperty (2) :theeventsaddedbycompositionwithcopycat areinessential,hencehiddenduringcomposition:
Theorem3. Let σ : S A beanuncoveredstrategy.Then ccA σ ∼ = E (σ ).
Thispromptsthefollowingdefinition.Anuncoveredpre-strategy σ is essential whenitisastrategy,andif,equivalently: (1) allitseventsareessential, (2) σ ∼ = E (σ ).Weobtainacharacterisationofstrategiesinthespiritof[14]:
Theorem4. Apre-strategy σ : S A isessentialifandonlyif ccA σ ∼ = σ .
Asaresult,weget:
Theorem5. Race-freegames,andessentialstrategiesuptoisomorphismform acompact-closedcategory CG .
RelationshipBetweenCGandCG . Coveredstrategiescanbemadeinto acompact-closedcategory[5, 14].Rememberthatthecompositionof σ : S → A⊥ B and τ : T → B ⊥ C in CG isdefinedas τ σ =(τ σ )↓ .
Lemma8. Theoperation σ → σ↓ extendstoanidentity-on-objectfunctor CG → CG
Intheotherdirection,astrategy σ : A mightnotbeanessentialstrategy;in factitmightnotevenbeanuncoveredstrategy,asitmayfailsecrecy.Sending σ to ccA σ delegatesthenon-deterministicchoicestointernaleventsandyields anessentialstrategy,butthisoperationisnotfunctorial.
16S.Castellanetal.