Categorical combinatorics of scheduling and synchronization in game - - PowerPoint PPT Presentation

categorical combinatorics of scheduling and
SMART_READER_LITE
LIVE PREVIEW

Categorical combinatorics of scheduling and synchronization in game - - PowerPoint PPT Presentation

Categorical combinatorics of scheduling and synchronization in game semantics Paul-Andr Mellis Institut de Recherche en Informatique Fondamentale (IRIF) CNRS & Universit Paris Diderot ACM Symposium on Principles of Programming


slide-1
SLIDE 1

Categorical combinatorics

  • f scheduling and synchronization

in game semantics

Paul-André Melliès

Institut de Recherche en Informatique Fondamentale (IRIF) CNRS & Université Paris Diderot ACM Symposium on Principles of Programming Languages Cascais

  • POPL

’19

  • 16 Ñ 19 January 2019
slide-2
SLIDE 2

Categorical combinatorics

  • f scheduling and synchronization

in game semantics

Paul-André Melliès

Institut de Recherche en Informatique Fondamentale (IRIF) CNRS & Université Paris Diderot ACM Symposium on Principles of Programming Languages Cascais

  • POPL

’19

  • 16 Ñ 19 January 2019
slide-3
SLIDE 3

Understanding logic in space and time

What are the principles at work in a dialogue?

slide-4
SLIDE 4

Understanding logic in space and time

What are the principles at work in a dialogue?

slide-5
SLIDE 5

Understanding logic in space and time

What are the principles at work in a dialogue?

slide-6
SLIDE 6

Purpose of this talk: Understand how different proofs and programs may be

˝

combined together in space

˝

synchronized together in time in the rich and modular ecosystem provided by linear logic.

slide-7
SLIDE 7

Purpose of this talk: Understand how different proofs and programs may be

˝

combined together in space

˝

synchronized together in time in the rich and modular ecosystem provided by game semantics.

slide-8
SLIDE 8

Template games

Categorical combinatorics of synchronization

slide-9
SLIDE 9

The category of polarities

We introduce the category

game

freely generated by the graph

xay x‘y

P O

the category game will play a fundamental role in the talk

slide-10
SLIDE 10

Template games

First idea: Define a game as a category A equipped with a functor A

game

λA

to the category game freely generated by the graph

xay x‘y

P O

Inspired by the notion of coloring in graph theory

slide-11
SLIDE 11

Positions and trajectories

It is convenient to use the following terminology

  • bjects

Ø

positions morphisms

Ø

trajectories and to see the category A as an unlabelled transition system.

slide-12
SLIDE 12

The polarity functor

The polarity functor λA : A

game

assigns a polarity ‘ or a to every position of the game A. Definition. A position a P A is called Player when its polarity λApaq “ ‘ is positive Opponent when its polarity λApaq “ a is negative

slide-13
SLIDE 13

Opponent moves

Definition. An Opponent move m : a ‘ b a is a trajectory of the game A transported to the edge O :

x‘y xay

  • f the template category game.
slide-14
SLIDE 14

Player moves

Definition. A Player move m : a a b ‘ is a trajectory of the game A transported to the edge P :

xay x‘y

  • f the template category game.
slide-15
SLIDE 15

Silent trajectories

Definition. A silent move m : a b is a trajectory of the game A transported to an identity morphism idx‘y :

x‘y x‘y

idxay :

xay xay

  • f the template category game.
slide-16
SLIDE 16

The template of strategies

Categorical combinatorics of synchronization

slide-17
SLIDE 17

The template of strategies

In order to describe the strategies between two games σ : A B

|

we introduce the template of strategies

strat

defined as the category freely generated by the graph

xa, ay x‘, ay x‘, ‘y

Os Ps Pt Ot

slide-18
SLIDE 18

The template of strategies

Each of the four labels Os Ps Ot Pt describes a specific kind of Opponent and Player move Os : Opponent move played at the source game Ps : Player move played at the source game Ot : Opponent move played at the target game Pt : Player move played at the target game which may appear on the interactive trajectory played by a strategy σ : A B.

|

slide-19
SLIDE 19

The template of strategies

The four generators

xa, ay x‘, ay x‘, ‘y

Os Ps Pt Ot

  • f the category

strat

may be depicted as follows:

O P O P s s t t

slide-20
SLIDE 20

The template of strategies

In that graphical notation, the sequence Ot ¨ Ps ¨ Os ¨ Pt is depicted as

O P O P s s t t

slide-21
SLIDE 21

The template of strategies

The category strat comes equipped with a span of functors

game strat game

s“p1q t“p2q

defined as the projection s “ p1q on the first component:

xa, ay ÞÑ xay x‘, ay , x‘, ‘y ÞÑ x‘y

Os ÞÑ P Ps ÞÑ O Ot , Pt ÞÑ idx‘y and as the projection t “ p2q on the second component:

x‘, ‘y ÞÑ x‘y xa, ay , x‘, ay ÞÑ xay

Ot ÞÑ O Pt ÞÑ P Os , Ps ÞÑ idxay

slide-22
SLIDE 22

The template of strategies

The two functors s and t are illustrated below:

O P O P s s t t O P O P

source target

slide-23
SLIDE 23

Strategies between games

Second idea: Define a strategy between two games σ : A B

|

as a span of functors A S B

s t

together with a scheduling functor S

strat

λσ

slide-24
SLIDE 24

Strategies between games

making the diagram below commute A S B

game strat game

λA s λσ t λB s t

Key idea: Every trajectory s P S induces a pair of trajectories sA P A and sB P B. The functor λσ describes how sA and sB are scheduled together by σ.

slide-25
SLIDE 25

Support of a strategy

Terminology. The category S defining the span A S B

s t

is called the support of the strategy σ : A B Basic intuition: « the support S contains the trajectories played by σ »

slide-26
SLIDE 26

A typical scheduling B¨A¨A¨B

A trajectory s P S of the strategy σ with schedule

x‘, ‘y x‘, ay xa, ay xa, ‘y x‘, ‘y

Ot Ps Os Pt

is traditionally depicted as A B first move m1 of polarity Ot m1 second move n1 of polarity Ps n1 third move m2 of polarity Os m2 fourth move n2 of polarity Pt n2

σ

slide-27
SLIDE 27

A typical scheduling B¨A¨A¨B

Thanks to the approach, one gets the more informative picture:

O P O P s s t t m :

:

m :

:

n n

slide-28
SLIDE 28

Simulations

Definition: A simulation between strategies θ : σ τ : A B

|

is a functor from the support of σ to the support of τ θ : S T making the three triangles commute S T

game

θ s s

S T

strat

θ λσ λτ

S T

game

θ t t

slide-29
SLIDE 29

The category of strategies and simulations

Suppose given two games A and B. The category Games pA, Bq has strategies between A and B σ, τ : A B

|

as objects and simulations between strategies θ : σ τ : A B

|

as morphisms.

slide-30
SLIDE 30

The bicategory Games

A bicategory of games, strategies and simulations

slide-31
SLIDE 31

The bicategory Games of games and strategies

At this stage, we want to turn the family of categories Games pA, Bq into a bicategory Games

  • f games and strategies.
slide-32
SLIDE 32

The bicategory Games of games and strategies

To that purpose, we need to define a composition functor

˝A,B,C : Games pB, Cq ˆ Games pA, Bq

Games pA, Cq which composes a pair of strategies σ : A B

|

τ : B C

|

into a strategy σ ˝A,B,C τ : A C

|

slide-33
SLIDE 33

Composition of strategies

The construction starts by putting the pair of functorial spans side by side: S T A

strat

B

strat

C

game game game

s λσ t s λτ t λA s t λB s t λC

Fine, but how shall one carry on and perform the composition?

slide-34
SLIDE 34

The template of interactions

Third idea: We define the template of interactions

int

as the category obtained by the pullback diagram below

int strat

pb

strat game game game

π1 π2 s t s t

slide-35
SLIDE 35

The template of interactions

Somewhat surprisingly, the category

int

is simple to describe, as the free category generated by the graph

xa, a, ay x‘, a, ay x‘, ‘, ay x‘, ‘, ‘y

Os P|O Ps Pt O|P Ot

with four states or positions.

slide-36
SLIDE 36

The template of interactions

The six generators

xa, a, ay x‘, a, ay x‘, ‘, ay x‘, ‘, ‘y

Os P|O Ps Pt O|P Ot

may be depicted as follows:

Ot Pt O P O P Ps Os

slide-37
SLIDE 37

The template of interactions

A typical sequence of interactions is thus depicted as follows:

Ot Pt O P O P Ps Os

slide-38
SLIDE 38

Key observation

The template int of interactions comes equipped with a functor hide :

int strat

which makes the diagram below commute:

strat int strat game strat game

p1q p12q p23q

hide

p2q

s“p1q t“p2q

and thus defines a map of span.

slide-39
SLIDE 39

Key observation

The functor hide :

int strat

is defined by projecting the positions of the interaction category

x ε1 , ε2 , ε3 y

  • n their first and third components:

xa, a, ay ÞÑ xa, ay

Os ÞÑ Os Ps ÞÑ Ps

x‘, a, ay , x‘, ‘, ay ÞÑ x‘, ay

O|P , P|O ÞÑ idx‘,ay

x‘, ‘, ‘y ÞÑ x‘, ‘y

Os ÞÑ Os Ps ÞÑ Ps

slide-40
SLIDE 40

Illustration

Ot Pt O P O P Ps Os Ps Os O P O P s s t t id id

hide

slide-41
SLIDE 41

Composition of strategies

S ˆB T S

int

T A

strat strat

C

game strat game

π1 π2 λσ } λτ π2 s λσ π1 π2 hide λτ t λA s t λC t s

slide-42
SLIDE 42

Composition of strategies

This definition of composition implements the slogan that composition = synchronization + hiding

slide-43
SLIDE 43

What about identities?

There exists a functor copycat :

game strat

which makes the diagram commute:

game game game strat

id id copycat s“p1q t“p2q

and thus defines a morphism of spans.

slide-44
SLIDE 44

What about identities?

The functor copycat :

game strat

is defined by duplicating the positions of the polarity category

xεy

in the following way:

xay ÞÑ xa, ay

O ÞÑ Ot ¨ Ps

x‘y ÞÑ x‘, ‘y

P ÞÑ Os ¨ Pt

slide-45
SLIDE 45

A synchronous copycat strategy

The functor copycat :

game strat

transports the edge

xay x‘y

O

to the trajectory consisting of two moves

xa, ay x‘, ay x‘, ‘y

Ps Ot

slide-46
SLIDE 46

A synchronous copycat strategy

The functor copycat :

game strat

transports the edge

xay x‘y

P

to the trajectory consisting of two moves

xa, ay x‘, ay x‘, ‘y

Os Pt

slide-47
SLIDE 47

The identity strategy

Given a game A, the copycat strategy ccA : A A is defined as the functorial span A A A

identity identity

together with the scheduling functor λ ccA “ A

game strat

λA copycat

slide-48
SLIDE 48

Identity strategy

A

game

A A

game strat game

identity λA identity copycat id id λA λA s t

slide-49
SLIDE 49

Discovery of an unexpected principle

Key observation: the categories

r0s “ game r1s “ strat r2s “ int

and the span of functors

r0s r1s r0s

s t

define an internal category in Cat with composition and identity

r2s r1s

hide

r0s r1s

copycat

slide-50
SLIDE 50

As an immediate consequence...

Theorem A. The construction just given defines a bicategory Games

  • f games, strategies and simulations.
slide-51
SLIDE 51

Main technical result of the paper

Theorem B. The bicategory Games

  • f games, strategies and simulations is symmetric monoidal.
slide-52
SLIDE 52

Main technical result of the paper

Theorem C. The bicategory Games

  • f games, strategies and simulations is star-autonomous.
slide-53
SLIDE 53

All these results are based on the same recipe!

One constructs an internal category of tensorial schedules

b

together with a pair of internal functors

ˆ b

  • pick

pince

slide-54
SLIDE 54

All these results are based on the same recipe!

One constructs an internal category of cotensorial schedules

  • together with a pair of internal functors

ˆ

  • pick

pince

slide-55
SLIDE 55

All these results are based on the same recipe!

One constructs an internal functor reverse :

  • p
  • which reverses the polarity of every position and move

‘ ÞÑ a

O ÞÑ P

a ÞÑ ‘

P ÞÑ O

slide-56
SLIDE 56

The pick functor

The internal functor pick :

b ˆ

is defined at dimension 0 by the functor:

pick r0s

slide-57
SLIDE 57

The pick functor

The internal functor pick :

b ˆ

is defined at dimension 1 by the functor:

pick r1s

slide-58
SLIDE 58

The pince functor

The internal functor pince :

b

  • is defined at dimension 0 by the functor:

pince r0s

slide-59
SLIDE 59

The pince functor

The internal functor pince :

b

  • is defined at dimension 1 by the functor:

pince r1s

slide-60
SLIDE 60

Conclusion and future work

⊲ games played on categories with synchronous copycats ⊲ an easy recipe to construct new game semantics ⊲ three templates considered in the paper:

alt

alternating games and strategies

conc

concurrent games and strategies

span

functorial spans with no scheduling ◮ same basic principles in concurrent separation logic ◮ a model of differential linear logic based on homotopy theory

slide-61
SLIDE 61

Selected bibliography

slide-62
SLIDE 62

[1] Pierre Castellan and Nobuko Yoshida. Two Sides of the Same Coin: Session Types and Game Semantics. POPL ’19 – Capabilities and Session Types session this afternoon! [2] Clovis Eberhart and Tom Hirschowitz. What’s in a Game? A Theory of Game Models. LICS 2018 [3] Russ Harmer, Martin Hyland and PAM. Categorical Combinatorics for Innocent Strategies. LICS 2007 [4] PAM and Samuel Mimram. Asynchronous Games: Innocence Without Alternation. CONCUR 2007 [5] PAM and Léo Stefanesco. An Asynchronous Soundness Theorem for Concurrent Separation Logic. LICS 2018 [6] Sylvain Rideau and Glynn Winskel. Concurrent Strategies. LICS 2011

slide-63
SLIDE 63

The distributivity law of linear logic

A game semantics of linear logic

slide-64
SLIDE 64

The distributivity law of linear logic

The main ingredient of linear logic κA,B,C : A b pB Cq

pA b Bq C

cannot be interpreted in traditional game semantics. When one interprets it in template games, here is what one gets...

slide-65
SLIDE 65

A B C A B C A B C

A B C

( )

A B C

( )

linear distributivity

O

A

P

A

O

B

P

B

P

C

O

C

O

A

P

A

O

A

P

A

O

B

P

B

P

C

O

C

P

C

OC O

A

P

A

O

B

P

B

P

C

O

C

& &

slide-66
SLIDE 66

The template of interactions

How the category int is computed as a pullback

slide-67
SLIDE 67

The template of interactions

We find illuminating to depict the canonical functor

int strat ˆ strat

p1223q

induced by the pullback diagram in the following way:

p1223q

slide-68
SLIDE 68

The template of interactions

In order to fully appreciate the diagram, one needs to “fatten” it

O

t

P

s

O

s

P P O O P

t

in such a way as to recover the template of interactions

xa, a, ay x‘, a, ay x‘, ‘, ay x‘, ‘, ‘y

Os P|O Ps Pt O|P Ot

slide-69
SLIDE 69

The template of concurrent games

Templates of concurrent games as commutative monoids

slide-70
SLIDE 70

The template of games

The category

conc r0s

is generated by the graph

x˚y

P O

together with the additional equation O ¨ P “ P ¨ O

slide-71
SLIDE 71

The template of strategies

The category

conc r1s

is generated by the graph together with the six elementary equations Os ¨ Ps “ Ps ¨ Os Os ¨ Pt “ Pt ¨ Os Os ¨ Ot “ Ot ¨ Os Ot ¨ Ps “ Ps ¨ Ot Ot ¨ Pt “ Pt ¨ Ot Ps ¨ Pt “ Pt ¨ Os

slide-72
SLIDE 72

The templates of games and strategies

The two templates

conc r0s conc r1s

are commutative monoids generated by the sets of moves:

concr0s “ concr1s “

The representation is nice to describe the source and target functors:

t s

slide-73
SLIDE 73

The template of interactions

When one computes the pullback

conc r2s conc r1s

pb

conc r1s conc r0s conc r0s conc r0s

π1 π2 s t s t

  • ne obtains the commutative monoid:

conc r2s “