<<

Resource modalities in game Paul-André Melliès, Nicolas Tabareau

To cite this version:

Paul-André Melliès, Nicolas Tabareau. Resource modalities in game semantics. 2007. ￿hal-00144510￿

HAL Id: hal-00144510 https://hal.archives-ouvertes.fr/hal-00144510 Preprint submitted on 3 May 2007

HAL is a multi-disciplinary open access L’archive ouverte pluridisciplinaire HAL, est archive for the deposit and dissemination of sci- destinée au dépôt et à la diffusion de documents entific research documents, whether they are pub- scientifiques de niveau recherche, publiés ou non, lished or not. The documents may come from émanant des établissements d’enseignement et de teaching and research institutions in France or recherche français ou étrangers, des laboratoires abroad, or from public or private research centers. publics ou privés. hal-00144510, version 1 - 3 May 2007 A itself. game the resource, a game consuming a playing like that just idea is the by semantics, game in reflected n)ishypothesis its ing) ue.I atclr ro fteformula the of proof a particular, con- In once every disappears that which sumed. is resource, striking a linear as and behaves of elegant formula principle of basic series One a by analogies. supported is games and game. ai I,2paeJsiu ae71,721PrsCdx0,F 05, Cedex Paris 75251 7014, Case addresses: Jussieu, Email place 2 PP VII, Equipe Paris address: Postal (INVAL). informatiques systèmes eurdt eueteconclusion the deduce to required proof atc eeoe taiy olwn h data every that idea the se- formula game following guided, steadily, Properly developed days. mantics early the health in extraordinarily profitable time. was and long logic it very linear a [9], of re- for ascendancy Girard This influence the Jean-Yves spiritual by by its produced under logic remained turmoil linear the be- of the in discovery at cent 1990s, reborn) the (or born of logic: ginning linear of sibling younger logic. linear and semantics Game Introduction 1 exponential. and poli affine to resource linear, various extended cies: capture is to bracketing order game of in arena notion multi-bracketing usual an the construct re- where and of model semantics, model categorical game a this in design from sources we Starting view, of concep- logic. point linear is revised than semantics ad- primitive We game more that lin- semantics. tually here: that game contrary than belief the primitive the vocate more is conception: logic misleading ear logic a linear of of precision because and simplicity the achieved never ∗ →¬ 7→ nte ai rnil flna oi sta that is logic linear of principle basic Another hscrepnec ewe omlso ierlogic linear of formulas between correspondence This h ecito frsucsi aesmnishas semantics game in resources of description The hswr a enspotdb h N nainsalgébriqu Invariants ANR the by supported been has work This ftefruadsrbsa describes formula the of A flna oi ecie a describes logic linear of sivltv.Ti en hteeyformula every that means This involutive. is [email protected] A xcl ne hspicpei nicely is principle This once. exactly Abstract eoremdlte ngm semantics game in modalities Resource strategy and B alAdéMlisNclsTabareau Nicolas Melliès Paul-André game [email protected] aesmnisi the is semantics Game yuig(rconsum- (or using by o lyn nthat on playing for n htevery that and ; A ,Université S, ⊸ RANCE. sdes es B A is is y - , h eetdcmoet ial,teepnnilmodality logic exponential linear the of Finally, component. selected the a es)todfeetlnso research: of lines by different propelled two arose, least) semantics (at game of generation new a So, wthfo oyt nte n n 2 ooe fresh a open to (2) and game one the to another of (1) to copy allowed copy is a Opponent game from only the switch and of parallel, copies in several played where are game the as terpreted ishsbe oeacpt teffo ierlgci the inher- designs, in semantics: own denotational logic its from with linear ited comply from to itself order in emancipate mid–1990s, to been has tics logic. linear with schism game A [5]. this logic that linear to remarkable predecessor also early resource is an the is It . flavour linear full of and the Simple policy reflects [6]. model in Blass the Andreas elegant, by defined logic linear of formulas rpnn ly h rtmv,wihcnit nchoosing in game consists the which between move, first the plays Proponent product formulas tensor two the of instance, For semantics. game in nothing. doing Opponent like and just Proponent is twice of which game twice, rôle a the negating permuting Hence, to players. amounts two the of rôles the yteie htngtn game a negating semantics game that in idea reflected the nicely by is principle this Again, mula) formula) (or oett h te n.Smlry h sum the Similarly, one. other the to ponent qa o tlatioopi)t h oml eae twice: negated formula the to isomorphic) least at (or equal .tedsr oudrtn h leri rnilso pro- of principles algebraic the understand to desire the 2. .tedsr ointerpret to desire the 1. htw eciehr si sec h aesemantics game the essence in is here describe we What h oncie flna oi r loncl reflected nicely also are logic linear of connectives The aeoytheory. of category the using effects, and gramming behaviour interactive etc.) their inside states, exactly characterise (recursion, to effects and with languages ming B hr nyOpnn a wthfo com- a from switch may Opponent only where , A ul abstract fully and A ! A B A lydi aallwt h ae(rfor- (or game the with parallel in played A A ssial nepee stegm where game the as interpreted suitably is ple oteformula the to applied and . n h game the and A B ∗ models; ssial nepee stegame the as interpreted suitably is = ∼ programs h etn fgm seman- game of destiny The ¬¬ A B A. eoecryn nin on carrying before , osssi permuting in consists rte nprogram- in written A A ssial in- suitably is ⊕ B A ftwo of ⊗ (1) B A 1. Samson Abramsky and Radha Jagadeesan [2] noticed is Proponent, and λOP (m) = −1 when it is Opponent. Fi- that the (alternating variant of the) Blass model does nally, one requires that the arena is alternating: not define a categorical model of . Worse: OP OP it does not even define a category, for lack of asso- m ⊢ n =⇒ λ (m)= −λ (n) ciativity. Abramsky dubs this phenomenon the Blass problem and describes it in [1]. and that all roots (called opening moves) of the arena have the same polarity. A typical example of arena is the boolean 2. Martin Hyland and Luke Ong [16] introduced the no- arena B: tion of arena game, and characterised the interactive q H behaviour of programs written in the functional lan- xx HH xx HH (3) guage PCF — the simply-typed λ-calculus with con- x true false ditional test, arithmetic and recursion. where the Opponent move q justifies the two Proponent So, the Blass problem indicates that it is difficult to con- moves true and false. Every arena game A induces a set struct a (sequential) game model of linear logic; and at of justified plays, which are essentially sequences of moves about the same time, arena games become mainstream al- (we will avoid discussing pointers here.) Typically, the PCF though they do not define a model of linear logic. These type two reasons (at least) opened a schism between game se- (B3 ⇒ B2) ⇒ B1 mantics and linear logic: it suddenly became accepted that categories of (sequential) games and strategies would only defines the arena capture fragments of linear logic (intuitionistic or polarised) ff q1 but not the whole thing. fffff HH fffff yy On the other hand, defining the resource modalities of f q2 true false fffff HH linear logic for game semantics requires to reunify the two fffff yy q3 f true false schismatic subjects. Since the disagreement started with x II category theory, this reunification should occur at the cat- true false egorical level. We explain (in §2) how to achieve this by re- where the indices 1, 2, 3 distinguish the three instances of laxing the involutive negation of linear logic into a less con- the boolean arena B. This arena contains the justified play strained tensorial negation. This negation induces in turn a linear continuation monad, whose unit q1 · q2 · q3 · true3 · true2 · true1 (4)

A −→ ¬¬A (2) also depicted using the convention below: refines the isomorphism (1) of linear logic. Moving from (B ⇒ B) ⇒ B an involutive to a tensorial negation means that we replace q linear logic by a more general and primitive logic – which q we call tensorial logic. As we will see, this shift to ten- q (5) sorial logic clarifies the Blass problem, and describes the true structure of arena games. It also enables the expressions true of resource modalities in game semantics, just as it is usu- true ally done in linear logic. However, because the presentation of modalities may appear difficult to readers not familiar Note that the play (4-5) belongs to the strategy implemented with categorical semantics, we prefer to recall first the no- by the PCF program λf.f(true). tion of well-bracketing in arena games — and explain how it can be reunderstood as a resource policy, and extended to Well-bracketing. Hyland and Ong demonstrate in their multi-bracketing. work [16] that a (finite) strategy can be implemented in PCF if and only if it satisfies two fundamental conditions, Arena games. Recall that an arena is defined as a forest called innocence and well-bracketing. We will focus here of rooted trees, whose nodes are called the moves of the on the well-bracketing condition, which is very similar game. One writes to a stack discipline. The condition is usually expressed m ⊢ n in the following way. Arenas are refined by attaching a and says that the move m enables the move n when the mode λQA(m) ∈ {Q, A} to every move m of the arena. move m is the immediate ancestor of the move n in the A move m is called a question when λQA(m) = Q, and arena. Every move m is assigned a polarity λOP (m) ∈ an answer when λQA(m) = A. One then requires that no {−1, +1}. By convention, λOP (m) = +1 when the move answer move m justifies another answer move n: m ⊢ n =⇒ λQA(m)= Q or λQA(n)= Q. • the number κ− of Opponent questions opened but left unanswered. The intuition indeed is that an answer n responds to the question m which justifies it in the play. Note that alterna- Of course, it is not sufficient to count the two numbers κ+ tion ensures that Proponent answers the questions raised by and κ− of a play s to detect whether the play is well- Opponent, and vice versa: hence, a player never answers his bracketed. Typically, the well-bracketed play (a) and the own questions. For instance, the arena game B is refined by non well-bracketed play (b) introduced in (6-7) induce the declaring that the Opponent move q is a question, and that same numbers κ+ and κ−: the two Proponent moves true and false are answers. + − Now, a justified play s is called well-bracketed when ev- (a) q1 · q2 · q3 · true3 7−→ κ =1, κ =1 + − ery answer n appearing in the play responds to the “pend- (b) q1 · q2 · q3 · true1 7−→ κ =1, κ =1 ing” question m. The terminology is supported by the intu- In order to detect well-bracketing, one needs to apply the ition that (1) every question “opens” a bracket and (2) every count to the subpaths (c) and (d) of these plays. This reveals answer “closes” a bracket, which should match the bracket a key difference: opened by the answered question. Typically, the play (4-5) is well-bracketed, because every answer responds properly + − (c) q3 · true3 7−→ κ =0, κ =0 to the last unanswered question, thus leading to the well- + − (d) q3 · true1 7−→ κ =0, κ =1 bracketed sequence: The elementary but key characterisation follows: q1 · q2 · q3 · true3 · true2 · true1 (1 1) Proposition 1 A play s is well-bracketed if and only if ev- (2 2) ery subpath m · t · n of the play s satisfies

(3 ) 3 κ+(m · t · n)=0 =⇒ κ−(m · t · n)=0 On the other hand, the play when m is Opponent and n is Proponent; and dually (B ⇒ B) ⇒ B q κ−(m · t · n)=0 =⇒ κ+(m · t · n)=0 q (6) q when m is Proponent and n is Opponent. true Let us explain this briefly. Suppose that m · t · n is a sub- is not well-bracketed, because the move true answers the path of a well-bracketed play s, where m is Opponent and first question of the play, whereas it should have answered n is Proponent. The first condition says that if there is an the third (and pending) question. This may be depicted in Opponent question unanswered in m · t, then either Player the following way: answers it – in which case κ−(m · t · n)=0 – or there is a Player question unanswered in m · t · n – in which case q1 · q2 · q3 · true1 κ+(m · t · n) 6=0. The other condition is dual. (1 1) (7) A resource policy. Reformulated in this way, the well- (2 bracketing looks very much like a resource policy. The ba- (3 sic intuition is that every question m emits a query for a In fact, the play (6-7) belongs to a strategy which tests linear session. This query is noted by a opening bracket (i and counted by κ± where is the polarity of the move m. whether the function f : B ⇒ B is strict, that is, interro- ± gates its argument: this test cannot be implemented in the The query is then complied with by a response emitted by language PCF – although it can be implemented in PCF ex- an answer move n, and noted by a closing bracket i). Inour tended with the control operator call-cc, see [7, 22]. example, the move q3 emits a query (3 which is later com- plied with in the play (4-5) by the response 3) emitted by the Counting resources. We would like to understand well- move true whereas it remains unanswered in the play (6- bracketing as a resource discipline, rather than simply as a 7). Hence, a play like (6-7) is not well-bracketed because it stack discipline. One key step in this direction is the obser- breaks the linearity policy implemented by the queries. Our vation that a well-bracketed play may be detected simply by game model will relate this linearity policy to the fact that counting two specific numbers on a path: the boolean formula is defined as • the number κ+ of Proponent questions opened but left B O P unanswered, = ¬ ¬ (1 ⊕ 1) (8) in tensorial logic. Here, the tags O and P are mnemonics the play (10) appears to be “well-bracketed” if one depicts to indicate that the external negation ¬O is interpreted as the situation in the following way: an Opponent move, whereas the internal negation ¬P is in- terpreted as a Proponent move. The story told by (8) goes q1 · q2 · true2 · q3 · true3 · true1 like this: Opponent plays the external negation, followed by (1 1) Proponent, who plays the internal negation and at the same (a a)(2 2) time resolves the choice 1 ⊕ 1 between true and false. ( )( ) This refines the picture conveyed by the boolean arena (3) b b 3 3 by decomposing the Player moves true and false in two whereas the play (11) is not “well-bracketed” because the compound stages: negation and choice – where negation query ( is never complied with, as can be guessed from the thus encapsulates the two moves true and false. This en- a picture below: ables to relax the well-bracketing policy by interpreting the boolean formula as q1 · q3 · true3 · true1 O P (1 1) B = ¬ w•! ¬ (1 ⊕ 1) (9) (a where the affine modality w•! of tensorial logic is inserted (b b)(3 3) between the two . The intuitionistic hierarchy on the boolean formula (8) coincides with the well-bracketed We explain in §3 and §4 how we apply the well-bracketing arena game model of PCF described by Hyland and Ong criterion devised in Proposition 1 in order to generalise in [16] whereas the intuitionistic hierarchy on the boolean well-bracketing to a multi-bracketed framework. formula (9) – where the affine modality w•! is replaced by the exponential modality •e! – coincides with the non-well- Plan of the paper. We describe (§2) a categorical seman- bracketed arena game model of PCF with control described tics of resources in game semantics, and explain in what by Jim Laird in [22] and Olivier Laurent in [24]. sense the resulting topography refines both linear logic and polarized logic. After that, we construct (§3) a compact- Multi-bracketing. This analysis leads us to the notion of closed (that is, self-dual) category of multi-bracketed Con- multi-bracketing in arenagames. In linear logic, everyproof way games and well-bracketed strategies, where the re- of the formula source policy is enforced by multi-bracketing. From this, (B ⊗ B) ⊸ B we derive (§4) a model of our categorical semantics of re- sources, using a family construction, and conclude (§5). asks the value of its two boolean arguments, and we would like to understand this as a kind of well-bracketing condi- Acknowledgements. We would like to thank Martin Hy- tion. So, the play land together with Masahito Hasegawa, Olivier Laurent, Laurent Regnier and Peter Selinger for stimulating discus- (B ⊗ B) ⊸ B q sions at various stages of this work. q true (10) 2 Categorical models of resources q true We introduce now the notion of tensorial negation on a true symmetric monoidal category; and then explain how such a category with negation may be equipped with additives would be “well-bracketed” in the new setting, whereas the and various resource modalities. The first author describes play in [27] how to extract a syntax of proofs from a categorical (B ⊗ B) ⊸ B semantics, using string diagrams and functorial boxes. The q recipe may be applied here to extract the syntax of a logic, q (11) called tensorial logic. However, we provide in Appendix a true sequent calculus for tensorial logic, in order to compare it true to linear logic [9] or polarized linear logic [23]. would not be “well-bracketed”, because it does not explore Tensorial negation. A tensorial negation on a symmetric the second argument of the function. This extended well- monoidal category (A, ⊗, 1) is defined as a functor bracketing is captured by the idea that the first question op emits three queries (1 and (a and (b at the same time. Then, ¬ : A −→ A together with a family of bijections Linear implication. A symmetric monoidal category A with a tensorial negation ¬ is not very far from being ϕA,B,C : A(A ⊗ B, ¬C) =∼ A(A, ¬(B ⊗ C)) monoidal closed. It is possible indeed to define a linear natural in A, B and C. Given a negation, it is customary to implication ⊸ when its target ¬B is a negated object: define the formula false as the object A ⊸ ¬B def= ¬ (A ⊗ B). def ⊥ = ¬ 1 In this way, the functor (12) defines what we call an expo- obtained by “negating” the unit object 1 of the monoidal nential ideal in the category A. When the functor is faith- category. Note that we use the notation 1 (instead of I or ful on objects and morphisms, we may identify this expo- e) in order to remain consistent with the notations of linear nential ideal with the subcategory of negated objects in the logic. Note also that the bijection ϕA,B,1 provides then the category A. The exponential ideal discussed in Guy Mc- category A with a one-to-one correspondence Cusker’s PhD thesis [26] arises precisely in this way. This enables in particular to define the linear and intuitionistic ϕA,B, : A(A ⊗ B, ⊥) =∼ A(A, ¬B) 1 hierarchies on the arena games (8) and (9). for all objects A and B. For that reason, the definition of a negation ¬ is often replaced by the — somewhat too in- Continuation category. Every symmetric monoidal cate- formal — statement that “the object ⊥ is exponentiable” gory A equipped with a negation ¬ induces a category of ¬ in the symmetric monoidal category A, with negation ¬A continuations A with the same objects as A, and mor- noted ⊥A. phisms defined as ¬ def Self-adjunction. In his PhD thesis, Hayo Thielecke [35] A (A, B) = A(¬A, ¬B). observes for the first time a fundamental “self-adjunction” Note that the category A¬ is the kleisli category associated phenomenon, related to negation. This observation plays to the comonad in Aop induced by the adjunction; and that then a key rôle in an unpublished work by Peter Selinger it is at the same time the opposite of the kleisli category as- and the first author [30] on polar categories, a categori- sociated to the continuation monad in A. Because the con- cal semantics of polarized linear logic, continuations and tinuation monad is strong, the category A¬ is premonoidal games. The same idea reappears recently in a nice, com- in the sense of John Power and Edmund Robinson [32]. It prehensive study on polarized categories (=distributors) by should be noted that string diagrams in premonoidal cate- Robin Cockett and Robert Seely [8]. In our situation, the gories are inherently related to control flow charts in soft- “self-adjunction” phenomenon amounts to the fact that ev- ware engineering, as noticed by Alan Jeffrey [18]. ery tensorial negation is left adjoint to the opposite functor Semantics of resources. A resource modality on a sym- op ¬ : A −→ A (12) metric monoidal category (A, ⊗,e) is defined as an adjunc- because of the natural bijection tion: U & op A, B ∼ A, B . & A (¬ ) = A( ¬ ) M g ⊥ A (14) Continuation monad. Every tensorial negation ¬ in- F where duces an adjunction, and thus a monad • (M, •,u) is a symmetric monoidal category, ¬¬ : A −→ A • U is a symmetric monoidal functor. This monad is called the continuation monad of the Recall that a symmetric monoidal functor U is a func- negation. One fundamental fact observed by Eugenio tor which transports the symmetric monoidal struc- Moggi [31] is that the continuation monad is strong but not ture of (M, •,u) to the symmetric monoidal structure commutative in general. By strong monad, we mean that of (A, ⊗,e), up to isomorphisms satisfying suitable coher- the monad is equipped with a family of morphisms: ¬¬ ence properties. Another more conceptualdefinition of a re- tA,B : A ⊗ ¬¬B −→ ¬¬ (A ⊗ B) source modality is possible: it is an adjunction defined in the natural in A and B, and satisfying a series of coherence 2-category of symmetric monoidal categories, lax symmet- properties. By commutative monad, we mean a strong ric monoidal functors, and monoidal transformations. Now, monad making the two canonical morphisms the resource modality is called • affine when the unit u is the terminal object of the cat- ¬¬A ⊗ ¬¬B ⇉ ¬¬ (A ⊗ B) (13) egory M, coincide. A tensorial negation ¬ is called commutative • exponential when the tensor product • is a cartesian when the continuation monad induced in A is commutative product, and the unit u is the terminal object of the — or equivalently, a monoidal monad in the lax sense. category M. This definition of resource modality is inspired by the cat- rent’s polarized logic LLP coincides with multiplicative ad- egorical semantics of linear logic, and more specifically by ditive tensorial logic — where the monoidal structure is Nick Benton’s notion of Linear-Non-Linear model [4] — cartesian. This is manifest in the monolateral formulation which may be reformulated now as a symmetric monoidal of tensorial logic, see Appendix. We sum up below the dif- closed category A equipped with an exponentialmodality in ference between tensorial logic and in a very our sense. Very often, we will identify the resource modal- schematic table: ity and the induced comonad ! = U ◦ F on the category A. ⊗ is monoidal Tensorial logic Tensorial logic. In our philosophy, tensorial logic is en- ¬ is tensorial ⊗ is cartesian tirely described by its categorical semantics — which is de- Classical logic fined in the following way. First, every symmetric monoidal ¬ is tensorial category A equipped with a tensorial negation ¬ defines a Note that every resource modality (14) on a category A model of multiplicative tensorial logic. Such a category de- equipped with a tensorial negation induces a tensorial fines a modelof multiplicative additive tensorial logic when ¬ negation F op ◦¬◦ U on the category M. This provides a the category A has finite coproducts (noted ⊕) which dis- model of polarized linear logic, and thus of classical logic, tribute over the tensor product: this means that the canoni- whenever is cartesian. This phenomenon underlies the cal morphisms M construction of a control category in [25], see also [12] for (A ⊗ B) ⊕ (A ⊗ C) −→ A ⊗ (B ⊕ C) another construction. 0 −→ A ⊗ 0 OP are isomorphisms. Then, a model of (full) tensorial logic is Linear logic. The continuation monad A 7→ ¬¬ A of defined as a model of multiplicative additive tensorial logic, game semantics lifts an Opponent-starting game A with an equipped with an affine resource modality (with comonad Opponent move ¬O followed by a Player move ¬P . Now, noted w•! ) as well as an exponential resource modality (with it appears that the Blass problem mentioned in §1 arises comonad noted •e!). precisely from the fact that the monad is strong, but not The diagrammatic syntax of tensorial logic will be read- commutative [30, 28]. Indeed, one obtains a game model ily extracted from its categorical definition, using the recipe of (full) propositional linear logic by identifying the two explained in [27]. However, the reader will find a se- canonical strategies (13) — this leading to a fully complete quent calculus of tensorial logic in Appendix, written in the model of linear logic expressed in the language of asyn- more familiar fashion of proof theory. Seen from that point chronous games [29]. of view, the modality-free fragment of tensorial logic de- This construction in game semantics has a nice categor- scribes a linear variant of Girard’s LC [10] thus akin to lu- ical counterpart. We already mentioned that the continu- dics [11] and more precisely to what Laurent calls MALLP ation category A¬ inherits a premonoidal structure from in his PhD thesis [23]. This convergence simply expresses the symmetric monoidal structure of A. Now, Hasegawa the fact that these systems are all based on tensors, sums Masahito shows (private communication) that the continua- and linear continuations. tion category A¬ equipped with this premonoidal structure Arena games and classical logic. Starting from Thi- is ∗-autonomous if and only if the continuation monad is elecke’s work, Selinger [33] designs the notion of control commutative. The specialist will recognize here a categori- category in order to axiomatize the categorical semantics fication of Girard’s phase space semantics [9]. Anyway, this of classical logic. Then, prompted by a completeness re- shows that linear logic is essentially tensorial logic in which sult established by Martin Hofmann and Thomas Streicher the tensorial negation is commutative. in [15], he proves a beautiful structure theorem, stating that ⊗ is monoidal ¬ Linear logic every control category C is the continuation category A ¬ is commutative of a response category A. Now, a response category A — where the monic requirement on the units (2) is relaxed — In that situation, every resource modality on the category A is exactly the same thing as a model of multiplicative addi- induces a resource modality on the ∗-autonomous cate- tive tensorial logic, where the tensor ⊗ is cartesian and the gory A¬, and thus a model of full linear logic. tensor unit 1 is terminal. A purely proof-theoretic analysis of classical logic leads 3 Multi-bracketed Conway games exactly to the same conclusion. Starting from Girard’s work on polarities in LC [10] and ludics [11], Laurent devel- We define here and in §4 a game semantics with resource oped a comprehensive analysis of polarities in logic, incor- modalities and fixpoints, in order to interpret recursion in porating classical logic, control categories and (non-well- programming languages. We achieve this by construct- bracketed) arena games [23, 24]. Now, it appears that Lau- ing first a compact-closed category B of multi-bracketed Conway games, inspired from André Joyal’s pioneering The definition of residuals is then extended to paths s : x ։ work [19]. The compact-closed structure of B induces a y in the usual way: by composition of relations. We then trace operator [20] which, in turn, providesenough fixpoints define in the category constructed in §4 in order to interpret the def ′ ′ def ′ ′ language PCF enriched with resource modalities. r[s] = {r | r[s]r } and [s]r = {r | r [s]r}.

Conway games. A Conway game is an oriented rooted We say that a path s : x ։ y: graph (V,E,λ) consisting of a set V of vertices called the positions of the game, a set E ⊂ V × V of edges called the • complies with a query r ∈ QA(x) when r has no resid- moves of the game, a function λ : E → {−1, +1} indicat- ual after s — that is, r[s]= ∅, ing whether a move belongsto Opponent(−1) or Proponent • initiates a query r ∈ QA(y) when r has no ancestor (+1). We note ⋆ the root of the underlying graph. before s — that is, [s]r = ∅.

Path and play. A play is a path starting from the root ⋆A We require that a move m only initiates queries of its own of the multi-bracketed game: polarity, and only complies with queries of the opposite po- larity. In order to formalise that a residual of a query is m1 m2 mk−1 mk ⋆A −−→ x1 −−→ . . . −−−→ xk−1 −−→ xk (15) intuitively the query itself, we also require that two parallel paths s and t induce the same residual relation: [s] = [t]. Two paths are parallel when they have the same initial and Finally, we require that there are no queries at the root: final positions. A play (15) is alternating when: QA(⋆)= ∅. ∀i ∈{1,...,k − 1}, λA(mi )= −λA(mi). +1 Resource function. Extending Conway games with Strategy. A strategy σ of a Conway game is defined as a queries enables the definition of a resource function set of alternating plays of even length such that: κ = (κ+,κ−) • σ contains the empty play, which counts, for every path s : x ։ y, the number κ+(s) • every nonempty play starts with an Opponent move, (respectively κ−(s)) of Proponent (respectively Opponent) σ is closed by even-length prefix: for every play s, and • queries in r ∈ Q (y) initiated by the path s — that is, for all moves m,n, A such that [s]r = ∅. The definition of multi-bracketed games ± s · m · n ∈ σ =⇒ s ∈ σ, induces three cardinal properties of κ , which will replace the very definition of κ, and will play the rôle of axioms in • σ is deterministic: for every play s, and for all all our proofs – in particular, in the proof that the composite moves m,n,n′, of two well-bracketed strategies is also well-bracketed. Property 1: accuracy. For all paths s : x ։ y and Propo- s · m · n ∈ σ and s · m · n′ ∈ σ =⇒ n = n′. nent move m : y → z, We write σ : A when σ is a strategy of A. Note that a κ−(m)=0 and κ+(s · m)= κ+(s)+ κ+(m), play in a Conway game is generally non-alternating,but that alternation is required on the plays of a strategy. as well as the dual equalities for Opponent moves. Property 2: suffix domination. For all paths s : x ։ y and Multi-bracketed games. A multi-bracketed game is a t : y ։ z, Conway game equipped with κ(t) ≤ κ(s · t). • a finite set QA(x) of queries for each position x ∈ V Property 3: sub-additivity. For all paths s : x ։ y and of the game, t : y ։ z, κ(s · t) ≤ κ(s)+ κ(t). • a function λ(x) : Q (x) −→ {−1, +1} which as- A Accuracy holds because Player does not initiate Opponent signs to every query in Q (x) a polarity which indi- A queries, and does not comply with Player queries. Suffix cates whether the query is made by Opponent (−1) or domination says that a query cannot already have been com- Proponent (+1), m plied with. Sub-additivity expresses that composing two • for each move x −→ y,a residual relation paths does not increase the number of queries. [m] ⊂ Q (x) × Q (y) A A Well-bracketed plays and strategies. Once the resource satisfying: function κ is defined on paths, it becomes possible to de- fine a well-bracketed play as a play which satisfies the two r[m]r1 and r[m]r2 =⇒ r1 = r2 conditions stated in Proposition 1 of §1. So, the property r1[m]r and r2[m]r =⇒ r1 = r2 becomes a definition here. A strategy σ is then declared well-bracketed when, for every play s · m · t · n of the strat- Proof: The proof is entirely based on the three cardinal egy σ where m is an Opponent move and n is (necessarily) properties of κ mentioned earlier. The proof appears in the a Proponent move: Master’s thesis of the second author [34]. κ+(m · t · n)=0 =⇒ κ−(m · t · n)=0. A A The category B of multi-bracketed games. The cate- Every well-bracketed strategy σ then preserves well- gory B has multi-bracketed games as objects, and well- bracketing in the following sense: bracketed strategies σ of A∗ ⊗B as morphisms σ : A → B. Lemma 1 Suppose s · m · n ∈ σ and that s · m is well- The identity strategy is the usual copycat strategy, defined bracketed. Then, s · m · n is well-bracketed. by André Joyal in Conway game [19]. The resulting cate- Hence, when Opponent and Proponent play according gory B is compact-closed in the sense of [21] and thus ad- to well-bracketed strategies, the resulting play is well- mits a canonical trace operator, unique up to equivalence, bracketed. see [20] for details.

Dual. Every multi-bracketed game A induces a dual game Negative and positive games. A multi-bracketed game A A∗ obtained by reversing the polarity of moves and queries. is called negative when all the moves starting from the + − − + root ⋆A are Opponent moves; and positive when its dual Thus, (κ ∗ ,κ ∗ ) = (κ ,κ ). A A A A game A∗ is negative. The full subcategory of negative (resp. Tensor product. The tensor product A ⊗ B of two multi- positive) multi-bracketed games is noted B− (resp. B+). bracketed games A and B is defined as: For a multi-bracketed game A, we write A− for the nega- - its positions are the pairs (x, y) noted x ⊗ y, ie. tive game obtained by removing all the Player moves from VA⊗B = VA × VB with ⋆A⊗B = (⋆A,⋆B). the root. - its moves are of two kinds: The exponential modality. Every multi-bracketed z ⊗ y if x → z in the game A, x ⊗ y → game A induces an exponential game !A as follows: x ⊗ z if y → z in the game B.  - its positions are the words w = x1 · · · xk whose let- - its queries at position x ⊗ y are the queries at posi- ters are positions xi of the game A different from the tion x in the game A and the queries at position y in root ⋆A; the intuition is that the letter xi describes the current position of the ith copy of the game, the game B: QA⊗B(x ⊗ y)= QA(x) ⊎ QB(y). - its root ⋆!A is the empty word, The polarities of moves and queries in the game A ⊗ B ′ are inherited from the games A and B, and the residual re- - its moves w → w are either moves played in one copy: lation of a move m in the game A ⊗ B is defined just in w1 x w2 → w1 y w2 the expected (pointwise) way. The unique multi-bracketed where x → y isa movein thegame A; or moves where game 1 with {⋆} as underlying Conway game is the neutral Opponent opens a new copy: element of the tensor product. As usual in game seman- tics, every play s in the game A ⊗ B may be seen as the w → w x where ⋆A → x is an Opponent move in A. interleaving of a play s|A in the game A and a play s|B in the game B. More interestingly, the resource function κ is - its queries at position w = x1 · · · xn are pairs (i, q) “tensorial” in the following sense: consisting of an index 1 ≤ i ≤ n and a query q at position xi in the game A. κA⊗B(s)= κA(s|A)+ κB(s|B). The polarities of moves and queries are inherited from the Composition. We proceed as in [26, 13], and say that u game A in the expected way, and the residual relation is is an interaction on three games A, B, C, this noted u ∈ defined as for the tensor product. Interestingly, the result- ∗ intABC, when the projection of u on each game A ⊗ B, ing multi-bracketed game !A defines the free commutative ∗ ∗ B ⊗ C and A ⊗ C is a play. Given two strategies σ : comonoid associated to the well-bracketed game A in the ∗ ∗ A ⊗ B, τ : B ⊗ C, we define the composition of these category B. Hence, the category B defines a model of multi- strategies as follows: plicative exponential linear logic. This model is degenerate in the sense that the tensor product is equal to its dual, i.e. σ; τ = {u|A∗⊗C | u ∈ intABC,u|A∗⊗B ∈ σ, u|B∗⊗C ∈ τ} (A ⊗ B)∗ = A∗ ⊗ B∗. As usually, the composition of two strategies is a strat- egy. More interestingly, we show that our notion of well- Fixpoints. The exponential modality together with the bracketing is preserved by composition: traced symmetric monoidal structure on B defines a fixpoint operator in B as shown by Hasegawa Masahito in [14]. Re- Proposition 2 The strategy σ; τ : A∗ ⊗C is well-bracketed mark that this construction does not require that the cate- when the two strategies σ : A∗ ⊗ B and τ : B∗ ⊗ C are gory B is cartesian. well-bracketed. 4 A game model with resources In particular, given a pointed game A, •e!A is defined as def We would like to construct a model of tensorial logic •e!A = !(!w• A) based on negative multi-bracketed games. However it is Free coproducts. The category B• lacks coproducts to be meaningless to construct an affine modality on the cate- a model of (full) tensorial logic. We adjust this by con- − gory B itself because its unit 1 is already a terminal ob- structing its free completion, noted Fam(B•), under small ject in the category. So we need to introduce the notion of coproducts [3]. Given a category C, the objects of Fam(C) pointed game. are families {Ai|i ∈ I} of objects of the category. A mor- Pointed games. A pointed game may be seen in two phism from {Ai|i ∈ I} to {Bj|j ∈ J} consists of a reindex- different ways: (1) as a positive multi-bracketed Conway ing function f : I → J together with a family of morphisms game, with a unique initial Player move, (2) as a negative {fi : Ai → Bf(i)|i ∈ I} of the category C. multi-bracketed Conway game, except that the hypothesis Fam is a pseudo-commutative monad on Cat [17]. that there are no queries at the root ∗ is now relaxed for Hence, the 2-monad for symmetric monoidal categories dis- Player queries. From now on, we adopt the first point of tributes over Fam. Consequently, (1) the category Fam(C) view, and thus see a pointed game as a positive game with inherits the symmetric monoidal structure of a symmetric a unique initial move. Now, a morphism σ : A −→ B monoidal category C, and (2) the coproductof Fam(C) dis- in the category B is called transverse when, for every play tributes over that tensor product, and (3) Fam preserves mn of length 2 in the strategy σ : A∗ ⊗ B, the Opponent monoidal adjunctions. Besides, Fam preserves categories move m is in A and the Player move n is in B. We note with finite products and categories with a terminal ob- B• the subcategory of B with pointed games as objects, and ject. The construction thus preserves affine and exponential well-bracketed transverse strategies as morphisms. modalities in the sense of §2. Gathering all those remarks, we obtain that: • Coalesced tensor. Given A, B ∈B , the coalesced tensor Proposition 3 Fam(B•) is a model of tensorial logic. A B is the pointed game obtained from A B by synchro- ⊙ ⊗ • nising the two initial Player moves of A and B. Remark Moreover, the category Fam(B ) has a fixpoint operator that the coalesced tensor product preserves affine games, restricted on its singleton objects — that is, objects {Ai|i ∈ and coincides there with the tensor product of B−. The cat- I} where I is singleton. This is sufficient to interpret a lin- egory • equipped with is symmetric monoidal. It is not ear variant of the language PCF equipped with affine and B ⊙ • monoidal closed, but admits a tensorial negation. Besides, exponential resource modalities, in the category Fam(B ). it inherits a trace operator from the category B, which is 5 Conclusion partial, but sufficient to interpret a linear PCF with resource modalities. In this paper, we integrate resource modalities in game semantics, in just the same way as they are integrated in Tensorial negation. The negation ¬A of a pointed linear logic. This is achieved by reunderstanding the very game A is the pointed game obtained by lifting the dual topographyof the field. More specifically, linear logic is re- game A∗ with a Proponent move m which initiates one laxed into tensorial logic, where the involutive negation of query. Then, every initial Opponent move in A∗ complies linear logic is replaced by a tensorial negation. Once this with this query. performed, it is possible to keep the best of linear logic: re- Affine modality. A pointed game A is called affine when source modalities, etc. but transported in the language of its unique initial Player move does not initiate any query. games and continuations. Then, linear logic coincides with Note that B− is isomorphic to the full subcategory of affine tensorial logic with the additional axiom that the continu- • ation monad is commutative. In that sense, tensorial logic games in the category B . The affine game w•! A associated to a pointed game A is defined by removing all the queries is more primitive than linear logic, in the same way that initiated by the first move — as well as their residuals. This groups are more primitive than abelian groups. This opens defines an affine resource modality on B•. a new horizon to the subject. The whole point indeed is to understand in the future how the theory of linear logic ex- Exponential modality. The exponential modality •e! on tends to this relaxed framework. We illustrate this approach pointed games is obtained by composing the two adjunc- here by extending well-bracketing in arena games to the full tions underlying the comonads w•! and ! (defined in §3). flavour of resources in linear logic, using multi-bracketing. ⊆ ⊆ References ' ' ⊥ − ⊥ • M g B g B [1] S. Abramsky. Sequentiality vs. concurrency in games and

! w•! logic. Math. Structures Comput. Sci., 13:531–565, 2003. [2] S. Abramsky and R. Jagadeesan. Games and full complete- [29] P.-A. Melliès. Asynchronous games 4: a fully complete ness for multiplicative linear logic. J Sym Log, 59(2):543– model of propositional linear logic. In LICS ’05, 2005. 574, 1994. [30] P.-A. Melliès and P. Selinger. Games are continuation mod- [3] S. Abramsky and G. McCusker. Call-by-value games. In els! Talk at Full Completeness and Full Abstraction, Satel- CSL’97, volume 1414 of LNCS. Springer-Verlag, 1998. lite workshop of LICS 2001. [4] N. Benton. A mixed linear and non-linear logic: Proofs, [31] E. Moggi. Notions of computation and monads. Inform. and terms and models. In CSL ’94, volume 933 of LNCS, Poland, Comput., 93:55–92, 1991. June 1995. Springer-Verlag. [32] J. Power and E. Robinson. Premonoidal categories and no- [5] A. Blass. Degrees of indeterminacy of games. Fund. Math., tions of computation. Math. Structures Comput. Sci., 7:453– 77:151–166, 1972. 468, 1997. [6] A. Blass. A games semantics for linear logic. Ann. Pure [33] P. Selinger. Control categories and duality: on the categori- Appl. Logic, 56:183–220, 1992. cal semantics of the λ-µ-calculus. Math. Structures Comput. [7] R. Cartwright, P. Curien, and M. Felleisen. Fully Abstract Sci., 11(2):207–260, 2001. Semantics for Observably Sequential Languages. Inform. [34] N. Tabareau. De l’opérateur de trace dans les jeux de con- and Comput., 111(2):297–401, 1994. way. Master’s thesis, ENS Cachan, 2005. Posted on HAL. [8] J. Cockett and R. Seely. Polarized category theory, modules, [35] H. Thielecke. Categorical Structure of Continuation Passing game semantics. Unpublished. Style. PhD thesis, University of Edinburgh, 1997. [9] J.-Y. Girard. Linear logic. TCS, 50:1–102, 1987. [10] J.-Y. Girard. A new constructive logic: Classical logic. A sequent calculus for tensorial logic Math. Structures Comput. Sci., 1(3):255–296, 1991. In the bilateral formulation of tensorial logic, the se- [11] J.-Y. Girard. Ludics. In this volume. Kluwer, 2002. quents are of two forms: Γ ⊢ A where Γ is a context, and A [12] M. Hamano and P. Scott. A categorical semantics for polar- is a formula; Γ ⊢ where Γ is a context (the notation [A] ized mall. Ann. Pure Appl. Logic, 145(3):276–313, 2007. expresses the unessential presence of A in the sequent). [13] R. Harmer. Games and Full Abstraction for Nondeterminis- Γ ⊢ A ∆ ⊢ B Γ1,A,B, Γ2 ⊢ [C] tic Languages. PhD thesis, University of London, 2000. ⊗-Right ⊗-Left [14] M. Hasegawa. Models of Sharing Graphs: A Categorical Γ, ∆ ⊢ A ⊗ B Γ1,A ⊗ B, Γ2 ⊢ [C] Semantics of Let and Letrec. Springer, 1999. Unit-Right Γ ⊢ [A] Unit-Left [15] M. Hofmann and T. Streicher. Completeness of continuation ⊢ 1 Γ, 1 ⊢ [A] models for λ-µ-calculus. Inform. and Comput., 179(2):332– Γ,A ⊢ Γ ⊢ A 355, December 2002. ¬-Right ¬-Left Γ, ¬A ⊢ [16] M. Hyland and L. Ong. On full abstraction for PCF: I, II and Γ ⊢ ¬A III. Inform. and Comput., 163(2):285–408, Dec. 2000. Axiom Γ ⊢ A A, ∆ ⊢ [B] A ⊢ A Cut [17] M. Hyland and J. Power. Pseudo-commutative monads and Γ, ∆ ⊢ [B] pseudo-closed 2-categories. J. Pure Appl. Algebra, 175(1- Γ ⊢ A ⊕-Right-1 3):141–185, November 2002. Γ ⊢ A ⊕ B Γ,A ⊢ C Γ, B ⊢ C [18] A. Jeffrey. Premonoidal categories and a graphical view of ⊕-Left Γ ⊢ B Γ,A ⊕ B ⊢ C programs. unpublished, June 1998. ⊕-Right-2 [19] A. Joyal. Remarques sur la théorie des jeux à deux person- Γ ⊢ A ⊕ B 0-Left nes. Gaz. Sc. Math. Qu., 1(4):46–52, 1977. English version No right introduction rule for 0 Γ, 0 ⊢ A by R. Houston available. •e!Γ ⊢ A Γ,A ⊢ [B] [20] A. Joyal, R. Street, and D. Verity. Traced monoidal cate- Strengthening Dereliction gories. Math. Proc. Cambridge Philos. Soc., (119(3)):447– •e!Γ ⊢ •e! A Γ, •e! A ⊢ [B]

468, 1996. Γ ⊢ [B] Γ, •e! A, •e! A ⊢ [B] Weakening Contraction [21] M. Kelly and M. L. Laplaza. Coherence for compact closed Γ, •e! A ⊢ [B] Γ, •e! A ⊢ [B] categories. J. Pure Appl. Algebra, 19:193–213, 1980. w•! Γ ⊢ A Γ,A ⊢ [B] [22] J. Laird. Full abstraction for functional languages with con- Strengthening Dereliction trol. In LICS ’97, pages 58–67, 1997. w•! Γ ⊢ w•! A Γ, w•! A ⊢ [B] [23] O. Laurent. Etude de la polarisation en logique. PhD thesis, Γ ⊢ [B] Université Aix-Marseille II, 2002. Weakening Γ, w•! A ⊢ [B] [24] O. Laurent. Polarized games (extended abstract). In LICS ’02, pages 265–274, 2002. The monolateral formulation requires to polarize formulas, [25] O. Laurent and L. Regnier. About translations of classical and to clone each construct into a negative counterpart. logic into polarized linear logic. In LICS ’03, 2003. Positives 0 | 1 | ↓ L | P ⊗ Q | P ⊕ Q | ! P | !P [26] G. McCusker. Games and Full Abstraction for a Functional w• •e Negatives P L M L M L L Metalanguage with Recursive Types. PhD thesis, University ⊥|⊤|↑ | Γ | & | w?• | ?e• of London, 1996. It is then possible to reformulate all the sequent above, as [27] P.-A. Melliès. Functorial boxes in string diagrams. Invited illustrated below by the right and left introduction of ⊗. talk in CSL ’06. ⊢ Γ, P ⊢ ∆, Q ⊢ Γ1,L,M, Γ2, [P ] [28] P.-A. Melliès. Asynchronous games 3: an innocent model ⊗ -Right Γ -Left ⊢ Γ, ∆, P ⊗ Q ⊢ Γ1,L Γ M, Γ2, [P ] of linear logic. In L. Birkedal, editor, CTCS. ENTCS, 2004.