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 Galop, 5 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 Galop, 5 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. ◮ Example of application: computing infinite trees generated by higher-order recursion schemes .

  3. Outline The correspondence Game semantics Computation tree The Correspondence Theorem Example Composition Demo Applications Higher-order grammars Other applications Conclusion & Future Works

  4. Outline The correspondence Game semantics Computation tree The Correspondence Theorem Example Composition Demo Applications Higher-order grammars Other applications Conclusion & Future Works

  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. 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

  9. 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 We can define notions of P-view and O-view, alternation, P-visibility, O-visibility.

  10. 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 � 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 ).

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

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

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

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

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

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

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

  18. Example of traversal λ fz @ λ y λ uv λ u z f λ λ 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 · λ · y

  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 λ λ v y t = λ fz · @ · λ uv · u · λ y · f · λ · y · λ · v

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

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

  24. 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

  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. 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 .

  27. More correspondences Computation tree notions Game-semantic equivalents computation tree arena(s) traversal uncovered play reduced traversal play path in the computation tree P-view of an uncovered play

  28. Example: ⊢ λ f o → o . ( λ u o → o . u ) f : ( o → o ) → o → o 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 ] ] .

  29. Example: ⊢ λ f o → o . ( λ u o → o . u ) f : ( o → o ) → o → o 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 → o ) → o → o 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. Composition [ [ M ] ]; [ [ N ] ] = [ [ λ x . N ( Mx )] ] Example: ◮ A = o , B = o → o , C = (( o → o ) → o ) → o ◮ σ = [ [ λ x o v o . x : A → B ] ] [ λ y B ϕ (( o → o ) → o ) .ϕ ( λ u o . y ( λ. u )) : B → C ] ◮ µ = [ ] We then have σ � µ = [ [ λ x ϕ.ϕ ( λ u . x ) : A → C ] ]. µ σ o − → ( o → o) − → ((( o → o) → o) → o)

Recommend


More recommend