SLIDE 1 Concurrent Strategies
Glynn Winskel The notion of deterministic/nondeterministic strategy is potentially as fundamental as the notion of function/relation. The notion needs to be developed in sufficient generality. Two-party concurrent games: Player (a team of players) against Opponent (a team of opponents) subject to constraints of the game. For Player/Opponent read process/environment, proof/refutation, ally/enemy. First: in a general model for concurrency. Later: a recent more geometrical view
FOSSACS Tallinn March 2012
SLIDE 2 Motivation from semantics and logic
In Semantics of computation it’s become clear that we need an intensional theory (a generalized domain theory) to capture the ways of computing, to near
- perational and algorithmic concerns.
What are to replace functions? A possible answer: strategies, “functions (or relations) extended in time.” [AJ] [There are others, e.g. profunctors as maps between presheaf categories.] In Logic the well-known Curry-Howard correspondence: Propositions as types, proofs as programs is being recast: Propositions as games, proofs as strategies. Traditional definitions of strategies in games are not general enough! Too sequential, too alternating ...
1
SLIDE 3 From strategies to arrows
Two important operations on games: parallel composition of games GH ; dual of a game G⊥ (reversing the roles of Player and Opponent) Joyal after Conway: A strategy σ from a game G to a game H, σ : G
+ H, is
a strategy in G⊥H; strategies compose with identities given by ‘copy-cat.’ A strategy in H corresponds to a strategy from the empty game ∅ to H. Note ∅
+ G + H composes to give ∅ + H ,
so a strategy in G gives rise to a strategy in H when G
+ H.
Conway’s surreal numbers are strengths of games.
2
SLIDE 4 Games in a model for concurrency (via Joyal-Conway)
Lead to
- Generalised domain theory
- Operations, including higher-order operations via “function spaces” G⊥H,
within the model for concurrency
- Techniques for Logic (via proofs as concurrent strategies) and possibly
verification and algorithmics
3
SLIDE 5
Event structures are the analogue of trees in a concurrent setting, where the causal dependence and independence of events is made explicit. E.g. just as a transition system unfolds to a tree, a more general model for concurrency such as a Petri net unfolds to an event structure.
4
SLIDE 6 Event structures
An event structure comprises (E, ≤, Con), consisting of a set of events E
- partially ordered by ≤, the causal dependency relation, and
- a nonempty family Con of finite subsets of E, the consistency relation,
which satisfy {e′ | e′ ≤ e} is finite for all e ∈ E, {e} ∈ Con for all e ∈ E, Y ⊆ X ∈ Con ⇒ Y ∈ Con, and X ∈ Con & e ≤ e′ ∈ X ⇒ X ∪ {e} ∈ Con. In games the relation of immediate dependency e e′, meaning e and e′ are distinct with e ≤ e′ and no event in between, will play an important role.
5
SLIDE 7 Configurations of an event structure
The configurations, C∞(E), of an event structure E consist of those subsets x ⊆ E which are Consistent: ∀X ⊆fin x. X ∈ Con and Down-closed: ∀e, e′. e′ ≤ e ∈ x ⇒ e′ ∈ x. Often concentrate on the finite configurations C(E).
6
SLIDE 8 Example: Streams as event structures
000
010
110
00
. .
- 11
- 1
- conflict (inconsistency)
- immediate causal dependency
7
SLIDE 9 Simple parallel composition
000
010
110
00
. .
aba
bba
aa
. .
SLIDE 10 Other examples
2 3 Con = { ∅, {1}, {2}, {3}, {1, 2}, {1, 3}, {2, 3} }
9
SLIDE 11 Maps of event structures
A (simulation) map of event structures f : E → E′ is a partial function on events f : E ⇀ E′ such that for all x ∈ C(E) fx ∈ C(E′) and if e1, e2 ∈ x and f(e1) = f(e2), then e1 = e2. (‘event linearity’) Idea: the occurrence of an event e in E induces the coincident occurrence of the event f(e) in E′ whenever it is defined. ❀
- Semantics of synchronising processes [Hoare, Milner] can be expressed in terms
- f universal constructions on event structures.
- Relations between models via adjunctions.
10
SLIDE 12 Process constructions on event structures
“Partial synchronous” product: A × B with projections Π1 and Π2,
- cf. synchronized composition where all events of A can synchronize with all events
- f B. (Hard to construct directly, use e.g. coreflection with stable families.)
Restriction: E ↾ R, the restriction of an event structure E to a subset of events R, has events E′ = {e ∈ E | [e] ⊆ R} with causal dependency and consistency restricted from E. Synchronized compositions: restrictions of products A × B ↾ R, where R specifies the allowed synchronized and unsynchronized events. Projection: Let E be an event structure. Let V be a subset of ‘visible’ events. The projection of E on V , E↓V , has events V with causal dependency and consistency restricted from E.
11
SLIDE 13 Product—an example
b (b, ∗)
× = a
(a, ∗)
SLIDE 14 Process constructions on event structures
“Partial synchronous” product: A × B with projections Π1 and Π2,
- cf. synchronized composition where all events of A can synchronize with all events
- f B. (Hard to construct directly, use e.g. coreflection with stable families.)
Restriction: E ↾ R, the restriction of an event structure E to a subset of events R, has events E′ = {e ∈ E | [e] ⊆ R} with causal dependency and consistency restricted from E. Synchronized compositions: restrictions of products A × B ↾ R, where R specifies the allowed synchronized and unsynchronized events. Projection: Let E be an event structure. Let V be a subset of ‘visible’ events. The projection of E on V , E↓V , has events V with causal dependency and consistency restricted from E.
13
SLIDE 15
The paradigm of Joyal-Conway carried out in event structures. We define and characterize concurrent strategies, those pre-strategies, i.e. nondeterministic plays, for which copy-cat strategies act as identities.
14
SLIDE 16 Concurrent games—basics
Games and strategies are represented by event structures with polarity, where events carry a polarity +/− (Player/Opponent), respected by maps. (Simple) Parallel composition: AB , by juxtaposition. Dual, B⊥, of an event structure with polarity B is a copy of the event structure B with a reversal of polarities; b ∈ B⊥ is complement of b ∈ B, and vice versa. A (nondeterministic) concurrent pre-strategy in game A is a total map σ : S → A
- f event structures with polarity (a nondeterministic play in game A).
15
SLIDE 17 Pre-strategies as arrows
A pre-strategy σ : A
+ B is a total map of event structures with polarity
σ : S → A⊥ B . It corresponds to a span of event structures with polarity S
σ1
B where σ1, σ2 are partial maps of event structures with polarity; one and only one
- f σ1, σ2 is defined on each event of S.
Pre-strategies are isomorphic if they are isomorphic as spans.
16
SLIDE 18 Concurrent copy-cat
Identities on games A are given by copy-cat strategies γA : C CA → A⊥ A —strategies for player based on copying the latest moves made by opponent. C CA has the same events, consistency and polarity as A⊥ A but with causal dependency ≤C
CA given as the transitive closure of the relation
≤A⊥A ∪ {(c, c) | c ∈ A⊥ A & polA⊥A(c) = +} where c ↔ c is the natural correspondence between A⊥ and A. The map γA is the identity on the common underlying set of events.
17
SLIDE 19 Copy-cat—an example
C CA A⊥ A a2 ⊖
a2 a1 ⊕
18
SLIDE 20 Composing pre-strategies
Two pre-strategies σ : A
+ B and τ : B + C as spans:
S
σ1
B T
τ1
C . Their composition T⊙S
(τ⊙σ)1
C where T⊙S =def (S × T ↾ Syn) ↓ Vis where ...
19
SLIDE 21 S × T
Π1
σ1
τ1
B B⊥ C Their composition: T⊙S =def (S × T ↾ Syn) ↓ Vis where Syn = {p ∈ S × T | σ1Π1(p) is defined & Π2(p) is undefined} ∪ {p ∈ S × T | σ2Π1(p) = τ1Π2(p) with both defined} ∪ {p ∈ S × T | τ2Π2(p) is defined & Π1(p) is undefined} , Vis = {p ∈ S × T ↾ Syn | σ1Π1(p) is defined} ∪ {p ∈ S × T ↾ Syn | τ2Π2(p) is defined} .
20
SLIDE 22 Theorem characterizing concurrent strategies
Receptivity σ : S → A⊥ B is receptive when σ(x)− ⊂−y implies there is a unique x′ ∈ C(S) such that x− ⊂x′ & σ(x′) = y . x
− ⊂
⊂− y
A strategy should be receptive to all possible moves of opponent. Innocence σ : S → A⊥ B is innocent when it is +-Innocence: If s s′ & pol(s) = + then σ(s) σ(s′) and −-Innocence: If s s′ & pol(s′) = − then σ(s) σ(s′). A strategy should only adjoin immediate causal dependencies ⊖ ⊕. Theorem Receptivity and innocence are necessary and sufficient for copy-cat to act as identity w.r.t. composition: γB⊙σ⊙γA ∼ = σ. [Silvain Rideau, GW]
21
SLIDE 23 Definition A strategy is a receptive, innocent pre-strategy. ❀ A bicategory, Games, whose
- bjects are event structures with polarity—the games,
maps are strategies σ : A
+ B
2-cells are maps of spans. The vertical composition of 2-cells is the usual composition of maps of spans. Horizontal composition is given by the composition of strategies ⊙ (which extends to a functor on 2-cells via the functoriality of synchronized composition). ❀ A sub-category where maps are deterministic strategies and
- bjects are ‘race-free’ games. [Melli`
es & Mimram’s receptive ingenuous strategies]
22
SLIDE 24 Winning strategies
The paradigm of Joyal-Conway carries through in concurrent games A with winning conditions W ⊆ C∞(A): A strategy σ : S → A in (A, W) is winning (for Player) iff any maximal play against a counter-strategy results in a win for Player iff σx ∈ W, for all +-maximal configurations x ∈ C∞(S).
23
SLIDE 25 A winning strategy from (A, WA) to (B, WB) is a winning strategy in (A, WA)⊥(B, WB) where (A, WA)⊥ = (A⊥, WA⊥) where WA⊥ is the complement of WA. (A, WA)(B, WB) = (AB, WAB) where x ∈ WAB ⇐ ⇒ xA ∈ WA or xB ∈ WB . To win in GH is to win in either game G or H. Winning strategies compose ❀ a bicategory of winning strategies.
24
SLIDE 26 Extensions
Determinacy for well-founded race-free concurrent games with winning conditions; concurrent game semantics for PC and a version of Hintikka’s IF Logic [LICS 2012 with Julian Gutierrez and Pierre Clairambault] Games with neutral configurations and imperfect information via access levels [Dexter Kozen festschrift] Back-tracking? To do so developing games with symmetry to support copying monads/comonads. ❀ fully-fledged generalized domain theory for concurrency Concurrent games with pay-off, early stages [with Pierre Clairambault] Linear strategies and full completeness for MALL [FOSSACS paper is wrong in claiming the linear strategies as defined there yield a monoidal closed category!]
- Games on categories with a factorization system ❀ a geometrical view •
25
SLIDE 27 An alternative description of strategies
A strategy in a game A comprises σ : S → A, a total map of event structures with polarity, such that (i) whenever σx ⊆− y in C(A) there is a unique x′ ∈ C(S) so that x ⊆ x′ & σx′ = y , i.e. x
x′
⊆−
y , and (ii) whenever y ⊆+ σx in C(A) there is a (necessarily unique) x′ ∈ C(S) so that x′ ⊆ x & σx′ = y , i.e. x′
x
⊆+ σx .
26
SLIDE 28 Corollary
Defining a partial order — the Scott order — on configurations of A x ⊑ y ⇐ ⇒
def x ⊇− x ∩ y ⊆+ y ,
we obtain a factorization system ((C(A), ⊑A), ⊇−, ⊆+), i.e. y ∃!z. x
⊑ ⊇−
z .
⊆+
Theorem Strategies σ : S → A correspond to a discrete fibrations σ“ : (C(S), ⊑S) → (C(A), ⊑A) , i.e. ∃!x′. x′
x
⊑A σ“(x) ,
preserving ⊇−, ⊆+ and ∅.
27
SLIDE 29 From strategies to profunctors
A strategy σ : A
+ B determines a discrete fibration so a presheaf over
(C(A⊥B), ⊑A⊥B) ∼ = (C(A), ⊑A)op × (C(B), ⊑B) i.e. a profunctor σ“ : (C(A), ⊑A)
+ (C(B), ⊑B).
❀ a lax pseudo functor ( ) “ : Games → Prof; have (τ⊙σ) “ ⇒ τ“ ◦ σ“. The profunctor composition introduces extra ‘unreachable’ elements. Not lax for ‘rigid’ strategies including : simple games; sub-bicategory of “stable spans” with objects A, B, · · · purely +ve.
28
SLIDE 30
- 3. GAMES AS FACTORIZATION SYSTEMS
A rooted factorization system (C, L, R, 0) comprises a small category C on which there is a factorization system (C, L, R), so all maps c → c′ factor uniquely up to iso as c′ c
c′′
R
with an object 0 s.t. 0 ←L · →R · · · ←L · →R c for all objects c in C. Example ( (C(A), ⊑A) , ⊇−, ⊆+, ∅) for a concurrent game A.
29
SLIDE 31 Strategies
A strategy on a rooted factorization system (A, LA, RA, 0A) is a discrete fibration F : (S, LS, RS, 0S) → (A, LA, RA, 0A) , from another rooted factorization system (S, LS, RS, 0S), which preserves L, R maps and 0. Example: The map σ“ : ((C(S), ⊑S), ⊇−, ⊆+, ∅) → ((C(A), ⊑A), ⊇−, ⊆+, ∅) induced by a strategy σ : S → A. Operations (C, L, R, 0)⊥ =def (Cop, Rop, Lop, 0) (B, LB, RB, 0B)(C, LC, RC, 0C) =def (B × C, LB × LC, RB × RC, (0B, 0C)) Composition: reachable part of profunctor composition. ❀ ‘Venn diagrams’ for games and strategies.
30
SLIDE 32
L R L R Example:theEuclideanquarterplane (x,y) (x',y') (x',y) atypicalmap areverse Opponentmove aPlayer move
SLIDE 33
L R Atypicalplay R R R R L L L
SLIDE 34
L R Atypicalplay R R R R L L L anequivalentplay
SLIDE 35
L R Atypicaldeterministicstrategy
SLIDE 36
L R Atypicaldeterministiccounter-strategy
SLIDE 37
L R Theirplayagainsteachother
SLIDE 38
L R Theirplayagainsteachother
SLIDE 39
L R Theirplayagainsteachother anequivalentplay
SLIDE 40
L R Winningstrategies Astrategyiswinningwrtwinning conditionswhichincludeitsR-maxl paths
SLIDE 41 A similar example: the game of chase
Player: the Hunter, velocity vector h; its moves are changes in velocity ∆h Opponent: the Prey, velocity vector p; its moves are changes in velocity ∆p A strategy for Hunter (observed in people): run (towards Prey) so Prey appears to be moving in a fixed straight line (direction vector d) from Hunter’s viewpoint, i.e. adjust velocity to maintain the winning condition p − h = c.d for some positive real c within a game with positions (p, h). [BBC Horizon programme “The Unconscious Mind”]
40