Resource Modalities in Game Semantics Paul-André Melliès, Nicolas Tabareau
Total Page:16
File Type:pdf, Size:1020Kb
Resource modalities in game semantics 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. Resource modalities in game semantics Paul-André Melliès Nicolas Tabareau ∗ Abstract equal (or at least isomorphic) to the formula negated twice: ∼ The description of resources in game semantics has A = ¬¬A. (1) never achieved the simplicity and precision of linear logic, because of a misleading conception: the belief that lin- Again, this principle is nicely reflected in game semantics ear logic is more primitive than game semantics. We ad- by the idea that negating a game A consists in permuting vocate the contrary here: that game semantics is concep- the rôles of the two players. Hence, negating a game twice tually more primitive than linear logic. Starting from this amounts to permuting the rôle of Proponent and Opponent revised point of view, we design a categorical model of re- twice, which is just like doing nothing. sources in game semantics, and construct an arena game The connectives of linear logic are also nicely reflected model where the usual notion of bracketing is extended to in game semantics. For instance, the tensor product A ⊗ B multi-bracketing in order to capture various resource poli- of two formulas A and B is suitably interpreted as the game cies: linear, affine and exponential. (or formula) A played in parallel with the game (or for- mula) B, where only Opponent may switch from a com- ponent to the other one. Similarly, the sum A ⊕ B of two formulas A and B is suitably interpreted as the game where 1 Introduction Proponent plays the first move, which consists in choosing between the game A and the game B, before carrying on in Game semantics and linear logic. Game semantics is the the selected component. Finally, the exponential modality younger sibling of linear logic: born (or reborn) at the be- of linear logic !A applied to the formula A is suitably in- ginning of the 1990s, in the turmoil produced by the re- terpreted as the game where several copies of the game A cent discovery of linear logic by Jean-Yves Girard [9], it are played in parallel, and only Opponent is allowed (1) to remained under its spiritual influence for a very long time. switch from a copy to another one and (2) to open a fresh This ascendancy of linear logic was extraordinarily healthy copy of the game A. and profitable in the early days. Properly guided, game se- What we describe here is in essence the game semantics mantics developed steadily, following the idea that every of linear logic defined by Andreas Blass in [6]. Simple and formula of linear logic describes a game; and that every elegant, the model reflects the full flavour of the resource proof of the formula describes a strategy for playing on that policy of linear logic. It is also remarkable that this game game. semantics is an early predecessor to linear logic [5]. This correspondence between formulas of linear logic and games is supported by a series of elegant and striking A schism with linear logic. The destiny of game seman- analogies. One basic principle of linear logic is that every tics has been to emancipate itself from linear logic in the formula behaves as a resource, which disappears once con- mid–1990s, in order to comply with its own designs, inher- sumed. In particular, a proof of the formula A ⊸ B is ited from denotational semantics: required to deduce the conclusion B by using (or consum- 1. the desire to interpret programs written in program- ing) its hypothesis A exactly once. This principle is nicely ming languages with effects (recursion, states, etc.) reflected in game semantics, by the idea that playing a game and to characterise exactly their interactive behaviour is just like consuming a resource, the game itself. inside fully abstract models; Another basic principle of linear logic is that negation 2. the desire to understandthe algebraic principlesof pro- hal-00144510, version 1 - 3 May 2007 A 7→ ¬A is involutive. This means that every formula A is gramming languages and effects, using the language of ∗This work has been supported by the ANR Invariants algébriques des category theory. systèmes informatiques (INVAL). Postal address: Equipe PPS, Université Paris VII, 2 place Jussieu, Case 7014, 75251 Paris Cedex 05, FRANCE. So, a new generation of game semantics arose, propelled by Email addresses: [email protected] and [email protected] (at least) two different lines of research: 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 linear logic. 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.