Innocent strategies as presheaves and interactive equivalences for CCS
Seeking a general framework for reasoning about and comparing programming languages, we derive a new view of Milner's CCS. We construct a category E of plays, and a subcategory V of views. We argue that presheaves on V adequately represent innocent s…
Authors: Tom Hirschowitz (CNRS, Chambery), Damien Pous (CNRS
Bliudze, S., Bruni, R., Carbone, M., Silva, A. (Eds.); ICE 2011 EPTCS 59, 2011, pp. 2–24, doi:10.4204/EPTCS.59.2 c T . Hirschowitz & D. Pous This work is licensed under the Creativ e Commons Attribution License. Innocent strategies as pr eshea ves and interactiv e equiv alences f or CCS T om Hirscho witz ∗ CNRS, Univ ersit ´ e de Sav oie Chamb ´ ery , France Damien Pous CNRS, Laboratoire d’Informatique de Grenoble Grenoble, France Seeking a general frame work for reasoning about and comparing programming languages, we deri ve a new vie w of Milner’ s CCS [30]. W e construct a category E of plays , and a subcategory V of views . W e argue that presheav es on V adequately represent innocent strategies, in the sense of game semantics [19]. W e then equip innocent strate gies with a simple notion of interaction. This results in an interpretation of CCS. Based on this, we propose a notion of interactive equivalence for innocent strategies, which is close in spirit to Bef fara’ s interpretation [1] of testing equi valences [6] in concurrenc y theory . In this framew ork we prov e that the analogues of fair and must testing equi valences coincide, while they differ in the standard setting. 1 Over view Theories of programming languages Research in programming languages is mainly technological. Indeed, it heavily relies on techniques which are ubiquitous in the field, but almost nev er formally made systematic. T ypically , the definition of a language then quotiented by variable renaming ( α -con version) appears in many theoretical papers about functional programming languages. Why isn’t there yet any abstract frame work performing these systematic steps for you? Because the quest for a real theory of programming languages is not achiev ed yet, in the sense of a corpus of results that actually help de veloping them or reasoning about them. Howe ver , many attempts at such a theory do exist. A problem for most of them is that they do not account for the dynamics of execution, which limits their range of application. This is for e xample the case of Fiore et al. ’ s second-order theories [9, 16, 17]. A problem for most of the other theories of programming languages is that they neglect denotational semantics, i.e., they do not provide a notion of model for a giv en language. This is for example the case of Milner et al. ’ s bigraphs [21], or of most approaches to structural operational semantics [32], with the notable exception of the bialgebraic semantics of T uri and Plotkin [36]. A recent, related, and promising approach is Kleene coalgebra , as advocated by Bonsangue et al. [2]. Finally , higher-or der r ewriting [31], and its semantics in double cate gories [11] or in cartesian closed 2-categories [18], is not currently kno wn to adequately account for process calculi. T owards a new approach The most rele vant approaches to us are bialgebraic semantics and Kleene coalgebra, since the programme underlying the present paper concerns a possible alternativ e. A first dif- ference, which is a bit technical but may be of importance, is that both bialgebraic semantics and Kleene coalgebra are based on labelled transition systems (L TSs), while our approach is based on reduction se- mantics. Reduction semantics is often considered more primitiv e than L TSs, and much work has been ∗ Both authors hav e been partially funded by the French projects CHoCo (ANR-07-BLAN-0324), PiCoq (ANR 2010 BLAN 0305 01), and CNRS PEPS CoGIP . T . Hirschowitz & D. Pous 3 de voted to deriving the latter from the former [35, 21, 34, 33]. It might thus be relev ant to propose a model based only on the more primitve reduction semantics. More generally , our approach puts more emphasis on interaction between programs, and hence is less interesting in cases where there is no interaction. A sort of wild hope is that this might lead to unexpected models of programming languages, e.g., physical ones. This could also inv olve finding a good notion of morphism between languages, and possibly propose a notion of compilation. At any rate, the framework is not set up yet, so in vestigating the precise relationship with bialgebraic semantics and Kleene coalgebra is deferred to further work. Ho w will this ne w approach look like? Compared to such long-term goals, we only take a small step forward here, by considering a particular case, namely Milner’ s CCS [30], and providing a new view of it. This vie w borro ws ideas from the following lines of research: game semantics [19], and in particular the notion of an innocent strate gy and graphical games [7, 15], Krivine realisability [25], ludics [12], testing equi valences in concurrency [6, 1], the presheaf approach to concurrenc y [22, 23], and shea ves [28]. But it is also related to, e.g., graph re writing [8], and computads [3]. From games to presheav es Game semantics [19] has provided fully complete models of programming languages. Ho wever , it is based on the notion of a strate gy , i.e., a set of plays in the game, satisfying a few conditions. In concurrency theory , taking as a semantics the set of accepted plays, or ‘traces’, is kno wn as trace semantics . Trace semantics is generally considered too coarse, since it equates, for a most famous e xample, the right and the wrong coffee machines, a . ( b + c ) and ab + ac [30]. An observation essentially due to Joyal, Nielsen, and W inskel is that strategies, i.e., prefix-closed sets of plays, are actually particular pr esheaves of booleans on the category C with plays as objects, and prefix inclusions as morphisms. By presheav es of booleans on C we here mean functors C op → 2, where 2 is the preorder category 0 ≤ 1. If a play p is accepted , i.e., mapped to 1, then its prefix inclusions q → p are mapped to the unique morphism with domain 1, i.e., id 1 , which entails that q is also accepted. W e consider instead presheaves (of sets) on C . So, a play p is no w mapped to a set S ( p ) , to be thought of as the set of ways for p to be accepted by the strategy S . Considering the set of players as a team, S ( p ) may also be thought of as the set of states of the team after playing p . Presheav es are fine enough to account for bisimilarity [22, 23]. Indeed, they are essentially forests with edges labelled in mov es. F or e xample, in the setting where plays are finite words on an alphabet, the wrong coffee machine may be represented by the presheaf S defined by the equations on the left and pictured as on the right: • S ( ε ) = { } , • S ( a ) = { x , x 0 } , • S ( ab ) = { y } , • S ( ac ) = { y 0 } , • S ( ε → a ) = { x 7→ , x 0 7→ } , • S ( a → ab ) = { y 7→ x } , • S ( a → ac ) = { y 0 7→ x 0 } : x x 0 y y 0 . a a b c So, in summary: the standard notion of strategy may be generalised to account for branching equi va- lences, by passing from presheav es of booleans to presheav es of sets. Multiple players T raditional game semantics mostly emphasises two-player games. There is an im- plicit appearance of three-player games in the definition of composition of strategies, and of four-player games in the proof of its associativity , but these games are nev er giv en a proper status. A central idea of graphical games, and to a lesser extent of ludics, is the emphasis on multiple-player g ames. 4 Innocent strategies as preshea ves . . . Here, there first is a base category B of positions , whose objects represent configurations of players to which the game may arriv e at. Since the game represents CCS, it should be natural that players are related to each other via the knowledge of communication channels . So, positions are bipartite graphs with verte x sets players and channels , and edges from channels to players indicating when the former is known to the latter . As a first approximation, morphisms of positions may be thought of as just embeddings of such graphs. Second, there is a category E of plays , with a functor to B sending each play to its initial position. Plays are represented in a more fle xible way than just sequences of mo ves, namely using a kind of string diagrams. This echoes the idea [29] that two moves may be independent, and that plays should not depend on the order in which two independent moves are performed. Furthermore, our plays are a rather general notion, allo wing, e.g., to look at ho w only some players of the initial position e volv e. Morphisms of plays account both for: • prefix inclusion, i.e., inclusion of a play into a longer play , and • position enlargement, e.g., inclusion of information about some players into information about more players. No w , restricting to plays abov e a gi ven position X , and then taking presheav es on this category E X , we hav e a category of strate gies on X . Innocence A fundamental idea of game semantics is the notion of innocence , which says that players hav e a restricted view of the play , and that their actions may only depend on that view . W e implement this here by defining a subcate gory V X → E X of views on X , and deeming a presheaf F on E X innocent when it is determined by its restriction F 0 to V X , in the sense that it is isomorphic to the right Kan extension [27] of F 0 along V op X → E op X . Gi ven this, it is sensible to define innocent strategies to be just preshea ves on V X , and view them as strategies via the (essential) embedding c V X → c E X induced by right Kan extension. Interaction For each position X , we thus hav e a category S X = c V X of innocent strategies. In game semantics, composition of strategies is achieved in two steps: interaction and hiding . Essentially , inter- action amounts to considering the three-player game obtained by letting two two-player games interact at a common interface. Hiding then for gets what happens at that interface, to recover a proper two-player game. W e hav e not yet in vestigated hiding in our approach, but, thanks to the central status of multiple- player games, interaction is accounted for in a very streamlined way . For any position X with two subpositions X 1 → X and X 2 → X such that each player is in either X 1 or X 2 , but none is in both, given strategies F 1 ∈ S X 1 and F 2 ∈ S X 2 , there is a unique innocent strategy (up to canonical isomorphism in S X ), the amalgamation [ F 1 , F 2 ] of F 1 and F 2 , whose restrictions to X 1 and X 2 are F 1 and F 2 (again up to isomorphism). Amalgamation in this sense models interaction in the sense of game semantics, and, using the cor- respondence with presheav es on E X gi ven by right Kan extension, it is the ke y to defining interactiv e equi valences. CCS Next, we define a translation of CCS terms with recursi ve equations into innocent strategies. This rests on spatial and temporal decomposition results, which entail that innocent strategies are a solution of a system of equations of categories (up to equi v alence). A natural question is then: which equi valence does this translation induce on CCS terms ? T . Hirschowitz & D. Pous 5 Interactive equivalences Returning to the dev elopment of our approach, we then define a notion of interactive equivalence , which is close in spirit to both testing equiv alences in concurrency theory and Kri vine realisability and ludics. The game, as sketched abov e, allows interacting with players which are not part of the considered position. E.g., a player in the considered position X may perform an input which is not part of any synchronisation. A test for a strategy F on X is then, roughly , a strategy G on a position X 0 with the same names as X . T o decide whether F passes the test G , we consider a restricted v ariant of the game on the ‘union’ X ∪ X 0 , forbidding any interaction with the outside. W e call that v ariant the closed-world game. Then F passes G iff the amalgamation [ F , G ] , right Kan extended to E X ∪ X 0 and then restricted to the closed-world game, belongs to some initially fixed class of strategies, ⊥ ⊥ X ∪ X 0 . Finally , two strategies F and F 0 on X are equiv alent when they pass the same tests. Examples of ⊥ ⊥ include: • ⊥ ⊥ m , consisting of all strategies whose maximal states (those that admit no strict extensions) all play a tic k mov e, fixed in advance; the tick move plays a r ˆ ole analogous to the daimon in ludics: it is the only mov e which is observable from the outside; • ⊥ ⊥ f , consisting of all strategies in which all states admit an e xtension playing tick. From the classical concurrency theory point of vie w on beha vioural equiv alences, the first choice mim- icks must testing equiv alence, while the second mimicks fair testing equiv alence [6]. As a somehow surprising result, we prove that ⊥ ⊥ f and ⊥ ⊥ m yield the same equiv alence. The reason is that our notion of play is more flexible than just sequences of mo ves, as we e xplain in Section 4.3. Summary In summary , our approach emphasises a flexible notion of multiple-player play , encompass- ing both views in the sense of game semantics, closed-world plays, and intermediate notions. Strategies are then described as presheav es on plays, while innocent strategies are preshea ves on views. Innocent strategies admit a notion of interaction, or amalgamation, and are embedded into strategies via right Kan extension. This allo ws a notion of testing, or interactiv e equiv alence by amalgamation with the test, right Kan extension, and finally restriction to closed-w orld. Our main technical contributions are then a translation of CCS terms with recursi ve equations into innocent strategies, and the result that f air and must equiv alence coincide in our setting. Perspecti ves So, we have defined a flexible category of multiple-player play , combining inclusion in time (more moves) and in width (more players). Ha ving isolated a subcategory of views, we have defined innocent strategies as presheaves on vie ws, relati ve to a base position. W e ha ve then translated CCS processes with recursi ve definitions into innocent strategies. Then, using right Kan extension and restriction to so-called closed-world plays, we have defined a notion of interactiv e equiv alence. Finally , we hav e prov ed that two interacti ve equi valences, fair and must testing, coincide. Our next task is clearly to tighten the link with CCS. Namely , we should explore which equiv alence on CCS is induced via our translation, for a giv en interacti ve equi valence. W e will start with ⊥ ⊥ m . Furthermore, the very notion of interactiv e equi valence might deserv e closer consideration. Its current form is rather ad hoc , and one could hope to see it emerge more naturally from the game. For instance, the fix ed class ⊥ ⊥ of ‘successful’ strategies should probably be subjected to more constraints than is done here, but tw o examples were not enough to make any guess. Also, the paradigm of observing via the set of successful tests might admit sensible refinements, e.g., probabilistic ones. Another possible research direction is to tighten the link with ‘graphical’ approaches to rewriting, such as graph rewriting or computads. E.g., our plays might be presented by a computad [14], or be the 6 Innocent strategies as preshea ves . . . Category Description of its objects b C ‘diagrams’ B → b C positions E → ( B ↓ b C b C ) plays E X = ( E ↓ B ( B / X )) plays on a position X V X → E X vie ws on X S X = c V X innocent strategies on X W → E closed-world plays W ( X ) closed-world plays on X T able 1: Summary of categories and functors bicategory of rewrite sequences up to shift equiv alence, generated by a graph grammar in the sense of Gadducci et al. [10]. Both goals might require some technical adjustments, howe ver . For computads, we would need the usual yoga of U-turns to flexibly model our positions; ho wev er , e.g., zigzags of U-turns are usually only equal up to a higher-dimensional cell, while they would map to equal positions in our setting. For graph re writing, the problem is that our positions are not exactly graphs (e.g., the channels kno wn to a player are totally ordered). Other perspectiv es include the treatment of more complicated calculi like π or λ . In particular , calculi with duplication of terms will pose a serious challenge. An even longer-term hope is to be able to abstract o ver our approach. Is it possible to systematise the process starting from a calculus as studied in programming language theory , and generating its strategies modulo interacti ve equi valence? If this is e ver understood, the next question is: when does a translation between tw o such calculi preserv e a gi ven interacti ve equi valence? Finding general criteria for this might ha ve useful implications in programming languages, especially compilation. F C F C 0 GD GD 0 F ( f ) u u 0 G ( g ) Notation The various categories and functors used in the development are summed up with a short description in T able 1. There, giv en two functors C F − → E G ← − D , we denote (slightly abusi vely) by C ↓ E D the comma category: it has as objects triples ( C , D , u ) with C ∈ C , D ∈ D , and u : F ( C ) → G ( D ) in E , and as morphisms ( C , D , u ) → ( C 0 , D 0 , u 0 ) pairs ( f , g ) making the square on the right commute. Also, when F is the identity on C and G : 1 → C is an object C of C , this yields the usual slice category , which we abbre viate as C / C . Finally , the category of preshea ves on an y category C is denoted by b C = Set C op . Furthermore, we denote, for any category C , by ob ( C ) its set of obects and by mor ( C ) its set of morphisms. For any functor F : C → D , we denote by F op : C op → D op the functor induced on opposite categories, defined exactly as F on both objects and morphisms. Also, recall that an embedding of categories is an injecti ve-on-objects, f aithful functor . This admits the following generalisation: a functor F : C → D is essentially injective on objects when F C ∼ = F C 0 implies C ∼ = C 0 . Any faithful, essentially injecti ve on objects functor is called an essential embedding . T . Hirschowitz & D. Pous 7 2 Plays as string diagrams W e now describe our approach more precisely , starting with multiple-player plays. W e remain at a not completely formal lev el, especially for presenting plays, because our experience is that most readers get stuck on that. Ho wev er , the interested reader may have a look at the formal definition in Appendix A. 2.1 Positions Since the game represents CCS, it should be natural that players are related to each other via the kno wledge of communication channels . This is represented by a kind of 1 bipartite graph: an e xample position is on the right. Bullets represent players, circles represent channels, and edges indicate when a player knows a channel. The channels kno wn by a player are linearly ordered, e.g., counterclockwise, starting from the lower one. Formally , as explained in Appendix A, positions are presheav es over a certain category C 1 . Morphisms of positions are natural transformations, which are roughly morphisms of graphs, mapping players to players and channels to channels. In full generality , morphisms thus do not ha ve to be injectiv e. Howe ver , let us restrict to injecti ve morphisms for this expository paper . Positions and morphisms between them form a category B . 2.2 Moves Plays are then defined as glueings of moves derived from the very definition of CCS, which we no w sketch. Moves come in three layers: • basic mov es, which are used to define views belo w , • full mov es, which are used in the statement of temporal decomposition (Theorem 2), • and closed-world moves, which are used to define closed-world plays (which in turn are central to the notion of interacti ve equi v alence). It might here be worth providing some intuition on the difference between the three notions of move. A closed-world move roughly consists of some players (one or more) synchronising together in some specified way , each of them forking into several ‘a v atars’. A full move g athers what concerns one of the players in volved in such a synchronisation. A basic mov e is what one of its av atars remembers of the mov e. Let us start with a closed-world move which concerns only one player , and which is hence also a full mov e: forking In the case of a player knowing two channels, the forking move is represented by the diagram P : , (1) 1 Only ‘a kind of ’, because, as mentioned above, the channels kno wn to a player are linearly ordered. 8 Innocent strategies as preshea ves . . . to be thought of as a mov e from the bottom position X to the top position Y . The whole mov e may be viewed as a cospan X → P ← Y in the category of diagrams (technically a presheaf category b C ). Both legs of the cospan are actually monic arrows in b C , as will be the case for all cospans considered here. The vertical lines represent dots (channels and players) moving in time, upwards. So for e xample the left- and right-hand borders are just channels e volving in time, not noticing that the represented player forks into two. The surfaces spread between those vertical lines represent links (edges in the in volv ed positions) ev olving in time. For example, each link here divides into two when the player forks, thus representing the fact that both of the ne wly created players retains kno wledge of the corresponding name. As for channels kno wn to a player , the players and channels touching the black triangle are ordered: in particular there are dif ferent ‘ports’ for the initial player and its two av atars. There is of course an instance π n of forking for each n , according to the number of channels kno wn to the player . Again, these explanations are very informal, but the diagrams hav e a very precise combi- natorial definition. The above forking mov e has two basic sub-mov es, left and right half-forking , respectively repre- sented by the diagrams and , (2) which represent what each of the ‘avatars’ of the forking player sees of the mov e. If a play contains both of the latter moves, then it contains the full move (1). Forking, being the only mov e with more than one player in the final position, is the only one subject to such a decomposition. W e call π l n and π r n the respecti ve instances of the left-hand and right-hand basic mov es for a player kno wing n names. Let us no w revie w the other basic moves of the game, which are also full. As for forking, there is an instance of each of them follo wing the number n of channels kno wn to the player , and we only show the case n = 2. First, we have the tick mo ve ♥ n , whose role is to define successful plays, and the usual name cr eation , or r estriction ν of CCS, here ν n . They are graphically represented as ♥ and respecti vely . W e finally have input and output, a . P and a . P in CCS, respecti vely ι + n , i and ι − n , i here ( n is the number of known channels, i is the index of the channel bearing the synchronisation). Here, output on the right-hand name and input on the left-hand name respecti vely look like and . T . Hirschowitz & D. Pous 9 Basic Full Closed-world Left half-forking Right half-forking Forking Forking Input Output Input Output Synchronisation T ick Tick T ick Name creation Name creation Name creation T able 2: Summary of classes of mov es W e hav e now defined all basic and full mov es, and mov e on to define closed-world mov es. Forking, name creation, and tick are all closed-world moves, and there is only one more closed-world move, which models CCS-like synchronisation. For all n and m , representing the numbers of channels known to the players in volv ed in the synchronisation, and for all i ∈ n , j ∈ m (seeing n and m as finite ordinals), there is a synchr onisation τ n , i , m , j , represented, (in the case where one player outputs on channel 1 ∈ 2 and the other inputs on channel 0 ∈ 1,) by . Let us emphasise here that the dotted wire in the picture is actually a point in the formal representation (i.e., an element of the corresponding presheaf). T able 2 summarises the various classes of mo ves, and altogether the y form the set of moves . 2.3 Plays W e now sketch how plays are defined as glueings of mov es. W e start with the follo wing example, depicted in Figure 1. The initial position consists of two players p 1 and p 2 sharing kno wledge of a name a , each of them knowing another name, resp. a 1 and a 2 . The play consists of four moves: first p 1 forks into p 1 , 1 and p 1 , 2 , then p 2 forks, and then p 1 , 1 does a left half-fork into p 1 , 1 , 1 ; finally p 1 , 1 , 1 synchronises (as the sender) with p 2 , 1 . Now , we reach the limits of the graphical representation, b ut the order in which the forks of p 1 and p 2 occur is irrele v ant: if p 2 had forked before p 1 , we would obtain the same play . This means that glueing the various parts of the picture in Figure 1 in dif ferent orders formally yields the same result (although there are subtle issues in representing this result graphically in a canonical way). No w , recall that moves may be seen as cospans X → M ← Y . Now , consider an extended notion of mov e, which may occur in a larger position than just one player (two for synchronisation). For example, the mov es in Figure 1 are extended mo ves in this sense. W e may no w state: Definition 1. A play is an embedding X 0 → U in the cate gory b C of diagrams, isomorphic to a possibly denumerable ‘composition’ of moves in the (bi)cate gory Cospan ( b C ) of cospans in b C , i.e., obtained as a colimit: 10 Innocent strategies as preshea ves . . . . Figure 1: An example play X 0 X 1 . . . X n X n + 1 X n + 2 . . . M 0 . . . M n M n + 1 . . . U , wher e each X i → M i ← X i + 1 is an extended mo ve. Notation: we often denote plays just by U , leaving the embedding X → U implicit. Remark 1. F or finite plays, one might want to keep track not only of the initial position, but also of the final position. This indeed makes sense. F inite plays then compose ‘vertically’, and form a double cate gory . But infinite plays do not r eally have any final position, which explains our definition. U V X Y . h k Let a morphism ( X → U ) → ( Y → V ) of plays be a pair ( h , k ) making the diagram on the right commute in b C . This permits both inclusion ‘in width’ and ‘in height’. E.g., the play consisting of the left-hand basic move in (2) embeds in exactly two ways into the play of Figure 1. (Only two because the image of the base position must lie in the base position of the codomain.) W e hav e: Proposition 1. Plays and morphisms between them form a cate gory E . There is a projection functor E → B mapping each play X → U to its base position X . This functor has a section, which is an embedding B → E , mapping each position X to the empty play X → X on X . Remark 2 (Size) . The category E is only locally small. Since pr esheaves on a locally small cate gory ar e less well-behaved than on a small cate gory , we will actually consider a skeleton of E . Because E consists only of denumerable presheaves, this skeleton is a small cate gory . Thus, our pr esheaves in the next section may be under stood as taken on a small cate gory . Remark 3. Plays ar e not very far fr om being just (infinite) abstract syntax trees (or for ests) ‘glued together along c hannels’. T . Hirschowitz & D. Pous 11 2.4 Relativisation If we no w want to restrict to plays ov er a gi ven base position X , we may consider Definition 2. Let the cate gory E X have • as objects pairs of a play Y → U and a morphism Y → X , • as morphisms ( Y → U ) → ( Y 0 → U 0 ) all pairs ( h , k ) making the following diagram commute: U U 0 Y Y 0 X k h in b C . W e will usually abbreviate U ← Y → X as just U when no ambiguity arises. As for morphisms of positions, in full generality , h and k , as well as the morphisms Y → X , do not hav e to be injecti ve. Ho wev er , for the purpose of this expository paper , let us again restrict to injecti ve h , k , and Y → X . Example 1. Let X be the position . The play in F igur e 1, say Y → U , equipped with the injection Y → X mapping the two players of Y to the two leftmost players of X , is an object of E X . 3 Innocent strategies as shea ves No w that the category of plays is defined, we mov e on to defining innocent strategies. There is a notion of a Grothendieck site [28], which consists of a category equipped with a (generalised) topology . On such sites, one may define a category of shea ves, which are very roughly the preshea ves that are continuous for the topology . W e claim that there is a topology on each E X , for which sheaves adequately model innocent strategies. Fortunately , in our setting, shea ves admit a simple description, so that in this expository paper we can av oid the whole machinery . 3.1 Innocent strategies Definition 3. A vie w is a finite ‘composition’ n → V of basic moves in Cospan ( b C ) . Example 2. F orking (1) has two non-trivial views, namely the basic mo ves (2) . Example 3. In F igur e 1, the left-hand branch contains a view consisting of three basic moves: two π l 2 and an input. Example 4. The embeddings 12 Innocent strategies as preshea ves . . . have views as domains. For an y position X , let V X be the subcategory of E X consisting of vie ws. Definition 4. Let the cate gory S X of innocent strategies on X be the cate gory c V X of pr esheaves on V X . A possible interpretation is that for a presheaf F ∈ c V X and view V ∈ V X , F ( V ) is the set of possible states of the strategy F after playing V . It might thus seem that we could content ourselves with defining only views, as opposed to full plays. Ho wev er , in order to define interactiv e equi valences in Section 4, we need to vie w innocent strategies as (particular) presheav es on the whole of E X . C D E F G H K α 0 ε α The connection is as follo ws. Recall from MacLane [27] the no- tion of right Kan extension . Gi ven functors F and G as on the right, a right Kan extension Ran F ( G ) of G along F is a functor H : D → E , equipped with a natural transformation ε : H F → G , such that for all functors K : D → E and transformations α : K F → G , there is a unique α 0 : K → H such that α = ε ◦ 1 ( α 0 ◦ id F ) , where ◦ 1 is vertical composi- tion of natural transformations. Now , precomposition with F induces a functor Cat ( F , E ) : Cat ( D , E ) → Cat ( C , E ) , where Cat ( D , E ) is the category of functors D → E and natural transformations between them. When E is complete, right Kan extensions alw ays exist (and an explicit formula for our setting is given belo w), and choosing one of them for each functor C → E induces a right adjoint to Cat ( F , E ) . Furthermore, it is known that when F is full and faithful, then ε is a natural isomorphism, i.e., H F ∼ = G , which entails that Ran F is a full essential embedding. Returning to views and plays, the embedding i X : V X → E X is full, so right Kan extension along i op X : V op X → E op X induces a full essential embedding Ran i op X : c V X → c E X . The (co)restriction of this essen- tial embedding to its essential image thus yields an essentially surjecti ve, fully faithful functor , i.e., an equi valence of cate gories: Proposition 2. The cate gory S X is equivalent to the essential image of Ran i op X . The standard characterisation of right Kan extensions as ends [27] yields, for any F ∈ c V X and U ∈ E X : Ran i op X ( F )( U ) = Z V ∈ V X F ( V ) E X ( V , U ) , i.e., an element of Ran i op X ( F ) on a play U consists, for each view V and morphism V → U , of an element of F ( V ) , satisfying some compatibility conditions. In Example 5 below , we compute an example right Kan extension. The interpretation of strategies in terms of states extends: for an y presheaf F ∈ c E X and play U ∈ E X , F ( U ) is the set of possible states of the strategy F after playing U . That F is in the image of Ran i op X amounts to F ( U ) being a compatible tuple of states of F after playing each view of U . Example 5. Her e is an example of a presheaf F ∈ c E X which is not innocent, i.e., not in the image of Ran i op X . Consider the position X consisting of three players, say x , y , z, sharing a name, say a. Let X x be the subposition with only x and a, and similarly for X y , X z , X x , y , and X x , z . Let I x = ( ι − 1 , 0 ← X x → X ) be the play wher e x inputs on a, and similarly let O y and O z be the plays wher e y and z output on a, r espectively . Let F ( I x ) = F ( O y ) = F ( O z ) = 1 be singletons. Let now S x , y = ( τ 1 , 0 , 1 , 0 ← X x , y → X ) be the play wher e x and y synchr onise on a (x inputs and y outputs), and similarly let S x , z be the play wher e x and z sync hr onise on a. Let F ( S x , y ) = 2 be a two-element set, and let F ( S x , z ) = / 0 . F inally , let F map any subplay of the above plays to a singleton, and any strict superplay to the empty set. T . Hirschowitz & D. Pous 13 This F fails to be innocent on two counts. F irst, since x and y accept to input and output in only one way , it is non-innocent to accept that they sync hr onise in mor e than one way . F ormally , S x , y has two non-trivial views, I x and O y , so since F maps the empty vie w to a singleton, F ( S x , y ) should be isomorphic to F ( I x ) × F ( O y ) = 1 × 1 = 1 . Second, since x and z accept to input and output, it is non-innocent to not accept that they synchr onise. F ormally , F ( S x , z ) should also be a singleton. This altogether models the fact that in CCS, pr ocesses do not get to choose with whic h other pr ocesses the y synchr onise. The r estriction of F to V X , i.e., F 0 = F ◦ i op X , in turn has a right Kan extension F 00 , which is innocent. (In passing, the unit of the adjunction Cat ( i op X , Set ) a Ran i op X is a natural transformation F → F 00 .) T o conclude this example, let us compute F 00 . F irst, F 0 only r etains fr om F its values on views. So, if X x denotes the empty view on X x , F 0 ( X x ) = 1 , and similarly F 0 ( X y ) = F 0 ( X z ) = 1 . Furthermor e, F 0 ( I x ) = F 0 ( O y ) = F 0 ( O z ) = 1 . F inally , for any view V not isomorphic to any of the pr evious ones, F 0 ( V ) = / 0 . So, r ecall that F 00 maps any play U ← Y → X to R V ∈ V X F 0 ( V ) E X ( V , U ) . So, e.g ., since the views of S x , y ar e subviews of I x and O y , we have F 00 ( S x , y ) = F 0 ( I x ) × F 0 ( O y ) = 1 . Similarly , F 00 ( S x , z ) = 1 . But also, for any play U such that all views V → U ar e subviews of either of I x , O y , or O z , we have F 00 ( U ) = 1 . F inally , for any play U such that ther e exists a vie w V → U which is not a subview of any of I x , O y , or O z , we have F 00 ( U ) = / 0 . One way to understand Proposition 2 is to view c V X as the syntax for innocent strategies: presheav es on vie ws are (almost) infinite terms in a certain syntax (see Section 3.2 below). On the other hand, seeing them as presheav es on plays will allo w us to consider their global behaviour: see Section 4 when we restrict to the closed-world game. Thus, right Kan extension followed by restriction to closed-world will associate a semantics to innocent strategies. So, we hav e defined for each X the category S X of innocent strategies on X . This assignment is actually functorial B op → CA T , as follo ws (where CA T is the large category of locally small categories). Any morphism f : Y → X induces a functor f ! : V Y → V X sending ( V ← Z → Y ) to ( V ← Z → Y → X ) . Precomposition with ( f ! ) op thus induces a functor S f : c V X → c V Y . Proposition 3. This defines a functor S : B op → CA T . But there is more: for any position, giving a strategy for each player in it easily yields a strategy on the whole position. W e call this amalgamation of strate gies. F ormally , consider an y subpositions X 1 and X 2 of a gi ven position X , inducing a partition of the players of X , i.e., such that X 1 ∪ X 2 contains all the players of X , and X 1 ∩ X 2 contains none. Then V X is isomorphic to the coproduct V X 1 + V X 2 . (Indeed, a vie w contains in particular an initial player in X , which forces it to belong either in V X 1 or in V X 2 .) Definition 5. Given strate gies F 1 on X 1 and F 2 on X 2 , let their amalgamation be their image in V X via the above equivalence, i.e ., the copairing [ F 1 , F 2 ] : V op X ∼ = ( V X 1 + V X 2 ) o p ∼ = V op X 1 + V op X 2 → Set . By uni versal property of coproduct: Proposition 4. Amalgamation yields an equivalence of cate gories c V X ' d V X 1 × d V X 2 . Example 6. Consider again the position X fr om Example 5, and let X y , z be the subposition with only y and z. W e have V X ' ( V X x + V X y , z ) , which we may explain by hand as follows. A view on X has a base player , x, y, or z, and so belongs either in V X x or in V X y , z . Furthermor e, if V is a view on x and W is a view on y, then V X ( V , W ) = / 0 (and similarly for any pair of distinct players in X ). Now , r ecall F 0 , the r estriction of F to V X . W e may define F x : V op X x → Set to be the r estriction of F 0 along the (opposite of the) embedding V X x → V X , and similarly F y , z to be the r estriction of F 0 along V X y , z → V X . Observe that F 0 sends any view V on x to F x ( V ) , and similarly for views on y and z, we conclude that F 0 is actually the copairing [ F x , F y , z ] . 14 Innocent strategies as preshea ves . . . Analogous reasoning leads to the follo wing. For any X , let Pl ( X ) denote the set of pairs ( n , x ) , where x is a player in X , knowing n names. This yields the spatial decomposition theorem, where n is abusi vely seen as the position with one player kno wing n names: Theorem 1. W e have c V X ' ∏ ( n , x ) ∈ Pl ( X ) c V n . There is actually more structure than that, namely the functor S is a stack [37], but we do not need to spell out the definition here. 3.2 T emporal decomposition and languages Let us no w describe temporal decomposition. The main goal here is to sketch the interpretation of CCS in innocent strategies. This material is not needed for Section 4. Recall that full mov es are forking (1), tick, name creation, input, and output. Definition 6. Let M n be the set of all full moves starting fr om n. F or each M ∈ M n , let cod ( M ) be the final position of the corr esponding move . Strictly speaking, M n is a proper class, b ut we may easily choose one representative of each isomor- phism class. For instance, all mov es are actually representable presheaves in b C , so we may just pick these. T o state the temporal decomposition theorem, we need a standard [20] categorical construction, the category of families on a gi ven category C . First, given a set X , consider the category Fam ( X ) with as objects X -index ed families of sets, i.e., sets ( Y x ) x ∈ X , and as morphisms Y → Z families ( f x : Y x → Z x ) x ∈ X of maps. This cate gory is equiv alently described as the slice category Set / X . T o see the correspondence, consider any family ( Y x ) x ∈ X , and map it to the projection function ∑ x ∈ X Y x → X sending ( x , y ) to x . Generalising from sets X to arbitrary categories C , Fam ( C ) , has as objects families f : Y → ob ( C ) index ed by the objects of C , and as morphisms ( Y , p ) → ( Z , q ) pairs of u : Y → Z and v : Y → mor ( C ) , such that qu = p , dom ( v ( x )) = p ( x ) , and cod ( v ( x )) = q ( u ( x )) . Thus, any element y ∈ Y above C ∈ C is mapped to some u ( y ) ∈ Z abov e C 0 ∈ C , and this mapping is labelled by a morphism v ( y ) : C → C 0 in C . W e may now state: Theorem 2. Ther e is an equivalence of cate gories S n ' Fam ∏ M ∈ M n S cod ( M ) . The main intuition for the proof is that a strategy is determined up to isomorphism by (i) its initial states, and (ii) what remains of them after each possible full mov e. The family construction is what permits non-deterministic strategies: a giv en move may lead to dif ferent states. Remark 4. The theor em almost makes str ate gies into a sketch (on the cate gory with positions as objects, finite compositions of extended moves as morphisms, and the M X ’ s as distinguished cones). Briefly , being a sketch would requir e a bijection of sets S n ∼ = ∏ M ∈ M n S cod ( M ) . Her e, the bijection becomes an equivalence of cate gories, and the family construction sneaks in. Putting the decomposition theorems together , we obtain S n ' Fam ∏ M ∈ M n ∏ ( n 0 , x 0 ) ∈ Pl ( cod ( M )) S n 0 ! , for all n . Considering a variant of this formula as a system of equations will lead to our interpretation of CCS. The first step is to consider the formula as an endofunctor F 0 on Cat / ω , where ω is the set of finite ordinals, seen as a discrete category . This functor is defined on an y family of categories X = ( X i ) i ∈ ω by: ( F 0 ( X )) n = Fam ∏ M ∈ M n ∏ ( n 0 , x 0 ) ∈ Pl ( cod ( M )) X n 0 ! . T . Hirschowitz & D. Pous 15 Then, using the notation just before Theorem 2, we restrict attention to families Y → ob ( C ) where Y is a finite ordinal n ∈ ω . Simultaneously , we restrict attention to discrete categories X , i.e., we see the formula as a endofunctor on Set / ω , i.e., ω -indexed f amilies of sets. This yields, for any f amily X = ( X i ) i ∈ ω , ( F ( X )) n = ∑ I ∈ ω ∏ M ∈ M n ∏ ( n 0 , x 0 ) ∈ Pl ( cod ( M )) X n 0 ! I . This endofunctor is polynomial [24] and we no w give a characterisation of its final coalgebra. Let for any cate gory C the category b C f be the functor category C op → FinOrd , where FinOrd is the category of finite ordinals and monotone functions between them. By composition with the embedding FinOrd → Set , we hav e an embedding b C f → b C . W e hav e: Theorem 3. The family ob ( c V n f ) formed for each n by the objects of c V n f is a terminal coalgebr a for F . By Lambek’ s lemma [26], there is a bijection (between the objects) c V n f ∼ = ∑ I ∈ ω ∏ M ∈ M n ∏ ( n 0 , x ) ∈ Pl ( cod ( M )) c V n 0 f ! I . (3) In particular , the family c V n f supports the operations of the grammar . . . n ` F i . . . ( ∀ i ∈ I ) n ` ∑ i ∈ I F i ( I ∈ ω ) . . . n 0 ` F M , n 0 , x . . . ( ∀ M ∈ M n , ( n 0 , x ) ∈ Pl ( cod ( M ))) n ` h ( M , ( n 0 , x )) 7→ F M , ( n 0 , x ) i · Here, n ` F denotes a presheaf of finite ordinals on V n . The interpretation is as follows: given preshea ves F 0 , . . . , F I − 1 , for I ∈ ω , the leftmost rule constructs the finite coproduct ∑ i ∈ I F i of presheaves (finite co- products exist in c V n f because they do in FinOrd ). In particular, when I is the empty ordinal, we sum ov er an empty set, so the rule degenerates to n ` / 0 · In terms of presheav es, this is just the constantly empty presheaf. For the second rule, if for all M , n 0 , x , we are giv en F M , ( n 0 , x ) ∈ c V n 0 f , then h ( M , ( n 0 , x )) 7→ F M , ( n 0 , x ) i denotes the image under (3) of ( 1 , 0 7→ M 7→ ( n 0 , x ) 7→ F M , n 0 , x ) . Here, we provide an element of the right-hand side of (3), consisting of the finite ordinal I = 1 = { 0 } , and the function mapping ( M , n 0 , x ) to F M , n 0 , x ∈ c V n 0 f (up to currying). That was for parsing; the intuition is that we construct a presheaf with one initial state, 0, which maps any vie w starting with ( M , n 0 , x ) , say M ; V , to F M , n 0 , x ( V ) . Thus the F M , n 0 , x ’ s specify what remains of our presheaf after each possible basic mov e. In particular , when all the F M , n 0 , x ’ s are empty , we obtain a presheaf which has an initial state, but which does nothing beyond it. W e abbreviate it as 0 = h 7→ / 0 i . 16 Innocent strategies as preshea ves . . . C C S A P P Ξ ; Γ ` x ( a 1 , . . . , a n ) (( x : n ) ∈ Ξ and a 1 , . . . , a n ∈ Γ ) Ξ ; Γ , a ` P Ξ ; Γ ` ν a . P . . . Ξ ; Γ ` P i . . . ( ∀ i ∈ I ) Ξ ; Γ ` ∑ i ∈ I α i . P i ( I ∈ ω and ∀ i ∈ I , b α i c ∈ Γ ) Ξ ; Γ ` P Ξ ; Γ ` Q Ξ ; Γ ` P | Q G L O BA L Ξ ; ∆ 1 ` P 1 . . . Ξ ; ∆ n ` P n Ξ ; Γ ` P Γ ` rec x 1 ( ∆ 1 ) := P 1 , . . . , x n ( ∆ n ) := P n in P Figure 2: CCS syntax 3.3 T ranslating CCS It is rather easy to translate CCS into this language. First, define CCS syntax by the natural deduction rules in Figure 2, where Names and Va rs are two fix ed, disjoint, and infinite sets of names and variables ; Ξ ranges ov er finite sequences of pairs ( x : n ) of a variable x and its arity n ∈ ω ; Γ ranges over finite sequences of names; there are two judgements: Γ ` P for global processes, Ξ ; Γ ` P for open processes. Rule G L O B A L is the only rule for forming global processes, and there Ξ = ( x 1 : | ∆ 1 | , . . . , x n : | ∆ n | ) . Fi- nally , α denotes a or a , for a ∈ Names , and b a c = b a c = a . First, we define the follo wing (approximation of a) translation on open processes, mapping each open process Ξ ; Γ ` P to J P K ∈ c V n f , for n = | Γ | . This translation ignores the recursi ve definitions, and we will refine it belo w to take them into account. W e proceed by induction on P , leaving conte xts Ξ ; Γ implicit: x ( a 1 , . . . , a k ) 7→ / 0 P | Q 7→ h ( π n , n , t 1 ) 7→ J P K , ( π n , n , t 2 ) 7→ J Q K , ( , ) 7→ / 0 i ν a . P 7→ h ( ν n , n + 1 , t ) 7→ J P K , ( , ) 7→ / 0 i ∑ i ∈ I α i . P i 7→ h (( ι + n , j , n , t ) 7→ ∑ k ∈ I j J P k K , ( ι − n , j , n , t ) 7→ ∑ k ∈ I j J P k K ) j ∈ n , ( , ) 7→ / 0 i . Let us e xplain intuitions and notation. In the first case, we assume implicitly that ( x : k ) ∈ Ξ ; the intuition is just that we approximate variables with empty strategies. Next, P | Q is translated to the strategy with one initial state, which only accepts the forking move first, and then lets its av atars play J P K and J Q K , respecti vely . In the definition, we denote by t 1 and t 2 the two players of the final position in the forking mov e (1). Furthermore, here and in all relev ant cases, n is the number of names in Γ . Similarly , ν a . P is translated to the strategy with one initial state, accepting only the name creation move, and then playing J P K . Here and in the next case, t is the player of the final position in the in volved mov e. In the last case, the guarded sum ∑ i ∈ I α i . P i is translated to the strategy with one initial state, which • accepts input on any channel a when α i = a for some i ∈ I , and output on any channel a when α i = a for some i ∈ I ; • after an input on a , plays the sum of all J P i K ’ s such that α i = a ; and after an output on a , plays the sum of all J P i K ’ s such that α i = a . Formally , in the definition, we let for all j ∈ n I j = { i ∈ I | α i = a j } and I j = { i ∈ I | α i = a j } . In particular , for the last case, when I = / 0, we obtain 0. T . Hirschowitz & D. Pous 17 Thus, almost all translations of open processes ha ve exactly one initial state, i.e., map the empty vie w on n to the singleton 1. The only exceptions are v ariable applications, which are mapped to the empty presheaf. The translation extends to global processes as follo ws. Fixing a global process rec x 1 ( ∆ 1 ) = P 1 , . . . , x k ( ∆ k ) = P k in P typed in Γ with n names, define the sequence ( P i ) i ∈ ω of open processes (all typed in Ξ ; Γ ) as follo ws. First, P 0 = P . Then, let P i + 1 = ∂ P i , where ∂ is the derivation endomap on open processes typed in any e xtension Ξ ; ( Γ , ∆ ) of Ξ ; Γ , which unfolds one layer of recursiv e definitions. This map is defined by induction on its argument as follo ws: ∂ ( x l ( a 1 , . . . , a k l )) = P l [ b j 7→ a j ] 1 ≤ j ≤ k l ∂ ( P | Q ) = ∂ P | ∂ Q ∂ ( ν a . P ) = ν a . ∂ P ∂ ( ∑ i ∈ I α i . P i ) = ∑ i ∈ I α i . ( ∂ P i ) , where for all l ∈ { 1 , . . . , k } , ∆ l = ( b 1 , . . . , b k l ) , and P [ σ ] denotes simultaneous, capture-av oiding substi- tution of names in P by σ . By construction, the translations of these open processes form a sequence J P 0 K → J P 1 K . . . of inclu- sions in c V n f , such that for any natural number i and view V ∈ V n of length i (i.e., with i basic moves), J P j K ( V ) is fixed after j = ( k + 1 ) i , at worst, i.e., for all j ≥ ( k + 1 ) i , J P j K ( V ) = J P ( k + 1 ) i K ( V ) . Thus, this sequence has a colimit in c V n f , the presheaf sending any view V of length i to J P ( k + 1 ) i K ( V ) , which we take as the translation of the original process. Which equi valence is induced by this mapping on CCS, especially when taking into account the interacti ve equiv alences de veloped in the next section? This is the main question we will try to address in future work. 4 Interactiv e equivalences 4.1 F air testing vs. must testing: the standard case An important part of concurrency theory consists in studying behavioural equivalences . Since each such equi valence is supposed to define when two processes behav e the same, it might seem paradoxical to consider several of them. V an Glabbeek [13] argues that each behavioural equiv alence corresponds to a physical scenario for observing processes. A distinction we wish to make here is between fair scenarios, and potentially unfair ones. An ex- ample of a fair scenario is when parallel composition of processes is thought of as modelling different physical agents, e.g., in a game with sev eral players. Otherwise said, players are really independent. On the other hand, an example of a potentially unfair scenario is when parallelism is implemented via a scheduler . Mainstream notions of processes, e.g., transition systems or automata, are actually unfair , as the follo wing example shows. Consider a looping process Ω , which has a silent transition τ to itself. The process P = ( Ω | a ) , which in parallel plays Ω and tries to synchronise on a , has an infinite trace P τ − → P τ − → . . . This has consequences on so-called testing equi valences [6]. Let ♥ be a fixed action. Definition 7. A pr ocess P is must orthogonal to a context C , notation P ⊥ m C, when all maximal traces of C [ P ] play ♥ at some point. 18 Innocent strategies as preshea ves . . . Here, maximal means either infinite or finite without extensions. Let P ⊥ m be the set of all contexts must orthogonal to P . Definition 8. P and Q ar e must equiv alent , notation P ∼ m Q, when P ⊥ m = Q ⊥ m . In transition systems, or automata, recalling P above and letting Q = Ω , we hav e P ∼ m Q . This might be surprising, because the context C = a . ♥ | intuitiv ely should distinguish P from Q , by being orthogonal to P but not to Q . Ho wev er , it is not orthogonal to P , because C [ P ] has an infinite looping trace gi ving priority to Ω . This looping trace is unfair , because the synchronisation on a is never performed. Thus, one may vie w the equiv alence P ∼ m Q as taking into account potential unfairness of a hypothetical scheduler . Usually , concurrency theorists consider this too coarse, and resort to fair testing equiv alence. Definition 9. A pr ocess P is fair orthogonal to a context C , notation P ⊥ f C, when all finite traces of C [ P ] extend to traces that play ♥ at some point. Again, P ⊥ f denotes the set of all contexts f air orthogonal to P . Definition 10. P and Q ar e fair equi valent , notation P ∼ f Q, when P ⊥ f = Q ⊥ f . This solves the issue, i.e., P f Q . In summary , the mainstream setting for testing equi valences relies on traces; and the notion of max- imality for traces is intrinsically unfair . This is usually rectified by resorting to fair testing equiv alence ov er must testing equiv alence. Our setting is more flexible, in the sense that maximal plays are better behav ed than maximal traces. In terms of the pre vious section, this allows viewing the looping trace P τ − → P τ − → . . . as non-maximal. In the next sections, we define an abstract notion of interactive equiv a- lence (still in the particular case of CCS but in our setting), instantiate it to define fair and must testing equi valence, which, as we finally sho w , coincide. 4.2 Interactive equi valences Definition 11. A play is closed-w orld when all its inputs and outputs ar e part of a synchr onisation. Let W → E be the full subcategory of closed-world plays, W ( X ) being the fibre over X for the projection functor W → B , i.e., the subcategory of W consisting of closed-w orld plays with base X , and morphisms ( id X , k ) between them 2 . Let the category of closed-world behaviours on X be the category G X = \ W ( X ) of presheaves on W ( X ) . W e may now put: Definition 12. An observ able criterion consists for all positions X , of a r eplete subcategory ⊥ ⊥ X → G X . Recall that ⊥ ⊥ X being replete means that for all F ∈ ⊥ ⊥ X and isomorphism f : F → F 0 in G X , F 0 and f are in ⊥ ⊥ X . An observ able criterion specifies the class of ‘successful’, closed-world beha viours. The tw o criteria considered below are two ways of formalising the idea that a successful behaviour is one in which all accepted closed-world plays are ‘successful’, in the sense that some player plays the tick move at some point. W e no w define interactiv e equi valences. Recall that [ F , G ] denotes the amalgamation of F and G , and that right Kan e xtension along i op Z induces a functor Ran i op Z : c V Z → c E Z . Furthermore, precomposition 2 This is not exactly equi valent to what could be noted W X , since in the latter there are objects U ← Y → X with a strict inclusion Y → X . Ho wev er , both should be equiv alent for what we do in this paper , i.e., fair and must equi valences. T . Hirschowitz & D. Pous 19 with the canonical inclusion j Z : W ( Z ) → E Z induces a functor j ∗ Z : c E Z → \ W ( Z ) . Composing the two, we obtain a functor Gl : S Z → G Z : S Z = c V Z Ran i op Z − − − → c E Z j ∗ Z − → \ W ( Z ) = G Z . Definition 13. F or any strate gy F on X and any pushout squar e P of positions as on the right, with I consisting only of channels, let F ⊥ ⊥ P be the class of all strate gies G on Y such that Gl ([ F , G ]) ∈ ⊥ ⊥ Z . I Y X Z (4) Here, G is thought of as a test for F . Also, P denotes the whole pushout square and F ⊥ ⊥ P is notation for a notion indexed by such squares, whose definition uses ⊥ ⊥ Z → G Z . From the CCS point of vie w , I corresponds to the set of names shared by the process under observ ation ( F ) and the testing context ( G ) . Definition 14. Any two strate gies F , F 0 ∈ S X ar e ⊥ ⊥ -equiv alent , notation F ∼ ⊥ ⊥ F 0 , iff for all pushouts P as in 4, F ⊥ ⊥ P = F 0 ⊥ ⊥ P . 4.3 F air vs. must Let us now define fair and must testing equiv alences. Let a closed-world play be successful when it contains a ♥ n . Furthermore, for any closed-world behaviour G ∈ G X and closed-world play U ∈ W ( X ) , an e xtension of a state σ ∈ G ( U ) to U 0 is a σ 0 ∈ G ( U 0 ) with i : U → U 0 and G ( i )( σ 0 ) = σ . The extension σ 0 is successful when U 0 is. The intuition is that the behaviour G , before reaching U 0 with state σ 0 , passed through U with state σ . Definition 15. The fair criterion ⊥ ⊥ f contains all closed-world behaviours G such that any state σ ∈ G ( U ) for finite U admits a successful extension. No w call an extension of σ ∈ G ( U ) strict when U → U 0 is not surjectiv e, or , equi valently , when U 0 contains more moves than U . For any closed-world behaviour G ∈ G X , a state σ ∈ G ( U ) is G - maximal when it has no strict extension. Definition 16. Let the must criterion ⊥ ⊥ m consist of all closed-world behaviours G such that for all closed-world U and G-maximal σ ∈ G ( U ) , U is successful. W e now sho w that fair and must testing equiv alence coincide. The key result for this is: Theorem 4. F or any strate gy F on X , any state σ ∈ Gl ( F )( U ) with finite U admits a Gl ( F ) -maximal extension. The proof basically amounts to implementing a scheduler in our framework — a fair one, of course. Thanks to the theorem, we hav e: Lemma 1. F or all F ∈ S X , Gl ( F ) ∈ ⊥ ⊥ m X iff Gl ( F ) ∈ ⊥ ⊥ f X . Pr oof. Let G = Gl ( F ) . ( ⇒ ) By Theorem 4, any state σ ∈ G ( U ) has a G -maximal e xtension σ 0 ∈ G ( U 0 ) , which is successful by hypothesis, hence σ has a successful extension. ( ⇐ ) Any G -maximal σ ∈ G ( U ) admits by hypothesis a successful extension which may only be on U by G -maximality , and hence U is successful. No w comes the expected result: Theorem 5. F or all F , F 0 ∈ S X , F ∼ ⊥ ⊥ m F 0 iff F ∼ ⊥ ⊥ f F 0 . 20 Innocent strategies as preshea ves . . . Pr oof. ( ⇒ ) Consider two strategies F and F 0 on X , and a strategy G on Y (as in the pushout (4)). W e hav e, using Lemma 1: Gl ( F k G ) ∈ ⊥ ⊥ f if f Gl ( F k G ) ∈ ⊥ ⊥ m if f Gl ( F 0 k G ) ∈ ⊥ ⊥ m if f Gl ( F 0 k G ) ∈ ⊥ ⊥ f . ( ⇐ ) Symmetric. T o explain what is going on here, let us consider again P = ( Ω | a ) , Q = Ω , and the context C = a . ♥ | . W e implement C by choosing as a test the strategy T = J a . ♥ K on a single player knowing one name a . T aking I to consist of the sole name a , the pushout Z as in Definition 13 consists of two players, say x for the observed strategy and y for the test strategy , sharing the name a . Now , assuming that Ω loops deterministically , the global behaviour G = Gl ([ J P K , T ]) has exactly one state on the empty play , and again exactly one state on the play π 1 consisting of only one fork mov e by x . Thus, G reaches a position with three players, say x 1 playing Ω , x 2 playing a , and y playing a . ♥ . What makes the theorem work is that the play with ω silent mov es by x 1 is not maximal. Indeed, we could insert (anywhere in the sequence of mov es by x 1 ) a synchronisation mov e by x 2 and y , and then a tick move by the av atar of y . Essentially: our notion of play is more fair than just traces. A Diagrams In this section, we define the category on which our diagrams are preshea ves. The techniques used here date back at least to Carboni and Johnstone [4, 5]. Let us first consider two baby examples. It is well- kno wn that directed multigraphs form a presheaf category: consider the category C freely generated by the graph with two vertices, say and [ 1 ] , and two edges d , c : → [ 1 ] between them. One way to visualise this is to compute the cate gory of elements of a fe w preshea ves on C . Recall that the category of elements of a presheaf F on C is the comma category y ↓ b C F , where y is the Y oneda embedding. V ia Y oneda, it has as elements pairs ( C , x ) with C ∈ ob ( C ) and x ∈ F ( C ) , and morphisms ( C , x ) → ( D , y ) morphisms f : C → D in C such that F ( f )( y ) = x (which we abbreviate as y · f = x when the context is clear). Example 7. Consider the pr esheaf F defined by the following equations, whose cate gory of elements is actually fr eely gener ated by the graph on the right: • F ( ) = { 0 , 1 , 2 } , • F ([ 1 ]) = { e , e 0 } , • e · d = 0 , • e · c = 1 , • e 0 · d = 1 , • e 0 · c = 2 , 1 e e 0 0 2 . d c d c This graph is of course not e xactly the expected one, b ut it does r epr esent it. Indeed, for each vertex we know whether it is in F ( ) or F ([ 1 ]) , hence whether it repr esents a ‘vertex’ or an ‘edg e’. The arr ows all go fr om a ‘vertex’ v to an ‘edge’ e. They are in F ( d ) when v is the domain of e, and in F ( c ) when v is the codomain of e. Multigraphs may also be seen as a presheav es on the category freely generated by the graph with • as vertices: one special vertex , plus for each natural number n a v ertex, say , [ n ] ; and • n + 1 edges → [ n ] , say d 1 , . . . , d n , and c . T . Hirschowitz & D. Pous 21 It should be natural for presheav es on this category to look like multigraphs: the elements of a presheaf F above are the vertices in the multigraph, the elements abov e [ n ] are the n -ary multiedges, and the action of the d i ’ s giv e the i th source of a multiedge, while the action of c gi ves its tar get. Example 8. Similarly , computing a fe w cate gories of elements might help visualising. As above, consider F defined by • F ( ) = { 0 , 1 , 2 , 3 , 4 } , • F ([ 1 ]) = F ([ 0 ]) = / 0 , • F ([ 2 ]) = { e 0 } , • F ([ 3 ]) = { e } , • F ([ n + 4 ]) = / 0 , • e · c = 0 , • e · d 1 = 1 , • e · d 2 = 2 , • e · d 3 = 3 , • e 0 · c = 1 , • e 0 · d 1 = 4 , • e 0 · d 2 = 5 , whose cate gory of elements is freely g enerated by the gr aph: 0 e 1 2 3 e 0 4 5 . c d 1 c d 2 d 3 d 1 d 2 No w , this pattern may be extended to higher dimensions. Consider for example e xtending the pre vious base graph with a vertex [ m 1 , . . . , m n ; p ] for all natural numbers n , p , m 1 , . . . , m n , plus edges s 1 : [ m 1 ] → [ m 1 , . . . , m n ; p ] , . . . , s n : [ m n ] → [ m 1 , . . . , m n ; p ] , and t : [ p ] → [ m 1 , . . . , m n ; p ] . Let no w C be the free category on this extended graph. Preshea ves on C are a kind of 2-multigraphs: they have vertices, multiedges, and multiedges between multiedges. W e could continue this in higher dimensions. Defining the base category of the paper follows a very similar pattern. W e start from a slightly dif ferent graph: let G 0 hav e just one verte x ; let G 1 , ha ve one vertex , plus a vertex [ n ] for each natural number n , plus n edges d 1 , . . . , d n : → [ n ] . Let C 0 and C 1 be the categories freely generated by G 0 and G 1 , respectively . So, presheaves on C 1 are a kind of hypergraphs with arity (since vertices incident to a hyperedge are numbered). This is enough to model positions. No w , consider the graph G 2 , which is G 1 augmented with: • for all n , vertices ♥ n , π l n , π r n , ν n , • for all n and 0 ≤ i < n , vertices ι + n , i and ι − n , i , • for all n , edges s , t : [ n ] → ♥ n , s , t : [ n ] → π l n , s , t : [ n ] → π r n , s : [ n ] → ν n , t : [ n + 1 ] → ν n , • for all n and 0 ≤ i < n , edges s , t : [ n ] → ι + n , i , s , t : [ n ] → ι − n , i . Note that only name creation changes the number of names known to the player, and accordingly the corresponding morphism t has domain [ n + 1 ] . W e slightly abuse language here by calling all these t ’ s and s ’ s the same. W e could label them with their codomain, but we refrain doing so for the sake of readability . 22 Innocent strategies as preshea ves . . . No w , let C 2 be the cate gory generated by G 2 and the relations s ◦ d i = t ◦ d i for all n and 0 ≤ i < n (for all possible — common — codomains with main index n for s and t ). Presheav es on C 2 are enough to model vie ws, but since we want more, we continue, as follo ws. Let G 3 be G 2 , augmented with: • for all n , a verte x π n , and • edges l : π l n → π n and r : π r n → π n . Let C 3 be the category generated by G 3 and the relations l ◦ s = r ◦ s (this models the fact that a forking mov e should be played by just one player). Presheav es on C 3 are enough to model full moves; to model closed-world mo ves, and in particular synchronisation, we continue as follo ws. Let G 4 be G 3 , augmented with, for all n , m , 0 ≤ i < n , and 0 ≤ j < m , • a verte x τ n , i , m , j , and • edges ε : ι + n , i → τ n , i , m , j and ρ : ι − m , j → τ n , i , m , j . Let C 4 be the category generated by G 4 and the relations ε ◦ s ◦ d i = ρ ◦ s ◦ d j (which models the fact that a synchronisation in volves an input and an output on the same name). Acknowledgements Thanks to the courageous having endured the first versions of this work. Spe- cial thanks to Paul-Andr ´ e Melli ` es for his graphical design skills, and to pseudonymous referee Michel Houellebecq, not only for our very useful and enjoyable discussion, but also for tolerating our rather poor litterary style. Finally , thanks to Mark W eber for teaching the first author the techniques of Appendix A. Refer ences [1] Emmanuel Bef fara (2005): Logique, r ´ ealisabilit ´ e et concurr ence . Ph.D. thesis, Universit ´ e Paris 7. [2] Marcello M. Bonsangue, Jan J. M. M. Rutten & Alexandra Silva (2009): A Kleene Theorem for P olynomial Coalgebras . In Luca de Alfaro, editor: FOSSACS , Lecture Notes in Computer Science 5504, Springer , pp. 122–136, doi:10.1007/978-3-642-00596-1 10. [3] Albert Burroni (1993): Higher-Dimensional W ord Pr oblems with Applications to Equational Logic . Theo- retical Computer Science 115(1), pp. 43–62, doi:10.1016/0304-3975(93)90054-W. [4] Aurelio Carboni & Peter Johnstone (1995): Connected Limits, F amilial Representability and Artin Glueing . Mathematical Structures in Computer Science 5(4), pp. 441–459, doi:10.1017/S0960129500001183. [5] Aurelio Carboni & Peter Johnstone (2004): Corrigenda for ’Connected limits, familial r epr e- sentability and Artin glueing’ . Mathematical Structures in Computer Science 14(1), pp. 185–187, doi:10.1017/S0960129503004080. [6] Rocco De Nicola & Matthe w Hennessy (1984): T esting Equivalences for Pr ocesses . Theor . Comput. Sci. 34, pp. 83–133, doi:10.1016/0304-3975(84)90113-0. [7] Oli vier Delande & Dale Miller (2008): A Neutral Appr oach to Pr oof and Refutation in MALL . In: Proc. LICS , pp. 498–508, doi:10.1109/LICS.2008.35. [8] H. Ehrig, H.-J. Kreowski, Ugo Montanari & Grze gorz Rozenber g, editors (1999): Handbook of Graph Gram- mars and Computing by Graph T ransformation, V olume 3: Concurrency , P arallelism and Distribution . W orld Scientific. [9] Marcelo P . Fiore (2008): Second-Order and Dependently-Sorted Abstract Syntax . In: Proc. LICS , pp. 57–68, doi:10.1109/LICS.2008.38. T . Hirschowitz & D. Pous 23 [10] Fabio Gadducci, Reiko Heckel & Merc ` e Llabr ´ es (1999): A Bi-Cate gorical Axiomatisation of Concurr ent Graph Rewriting . Electronic Notes in Theoretical Computer Science 29, doi:10.1016/S1571-0661(05)80309- 3. [11] Fabio Gadducci & Ugo Montanari (2000): The tile model . In Gordon D. Plotkin, Colin Stirling & Mads T ofte, editors: Proof, Language, and Interaction , The MIT Press, pp. 133–166. [12] Jean-Yves Girard (2001): Locus Solum: F r om the rules of logic to the logic of rules . Mathematical Structures in Computer Science 11(3), pp. 301–506, doi:10.1007/3-540-44802-0 3. [13] Rob J. van Glabbeek (1990): The Linear T ime-Branching T ime Spectrum (Extended Abstract) . In Jos C. M. Baeten & Jan W illem Klop, editors: CONCUR , Lecture Notes in Computer Science 458, Springer , pp. 278– 297, doi:10.1007/BFb0039066. [14] Yves Guiraud & Philippe Malbos (2009): Higher-dimensional cate gories with finite derivation type . Theory and Applications of Cate gories 22(18), pp. 420–278. [15] Andr ´ e Hirschowitz, Michel Hirscho witz & T om Hirschowitz (2009): Contraction-fr ee Pr oofs and F ini- tary Games for Linear Logic . Electronic Notes in Theoretical Computer Science 249, pp. 287–305, doi:10.1016/j.entcs.2009.07.095. [16] Andr ´ e Hirschowitz & Marco Maggesi (2007): Modules over Monads and Linearity . In Daniel Leiv ant & Ruy J. G. B. de Queiroz, editors: W oLLIC , Lecture Notes in Computer Science 4576, Springer , pp. 218–237, doi:10.1007/3-540-44802-0 3. [17] Andr ´ e Hirschowitz & Marco Maggesi (2010): Modules over monads and initial semantics . Information and Computation 208(5), pp. 545–564, doi:10.1016/j.ic.2009.07.003. [18] Tom Hirschowitz: Cartesian closed 2-cate gories and permutation equivalence in higher-or der re writing . A vailable at http://hal.archives- ouvertes.fr/hal- 00540205/en/ . [19] Martin Hyland (1997): Semantics and Logics of Computation , chapter Game Semantics. Cambridge Univ er- sity Press, doi:10.1017/CBO9780511526619.005. [20] Bart Jacobs (1999): Categorical Logic and T ype Theory . Studies in Logic and the Foundations of Mathemat- ics 141, North Holland, Amsterdam. [21] Ole H. Jensen & Robin Milner (2004): Bigraphs and mobile pr ocesses (re vised) . T echnical Report TR580, Univ ersity of Cambridge. A vailable at http://www.cl.cam.ac.uk/TechReports/UCAM- CL- TR- 580. pdf . [22] Andr ´ e Joyal, Mogens Nielsen & Glynn W inskel (1993): Bisimulation and open maps . In: LICS , IEEE Computer Society , pp. 418–427, doi:10.1109/LICS.1993.287566. [23] Stefano Kasangian & Anna Labella (1999): Observational trees as models for concurr ency . Mathematical Structures in Computer Science 9(6), pp. 687–718, doi:10.1017/S0960129599002935. [24] Joachim K ock (2011): P olynomial Functors and T rees . International Mathematics Research Notices 2011(3), pp. 609–673, doi:10.1093/imrn/rnq068. [25] Jean-Louis Krivine (2003): Dependent choice, ‘quote’ and the clock . Theor . Comput. Sci. 308(1-3), pp. 259–276, doi:10.1016/S0304-3975(02)00776-4. [26] Joachim Lambek (1968): A fixpoint theor em for complete cate gories . Mathematische Zeitschrift 103, pp. 151–161, doi:10.1007/BF01110627. [27] Saunders Mac Lane (1998): Cate gories for the W orking Mathematician , 2nd edition. Graduate T exts in Mathematics 5, Springer . [28] Saunders MacLane & Ieke Moerdijk (1992): Sheaves in Geometry and Logic: A F irst Intr oduction to T opos Theory . Universite xt, Springer . [29] Paul-Andr ´ e Melli ` es (2004): Async hr onous games 2: the true concurrency of innocence . In: Proc. CON- CUR ’04 , LNCS 3170, Springer V erlag, pp. 448–465, doi:10.1016/j.tcs.2006.01.016. [30] Robin Milner (1980): A Calculus of Communicating Systems . LNCS 92, Springer, doi:10.1007/3-540-10235- 3. 24 Innocent strategies as preshea ves . . . [31] T obias Nipko w (1991): Higher-Or der Critical P airs . In: LICS , IEEE Computer Society , pp. 342–349, doi:10.1109/LICS.1991.151658. [32] Gordon D. Plotkin (1981): A structur al appr oach to operational semantics . DAIMI Report FN-19, Computer Science Department, Aarhus Univ ersity . [33] Julian Rathke & Pawel Sobocinski (2008): Deconstructing behavioural theories of mobility . In: IFIP TCS , IFIP 273, Springer, pp. 507–520, doi:10.1007/978-0-387-09680-3 34. [34] Vladimiro Sassone & Pawel Soboci ´ nski (2003): Deriving Bisimulation Congruences Using 2-cate gories . Nordic Journal of Computing 10(2). [35] Peter Sewell (1998): F r om Rewrite to Bisimulation Congruences . In Davide Sangiorgi & Robert de Simone, editors: CONCUR , Lecture Notes in Computer Science 1466, Springer , pp. 269–284, doi:10.1007/BFb0055611. [36] Daniele Turi & Gordon D. Plotkin (1997): T owards a Mathematical Operational Semantics . In: LICS , pp. 280–291, doi:10.1109/LICS.1997.614955. [37] Angelo V istoli (2007): Notes on Gr othendieck topologies, fiber ed cate gories and descent theory . A vailable at .
Original Paper
Loading high-quality paper...
Comments & Academic Discussion
Loading comments...
Leave a Comment