SLIDE 1
Towards Nominal Abramsky Towards Nominal Abramsky Andrzej Murawski - - PowerPoint PPT Presentation
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 2
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
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
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
Abramsky's cube (90's)
PCF
state control probability non-determinism concurrency ...
move at each axis: relax constraints
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
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
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
Nominal games
1 * O P O P O P 1 Refint
λx.ref(0) : unit ref int
SLIDE 11
Nominal games
1 * O P O P * O P 1 Refint
λx.ref(0) : unit ref int
SLIDE 12
Nominal games
1 * O P O P * O P * 1 Refint
λx.ref(0) : unit ref int
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
Nominal games
1 * O P O P * O P * * 1 Refint
λx.ref(0) : unit ref int
a (a ,0)
1
1
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
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
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
Towards nominal Abramsky
funML
state control probability non-determinism concurrency ...
SLIDE 19
Towards nominal Abramsky
funML
state control probability non-determinism concurrency ... concurrency
funML GrML RefML
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
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
Game semantics for RefML
SLIDE 23
Game semantics for RefML
SLIDE 24
Game semantics for RefML
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
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 intunit. first: x:=y after: (!x) 0
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
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
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
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)