Concurrent Strategies Glynn Winskel The notion of - - PowerPoint PPT Presentation

concurrent strategies
SMART_READER_LITE
LIVE PREVIEW

Concurrent Strategies Glynn Winskel The notion of - - PowerPoint PPT Presentation

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:


slide-1
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
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
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
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
SLIDE 5
  • 1. EVENT STRUCTURES

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
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
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
SLIDE 8

Example: Streams as event structures

000

  • 001

010

  • 011

110

  • 111

00

  • 01
  • .

. .

  • 11
  • 1
  • conflict (inconsistency)
  • immediate causal dependency

7

slide-9
SLIDE 9

Simple parallel composition

000

  • 001

010

  • 011

110

  • 111

00

  • 01
  • .

. .

  • 11
  • 1
  • aaa
  • aab

aba

  • abb

bba

  • bbb

aa

  • ab
  • .

. .

  • bb
  • a
  • b
  • 8
slide-10
SLIDE 10

Other examples

  • 1

2 3 Con = { ∅, {1}, {2}, {3}, {1, 2}, {1, 3}, {2, 3} }

9

slide-11
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
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
SLIDE 13

Product—an example

b (b, ∗)

  • (b, ∗)
  • (b, c)

× = a

  • c

(a, ∗)

  • (a, c)
  • (∗, c)
  • 12
slide-14
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
SLIDE 15
  • 2. CONCURRENT GAMES

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
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
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

  • σ2
  • A⊥

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
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
SLIDE 19

Copy-cat—an example

C CA A⊥ A a2 ⊖

a2 a1 ⊕

  • a1

18

slide-20
SLIDE 20

Composing pre-strategies

Two pre-strategies σ : A

+ B and τ : B + C as spans:

S

σ1

  • σ2
  • A⊥

B T

τ1

  • τ2
  • B⊥

C . Their composition T⊙S

(τ⊙σ)1

  • (τ⊙σ)2
  • A⊥

C where T⊙S =def (S × T ↾ Syn) ↓ Vis where ...

19

slide-21
SLIDE 21

S × T

Π1

  • Π2
  • S

σ1

  • σ2
  • T

τ1

  • τ2
  • A⊥

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
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

− ⊂

  • x′
  • σ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
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
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
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
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
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′

  • σ
  • σ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

  • σ
  • y

⊆+ σx .

26

slide-28
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′

  • σ“
  • ⊑S

x

  • σ“
  • y

⊑A σ“(x) ,

preserving ⊇−, ⊆+ and ∅.

27

slide-29
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
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

  • L

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
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
SLIDE 32

L R L R Example:theEuclideanquarterplane (x,y) (x',y') (x',y) atypicalmap areverse Opponentmove aPlayer move

slide-33
SLIDE 33

L R Atypicalplay R R R R L L L

slide-34
SLIDE 34

L R Atypicalplay R R R R L L L anequivalentplay

slide-35
SLIDE 35

L R Atypicaldeterministicstrategy

slide-36
SLIDE 36

L R Atypicaldeterministiccounter-strategy

slide-37
SLIDE 37

L R Theirplayagainsteachother

slide-38
SLIDE 38

L R Theirplayagainsteachother

slide-39
SLIDE 39

L R Theirplayagainsteachother anequivalentplay

slide-40
SLIDE 40

L R Winningstrategies Astrategyiswinningwrtwinning conditionswhichincludeitsR-maxl paths

slide-41
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

slide-42
SLIDE 42

THANK YOU!

41