a concrete presentation of game semantics
play

A Concrete Presentation of Game Semantics William Blum Joint work - PowerPoint PPT Presentation

A Concrete Presentation of Game Semantics William Blum Joint work with C.-H. Luke Ong School of Informatics, University of Edinburgh Oxford University Computing Laboratory BCTCS, 8 April 2008 Overview Game-semantic models are abstract


  1. A Concrete Presentation of Game Semantics William Blum Joint work with C.-H. Luke Ong School of Informatics, University of Edinburgh – Oxford University Computing Laboratory BCTCS, 8 April 2008

  2. Overview ◮ Game-semantic models are abstract i.e. independent of the syntax of the denotated term. We give here a concrete i.e. syntactic representation of game semantics where: ◮ The arena game is ‘incarnated’ by some abstract syntax tree of the term, ◮ Uncovered plays are given by traversals over this tree. ◮ A “Correspondence Theorem” establishes the relationship between the game-semantic and traversal models. ◮ The tool HOG illustrates this correspondence.

  3. Outline Game semantics The theory of traversals The ingredients The Correspondence Theorem Example Demo Applications Conclusion

  4. Outline Game semantics The theory of traversals The ingredients The Correspondence Theorem Example Demo Applications Conclusion

  5. Game semantics Model of programming languages based on games (Abramsky et al.; Hyland and Ong; Nickau) ◮ 2 players: Opponnent (system) and Proponent (program) ◮ The term type induces an arena defining the possible moves q 0 [ [ N ] ] = q [ [ N → N ] ] = q 1 0 1 0 1 ... ... 0 1 ... ◮ Play = sequence of moves played alternatively by O and P with justification pointers. ◮ Strategy for P = prefix-closed set of plays. sab in the strategy means that P should respond b when O plays a in position s . ◮ The denotation of a term M , written [ [ M ] ], is a strategy for P. ◮ [ [7 : N ] ] = { ǫ, q , q 7 } ] = Pref ( { q 0 q 1 n ( n + 1) | n ∈ N } ) [ [ succ : N → N ] ◮ Compositionality: [ [ succ 7] ] = [ [ succ ] ]; [ [7] ]

  6. Game semantics: composition ◮ Composition is done by CSP-composition + hiding: If σ : A → B and µ : B → C then “ σ ; µ = ( σ � µ ) ↾ A , C ” ◮ The fully revealed game denotation, written � � M � � , denotes the set of plays obtained by not performing hiding of internal moves during composition.

  7. Game semantics: composition ◮ Composition is done by CSP-composition + hiding: If σ : A → B and µ : B → C then “ σ ; µ = ( σ � µ ) ↾ A , C ” ◮ The fully revealed game denotation, written � � M � � , denotes the set of plays obtained by not performing hiding of internal moves during composition.

  8. Outline Game semantics The theory of traversals The ingredients The Correspondence Theorem Example Demo Applications Conclusion

  9. Computation tree We fix a simply-typed term Γ ⊢ M : T . Computation tree of M is the AST of its η -long normal form. ◮ The η -expansion of M : A → B is λ x : A . Mx : A → B . ◮ The η -long normal form of M is obtained by hereditarily η -expanding every subterm of M occurring at an operand position or as the body of a λ -abstraction. Example: ⊢ λ f o → o . ( λ u o → o . u ) f : ( o → o ) → o → o The computation tree is: Its η -long normal form is λ fz ⊢ λ f o → o z o . @ ( λ u o → o v o . u ( λ. v )) λ y λ uv λ ( λ y o . fy ) u z f ( λ. z ) λ λ : ( o → o ) → o → o y v

  10. Justified sequence ◮ We define an enabling relation ⊢ on the set of nodes: ◮ a bound variable is enabled by its binder; ◮ a free variable is enabled by the root ⊛ ; ◮ a lambda node is enabled by its parent node; ◮ an @-node has no enabler. ◮ Distinction between external nodes N ⊛ ⊢ (hereditarily justified by the root) and the internal nodes N @ ⊢ (her. just. by an @-node). ◮ A justified sequence is a sequence of nodes such that all the non @-nodes have a justification pointer respecting the relation ⊢ . ◮ The analogy with game semantics is: ◮ λ -nodes ≡ O-moves ◮ @-nodes and variable-nodes ≡ P-moves ◮ Notions of alternation, P-view, O-view, P-visibility and O-visibility.

  11. Traversals rules The computation is described by a set T rav ( M ) of justified sequences called traversals and given by induction over the rules: ◮ (Empty) ǫ ∈ T rav ( M ) ◮ (Root) ⊛ ∈ T rav ( M ) ◮ (Lam) t · λξ ∈ T rav ( M ) = ⇒ t · λξ · n ∈ T rav ( M ) where n is λξ ’s child and is justified by the only occurrence of its enabler in the P-view 0 ◮ (App) t · @ ∈ T rav ( M ) = ⇒ t · @ · n ∈ T rav ( M ). ◮ (ExtVar) t · x ∈ T rav ( M ), x ∈ N ⊛ ⊢ = ⇒ t · x · n ∈ T rav ( M ) var for any λ -node n justified by some occurrence of its parent node in the O-view of t . i ◮ (IntVar) t · n · λ x . . . x i ∈ T rav ( M ), x i ∈ N @ ⊢ var = ⇒ i i t · n · λ x . . . x i · λη i ∈ T rav ( M ).

  12. Example of traversal λ fz @ λ y λ uv λ u z f λ λ y v

  13. Example of traversal λ fz @ λ y λ uv λ u z f λ λ y v t = λ fz

  14. Example of traversal λ fz @ λ y λ uv λ u z f λ λ y v t = λ fz · @

  15. Example of traversal λ fz @ λ uv λ y λ u z f λ λ y v t = λ fz · @ · λ uv

  16. Example of traversal λ fz @ λ y λ uv λ u z f λ λ y v t = λ fz · @ · λ uv · u

  17. Example of traversal λ fz @ λ y λ uv λ u z f λ λ y v t = λ fz · @ · λ uv · u · λ y

  18. Example of traversal λ fz @ λ y λ uv λ u f z λ λ y v t = λ fz · @ · λ uv · u · λ y · f

  19. Example of traversal λ fz @ λ y λ uv λ u z f λ λ y v t = λ fz · @ · λ uv · u · λ y · f · λ

  20. Example of traversal λ fz @ λ y λ uv λ u z f λ λ y v t = λ fz · @ · λ uv · u · λ y · f · λ · y

  21. Example of traversal λ fz @ λ y λ uv λ u z f λ λ y v t = λ fz · @ · λ uv · u · λ y · f · λ · y · λ

  22. Example of traversal λ fz @ λ y λ uv λ u z f λ λ v y t = λ fz · @ · λ uv · u · λ y · f · λ · y · λ · v

  23. Example of traversal λ fz @ λ y λ uv λ u z f λ λ y v t = λ fz · @ · λ uv · u · λ y · f · λ · y · λ · v · λ

  24. Example of traversal λ fz @ λ y λ uv λ z u f λ λ y v t = λ fz · @ · λ uv · u · λ y · f · λ · y · λ · v · λ · z

  25. Operations on traversals t = λ fz · @ · λ uv · u · λ y · f · λ · y · λ · v · λ · z ◮ The reduction of a traversal is obtained by keeping only the occurrences hereditarily justified by the root: t ↾ λ fz = λ fz f λ z ◮ @-nodes removal: t − @ = λ fz λ uv u λ y f λ y λ v λ z

  26. Operations on traversals t = λ fz · @ · λ uv · u · λ y · f · λ · y · λ · v · λ · z ◮ The reduction of a traversal is obtained by keeping only the occurrences hereditarily justified by the root: t ↾ λ fz = λ fz f λ z ◮ @-nodes removal: t − @ = λ fz λ uv u λ y f λ y λ v λ z

  27. The Correspondence Theorem Let M be a simply typed term of type T . There exists a function ϕ from the nodes of the computation tree to the moves of the arenas of � � T � � such that ϕ : T rav ( M ) − @ ∼ = − →� � M � � ϕ : T rav ( M ) ↾⊛ ∼ = − → [ [ M ] ] . where ◮ T rav ( M ) = set of traversals of the computation tree of M ◮ T rav ( M ) ↾⊛ = { t ↾ t 0 | t ∈ T rav ( M ) } ◮ T rav ( M ) − @ = { t − @ | t ∈ T rav ( M ) } ◮ [ [ M ] ] = game-semantic denotation of M ◮ � � M � � = revealed denotation of M .

  28. More correspondences Computation tree notions Game-semantic equivalents computation tree revealed arena traversal uncovered play reduced traversal play path in the computation tree P-view of an uncovered play

  29. Example: ⊢ λ f o → o . ( λ u o → o . u ) f : ( o 4 → o 3 ) → o 2 → o 1 Left: computation tree. Right: arena. q 1 λ fz @ λ y λ uv λ q 3 q 2 u z f λ λ q 4 y v ◮ t = λ fz · @ · λ uv · u · λ y · f · λ · y · λ · v · λ · z ◮ � t � = λ fz · @ · λ · z ◮ ϕ ( t ↾ λ fz ) = ϕ ( λ fz · f · λ · z ) = q 1 q 3 q 4 q 2 ∈ [ [ M ] ] .

  30. Example: ⊢ λ f o → o . ( λ u o → o . u ) f : ( o 4 → o 3 ) → o 2 → o 1 Left: computation tree. Right: arena. q 1 λ fz @ λ y λ uv λ q 3 q 2 u z f λ λ q 4 y v ◮ t = λ fz · @ · λ uv · u · λ y · f · λ · y · λ · v · λ · z ◮ � t � = λ fz · @ · λ · z ◮ ϕ ( t ↾ λ fz ) = ϕ ( λ fz · f · λ · z ) = q 1 q 3 q 4 q 2 ∈ [ [ M ] ] .

  31. Example: ⊢ λ f o → o . ( λ u o → o . u ) f : ( o 4 → o 3 ) → o 2 → o 1 Left: computation tree. Right: arena. ϕ q 1 λ fz @ λ y λ uv λ q 3 q 2 u z f λ λ q 4 y v ◮ t = λ fz · @ · λ uv · u · λ y · f · λ · y · λ · v · λ · z ◮ � t � = λ fz · @ · λ · z ◮ ϕ ( t ↾ λ fz ) = ϕ ( λ fz · f · λ · z ) = q 1 q 3 q 4 q 2 ∈ [ [ M ] ] .

  32. Tool demo

Recommend


More recommend