Towards Nominal Abramsky Towards Nominal Abramsky Andrzej Murawski - - PowerPoint PPT Presentation

towards nominal abramsky towards nominal abramsky andrzej
SMART_READER_LITE
LIVE PREVIEW

Towards Nominal Abramsky Towards Nominal Abramsky Andrzej Murawski - - PowerPoint PPT Presentation

Towards Nominal Abramsky Towards Nominal Abramsky Andrzej Murawski Nikos Tzevelekos University of Warwick Queen Mary, U. of London What this talk is about Abramsky's cube (1990's): a taxonomy of game semantics models Nominal game


slide-1
SLIDE 1

Towards Nominal Abramsky Towards Nominal Abramsky Andrzej Murawski Nikos Tzevelekos

University of Warwick Queen Mary, U. of London

slide-2
SLIDE 2

What this talk is about

Abramsky's cube (1990's): a taxonomy of game semantics models Nominal game semantics (2000's): games for programs generating new/fresh resources (references, exceptions, channels, etc.) Nominal Abramsky: the construction of an analogous taxonomy for nominal game models

slide-3
SLIDE 3

Game Semantics

  • Computation is modelled as a 2-player game

between:

  • Opponent (the environment)
  • Proponent (the program)
  • Qualitative games ( ≠ Game Theory)
  • Programs = strategies for Proponent
  • Categories of games
slide-4
SLIDE 4

Example strategy

* O P 5 O P : : : : : :

f : int int λx.f(x)+1 : int int

─ * 15 P : : Int  Int 5   Int  Int 14 O

slide-5
SLIDE 5

Example strategy

* O P 5 O P : : : : : : 14

f : int int λx.f(x)+1 : int int

─ * 15 P : : Int  Int 5   Int  Int * * 5 5 14 15 … O P O P O P

slide-6
SLIDE 6

Abramsky's cube (90's)

PCF

state control probability non-determinism concurrency ...

move at each axis: relax constraints

slide-7
SLIDE 7

Two ways to model references

References are pairs:

ref int = (unit  int)x(int  unit) (1  Z)x(Z  1)

  • Theoretically attractive
  • but: mkvar(λx.3,λx.())

(bad variables)

Reynolds

  • Idealized Algol (1978)
slide-8
SLIDE 8

Two ways to model references

References are pairs: References are names: Pitts & Stark

  • nu-calculus (1993)

ref int = (unit  int)x(int  unit) (1  Z)x(Z  1) ref int = base type N (names)

  • Theoretically attractive
  • but: mkvar(λx.3,λx.())

(bad variables)

  • Notion of resource (name):
  • atomic values
  • infinitely many
  • comparable for equality

Reynolds

  • Idealized Algol (1978)
slide-9
SLIDE 9

Two ways to model references

References are pairs: References are names: Pitts & Stark

  • nu-calculus (1993)

ref int = (unit  int)x(int  unit) (1  Z)x(Z  1) ref int = base type N (names)

  • Theoretically attractive
  • but: mkvar(λx.3,λx.())

(bad variables)

  • Notion of resource (name):
  • atomic values
  • infinitely many
  • comparable for equality

Reynolds

  • Idealized Algol (1978)

references exceptions channels …

slide-10
SLIDE 10

Nominal games

1 * O P O P O P 1  Refint

λx.ref(0) : unit  ref int

slide-11
SLIDE 11

Nominal games

1 * O P O P * O P 1  Refint

λx.ref(0) : unit  ref int

slide-12
SLIDE 12

Nominal games

1 * O P O P * O P * 1  Refint

λx.ref(0) : unit  ref int

slide-13
SLIDE 13

Nominal games

1 * O P O P * O P * 1  Refint

λx.ref(0) : unit  ref int

a (a ,0)

1

1

slide-14
SLIDE 14

Nominal games

1 * O P O P * O P * * 1  Refint

λx.ref(0) : unit  ref int

a (a ,0)

1

1

slide-15
SLIDE 15

Nominal games

1 * O P O P * O P * * 1  Refint

λx.ref(0) : unit  ref int

: : : :

2

a (a ,0)

2

: : a (a ,0)

1

1

slide-16
SLIDE 16

Nominal games

1 * O P O P * O P * n *

2

1  Refint

λx.ref(0) : unit  ref int

: : : : : : : : : : : : : : 15 P : : * * * a1

(a1,0) * a2 (a2,0) …

a (a ,0)

1

1

slide-17
SLIDE 17

Nominal games

1 * O P O P * O P * n *

2

1  Refint

λx.ref(0) : unit  ref int

: : : : : : : : : : : : : : 15 P : : * * * a1

(a1,0) * a2 (a2,0) …

a (a ,0)

1

1

N

slide-18
SLIDE 18

Towards nominal Abramsky

funML

state control probability non-determinism concurrency ...

slide-19
SLIDE 19

Towards nominal Abramsky

funML

state control probability non-determinism concurrency ... concurrency

funML GrML RefML

slide-20
SLIDE 20

RefML: storable functions

─ ─ ─

s Γ

: A

Γ

() : unit, i : int

Γ

ref(s) : ref A

─ ─ ─ ─

, x:A s Γ

: B s

Γ

: A → B

Γ t : A Γ

λx.s : A → B s t

Γ : B

A ::= unit | int | ref A | A → A

─ ─ ─ ─

s Γ

: ref A s

Γ

: ref A, t : A s, t

Γ

: ref A

Γ !s : A s Γ

:= t : unit s

Γ

== t : int

─ ─

slide-21
SLIDE 21

Game semantics for RefML

  • Moves with HO-store

S = { (a,4), (b,c), (c,3), (d,*), ... }

  • Justify by store

m (a,*) … m'

  • Frugality

… m {(a,v), ...} ⇒ … a S … m {(a,v), ...}

MTz LICS'11

slide-22
SLIDE 22

Game semantics for RefML

slide-23
SLIDE 23

Game semantics for RefML

slide-24
SLIDE 24

Game semantics for RefML

slide-25
SLIDE 25

Ground ML: full ground store

Restrict ref constructor to non-function types

  • y:ref(int  int) s but not (λy.s) (ref (λx.x))
  • allow (λy.s) (ref (ref(0))) , …

In the game model:

  • Ban P from introducing/creating (a,*)
  • Impose visibility

slide-26
SLIDE 26

Visibility (breaking of)

P : : P n : : : : 15 P : : *

(a,*) * (a,*) *y (a,*) * (a,*) *y (a,*) 0 (a,*)

O P O P O P

let x=ref(..) in λy intunit. first: x:=y after: (!x) 0

slide-27
SLIDE 27

Fun ML: pure functional behaviour

Remove ref constructor

  • y:ref(int) s but not (λy.s) (ref (0))

In the game model:

  • Ban P from introducing/creating any name
  • Impose innocence

slide-28
SLIDE 28

Innocence (breaking of)

P 1 : : : : : : : : P n 2 : : : : : : : : : : : : : : 15 P : : *

(a,0) * (a,0) *y (a,0) 0 (a,1) *y (a,) 1 (a,2) …

O P O P O P

let x=ref(-1) in λy. x++; !x : unit  int

slide-29
SLIDE 29

Factorisations

  • RefML = GrML

+ one reference of type unit  unit + name generators for HO-types

  • GrML = FunML

+ one reference of type int + name generators for base types + oracles mapping names to integers

slide-30
SLIDE 30

Further axes

  • Concurrent ML: Laird (FSTTCS'06)

To do:

  • Exceptions: Laird (LICS'01), Tz (PhD'09)
  • Non-determinism: Harmer & McCusker (LICS'99)
  • Polymorphism: Hughes (LICS'97),

Abramsky & Jagadeesan (FOSSACS'03), Laird (LICS'10, ICALP'10)

  • Probability: Danos & Harmer (LICS'00)