tutorial on game semantics - uvaprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdftutorial on...

148
Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 1 / 80 Tutorial on Game Semantics Samson Abramsky Oxford University Computing Laboratory http://web.comlab.ox.ac.uk/oucl/work/samson.abramsky/ December 4, 2008

Upload: others

Post on 02-Aug-2020

15 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 1 / 80

Tutorial on Game Semantics

Samson AbramskyOxford University Computing Laboratory

http://web.comlab.ox.ac.uk/oucl/work/samson.abramsky/

December 4, 2008

Page 2: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Introduction

Introduction• What is Logic about,anyway?

• And GameSemantics?

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics

Page 3: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

What is Logic about, anyway?

Introduction• What is Logic about,anyway?

• And GameSemantics?

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80

Page 4: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

What is Logic about, anyway?

Introduction• What is Logic about,anyway?

• And GameSemantics?

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80

Two views: the ‘model-theoretic’ and the ‘proof-theoretic’ perspectives.

Page 5: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

What is Logic about, anyway?

Introduction• What is Logic about,anyway?

• And GameSemantics?

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80

Two views: the ‘model-theoretic’ and the ‘proof-theoretic’ perspectives.

1. The Descriptive View. Logic is used to talk about structure. This is the

view taken in Model Theory, and in most of the uses of Logic (Temporal

logics, MSO etc.) in Verification. It is by far the more prevalent and

widely-understood view.

Page 6: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

What is Logic about, anyway?

Introduction• What is Logic about,anyway?

• And GameSemantics?

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80

Two views: the ‘model-theoretic’ and the ‘proof-theoretic’ perspectives.

1. The Descriptive View. Logic is used to talk about structure. This is the

view taken in Model Theory, and in most of the uses of Logic (Temporal

logics, MSO etc.) in Verification. It is by far the more prevalent and

widely-understood view.

2. The Intrinsic View. Logic is taken to embody structure. This is,

implicitly or explicitly, the view taken in the Curry-Howard isomorphism,

and more generally in Structural Proof Theory, and in (much of)Categorical Logic. In the Curry-Howard isomorphism, one is not using

logic to talk about functional programming; rather, logic (in this aspect)

is functional programming.

Page 7: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

What is Logic about, anyway?

Introduction• What is Logic about,anyway?

• And GameSemantics?

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80

Two views: the ‘model-theoretic’ and the ‘proof-theoretic’ perspectives.

1. The Descriptive View. Logic is used to talk about structure. This is the

view taken in Model Theory, and in most of the uses of Logic (Temporal

logics, MSO etc.) in Verification. It is by far the more prevalent and

widely-understood view.

2. The Intrinsic View. Logic is taken to embody structure. This is,

implicitly or explicitly, the view taken in the Curry-Howard isomorphism,

and more generally in Structural Proof Theory, and in (much of)Categorical Logic. In the Curry-Howard isomorphism, one is not using

logic to talk about functional programming; rather, logic (in this aspect)

is functional programming.

Amazingly, the relationship between these two points of view has hardly been

identified as an issue, let alone discussed.

Page 8: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

What is Logic about, anyway?

Introduction• What is Logic about,anyway?

• And GameSemantics?

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80

Two views: the ‘model-theoretic’ and the ‘proof-theoretic’ perspectives.

1. The Descriptive View. Logic is used to talk about structure. This is the

view taken in Model Theory, and in most of the uses of Logic (Temporal

logics, MSO etc.) in Verification. It is by far the more prevalent and

widely-understood view.

2. The Intrinsic View. Logic is taken to embody structure. This is,

implicitly or explicitly, the view taken in the Curry-Howard isomorphism,

and more generally in Structural Proof Theory, and in (much of)Categorical Logic. In the Curry-Howard isomorphism, one is not using

logic to talk about functional programming; rather, logic (in this aspect)

is functional programming.

Amazingly, the relationship between these two points of view has hardly been

identified as an issue, let alone discussed.

I hope we will do this in LINT!

Page 9: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

And Game Semantics?

Introduction• What is Logic about,anyway?

• And GameSemantics?

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 4 / 80

Page 10: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

And Game Semantics?

Introduction• What is Logic about,anyway?

• And GameSemantics?

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 4 / 80

Games have many faces in logic and computation.

Page 11: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

And Game Semantics?

Introduction• What is Logic about,anyway?

• And GameSemantics?

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 4 / 80

Games have many faces in logic and computation.

‘Game Semantics’ can cover a wide range of material.

Page 12: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

And Game Semantics?

Introduction• What is Logic about,anyway?

• And GameSemantics?

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 4 / 80

Games have many faces in logic and computation.

‘Game Semantics’ can cover a wide range of material.

Since around 1992, a community has developed in the Logic and Semantics

side of CS working in Game Semantics with the following key features, makingit rather distinct from previous work under this heading.

Page 13: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

And Game Semantics?

Introduction• What is Logic about,anyway?

• And GameSemantics?

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 4 / 80

Games have many faces in logic and computation.

‘Game Semantics’ can cover a wide range of material.

Since around 1992, a community has developed in the Logic and Semantics

side of CS working in Game Semantics with the following key features, makingit rather distinct from previous work under this heading.

• Compositionality

Page 14: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

And Game Semantics?

Introduction• What is Logic about,anyway?

• And GameSemantics?

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 4 / 80

Games have many faces in logic and computation.

‘Game Semantics’ can cover a wide range of material.

Since around 1992, a community has developed in the Logic and Semantics

side of CS working in Game Semantics with the following key features, makingit rather distinct from previous work under this heading.

• Compositionality

• Syntax-independence

Page 15: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

And Game Semantics?

Introduction• What is Logic about,anyway?

• And GameSemantics?

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 4 / 80

Games have many faces in logic and computation.

‘Game Semantics’ can cover a wide range of material.

Since around 1992, a community has developed in the Logic and Semantics

side of CS working in Game Semantics with the following key features, makingit rather distinct from previous work under this heading.

• Compositionality

• Syntax-independence

• Powerful results on full abstraction and full completeness for a wide

range of programming languages and logical type theories

Page 16: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

And Game Semantics?

Introduction• What is Logic about,anyway?

• And GameSemantics?

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 4 / 80

Games have many faces in logic and computation.

‘Game Semantics’ can cover a wide range of material.

Since around 1992, a community has developed in the Logic and Semantics

side of CS working in Game Semantics with the following key features, makingit rather distinct from previous work under this heading.

• Compositionality

• Syntax-independence

• Powerful results on full abstraction and full completeness for a wide

range of programming languages and logical type theories

• More recently an algorithmic turn, and many striking applications to

verification.

Page 17: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Game Semantics for Programs

Introduction

Game Semantics forPrograms

• Basic Ideas

• Types as Games

• Example

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics

Page 18: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Basic Ideas

Introduction

Game Semantics forPrograms

• Basic Ideas

• Types as Games

• Example

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 6 / 80

Page 19: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Basic Ideas

Introduction

Game Semantics forPrograms

• Basic Ideas

• Types as Games

• Example

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 6 / 80

• Types of a programming language are interpreted as 2-person games:

the Player is the System (program fragment) currently underconsideration, while the Opponent is the Environment or context.

Page 20: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Basic Ideas

Introduction

Game Semantics forPrograms

• Basic Ideas

• Types as Games

• Example

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 6 / 80

• Types of a programming language are interpreted as 2-person games:

the Player is the System (program fragment) currently underconsideration, while the Opponent is the Environment or context.

• Programs are strategies for these games.

Page 21: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Basic Ideas

Introduction

Game Semantics forPrograms

• Basic Ideas

• Types as Games

• Example

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 6 / 80

• Types of a programming language are interpreted as 2-person games:

the Player is the System (program fragment) currently underconsideration, while the Opponent is the Environment or context.

• Programs are strategies for these games.

So game semantics is inherently a semantics of open systems ; the meaning

of a program is given by its potential interactions with its environment.

Page 22: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Basic Ideas

Introduction

Game Semantics forPrograms

• Basic Ideas

• Types as Games

• Example

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 6 / 80

• Types of a programming language are interpreted as 2-person games:

the Player is the System (program fragment) currently underconsideration, while the Opponent is the Environment or context.

• Programs are strategies for these games.

So game semantics is inherently a semantics of open systems ; the meaning

of a program is given by its potential interactions with its environment.

• Compositionality. The key operation is plugging two strategies together,

so that each actualizes part of the environment of the other. (Usualgame idea corresponds to a closed system, with no residual

environment). This exploits the game-theoretic P/O duality.

Page 23: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Types as Games

Introduction

Game Semantics forPrograms

• Basic Ideas

• Types as Games

• Example

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 7 / 80

Page 24: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Types as Games

Introduction

Game Semantics forPrograms

• Basic Ideas

• Types as Games

• Example

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 7 / 80

• A simple example of a basic datatype of natural numbers:

N = {q · n | n ∈ N}

Page 25: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Types as Games

Introduction

Game Semantics forPrograms

• Basic Ideas

• Types as Games

• Example

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 7 / 80

• A simple example of a basic datatype of natural numbers:

N = {q · n | n ∈ N}

Note a further classification of moves, orthgonal to the P/O duality; q is

a question , n are answers . This turns out to be important for capturingcontrol features of programming languages.

Page 26: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Types as Games

Introduction

Game Semantics forPrograms

• Basic Ideas

• Types as Games

• Example

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 7 / 80

• A simple example of a basic datatype of natural numbers:

N = {q · n | n ∈ N}

Note a further classification of moves, orthgonal to the P/O duality; q is

a question , n are answers . This turns out to be important for capturingcontrol features of programming languages.

• Forming function or procedure types A⇒ B. We form a new game

from disjoint copies of A and B, with P/O roles in A reversed . Thuswe think of A⇒ B as a structured interface to the Environment; in B,

we interact with the caller of the procedure, covariantly , while in A, we

interact with the argument supplied to the procedure call,

contravariantly .

Page 27: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Example

Introduction

Game Semantics forPrograms

• Basic Ideas

• Types as Games

• Example

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 8 / 80

Strategy for λf : N⇒ N. λx : N. f(x) + 2.

Page 28: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Example

Introduction

Game Semantics forPrograms

• Basic Ideas

• Types as Games

• Example

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 8 / 80

Strategy for λf : N⇒ N. λx : N. f(x) + 2.

(This names the procedure P (f, x) such that P (f, x) returns f(x) + 2.)

Page 29: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Example

Introduction

Game Semantics forPrograms

• Basic Ideas

• Types as Games

• Example

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 8 / 80

Strategy for λf : N⇒ N. λx : N. f(x) + 2.

(This names the procedure P (f, x) such that P (f, x) returns f(x) + 2.)

( N ⇒ N ) ⇒ N ⇒ N

Page 30: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Example

Introduction

Game Semantics forPrograms

• Basic Ideas

• Types as Games

• Example

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 9 / 80

Strategy for λf : N⇒ N. λx : N. f(x) + 2.( N ⇒ N ) ⇒ N ⇒ N

O

Page 31: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Example

Introduction

Game Semantics forPrograms

• Basic Ideas

• Types as Games

• Example

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 10 / 80

Strategy for λf : N⇒ N. λx : N. f(x) + 2.( N ⇒ N ) ⇒ N ⇒ N

O q

Page 32: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Example

Introduction

Game Semantics forPrograms

• Basic Ideas

• Types as Games

• Example

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 11 / 80

Strategy for λf : N⇒ N. λx : N. f(x) + 2.( N ⇒ N ) ⇒ N ⇒ N

O qP q

Page 33: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Example

Introduction

Game Semantics forPrograms

• Basic Ideas

• Types as Games

• Example

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 12 / 80

Strategy for λf : N⇒ N. λx : N. f(x) + 2.( N ⇒ N ) ⇒ N ⇒ N

O qP qO q

Page 34: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Example

Introduction

Game Semantics forPrograms

• Basic Ideas

• Types as Games

• Example

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 13 / 80

Strategy for λf : N⇒ N. λx : N. f(x) + 2.( N ⇒ N ) ⇒ N ⇒ N

O qP qO qP q

Page 35: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Example

Introduction

Game Semantics forPrograms

• Basic Ideas

• Types as Games

• Example

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 14 / 80

Strategy for λf : N⇒ N. λx : N. f(x) + 2.( N ⇒ N ) ⇒ N ⇒ N

O qP qO qP qO n

Page 36: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Example

Introduction

Game Semantics forPrograms

• Basic Ideas

• Types as Games

• Example

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 15 / 80

Strategy for λf : N⇒ N. λx : N. f(x) + 2.( N ⇒ N ) ⇒ N ⇒ N

O qP qO qP qO nP n

Page 37: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Example

Introduction

Game Semantics forPrograms

• Basic Ideas

• Types as Games

• Example

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 16 / 80

Strategy for λf : N⇒ N. λx : N. f(x) + 2.( N ⇒ N ) ⇒ N ⇒ N

O qP qO qP qO nP nO m

Page 38: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Example

Introduction

Game Semantics forPrograms

• Basic Ideas

• Types as Games

• Example

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 17 / 80

Strategy for λf : N⇒ N. λx : N. f(x) + 2.( N ⇒ N ) ⇒ N ⇒ N

O qP qO qP qO nP nO mP m + 2

Page 39: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Composition

Introduction

Game Semantics forPrograms

• Basic Ideas

• Types as Games

• Example

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 18 / 80

Apply λf : N⇒ N. λx : N. f(x) + 2 to λx : N. x2.

N ⇒ N ( N ⇒ N ) × N ⇒ N

Page 40: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Composition

Introduction

Game Semantics forPrograms

• Basic Ideas

• Types as Games

• Example

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 19 / 80

Apply λf : N⇒ N. λx : N. f(x) + 2 to λx : N. x2.

N ⇒ N ( N ⇒ N ) × N ⇒ N

q

Page 41: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Composition

Introduction

Game Semantics forPrograms

• Basic Ideas

• Types as Games

• Example

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 20 / 80

Apply λf : N⇒ N. λx : N. f(x) + 2 to λx : N. x2.

N ⇒ N ( N ⇒ N ) × N ⇒ N

qq q

Page 42: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Composition

Introduction

Game Semantics forPrograms

• Basic Ideas

• Types as Games

• Example

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 21 / 80

Apply λf : N⇒ N. λx : N. f(x) + 2 to λx : N. x2.

N ⇒ N ( N ⇒ N ) × N ⇒ N

qq q

q q

Page 43: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Composition

Introduction

Game Semantics forPrograms

• Basic Ideas

• Types as Games

• Example

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 22 / 80

Apply λf : N⇒ N. λx : N. f(x) + 2 to λx : N. x2.

N ⇒ N ( N ⇒ N ) × N ⇒ N

qq q

q qq

Page 44: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Composition

Introduction

Game Semantics forPrograms

• Basic Ideas

• Types as Games

• Example

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 23 / 80

Apply λf : N⇒ N. λx : N. f(x) + 2 to λx : N. x2.

N ⇒ N ( N ⇒ N ) × N ⇒ N

qq q

q qqn

Page 45: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Composition

Introduction

Game Semantics forPrograms

• Basic Ideas

• Types as Games

• Example

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 24 / 80

Apply λf : N⇒ N. λx : N. f(x) + 2 to λx : N. x2.

N ⇒ N ( N ⇒ N ) × N ⇒ N

qq q

q qqn

n n

Page 46: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Composition

Introduction

Game Semantics forPrograms

• Basic Ideas

• Types as Games

• Example

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 25 / 80

Apply λf : N⇒ N. λx : N. f(x) + 2 to λx : N. x2.

N ⇒ N ( N ⇒ N ) × N ⇒ N

qq q

q qqn

n nn2 n2

Page 47: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Composition

Introduction

Game Semantics forPrograms

• Basic Ideas

• Types as Games

• Example

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 26 / 80

Apply λf : N⇒ N. λx : N. f(x) + 2 to λx : N. x2.

N ⇒ N ( N ⇒ N ) × N ⇒ N

qq q

q qqn

n nn2 n2

n2 + 2

Page 48: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Overview

Introduction

Game Semantics forPrograms

Overview

• Some Key Features

• Some BeautifulResults of GameSemantics

• Full Completeness

• The Game SemanticsLandscape

• Algorithmic GameSemantics• 20-element array ofintegers %2

• On modeling sortingprograms

• Current Work• Game Semantics inthe Games landscape

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics

Page 49: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Some Key Features

Introduction

Game Semantics forPrograms

Overview

• Some Key Features

• Some BeautifulResults of GameSemantics

• Full Completeness

• The Game SemanticsLandscape

• Algorithmic GameSemantics• 20-element array ofintegers %2

• On modeling sortingprograms

• Current Work• Game Semantics inthe Games landscape

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 28 / 80

Page 50: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Some Key Features

Introduction

Game Semantics forPrograms

Overview

• Some Key Features

• Some BeautifulResults of GameSemantics

• Full Completeness

• The Game SemanticsLandscape

• Algorithmic GameSemantics• 20-element array ofintegers %2

• On modeling sortingprograms

• Current Work• Game Semantics inthe Games landscape

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 28 / 80

• Compositionality I: The importance of composition as an operation on

strategies, for gluing small pieces together. This gives direct meaning to

open programs, proofs from assumptions, etc.

Page 51: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Some Key Features

Introduction

Game Semantics forPrograms

Overview

• Some Key Features

• Some BeautifulResults of GameSemantics

• Full Completeness

• The Game SemanticsLandscape

• Algorithmic GameSemantics• 20-element array ofintegers %2

• On modeling sortingprograms

• Current Work• Game Semantics inthe Games landscape

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 28 / 80

• Compositionality I: The importance of composition as an operation on

strategies, for gluing small pieces together. This gives direct meaning to

open programs, proofs from assumptions, etc.

• Compositionality II: The attribution of games as meanings of types or

formulas, and of strategies as meanings of terms or proofs, is done in asystematic, compositional fashion, following more generally from:

Page 52: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Some Key Features

Introduction

Game Semantics forPrograms

Overview

• Some Key Features

• Some BeautifulResults of GameSemantics

• Full Completeness

• The Game SemanticsLandscape

• Algorithmic GameSemantics• 20-element array ofintegers %2

• On modeling sortingprograms

• Current Work• Game Semantics inthe Games landscape

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 28 / 80

• Compositionality I: The importance of composition as an operation on

strategies, for gluing small pieces together. This gives direct meaning to

open programs, proofs from assumptions, etc.

• Compositionality II: The attribution of games as meanings of types or

formulas, and of strategies as meanings of terms or proofs, is done in asystematic, compositional fashion, following more generally from:

• Games as a mathematical universe with its own structure,

independently of any preconceived syntax. The right mathematicallanguage for expressing this is (of course) category theory.

Page 53: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Some Beautiful Results of Game Semantics

Introduction

Game Semantics forPrograms

Overview

• Some Key Features

• Some BeautifulResults of GameSemantics

• Full Completeness

• The Game SemanticsLandscape

• Algorithmic GameSemantics• 20-element array ofintegers %2

• On modeling sortingprograms

• Current Work• Game Semantics inthe Games landscape

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 29 / 80

Page 54: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Some Beautiful Results of Game Semantics

Introduction

Game Semantics forPrograms

Overview

• Some Key Features

• Some BeautifulResults of GameSemantics

• Full Completeness

• The Game SemanticsLandscape

• Algorithmic GameSemantics• 20-element array ofintegers %2

• On modeling sortingprograms

• Current Work• Game Semantics inthe Games landscape

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 29 / 80

Games and strategies organize themselves into mathematical structures

(categories of various kinds) suitable for modelling programming languages

and logic.

Page 55: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Some Beautiful Results of Game Semantics

Introduction

Game Semantics forPrograms

Overview

• Some Key Features

• Some BeautifulResults of GameSemantics

• Full Completeness

• The Game SemanticsLandscape

• Algorithmic GameSemantics• 20-element array ofintegers %2

• On modeling sortingprograms

• Current Work• Game Semantics inthe Games landscape

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 29 / 80

Games and strategies organize themselves into mathematical structures

(categories of various kinds) suitable for modelling programming languages

and logic.

Key Examples Cartesian closed categories, Linear categories (symmmetricmonoidal closed categories with monoidal adjunctions to cartesian closed

categories).

Page 56: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Some Beautiful Results of Game Semantics

Introduction

Game Semantics forPrograms

Overview

• Some Key Features

• Some BeautifulResults of GameSemantics

• Full Completeness

• The Game SemanticsLandscape

• Algorithmic GameSemantics• 20-element array ofintegers %2

• On modeling sortingprograms

• Current Work• Game Semantics inthe Games landscape

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 29 / 80

Games and strategies organize themselves into mathematical structures

(categories of various kinds) suitable for modelling programming languages

and logic.

Key Examples Cartesian closed categories, Linear categories (symmmetricmonoidal closed categories with monoidal adjunctions to cartesian closed

categories).

By imposing various structural constraints on strategies, exact matches can

be found with various logical disciplines , leading to full completenessresults, which characterize the ‘space of proofs’ of various logics.

Page 57: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Some Beautiful Results of Game Semantics

Introduction

Game Semantics forPrograms

Overview

• Some Key Features

• Some BeautifulResults of GameSemantics

• Full Completeness

• The Game SemanticsLandscape

• Algorithmic GameSemantics• 20-element array ofintegers %2

• On modeling sortingprograms

• Current Work• Game Semantics inthe Games landscape

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 29 / 80

Games and strategies organize themselves into mathematical structures

(categories of various kinds) suitable for modelling programming languages

and logic.

Key Examples Cartesian closed categories, Linear categories (symmmetricmonoidal closed categories with monoidal adjunctions to cartesian closed

categories).

By imposing various structural constraints on strategies, exact matches can

be found with various logical disciplines , leading to full completenessresults, which characterize the ‘space of proofs’ of various logics.

Similarly, exact matches can be found with a wide range of computationalfeatures as embodied in key programming language constructs, leading to

full abstraction results.

Page 58: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Full Completeness

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 30 / 80

Page 59: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Full Completeness

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 30 / 80

Ordinary completeness speaks of provability ; full (and faithful) completeness speaks of

proofs . A proof of Γ ⊢ A will denote a strategy

σ : JΓK −→ JAK.

This is (part of) soundness.

Page 60: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Full Completeness

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 30 / 80

Ordinary completeness speaks of provability ; full (and faithful) completeness speaks of

proofs . A proof of Γ ⊢ A will denote a strategy

σ : JΓK −→ JAK.

This is (part of) soundness.

Completeness asks for a converse; that for every such σ, there exists a proof Π of

Γ ⊢ A. Full completeness asks that moreover Π denotes the σ we started with, i.e. that

the mapping of proofs to strategies is surjective. Faithfulness is the additional

requirement that different normal forms map onto distinct strategies.

Page 61: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Full Completeness

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 30 / 80

Ordinary completeness speaks of provability ; full (and faithful) completeness speaks of

proofs . A proof of Γ ⊢ A will denote a strategy

σ : JΓK −→ JAK.

This is (part of) soundness.

Completeness asks for a converse; that for every such σ, there exists a proof Π of

Γ ⊢ A. Full completeness asks that moreover Π denotes the σ we started with, i.e. that

the mapping of proofs to strategies is surjective. Faithfulness is the additional

requirement that different normal forms map onto distinct strategies.

These results give intrinsic semantic characterizations of the ‘space of proofs’ of a logic.

Page 62: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Full Completeness

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 30 / 80

Ordinary completeness speaks of provability ; full (and faithful) completeness speaks of

proofs . A proof of Γ ⊢ A will denote a strategy

σ : JΓK −→ JAK.

This is (part of) soundness.

Completeness asks for a converse; that for every such σ, there exists a proof Π of

Γ ⊢ A. Full completeness asks that moreover Π denotes the σ we started with, i.e. that

the mapping of proofs to strategies is surjective. Faithfulness is the additional

requirement that different normal forms map onto distinct strategies.

These results give intrinsic semantic characterizations of the ‘space of proofs’ of a logic.

There are results of this kind now for a range of logics and logical type theories, including:

• Simply typed and polymorphic lambda calculus

• The lambda-mu calculus

• Various fragments of Linear Logic

Page 63: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

The Game Semantics Landscape

Introduction

Game Semantics forPrograms

Overview

• Some Key Features

• Some BeautifulResults of GameSemantics

• Full Completeness

• The Game SemanticsLandscape

• Algorithmic GameSemantics• 20-element array ofintegers %2

• On modeling sortingprograms

• Current Work• Game Semantics inthe Games landscape

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 31 / 80

Game semantics has proved to be a flexible and powerful paradigm for

constructing highly structured fully abstract semantics for languages with a

wide range of computational features:

Page 64: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

The Game Semantics Landscape

Introduction

Game Semantics forPrograms

Overview

• Some Key Features

• Some BeautifulResults of GameSemantics

• Full Completeness

• The Game SemanticsLandscape

• Algorithmic GameSemantics• 20-element array ofintegers %2

• On modeling sortingprograms

• Current Work• Game Semantics inthe Games landscape

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 31 / 80

Game semantics has proved to be a flexible and powerful paradigm for

constructing highly structured fully abstract semantics for languages with a

wide range of computational features:

• (higher-order) functions and procedures

• call by name and call by value

• locally scoped state

• general reference types

• control features (continuations, exceptions)

• non-determinism, probabilities

• concurrency

• names and freshness

Page 65: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Algorithmic Game Semantics

Introduction

Game Semantics forPrograms

Overview

• Some Key Features

• Some BeautifulResults of GameSemantics

• Full Completeness

• The Game SemanticsLandscape

• Algorithmic GameSemantics• 20-element array ofintegers %2

• On modeling sortingprograms

• Current Work• Game Semantics inthe Games landscape

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 32 / 80

We can take advantage of the concrete nature of game semantics. A play is

a sequence of moves, so a strategy can be represented by the set of its plays,

i.e. by a language over the alphabet of moves, and hence by an automaton.

There are significant finite-state fragments of the semantics for variousinteresting languages, as first observed by Ghica and McCusker (ICALP 00).

This means we can compositionally construct automata as (representations

of) the meanings of open (incomplete) programs, giving a powerful basis for

compositional software model-checking.

The key construct is composition ; the corresponding construction on

automata is ‘product automaton plus hiding’.

Page 66: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

20-element array of integers %2

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 33 / 80

Page 67: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

On modeling sorting programs

Introduction

Game Semantics forPrograms

Overview

• Some Key Features

• Some BeautifulResults of GameSemantics

• Full Completeness

• The Game SemanticsLandscape

• Algorithmic GameSemantics• 20-element array ofintegers %2

• On modeling sortingprograms

• Current Work• Game Semantics inthe Games landscape

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 34 / 80

“[...] it seems impossible to use model-checking to verify that a sorting

algorithm is correct since sorting correctness is a data-oriented property

involving several quantifications and data structures.” [Bandera user manual]

Why does it work?

• program state-space: 5.5× 1012 states

• model: 6, 393 states

• max space: 1, 153, 240 states

Hiding local state!

Page 68: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Current Work

Introduction

Game Semantics forPrograms

Overview

• Some Key Features

• Some BeautifulResults of GameSemantics

• Full Completeness

• The Game SemanticsLandscape

• Algorithmic GameSemantics• 20-element array ofintegers %2

• On modeling sortingprograms

• Current Work• Game Semantics inthe Games landscape

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 35 / 80

Page 69: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Current Work

Introduction

Game Semantics forPrograms

Overview

• Some Key Features

• Some BeautifulResults of GameSemantics

• Full Completeness

• The Game SemanticsLandscape

• Algorithmic GameSemantics• 20-element array ofintegers %2

• On modeling sortingprograms

• Current Work• Game Semantics inthe Games landscape

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 35 / 80

• Model-checking: Ghica (Birmingham):

• State-of-the-art tool MAGE.

• Earlier tool: GameChecker (FDR based)

• Related work by Lazic and Dimovski (Warwick).

Page 70: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Current Work

Introduction

Game Semantics forPrograms

Overview

• Some Key Features

• Some BeautifulResults of GameSemantics

• Full Completeness

• The Game SemanticsLandscape

• Algorithmic GameSemantics• 20-element array ofintegers %2

• On modeling sortingprograms

• Current Work• Game Semantics inthe Games landscape

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 35 / 80

• Model-checking: Ghica (Birmingham):

• State-of-the-art tool MAGE.

• Earlier tool: GameChecker (FDR based)

• Related work by Lazic and Dimovski (Warwick).

• Andrzej Murawski, Joel Ouaknine and Ben Worrell: automatedverification of probabilistic programs.

Page 71: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Current Work

Introduction

Game Semantics forPrograms

Overview

• Some Key Features

• Some BeautifulResults of GameSemantics

• Full Completeness

• The Game SemanticsLandscape

• Algorithmic GameSemantics• 20-element array ofintegers %2

• On modeling sortingprograms

• Current Work• Game Semantics inthe Games landscape

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 35 / 80

• Model-checking: Ghica (Birmingham):

• State-of-the-art tool MAGE.

• Earlier tool: GameChecker (FDR based)

• Related work by Lazic and Dimovski (Warwick).

• Andrzej Murawski, Joel Ouaknine and Ben Worrell: automatedverification of probabilistic programs.

• Luke Ong, Andrzej Murawski: extensive applications of GameSemantics to proving theoretical results on complexity of verification

problems. A beautiful combination of game-semantic and

automata-theoretic methods.

Page 72: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Game Semantics in the Games landscape

Introduction

Game Semantics forPrograms

Overview

• Some Key Features

• Some BeautifulResults of GameSemantics

• Full Completeness

• The Game SemanticsLandscape

• Algorithmic GameSemantics• 20-element array ofintegers %2

• On modeling sortingprograms

• Current Work• Game Semantics inthe Games landscape

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 36 / 80

Page 73: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Game Semantics in the Games landscape

Introduction

Game Semantics forPrograms

Overview

• Some Key Features

• Some BeautifulResults of GameSemantics

• Full Completeness

• The Game SemanticsLandscape

• Algorithmic GameSemantics• 20-element array ofintegers %2

• On modeling sortingprograms

• Current Work• Game Semantics inthe Games landscape

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 36 / 80

Some comparisons:

Page 74: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Game Semantics in the Games landscape

Introduction

Game Semantics forPrograms

Overview

• Some Key Features

• Some BeautifulResults of GameSemantics

• Full Completeness

• The Game SemanticsLandscape

• Algorithmic GameSemantics• 20-element array ofintegers %2

• On modeling sortingprograms

• Current Work• Game Semantics inthe Games landscape

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 36 / 80

Some comparisons:

• Hintikka GTS and IF logic. GS is more compositional; a proper analysis

of implication!

Page 75: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Game Semantics in the Games landscape

Introduction

Game Semantics forPrograms

Overview

• Some Key Features

• Some BeautifulResults of GameSemantics

• Full Completeness

• The Game SemanticsLandscape

• Algorithmic GameSemantics• 20-element array ofintegers %2

• On modeling sortingprograms

• Current Work• Game Semantics inthe Games landscape

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 36 / 80

Some comparisons:

• Hintikka GTS and IF logic. GS is more compositional; a proper analysis

of implication!

• Lorenzen school of dialogue games. An ancestor; GS is more

compositional, ‘syntax-free’, much wider scope.

Page 76: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Game Semantics in the Games landscape

Introduction

Game Semantics forPrograms

Overview

• Some Key Features

• Some BeautifulResults of GameSemantics

• Full Completeness

• The Game SemanticsLandscape

• Algorithmic GameSemantics• 20-element array ofintegers %2

• On modeling sortingprograms

• Current Work• Game Semantics inthe Games landscape

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 36 / 80

Some comparisons:

• Hintikka GTS and IF logic. GS is more compositional; a proper analysis

of implication!

• Lorenzen school of dialogue games. An ancestor; GS is more

compositional, ‘syntax-free’, much wider scope.

• Blass games. Another ancestor. Overcomes problems with

compositionality.

Page 77: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Game Semantics in the Games landscape

Introduction

Game Semantics forPrograms

Overview

• Some Key Features

• Some BeautifulResults of GameSemantics

• Full Completeness

• The Game SemanticsLandscape

• Algorithmic GameSemantics• 20-element array ofintegers %2

• On modeling sortingprograms

• Current Work• Game Semantics inthe Games landscape

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 36 / 80

Some comparisons:

• Hintikka GTS and IF logic. GS is more compositional; a proper analysis

of implication!

• Lorenzen school of dialogue games. An ancestor; GS is more

compositional, ‘syntax-free’, much wider scope.

• Blass games. Another ancestor. Overcomes problems with

compositionality.

• Kleene oracle semantics for higher-type recursive functionals. Fixes a

number of problems. again fundamentally related to composition and

substitution.

Page 78: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Game Semantics in the Games landscape

Introduction

Game Semantics forPrograms

Overview

• Some Key Features

• Some BeautifulResults of GameSemantics

• Full Completeness

• The Game SemanticsLandscape

• Algorithmic GameSemantics• 20-element array ofintegers %2

• On modeling sortingprograms

• Current Work• Game Semantics inthe Games landscape

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 36 / 80

Some comparisons:

• Hintikka GTS and IF logic. GS is more compositional; a proper analysis

of implication!

• Lorenzen school of dialogue games. An ancestor; GS is more

compositional, ‘syntax-free’, much wider scope.

• Blass games. Another ancestor. Overcomes problems with

compositionality.

• Kleene oracle semantics for higher-type recursive functionals. Fixes a

number of problems. again fundamentally related to composition and

substitution.

Our main focus (to date) has been on structural aspects, (categories of)

games in extensive form, rather than fine-grained analysis of winning

strategies, or solution concepts and equilibria. Our key equilibria are ‘logical’,

e.g. the copy-cat strategy.

Page 79: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

The Structure of the GamesUniverse:

a glimpse under the hood

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

• Games• Formal definition ofgames

• AlternatingSequences

• Example

• Strategies

• Strategies as actionsconditioned on histories• Strategies generalizefunctions

• Example

• Strategies on B

• Constructions ongames

• Switching Conditionfor Tensor Product• State transitiondiagram for TensorProduct

• Linear Implication• Linear ImplicationContinued• Switching ConditionTutorial on Game Semantics

Page 80: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Games

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

• Games• Formal definition ofgames

• AlternatingSequences

• Example

• Strategies

• Strategies as actionsconditioned on histories• Strategies generalizefunctions

• Example

• Strategies on B

• Constructions ongames

• Switching Conditionfor Tensor Product• State transitiondiagram for TensorProduct

• Linear Implication• Linear ImplicationContinued• Switching ConditionTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 38 / 80

A game specifies the set of possible runs (or ‘plays’). It can be thought of as a

tree◦

a1

��~~~~

~~~

a2

��@@@

@@@@

•b1

��~~~~

~~~

•b1

��~~~~

~~~

b2��

b3

��@@@

@@@@

◦ ◦ ◦ ◦

• nodes ◦ are Opponent positions

• nodes • are Player positions

• arcs are labelled with moves

Page 81: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Formal definition of games

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

• Games• Formal definition ofgames

• AlternatingSequences

• Example

• Strategies

• Strategies as actionsconditioned on histories• Strategies generalizefunctions

• Example

• Strategies on B

• Constructions ongames

• Switching Conditionfor Tensor Product• State transitiondiagram for TensorProduct

• Linear Implication• Linear ImplicationContinued• Switching ConditionTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 39 / 80

Formally, we define a game G to be a structure (MG, λG, PG), where

• MG is the set of moves of the game;

• λG : MG −→ {P, O} is a labelling function designating each move as

by Player or Opponent;

• PG ⊆nepref Malt

G , i.e. PG is a non-empty, prefix-closed subset of MaltG ,

the set of alternating sequences of moves in MG.

Page 82: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Alternating Sequences

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

• Games• Formal definition ofgames

• AlternatingSequences

• Example

• Strategies

• Strategies as actionsconditioned on histories• Strategies generalizefunctions

• Example

• Strategies on B

• Constructions ongames

• Switching Conditionfor Tensor Product• State transitiondiagram for TensorProduct

• Linear Implication• Linear ImplicationContinued• Switching ConditionTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 40 / 80

More formally, MaltG is the set of all s ∈M∗

G such that

∀i : 1 ≤ i ≤ |s| even(i) =⇒ λG(si) = P∧ odd(i) =⇒ λG(si) = O

s = a1 a2 · · · a2k+1 a2k+2 · · ·λG ↓ ↓ ↓ ↓

O P O P

.

Page 83: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Example

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

• Games• Formal definition ofgames

• AlternatingSequences

• Example

• Strategies

• Strategies as actionsconditioned on histories• Strategies generalizefunctions

• Example

• Strategies on B

• Constructions ongames

• Switching Conditionfor Tensor Product• State transitiondiagram for TensorProduct

• Linear Implication• Linear ImplicationContinued• Switching ConditionTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 41 / 80

The game

({a1, a2, b1, b2, b3}, λ, {ǫ, a1, a1b1, a2, a2b2, a2b3})

λ : a1, a2 7→ O, b1, b2, b3 7→ P

represents the tree

◦a1

��~~~~

~~~

a2

��@@@

@@@@

•b1

��~~~~

~~~

•b2

��~~~~

~~~

b3

��@@@

@@@@

◦ ◦ ◦

Page 84: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Strategies

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

• Games• Formal definition ofgames

• AlternatingSequences

• Example

• Strategies

• Strategies as actionsconditioned on histories• Strategies generalizefunctions

• Example

• Strategies on B

• Constructions ongames

• Switching Conditionfor Tensor Product• State transitiondiagram for TensorProduct

• Linear Implication• Linear ImplicationContinued• Switching ConditionTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 42 / 80

Formally, we define a (deterministic) strategy σ on a game G to be a

non-empty subset σ ⊆ P evenG of the game tree, satisfying:

(s1) ǫ ∈ σ(s2) sab ∈ σ =⇒ s ∈ σ(s3) sab, sac ∈ σ =⇒ b = c.

Page 85: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Strategies as actions conditioned on histories

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

• Games• Formal definition ofgames

• AlternatingSequences

• Example

• Strategies

• Strategies as actionsconditioned on histories• Strategies generalizefunctions

• Example

• Strategies on B

• Constructions ongames

• Switching Conditionfor Tensor Product• State transitiondiagram for TensorProduct

• Linear Implication• Linear ImplicationContinued• Switching ConditionTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 43 / 80

To understand this definition, think of

s = a1b1 · · · akbk ∈ σ

as a record of repeated interactions with the Environment following σ. It can

be read as follows:

If the Environment initially does a1,

then respond with b1;

If the Environment then does a2,

then respond with b2;...

If the Environment finally does ak,then respond with bk.

The first two conditions on σ say that it is a sub-tree of PG of even-length

paths. The third is a determinacy condition.

Page 86: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Strategies generalize functions

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

• Games• Formal definition ofgames

• AlternatingSequences

• Example

• Strategies

• Strategies as actionsconditioned on histories• Strategies generalizefunctions

• Example

• Strategies on B

• Constructions ongames

• Switching Conditionfor Tensor Product• State transitiondiagram for TensorProduct

• Linear Implication• Linear ImplicationContinued• Switching ConditionTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 44 / 80

This can be seen as generalizing the notion of graph of a relation, i.e. of a set

of ordered pairs, which can be read as a set of stimulus-response instructions.

The generalization is that ordinary relations describe a single

stimulus-response event only (giving rules for what the response to any givenstimulus may be), whereas strategies describe repeated interactions between

the System and the Environment. We can regard sab ∈ σ as saying: ‘when

given the stimulus a in the context s, respond with b’. Note that, with this

reading, the condition (s3) generalizes the usual single-valuedness condition

for (the graphs of) partial functions. Thus a useful slogan is:

“Strategies are (partial) functions extended in time.”

Page 87: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Example

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

• Games• Formal definition ofgames

• AlternatingSequences

• Example

• Strategies

• Strategies as actionsconditioned on histories• Strategies generalizefunctions

• Example

• Strategies on B

• Constructions ongames

• Switching Conditionfor Tensor Product• State transitiondiagram for TensorProduct

• Linear Implication• Linear ImplicationContinued• Switching ConditionTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 45 / 80

Let B be the game

({∗, tt, ff}, {∗ 7→ O, tt 7→ P, ff 7→ P}, {ǫ, ∗, ∗tt, ∗ff})

��•

tt

��~~~~

~~~

ff

��@@@

@@@@

◦ ◦

This game can be seen as representing the data type of booleans. The

opening move ∗ is a request by Opponent for the data, which can be

answered by either tt or ff by Player.

Page 88: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Strategies on B

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

• Games• Formal definition ofgames

• AlternatingSequences

• Example

• Strategies

• Strategies as actionsconditioned on histories• Strategies generalizefunctions

• Example

• Strategies on B

• Constructions ongames

• Switching Conditionfor Tensor Product• State transitiondiagram for TensorProduct

• Linear Implication• Linear ImplicationContinued• Switching ConditionTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 46 / 80

{ǫ} Pref{∗tt} Pref{∗ff}

The first of these is the undefined strategy (‘⊥’), the second and third

correspond to the boolean values tt and ff. Taken with the inclusion ordering,

this “space of strategies” corresponds to the usual flat domain of booleans:

tt

@@@@

@@@ ff

����

���

Page 89: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Constructions on games

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

• Games• Formal definition ofgames

• AlternatingSequences

• Example

• Strategies

• Strategies as actionsconditioned on histories• Strategies generalizefunctions

• Example

• Strategies on B

• Constructions ongames

• Switching Conditionfor Tensor Product• State transitiondiagram for TensorProduct

• Linear Implication• Linear ImplicationContinued• Switching ConditionTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 47 / 80

We will now describe some fundamental constructions on games.

Tensor Product Given games A, B, we describe the tensor product A⊗B.

MA⊗B = MA + MB

λA⊗B = [λA, λB]PA⊗B = {s ∈Malt

A⊗B | s↾MA ∈ PA ∧ s↾MB ∈ PB}

We can think of A⊗B as allowing play to proceed in both the subgames Aand B in an interleaved fashion. It is a form of ‘disjoint (i.e.

non-communicating or interacting) parallel composition’.

Page 90: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Switching Condition for Tensor Product

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

• Games• Formal definition ofgames

• AlternatingSequences

• Example

• Strategies

• Strategies as actionsconditioned on histories• Strategies generalizefunctions

• Example

• Strategies on B

• Constructions ongames

• Switching Conditionfor Tensor Product• State transitiondiagram for TensorProduct

• Linear Implication• Linear ImplicationContinued• Switching ConditionTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 48 / 80

A first hint of the additional subtleties introduced by the explicit representation

of both System and Environment is given by the following result.

Proposition 1 (Switching condition)

In any play s ∈ PA⊗B , if successive moves si, si+1 are in different subgames

(i.e. one is in A and the other in B), then λA⊗B(si) = P , λA⊗B(si+1) = O.In other words, only Opponent can switch from one subgame to another;

Player must always respond in the same subgame that Opponent just moved

in.

Page 91: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

State transition diagram for Tensor Product

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

• Games• Formal definition ofgames

• AlternatingSequences

• Example

• Strategies

• Strategies as actionsconditioned on histories• Strategies generalizefunctions

• Example

• Strategies on B

• Constructions ongames

• Switching Conditionfor Tensor Product• State transitiondiagram for TensorProduct

• Linear Implication• Linear ImplicationContinued• Switching ConditionTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 49 / 80

��

(O, O)

O

������

����

����

���

O

��:::

::::

::::

::::

(P, O)@A

GFP

55kkkkkkkkkkkkkkkkk

(O, P )BC

EDP

iiSSSSSSSSSSSSSSSSS

We see immediately from this that the switching condition holds; and also that

the state (P, P ) can never be reached (i.e. for no s ∈ PA⊗B is

psq = (P, P )).

Page 92: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Linear Implication

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

• Games• Formal definition ofgames

• AlternatingSequences

• Example

• Strategies

• Strategies as actionsconditioned on histories• Strategies generalizefunctions

• Example

• Strategies on B

• Constructions ongames

• Switching Conditionfor Tensor Product• State transitiondiagram for TensorProduct

• Linear Implication• Linear ImplicationContinued• Switching ConditionTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 50 / 80

Given games A, B, we define the game A ⊸ B as follows:

MA⊸B = MA + MB

λA⊗B = [λA, λB] where λA(m) =

{

P when λA(m) = OO when λA(m) = P

PA⊸B = {s ∈MaltA⊸B | s ↾ MA ∈ PA ∧ s ↾ MB ∈ PB}

This definition is almost the same as that of A⊗B. The crucial difference is

the inversion of the labelling function on the moves of A, corresponding to the

idea that on the left of the arrow the roles of Player and Opponent are

interchanged.

Page 93: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Linear Implication Continued

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

• Games• Formal definition ofgames

• AlternatingSequences

• Example

• Strategies

• Strategies as actionsconditioned on histories• Strategies generalizefunctions

• Example

• Strategies on B

• Constructions ongames

• Switching Conditionfor Tensor Product• State transitiondiagram for TensorProduct

• Linear Implication• Linear ImplicationContinued• Switching ConditionTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 51 / 80

If we think of ‘function boxes’, this is clear enough:

Input Output

// System //

On the output side, the System is the producer and the Environment is the

consumer; these roles are reversed on the input side.

Note that MaltA⊸B , and hence PA⊸B , are in general quite different to Malt

A⊗B ,

PA⊗B respectively. In particular, the first move in PA⊸B must always be in

B, since the first move must be by Opponent, and all opening moves in A arelabelled P by λA.

Page 94: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Switching Condition for Linear Implication

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

• Games• Formal definition ofgames

• AlternatingSequences

• Example

• Strategies

• Strategies as actionsconditioned on histories• Strategies generalizefunctions

• Example

• Strategies on B

• Constructions ongames

• Switching Conditionfor Tensor Product• State transitiondiagram for TensorProduct

• Linear Implication• Linear ImplicationContinued• Switching ConditionTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 52 / 80

We obtain the following switching condition for A ⊸ B:

If two consecutive moves are in different components, the first

was by Opponent and the second by Player; so only Player can

switch components.

This is supported by the following state-transition diagram:

��

(P, O)

O

��

(P, P )

P

������

����

����

���

P

��:::

::::

::::

::::

(O, P )@A

GFO

55kkkkkkkkkkkkkkkkk

(P, O)BC

EDO

iiSSSSSSSSSSSSSSSSS

Page 95: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

The Copy-Cat Strategy

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

• Games• Formal definition ofgames

• AlternatingSequences

• Example

• Strategies

• Strategies as actionsconditioned on histories• Strategies generalizefunctions

• Example

• Strategies on B

• Constructions ongames

• Switching Conditionfor Tensor Product• State transitiondiagram for TensorProduct

• Linear Implication• Linear ImplicationContinued• Switching ConditionTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 53 / 80

How to beat an International Grand-Master at chess by the power of Logic.

Kasparov Short

B

W

W

B

·

OOOOOOOOOOOO

ooooooooooooo

Page 96: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Does Copy-Cat still work here?

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

• Games• Formal definition ofgames

• AlternatingSequences

• Example

• Strategies

• Strategies as actionsconditioned on histories• Strategies generalizefunctions

• Example

• Strategies on B

• Constructions ongames

• Switching Conditionfor Tensor Product• State transitiondiagram for TensorProduct

• Linear Implication• Linear ImplicationContinued• Switching ConditionTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 54 / 80

Kasparov Short Short

B

W

W

B

W

B

·

OOOOOOOOOOOO

ooooooooooooo

fffffffffffffffffffffffffffff

Page 97: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

And here?

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

• Games• Formal definition ofgames

• AlternatingSequences

• Example

• Strategies

• Strategies as actionsconditioned on histories• Strategies generalizefunctions

• Example

• Strategies on B

• Constructions ongames

• Switching Conditionfor Tensor Product• State transitiondiagram for TensorProduct

• Linear Implication• Linear ImplicationContinued• Switching ConditionTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 55 / 80

Kasparov Kasparov Short

B

W

B

W

W

B

·

XXXXXXXXXXXXXXXXXXXXXXXXXXXX

OOOOOOOOOOOO

ooooooooooooo

Page 98: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

General definition of Copy-Cat strategy

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

• Games• Formal definition ofgames

• AlternatingSequences

• Example

• Strategies

• Strategies as actionsconditioned on histories• Strategies generalizefunctions

• Example

• Strategies on B

• Constructions ongames

• Switching Conditionfor Tensor Product• State transitiondiagram for TensorProduct

• Linear Implication• Linear ImplicationContinued• Switching ConditionTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 56 / 80

A ⊸ ATime

1 a1 O2 a1 P3 a2 O4 a2 P...

......

idA = {s ∈ P evenA1⊸A2

| ∀t even-length prefix of s : t↾A1 = t↾A2}

We indicate such a strategy briefly by A'& %$

⊸ A

Page 99: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Application ( Modus Ponens)

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

• Games• Formal definition ofgames

• AlternatingSequences

• Example

• Strategies

• Strategies as actionsconditioned on histories• Strategies generalizefunctions

• Example

• Strategies on B

• Constructions ongames

• Switching Conditionfor Tensor Product• State transitiondiagram for TensorProduct

• Linear Implication• Linear ImplicationContinued• Switching ConditionTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 57 / 80

ApA,B : (A ⊸ B)⊗A ⊸ B

This is the conjunction of two copy-cat strategies

(A'& %$

⊸ B)GF ED

⊗ A ⊸ B

Note that A and B each occur once positively and once negatively in this

formula; we simply connect up the positive and negative occurrences by

‘copy-cats’.

ApA,B = {s ∈ P even(A1⊸B1)⊗A2 ⊸ B2

| ∀t even-length prefix of s :

t↾A1 = t↾A2 ∧ t↾B1 = t↾B2}

Page 100: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Linear Function Application

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

• Games• Formal definition ofgames

• AlternatingSequences

• Example

• Strategies

• Strategies as actionsconditioned on histories• Strategies generalizefunctions

• Example

• Strategies on B

• Constructions ongames

• Switching Conditionfor Tensor Product• State transitiondiagram for TensorProduct

• Linear Implication• Linear ImplicationContinued• Switching ConditionTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 58 / 80

The Ap strategy as a protocol for (linear) function application.( A ⊸ B ) ⊗ A ⊸ B

O roP roO riP riO idP idO odP od

ro — request output

ri — request inputid — input data

od — output data

Page 101: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

The Category of Games G

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

• Games• Formal definition ofgames

• AlternatingSequences

• Example

• Strategies

• Strategies as actionsconditioned on histories• Strategies generalizefunctions

• Example

• Strategies on B

• Constructions ongames

• Switching Conditionfor Tensor Product• State transitiondiagram for TensorProduct

• Linear Implication• Linear ImplicationContinued• Switching ConditionTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 59 / 80

• Objects: Games

• Morphisms: σ : A −→ B are strategies σ on A ⊸ B.

• Composition: interaction between strategies .

σ : A→ B τ : B → C

σ; τ : A→ C

Page 102: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Composition as Interaction: The idea

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

• Games• Formal definition ofgames

• AlternatingSequences

• Example

• Strategies

• Strategies as actionsconditioned on histories• Strategies generalizefunctions

• Example

• Strategies on B

• Constructions ongames

• Switching Conditionfor Tensor Product• State transitiondiagram for TensorProduct

• Linear Implication• Linear ImplicationContinued• Switching ConditionTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 60 / 80

Aσ⊸ B B

τ⊸ C

c1

b1

b1

b2

b2...

...

bk

bk

a1

Page 103: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Composition Continued

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

• Games• Formal definition ofgames

• AlternatingSequences

• Example

• Strategies

• Strategies as actionsconditioned on histories• Strategies generalizefunctions

• Example

• Strategies on B

• Constructions ongames

• Switching Conditionfor Tensor Product• State transitiondiagram for TensorProduct

• Linear Implication• Linear ImplicationContinued• Switching ConditionTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 61 / 80

Continuing in this way, we obtain a uniquely determined sequence.

c1b1b2 · · · bk · · ·

If the sequence ends in a visible action in A or C, this is the response by the

strategy σ; τ to the initial move c1, with the internal dialogue between σ and τin B being hidden from the Environment. Note that σ and τ may continue their

internal dialogue in B forever. This is “infinite chattering” in CSP terminology,and “divergence by an infinite τ -computation” in CCS terminology.

Page 104: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Composition Continued

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

• Games• Formal definition ofgames

• AlternatingSequences

• Example

• Strategies

• Strategies as actionsconditioned on histories• Strategies generalizefunctions

• Example

• Strategies on B

• Constructions ongames

• Switching Conditionfor Tensor Product• State transitiondiagram for TensorProduct

• Linear Implication• Linear ImplicationContinued• Switching ConditionTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 61 / 80

Continuing in this way, we obtain a uniquely determined sequence.

c1b1b2 · · · bk · · ·

If the sequence ends in a visible action in A or C, this is the response by the

strategy σ; τ to the initial move c1, with the internal dialogue between σ and τin B being hidden from the Environment. Note that σ and τ may continue their

internal dialogue in B forever. This is “infinite chattering” in CSP terminology,and “divergence by an infinite τ -computation” in CCS terminology.

As this discussion clearly shows composition in G expresses interaction

between strategies.

Page 105: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Formal Definition of Composition

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

• Games• Formal definition ofgames

• AlternatingSequences

• Example

• Strategies

• Strategies as actionsconditioned on histories• Strategies generalizefunctions

• Example

• Strategies on B

• Constructions ongames

• Switching Conditionfor Tensor Product• State transitiondiagram for TensorProduct

• Linear Implication• Linear ImplicationContinued• Switching ConditionTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 62 / 80

‘Parallel Composition + Hiding’

σ : A→ B τ : B → C

σ; τ : A→ C

σ; τ = (σ ‖ τ)/B = {s↾A, C | s ∈ σ ‖ τ}

σ ‖ τ = {s ∈ (MA + MB + MC)∗ | s↾A, B ∈ σ ∧ s↾B, C ∈ τ}.

Page 106: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Formal Definition of Composition

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

• Games• Formal definition ofgames

• AlternatingSequences

• Example

• Strategies

• Strategies as actionsconditioned on histories• Strategies generalizefunctions

• Example

• Strategies on B

• Constructions ongames

• Switching Conditionfor Tensor Product• State transitiondiagram for TensorProduct

• Linear Implication• Linear ImplicationContinued• Switching ConditionTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 62 / 80

‘Parallel Composition + Hiding’

σ : A→ B τ : B → C

σ; τ : A→ C

σ; τ = (σ ‖ τ)/B = {s↾A, C | s ∈ σ ‖ τ}

σ ‖ τ = {s ∈ (MA + MB + MC)∗ | s↾A, B ∈ σ ∧ s↾B, C ∈ τ}.

(Note that we extend our abuse of notation for restriction here; by s↾A, B we

mean the restriction of s to MA + MB as a “subset” of MA + MB + MC ,and similarly for s↾A, C and s↾B, C.)

Page 107: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

The Category of Games

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

• Games• Formal definition ofgames

• AlternatingSequences

• Example

• Strategies

• Strategies as actionsconditioned on histories• Strategies generalizefunctions

• Example

• Strategies on B

• Constructions ongames

• Switching Conditionfor Tensor Product• State transitiondiagram for TensorProduct

• Linear Implication• Linear ImplicationContinued• Switching ConditionTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 63 / 80

Proposition 2 G is a category.

Page 108: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

The Category of Games

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

• Games• Formal definition ofgames

• AlternatingSequences

• Example

• Strategies

• Strategies as actionsconditioned on histories• Strategies generalizefunctions

• Example

• Strategies on B

• Constructions ongames

• Switching Conditionfor Tensor Product• State transitiondiagram for TensorProduct

• Linear Implication• Linear ImplicationContinued• Switching ConditionTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 63 / 80

Proposition 3 G is a category.

In particular, idA : A −→ A is the copy-cat strategy described previously.

Page 109: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

The Category of Games

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

• Games• Formal definition ofgames

• AlternatingSequences

• Example

• Strategies

• Strategies as actionsconditioned on histories• Strategies generalizefunctions

• Example

• Strategies on B

• Constructions ongames

• Switching Conditionfor Tensor Product• State transitiondiagram for TensorProduct

• Linear Implication• Linear ImplicationContinued• Switching ConditionTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 63 / 80

Proposition 4 G is a category.

In particular, idA : A −→ A is the copy-cat strategy described previously.

Composition and Copy-Cat (Identity Axiom and Cut) are two sides of the same

coin:

• Copy-cat makes the same thing happen in two different places

• Composition makes two different things happen in the same place (the

‘locus of interaction’).

Page 110: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Tensor structure of G

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

• Games• Formal definition ofgames

• AlternatingSequences

• Example

• Strategies

• Strategies as actionsconditioned on histories• Strategies generalizefunctions

• Example

• Strategies on B

• Constructions ongames

• Switching Conditionfor Tensor Product• State transitiondiagram for TensorProduct

• Linear Implication• Linear ImplicationContinued• Switching ConditionTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 64 / 80

We have already defined the tensor product A⊗B on objects. Now we

extend it to morphisms:

Page 111: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Tensor structure of G

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

• Games• Formal definition ofgames

• AlternatingSequences

• Example

• Strategies

• Strategies as actionsconditioned on histories• Strategies generalizefunctions

• Example

• Strategies on B

• Constructions ongames

• Switching Conditionfor Tensor Product• State transitiondiagram for TensorProduct

• Linear Implication• Linear ImplicationContinued• Switching ConditionTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 64 / 80

We have already defined the tensor product A⊗B on objects. Now we

extend it to morphisms:

σ : A→ B τ : A′ → B′

σ ⊗ τ : A⊗A′ → B ⊗B′

σ ⊗ τ = {s ∈ P evenA⊗A′

⊸B⊗B′ | s ↾ A, B ∈ σ ∧ s ↾ A′, B′ ∈ τ}.

Page 112: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Tensor structure of G

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

• Games• Formal definition ofgames

• AlternatingSequences

• Example

• Strategies

• Strategies as actionsconditioned on histories• Strategies generalizefunctions

• Example

• Strategies on B

• Constructions ongames

• Switching Conditionfor Tensor Product• State transitiondiagram for TensorProduct

• Linear Implication• Linear ImplicationContinued• Switching ConditionTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 64 / 80

We have already defined the tensor product A⊗B on objects. Now we

extend it to morphisms:

σ : A→ B τ : A′ → B′

σ ⊗ τ : A⊗A′ → B ⊗B′

σ ⊗ τ = {s ∈ P evenA⊗A′

⊸B⊗B′ | s ↾ A, B ∈ σ ∧ s ↾ A′, B′ ∈ τ}.

This can be seen as disjoint (i.e. non-communicating) parallel composition of

σ and τ .

Page 113: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

‘Canonical isomorphisms’ for monoidal structure

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

• Games• Formal definition ofgames

• AlternatingSequences

• Example

• Strategies

• Strategies as actionsconditioned on histories• Strategies generalizefunctions

• Example

• Strategies on B

• Constructions ongames

• Switching Conditionfor Tensor Product• State transitiondiagram for TensorProduct

• Linear Implication• Linear ImplicationContinued• Switching ConditionTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 65 / 80

These arise as conjunctions of copy-cat strategies.

assocA,B,C : (A⊗B)⊗ C∼−→ A⊗ (B ⊗ C)

(A�� ��⊗ B)

?> =<⊗ C

ON ML⊸ A ⊗ (B ⊗ C)

symmA,B : A⊗B∼−→ B ⊗A

AGF ED⊗ B

'& %$⊸ B ⊗ A

Page 114: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Linear Implication

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

• Games• Formal definition ofgames

• AlternatingSequences

• Example

• Strategies

• Strategies as actionsconditioned on histories• Strategies generalizefunctions

• Example

• Strategies on B

• Constructions ongames

• Switching Conditionfor Tensor Product• State transitiondiagram for TensorProduct

• Linear Implication• Linear ImplicationContinued• Switching ConditionTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 66 / 80

The application (or evaluation) morphisms

ApA,B : (A ⊸ B)⊗A −→ B

have already been defined. For currying, given

σ : A⊗B ⊸ C

define

Λ(σ) : A −→ (B ⊸ C)

byΛ(σ) = {α∗(s) | s ∈ σ}

where α : (MA + MB) + MC∼−→MA + (MB + MC) is the canonical

isomorphism in Set.

Page 115: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Copying in Game Semantics

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics• Interpreting the Linearexponential ! in G

• Combinatorics ofCopying

• Co-MonadicOperations

• Comonads for ModalLogicians

• Copying is comonoidal

• Comonoid AxiomsContinued• Comonoids inmonoidal categories

• Solution• A Cartesian ClosedCategory of Games

• The additiveconjunction

• Cartesian Closure

• The Story From Here

• Some ReferencesTutorial on Game Semantics

Page 116: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Interpreting the Linear exponential ! in G

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics• Interpreting the Linearexponential ! in G

• Combinatorics ofCopying

• Co-MonadicOperations

• Comonads for ModalLogicians

• Copying is comonoidal

• Comonoid AxiomsContinued• Comonoids inmonoidal categories

• Solution• A Cartesian ClosedCategory of Games

• The additiveconjunction

• Cartesian Closure

• The Story From Here

• Some ReferencesTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 68 / 80

The resource sensitivity of games means that copying does not come for free;

but it can be modelled explicitly.

Page 117: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Interpreting the Linear exponential ! in G

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics• Interpreting the Linearexponential ! in G

• Combinatorics ofCopying

• Co-MonadicOperations

• Comonads for ModalLogicians

• Copying is comonoidal

• Comonoid AxiomsContinued• Comonoids inmonoidal categories

• Solution• A Cartesian ClosedCategory of Games

• The additiveconjunction

• Cartesian Closure

• The Story From Here

• Some ReferencesTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 68 / 80

The resource sensitivity of games means that copying does not come for free;

but it can be modelled explicitly.

We begin with a simpler construction: the ‘Tensor product of countably many

copies of A’, which we write as⊗ωA:

Page 118: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Interpreting the Linear exponential ! in G

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics• Interpreting the Linearexponential ! in G

• Combinatorics ofCopying

• Co-MonadicOperations

• Comonads for ModalLogicians

• Copying is comonoidal

• Comonoid AxiomsContinued• Comonoids inmonoidal categories

• Solution• A Cartesian ClosedCategory of Games

• The additiveconjunction

• Cartesian Closure

• The Story From Here

• Some ReferencesTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 68 / 80

The resource sensitivity of games means that copying does not come for free;

but it can be modelled explicitly.

We begin with a simpler construction: the ‘Tensor product of countably many

copies of A’, which we write as⊗ωA:

• M⊗ωA = N×MA, i.e. the disjoint union of countably many copies ofMA.

• λ⊗ωA(n, a) = λA(a).

• P⊗ωA is the set of all alternating sequences of moves in M⊗ωA such

that for all n, s↾n ∈ PA.

Page 119: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Interpreting the Linear exponential ! in G

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics• Interpreting the Linearexponential ! in G

• Combinatorics ofCopying

• Co-MonadicOperations

• Comonads for ModalLogicians

• Copying is comonoidal

• Comonoid AxiomsContinued• Comonoids inmonoidal categories

• Solution• A Cartesian ClosedCategory of Games

• The additiveconjunction

• Cartesian Closure

• The Story From Here

• Some ReferencesTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 68 / 80

The resource sensitivity of games means that copying does not come for free;

but it can be modelled explicitly.

We begin with a simpler construction: the ‘Tensor product of countably many

copies of A’, which we write as⊗ωA:

• M⊗ωA = N×MA, i.e. the disjoint union of countably many copies ofMA.

• λ⊗ωA(n, a) = λA(a).

• P⊗ωA is the set of all alternating sequences of moves in M⊗ωA such

that for all n, s↾n ∈ PA.

(Switching conditions?)

Page 120: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Combinatorics of Copying

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics• Interpreting the Linearexponential ! in G

• Combinatorics ofCopying

• Co-MonadicOperations

• Comonads for ModalLogicians

• Copying is comonoidal

• Comonoid AxiomsContinued• Comonoids inmonoidal categories

• Solution• A Cartesian ClosedCategory of Games

• The additiveconjunction

• Cartesian Closure

• The Story From Here

• Some ReferencesTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 69 / 80

We can define a copying strategy

δA : ⊗ωA −→ ⊗ωA⊗⊗ωA

using the bijection on moves

M⊗ωA ≡ N×MA∼= (N + N)×A∼= N×MA + N×MA∼= M⊗ωA + M⊗ωA

based on the (rather: a) bijection N ∼= N + N (‘Hilbert hotel’).

Page 121: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Combinatorics of Copying

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics• Interpreting the Linearexponential ! in G

• Combinatorics ofCopying

• Co-MonadicOperations

• Comonads for ModalLogicians

• Copying is comonoidal

• Comonoid AxiomsContinued• Comonoids inmonoidal categories

• Solution• A Cartesian ClosedCategory of Games

• The additiveconjunction

• Cartesian Closure

• The Story From Here

• Some ReferencesTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 69 / 80

We can define a copying strategy

δA : ⊗ωA −→ ⊗ωA⊗⊗ωA

using the bijection on moves

M⊗ωA ≡ N×MA∼= (N + N)×A∼= N×MA + N×MA∼= M⊗ωA + M⊗ωA

based on the (rather: a) bijection N ∼= N + N (‘Hilbert hotel’).

The strategy simply plays copy-cat between the copies of A paired by this

bijection.

Page 122: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Co-Monadic Operations

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics• Interpreting the Linearexponential ! in G

• Combinatorics ofCopying

• Co-MonadicOperations

• Comonads for ModalLogicians

• Copying is comonoidal

• Comonoid AxiomsContinued• Comonoids inmonoidal categories

• Solution• A Cartesian ClosedCategory of Games

• The additiveconjunction

• Cartesian Closure

• The Story From Here

• Some ReferencesTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 70 / 80

We also have the following operations:

Page 123: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Co-Monadic Operations

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics• Interpreting the Linearexponential ! in G

• Combinatorics ofCopying

• Co-MonadicOperations

• Comonads for ModalLogicians

• Copying is comonoidal

• Comonoid AxiomsContinued• Comonoids inmonoidal categories

• Solution• A Cartesian ClosedCategory of Games

• The additiveconjunction

• Cartesian Closure

• The Story From Here

• Some ReferencesTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 70 / 80

We also have the following operations:

Dereliction: derA : ⊗ωA −→ A.

We choose some index, e.g. 0, to play copycat with.

Page 124: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Co-Monadic Operations

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics• Interpreting the Linearexponential ! in G

• Combinatorics ofCopying

• Co-MonadicOperations

• Comonads for ModalLogicians

• Copying is comonoidal

• Comonoid AxiomsContinued• Comonoids inmonoidal categories

• Solution• A Cartesian ClosedCategory of Games

• The additiveconjunction

• Cartesian Closure

• The Story From Here

• Some ReferencesTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 70 / 80

We also have the following operations:

Dereliction: derA : ⊗ωA −→ A.

We choose some index, e.g. 0, to play copycat with.

Promotion: ⊗ωA −→ ⊗ω ⊗ω A.Another copycat based on the bijection of moves

M⊗ωA ≡ N×MA∼= (N× N)×MA∼= N× (N×MA)≡ M⊗ω⊗ωA

using some pairing function N ∼= N× N.

Page 125: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Co-Monadic Operations

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics• Interpreting the Linearexponential ! in G

• Combinatorics ofCopying

• Co-MonadicOperations

• Comonads for ModalLogicians

• Copying is comonoidal

• Comonoid AxiomsContinued• Comonoids inmonoidal categories

• Solution• A Cartesian ClosedCategory of Games

• The additiveconjunction

• Cartesian Closure

• The Story From Here

• Some ReferencesTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 70 / 80

We also have the following operations:

Dereliction: derA : ⊗ωA −→ A.

We choose some index, e.g. 0, to play copycat with.

Promotion: ⊗ωA −→ ⊗ω ⊗ω A.Another copycat based on the bijection of moves

M⊗ωA ≡ N×MA∼= (N× N)×MA∼= N× (N×MA)≡ M⊗ω⊗ωA

using some pairing function N ∼= N× N.

Functorial action:σ : A −→ B

⊗ωσ : ⊗ωA −→ ⊗ωB

playing σ in each index.

Page 126: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Comonads for Modal Logicians

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics• Interpreting the Linearexponential ! in G

• Combinatorics ofCopying

• Co-MonadicOperations

• Comonads for ModalLogicians

• Copying is comonoidal

• Comonoid AxiomsContinued• Comonoids inmonoidal categories

• Solution• A Cartesian ClosedCategory of Games

• The additiveconjunction

• Cartesian Closure

• The Story From Here

• Some ReferencesTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 71 / 80

Comonads are the categorical or type-theoretic equivalents of S4 necessity

modalities.

Cf.2A→ A2A→ 22A(A→ B)→ (2A→ 2B)

Page 127: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Comonads for Modal Logicians

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics• Interpreting the Linearexponential ! in G

• Combinatorics ofCopying

• Co-MonadicOperations

• Comonads for ModalLogicians

• Copying is comonoidal

• Comonoid AxiomsContinued• Comonoids inmonoidal categories

• Solution• A Cartesian ClosedCategory of Games

• The additiveconjunction

• Cartesian Closure

• The Story From Here

• Some ReferencesTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 71 / 80

Comonads are the categorical or type-theoretic equivalents of S4 necessity

modalities.

Cf.2A→ A2A→ 22A(A→ B)→ (2A→ 2B)

However: this treatment of copying based on ⊗ω is all coding-dependent and

does not satisfy the appropriate equational properties.

Page 128: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Comonads for Modal Logicians

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics• Interpreting the Linearexponential ! in G

• Combinatorics ofCopying

• Co-MonadicOperations

• Comonads for ModalLogicians

• Copying is comonoidal

• Comonoid AxiomsContinued• Comonoids inmonoidal categories

• Solution• A Cartesian ClosedCategory of Games

• The additiveconjunction

• Cartesian Closure

• The Story From Here

• Some ReferencesTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 71 / 80

Comonads are the categorical or type-theoretic equivalents of S4 necessity

modalities.

Cf.2A→ A2A→ 22A(A→ B)→ (2A→ 2B)

However: this treatment of copying based on ⊗ω is all coding-dependent and

does not satisfy the appropriate equational properties.

The basic reason that we are not content with ⊗ωA is that the various copies

have distinct ‘identities’ via their indices i ∈ N.

Page 129: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Comonads for Modal Logicians

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics• Interpreting the Linearexponential ! in G

• Combinatorics ofCopying

• Co-MonadicOperations

• Comonads for ModalLogicians

• Copying is comonoidal

• Comonoid AxiomsContinued• Comonoids inmonoidal categories

• Solution• A Cartesian ClosedCategory of Games

• The additiveconjunction

• Cartesian Closure

• The Story From Here

• Some ReferencesTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 71 / 80

Comonads are the categorical or type-theoretic equivalents of S4 necessity

modalities.

Cf.2A→ A2A→ 22A(A→ B)→ (2A→ 2B)

However: this treatment of copying based on ⊗ω is all coding-dependent and

does not satisfy the appropriate equational properties.

The basic reason that we are not content with ⊗ωA is that the various copies

have distinct ‘identities’ via their indices i ∈ N.

Cf. Fock space in quantum physics: bosons (such as electrons) do not have

individual identities.

Page 130: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Copying is comonoidal

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics• Interpreting the Linearexponential ! in G

• Combinatorics ofCopying

• Co-MonadicOperations

• Comonads for ModalLogicians

• Copying is comonoidal

• Comonoid AxiomsContinued• Comonoids inmonoidal categories

• Solution• A Cartesian ClosedCategory of Games

• The additiveconjunction

• Cartesian Closure

• The Story From Here

• Some ReferencesTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 72 / 80

Page 131: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Copying is comonoidal

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics• Interpreting the Linearexponential ! in G

• Combinatorics ofCopying

• Co-MonadicOperations

• Comonads for ModalLogicians

• Copying is comonoidal

• Comonoid AxiomsContinued• Comonoids inmonoidal categories

• Solution• A Cartesian ClosedCategory of Games

• The additiveconjunction

• Cartesian Closure

• The Story From Here

• Some ReferencesTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 72 / 80

In any category with products, the diagonal — which expresses copyability —

has an algebraic structure; it is a cocommutative comonoid — the dual of a

commutative monoid.

Page 132: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Copying is comonoidal

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics• Interpreting the Linearexponential ! in G

• Combinatorics ofCopying

• Co-MonadicOperations

• Comonads for ModalLogicians

• Copying is comonoidal

• Comonoid AxiomsContinued• Comonoids inmonoidal categories

• Solution• A Cartesian ClosedCategory of Games

• The additiveconjunction

• Cartesian Closure

• The Story From Here

• Some ReferencesTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 72 / 80

In any category with products, the diagonal — which expresses copyability —

has an algebraic structure; it is a cocommutative comonoid — the dual of a

commutative monoid.

That is, we have, for any object C:

Page 133: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Copying is comonoidal

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics• Interpreting the Linearexponential ! in G

• Combinatorics ofCopying

• Co-MonadicOperations

• Comonads for ModalLogicians

• Copying is comonoidal

• Comonoid AxiomsContinued• Comonoids inmonoidal categories

• Solution• A Cartesian ClosedCategory of Games

• The additiveconjunction

• Cartesian Closure

• The Story From Here

• Some ReferencesTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 72 / 80

In any category with products, the diagonal — which expresses copyability —

has an algebraic structure; it is a cocommutative comonoid — the dual of a

commutative monoid.

That is, we have, for any object C:

(1) Coassociativity

C × (C × C)aC,C,C - (C × C)× C

C × C

idC×∆

6

� ∆C

∆ - C × C

∆×idC

6

Page 134: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Comonoid Axioms Continued

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics• Interpreting the Linearexponential ! in G

• Combinatorics ofCopying

• Co-MonadicOperations

• Comonads for ModalLogicians

• Copying is comonoidal

• Comonoid AxiomsContinued• Comonoids inmonoidal categories

• Solution• A Cartesian ClosedCategory of Games

• The additiveconjunction

• Cartesian Closure

• The Story From Here

• Some ReferencesTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 73 / 80

(2) Counit

⊤× C �⊤×idCC × C

idC×⊤- C ×⊤

C

6

r−1

-�

l −1

(3) Cocommutativity

C∆- C × C

C × C

s

?∆

-

Page 135: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Comonoids in monoidal categories

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics• Interpreting the Linearexponential ! in G

• Combinatorics ofCopying

• Co-MonadicOperations

• Comonads for ModalLogicians

• Copying is comonoidal

• Comonoid AxiomsContinued• Comonoids inmonoidal categories

• Solution• A Cartesian ClosedCategory of Games

• The additiveconjunction

• Cartesian Closure

• The Story From Here

• Some ReferencesTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 74 / 80

The notion of cocommutative comonoid (in future: coalgebra for short) makes

sense in any symmetric monoidal category.

Page 136: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Comonoids in monoidal categories

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics• Interpreting the Linearexponential ! in G

• Combinatorics ofCopying

• Co-MonadicOperations

• Comonads for ModalLogicians

• Copying is comonoidal

• Comonoid AxiomsContinued• Comonoids inmonoidal categories

• Solution• A Cartesian ClosedCategory of Games

• The additiveconjunction

• Cartesian Closure

• The Story From Here

• Some ReferencesTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 74 / 80

The notion of cocommutative comonoid (in future: coalgebra for short) makes

sense in any symmetric monoidal category.

Let (C,⊗, I, a, l, r, s) be a symmetric monoidal category. A comonoid in C

is a triple (C, δ, ǫ) where C is an object, and δ : C −→ C ⊗ C andǫ : C −→ I are morphisms satisfying the commutative diagrams for

Coassociativity, Counit, and Cocommutativity.

Page 137: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Comonoids in monoidal categories

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics• Interpreting the Linearexponential ! in G

• Combinatorics ofCopying

• Co-MonadicOperations

• Comonads for ModalLogicians

• Copying is comonoidal

• Comonoid AxiomsContinued• Comonoids inmonoidal categories

• Solution• A Cartesian ClosedCategory of Games

• The additiveconjunction

• Cartesian Closure

• The Story From Here

• Some ReferencesTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 74 / 80

The notion of cocommutative comonoid (in future: coalgebra for short) makes

sense in any symmetric monoidal category.

Let (C,⊗, I, a, l, r, s) be a symmetric monoidal category. A comonoid in C

is a triple (C, δ, ǫ) where C is an object, and δ : C −→ C ⊗ C andǫ : C −→ I are morphisms satisfying the commutative diagrams for

Coassociativity, Counit, and Cocommutativity.

(N.B. coalgebraic structures are important in current mathematics, e.g. Hopf

algebras, Quantum groups, Frobenius algebras etc.)

Page 138: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Solution

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics• Interpreting the Linearexponential ! in G

• Combinatorics ofCopying

• Co-MonadicOperations

• Comonads for ModalLogicians

• Copying is comonoidal

• Comonoid AxiomsContinued• Comonoids inmonoidal categories

• Solution• A Cartesian ClosedCategory of Games

• The additiveconjunction

• Cartesian Closure

• The Story From Here

• Some ReferencesTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 75 / 80

We obtain the ‘right’ notion of ! with all the appropriate properties by factoring

out modulo the action of permutations (of finite support) on N. This means

that indices become ‘generic’ and have no specific identities; the only

operation available on them is comparison for equality. All operations andrelations on indices are required to be equivariant .

Page 139: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Solution

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics• Interpreting the Linearexponential ! in G

• Combinatorics ofCopying

• Co-MonadicOperations

• Comonads for ModalLogicians

• Copying is comonoidal

• Comonoid AxiomsContinued• Comonoids inmonoidal categories

• Solution• A Cartesian ClosedCategory of Games

• The additiveconjunction

• Cartesian Closure

• The Story From Here

• Some ReferencesTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 75 / 80

We obtain the ‘right’ notion of ! with all the appropriate properties by factoring

out modulo the action of permutations (of finite support) on N. This means

that indices become ‘generic’ and have no specific identities; the only

operation available on them is comparison for equality. All operations andrelations on indices are required to be equivariant .

The most elegant way of formulating this is in the setting of (multi)nominalsets .

Page 140: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Solution

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics• Interpreting the Linearexponential ! in G

• Combinatorics ofCopying

• Co-MonadicOperations

• Comonads for ModalLogicians

• Copying is comonoidal

• Comonoid AxiomsContinued• Comonoids inmonoidal categories

• Solution• A Cartesian ClosedCategory of Games

• The additiveconjunction

• Cartesian Closure

• The Story From Here

• Some ReferencesTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 75 / 80

We obtain the ‘right’ notion of ! with all the appropriate properties by factoring

out modulo the action of permutations (of finite support) on N. This means

that indices become ‘generic’ and have no specific identities; the only

operation available on them is comparison for equality. All operations andrelations on indices are required to be equivariant .

The most elegant way of formulating this is in the setting of (multi)nominalsets .

Introduction to nominal sets in talk by Nikos Tzevelekos.

Page 141: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

A Cartesian Closed Category of Games

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics• Interpreting the Linearexponential ! in G

• Combinatorics ofCopying

• Co-MonadicOperations

• Comonads for ModalLogicians

• Copying is comonoidal

• Comonoid AxiomsContinued• Comonoids inmonoidal categories

• Solution• A Cartesian ClosedCategory of Games

• The additiveconjunction

• Cartesian Closure

• The Story From Here

• Some ReferencesTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 76 / 80

Corresponding the the syntactic translation of ⊃, ∧ logic into Linear Logic

using ⊗, ⊸, & , !, we can build a cartesian closed category of games using

the comonadic structure of !.

Page 142: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

A Cartesian Closed Category of Games

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics• Interpreting the Linearexponential ! in G

• Combinatorics ofCopying

• Co-MonadicOperations

• Comonads for ModalLogicians

• Copying is comonoidal

• Comonoid AxiomsContinued• Comonoids inmonoidal categories

• Solution• A Cartesian ClosedCategory of Games

• The additiveconjunction

• Cartesian Closure

• The Story From Here

• Some ReferencesTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 76 / 80

Corresponding the the syntactic translation of ⊃, ∧ logic into Linear Logic

using ⊗, ⊸, & , !, we can build a cartesian closed category of games using

the comonadic structure of !.

We build a category K!(G) (the ‘co-Kleisli category’) as follows:

Objects: same as in G.

Morphisms: K!(G)A, B = G(!A, B).

Composition:!A

σ−→ B !B

τ−→ C

!AδA−→ !!A

!σ−→ !B

τ−→ C

Products: A×B = A&BExponentials: A⇒ B = !A ⊸ B.

Page 143: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

The additive conjunction

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics• Interpreting the Linearexponential ! in G

• Combinatorics ofCopying

• Co-MonadicOperations

• Comonads for ModalLogicians

• Copying is comonoidal

• Comonoid AxiomsContinued• Comonoids inmonoidal categories

• Solution• A Cartesian ClosedCategory of Games

• The additiveconjunction

• Cartesian Closure

• The Story From Here

• Some ReferencesTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 77 / 80

Given A, B define A&B by

MA&B = MA + MB

λA&B = [λA, λB]PA&B = {inl∗(s) | s ∈ PA} ∪ {inr

∗(t) | t ∈ PB}.

A&B is the product of A and B in G. We can define projections

Afst←− A&B

snd−→ B

(Partial copy-cats) and pairing

σ : C −→ A τ : C −→ B

〈σ, τ〉 : C −→ A&B

(Disjoint union)

Page 144: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Cartesian Closure

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics• Interpreting the Linearexponential ! in G

• Combinatorics ofCopying

• Co-MonadicOperations

• Comonads for ModalLogicians

• Copying is comonoidal

• Comonoid AxiomsContinued• Comonoids inmonoidal categories

• Solution• A Cartesian ClosedCategory of Games

• The additiveconjunction

• Cartesian Closure

• The Story From Here

• Some ReferencesTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 78 / 80

Exponential isomorphisms

!(A&B) ∼= !A⊗ !B!⊤ ∼= I

Page 145: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Cartesian Closure

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics• Interpreting the Linearexponential ! in G

• Combinatorics ofCopying

• Co-MonadicOperations

• Comonads for ModalLogicians

• Copying is comonoidal

• Comonoid AxiomsContinued• Comonoids inmonoidal categories

• Solution• A Cartesian ClosedCategory of Games

• The additiveconjunction

• Cartesian Closure

• The Story From Here

• Some ReferencesTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 78 / 80

Exponential isomorphisms

!(A&B) ∼= !A⊗ !B!⊤ ∼= I

Cartesian Closure :

K!(A×B, C) = G(!(A&B), C)∼= G(!A⊗ !B, C)∼= G(!A, !B ⊸ C)= K!(A, B ⇒ C).

Page 146: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

The Story From Here

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics• Interpreting the Linearexponential ! in G

• Combinatorics ofCopying

• Co-MonadicOperations

• Comonads for ModalLogicians

• Copying is comonoidal

• Comonoid AxiomsContinued• Comonoids inmonoidal categories

• Solution• A Cartesian ClosedCategory of Games

• The additiveconjunction

• Cartesian Closure

• The Story From Here

• Some ReferencesTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 79 / 80

Now we have a cartesian closed category of games, we are in business to

model lambda-calculus based typed theories and programming languages.

Page 147: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

The Story From Here

Introduction

Game Semantics forPrograms

Overview

The Structure of theGames Universe:a glimpse under thehood

Copying in GameSemantics• Interpreting the Linearexponential ! in G

• Combinatorics ofCopying

• Co-MonadicOperations

• Comonads for ModalLogicians

• Copying is comonoidal

• Comonoid AxiomsContinued• Comonoids inmonoidal categories

• Solution• A Cartesian ClosedCategory of Games

• The additiveconjunction

• Cartesian Closure

• The Story From Here

• Some ReferencesTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 79 / 80

Now we have a cartesian closed category of games, we are in business to

model lambda-calculus based typed theories and programming languages.

Now we can begin! We roll up our sleeves and start proving full completeness,

full abstraction, etc. . . .

Page 148: Tutorial on Game Semantics - UvAprojects.illc.uva.nl/.../slides/abramsky_tutorial.pdfTutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 3 / 80 Two views: the ‘model-theoretic’

Some References

Tutorial on Game Semantics LINT Workshop Amsterdam December 2008 – 80 / 80

Papers available from my webpageshttp://web.comlab.ox.ac.uk/oucl/work/samson.abramsky/

• S. Abramsky and R. Jagadeesan, “Games and Full Completeness for Multiplicative

Linear Logic”, Journal of Symbolic Logic, (1994), vol. 59, no. 2, 543–574.

• S. Abramsky, Semantics of Interaction: an introduction to Game Semantics, inProceedings of the 1996 CLiCS Summer School, Isaac Newton Institute, P. Dybjer

and A. Pitts, eds. (Cambridge University Press) 1997, 1–31.

• S. Abramsky and G. McCusker, Game Semantics, in Computational Logic:

Proceedings of the 1997 Marktoberdorf Summer School, H. Schwichtenberg and U.

Berger, eds. (Springer-Verlag) 1999, 1–56.

• S. Abramsky, Algorithmic Game Semantics: A Tutorial Introduction, in Proof and

System Reliability, H. Schichtenberg and R. Steinbruggen, eds., Proceedings of the

NATO Advanced Study Institute, Marktoberdorf, Kluwer Academic Publishers,

2001, 21–47.

• S. Abramsky, Information, Processes and Games. To appear in: Handbook of the

Philosophy of Information, ed. P. Adriaans and J. van Benthem, Elsevier, 2008.