game semantics approach to higher order complexity
play

Game Semantics Approach to Higher-Order Complexity Hugo Fre - PowerPoint PPT Presentation

Game Semantics Approach to Higher-Order Complexity Hugo Fre September 2, 2016 LCC 2016 Introduction Computability and complexity are defined for first-order functions (i.e. ) in many different ways Same for


  1. Game Semantics Approach to Higher-Order Complexity Hugo Férée September 2, 2016 LCC 2016

  2. Introduction • Computability and complexity are defined for first-order functions (i.e. Σ ∗ → Σ ∗ ) in many different ways • Same for second-order functions,e.g. (Σ ∗ → Σ ∗ ) → Σ ∗ (to a lesser extent) • For third-order functions and above? • a few incomplete atempts to define complexity • not even a unique notion of computability 2/32

  3. Motivations • First-order is sufficient to define computability/complexity for countable sets (e.g. integers, finite graphs, matrices, etc.) • Second-order is required for computations over some uncountable sets (e.g. real numbers) • Higher orders are required for some "larger spaces", especially for complexity • Higher-order functions appear naturally in functional programming languages 3/32

  4. First-order complexity Several computational models, equivalent for complexity: Machine models: Complexity = a bound on running time given a bound on the input size Function algebras: Cobham 1965 : bounded recursion on notation Others Logic-based (linear logic), program interpretations, etc. 4/32

  5. Second-order complexity Definition (Mehlhorn (1976)) fptime 2 = [ fptime , Application, Composition, Extension, R ]  x 0 if x = 0   R ( x 0 , F , B , x ) . t if | t | ≤ B ( x )  B ( x ) otherwise.  where t = F ( x , R ( x 0 , F , B , ⌊ x 2 ⌋ )) . Theorem (Kapron & Cook 1996) fptime 2 is the class of functions computed by an oracle Turing machine in second-order polynomial time. 5/32

  6. Oracle Turing machine f w f ( w ) M Definition F : (Σ ∗ → Σ ∗ ) → Σ ∗ is computed by an oracle Turing ma- chine M if for any oracle f : Σ ∗ → Σ ∗ , M f computes F ( f ) . 6/32

  7. Second order complexity Definition (Time complexity) The complexity of a machine is an upper bound on its com- putation time w.r.t the size of its input. ✓ size of a finite word ? size of an order 1 function 7/32

  8. Second order complexity Definition (Time complexity) The complexity of a machine is an upper bound on its com- putation time w.r.t the size of its input. ✓ size of a finite word ? size of an order 1 function Definition (Size of a function) The size of f : Σ ∗ → Σ ∗ is | f | : N → N : | f | ( n ) = max | x |≤ n | f ( x ) | . 7/32

  9. Second order polynomial time Definition (Second order polynomials) P := c | X | Y � P � | P + P | P × P Example P ( X , Y ) = ( Y � X × Y � X + 1 �� ) 2 Definition ( fptime 2 ) A second order function is computable in polynomial time if it is computed by an oracle Turing machine whose running time is bounded by a second order polynomial. 8/32

  10. Some higher order models • Kleene schemata • Kleene associates • Berry-Curien sequential algorithms • ... • pcf (Scot, Plotkin) λ -calculus over N + fixpoint combinator. ✗ No simple underlying complexity notion. • bff (Cook, Urquhart) λ -calculus + fptime + R (2 nd -order bounded recursion) ✗ Defines only one complexity class (no exptime , etc.) ✗ Misses some intuitively feasible functionals. 9/32

  11. Example (Irwin, Kapron, Royer) ⇒ y = 2 x f x ( y ) = 1 ⇐ Φ , Ψ : (( N → N ) → N ) × N → N  if F ( f x ) = F ( λ y . 0 ) 0  Φ( F , x ) = 1 otherwise.  Φ ∈ bff 3  0 if F ( f x ) = F ( λ y . 0 )  Ψ( F , x ) = 2 x otherwise.  Ψ �∈ bff 3 , but Ψ is "as feasible as" Φ . 10/32

  12. The size issue Main issue: No notion of size for functions of order 2 and above In particular, for second-order, the modulus of continuity should be taken into account Solution: • A model where the interaction between machine and input is a dialogue. • Size ≃ "length" of the dialogue. 11/32

  13. Computation = dialogue What is f ( x ) ? O: P: What is x ? O: x equals 4. f ( x ) equals 2. P: Figure 1: Dialogue between a Turing machine (P) computing f and its opponent (O) computing x . 11/32

  14. Computation = dialogue O: What is F ( f ) ? What is f ( x ) ? P: O: What is x ? P: x equals 4. f ( x ) equals 2. O: ... What is f ( x ) ? P: O: What is x ? P: x equals 2. f ( x ) equals 9. O: P: F ( f ) equals 16. Figure 1: Dialogue between an otm (P) computing F and its opponent (O) computing f . 11/32

  15. Computation = dialogue What is Φ( F ) ? O: Second order dialogue ( F ( f 1 ) ) . . . Second order dialogue ( F ( f k ) ) Φ( F ) equals 11. P: Figure 1: Dialogue between an order 3 machine (P) computing Φ and its opponent (O) computing F . 11/32

  16. Game Semantics Origin: provide a fully abstract semantics for pcf Solution: (Hyland & Ong, Nickau, Abramsky): • functions ↔ strategies • function application ↔ confrontation of strategies 12/32

  17. Game Semantics Origin: provide a fully abstract semantics for pcf Solution: (Hyland & Ong, Nickau, Abramsky): • functions ↔ strategies • function application ↔ confrontation of strategies Not made with effectivity/complexity in mind, although Nickau mentionned it. 12/32

  18. Arena An ar ena is a set of(player and opponent) moves (questions or answers) as well as a subset of initial questions and an enabling relation. The answers enabled by an initial question are called final answers. 13/32

  19. Arenas for finite types q O . . . . . . a P a P a P 0 1 n Figure 2: Ar ena for the base type N 14/32

  20. Arenas for finite types . . . . . . i 1 i n i ′ i ′ 1 k A σ A τ Figure 2: Ar ena A σ × τ built from A τ and A σ 14/32

  21. Arenas for finite types . . . i ′ i ′ k 1 A τ . . . i 1 i n A ⊥ σ Figure 2: Ar ena A σ → τ built from A τ and A σ 14/32

  22. Arenas for finite types q ′ O . . . . . . a ′ P a ′ P a ′ P 0 1 n q P . . . . . . a O a O a O 0 1 n Figure 2: Ar ena for type N → N 14/32

  23. Arenas for finite types q ′′ O . . . . . . a ′′ P a ′′ P a ′′ P q ′ P 0 1 n . . . . . . a ′ O a ′ O a ′ O 0 1 n q O . . . . . . a P a P a P 0 1 n Figure 2: Ar ena for type ( N → N ) → N 14/32

  24. Plays & Rules Definition (Play) A play is a list of named moves, i.e. m [ α ] ( m ∈ A , α ∈ N ). A play p is said to be: • justified: if every non initial move is justified by a previous move in p ; • well-opened: if there is only one initial move, at the beginning of p ; • alternating: if two consecutive moves belong to different protagonists ; • strictly scoped: if answering a question prevents further moves to be justified by this question ; • strictly nested: if question/answer pairs form a valid 15/32 bracketing.

  25. Innocent Strategies Definition (Strategy) A strategy is a partial function from plays to moves. Definition (Innocent strategy) A strategy is innocent if its output only depends on its current view of the play. 16/32

  26. Confrontation If τ = τ 1 × . . . τ n → N and s , s 1 , . . . s n are strategies on the arenas A τ , A τ 1 , . . . A τ n , then the confrontation of s agains s 1 , . . . , s n is defined this way: • the play p starts with the initial question of A τ • the confrontation stops when s plays a final answer • the play is successively extended this way: • if s is defined on p , then p is extended with s ( p ) • if s ( p ) is not a final answer, it belongs to one of the A i and p contains a play p i in A i • the play is extended with s i ( p i ) (+renaming) The final play H ( s , s 1 , . . . , s n ) is the history of the confrontation, and this defines a partial function s [] from argument strategies to final answers. 17/32

  27. Games for pcf Given a finite type τ , the corresponding game is defined by innocent strategies playing justified, alternating, well-opened, strictly-nested, ... plays in the arena A τ . Definition Such a strategy s represents F : τ 1 × · · · × → N if whenever s 1 , . . . , s n represent f 1 : τ 1 , . . . , f n : τ n , then s [ s 1 , . . . , s n ] represents F ( f 1 , . . . , f n ) 18/32

  28. Effectivity Our presentation of game semantics allows to define an explicit encoding of moves and names: for every game on a finite type τ , • an answer of the form a n (i.e. representing n ∈ N ) can be encoded by a binary word of size O ( log 2 ( n )) ; • the questions can be encoded by words of bounded size ; • names are integers → usual binary encoding ; • this encoding can be extended to plays ; • a strategy s can be represented by a partial function ¯ s of type Σ ∗ → Σ ∗ 19/32

  29. Computability and complexity Definition A strategy is s is computable if ¯ s is computable. 20/32

  30. Computability and complexity Definition A strategy is s is computable if ¯ s is computable. Definition atempt A function is computable in time t, if it is represented by a strat- egy s such that ¯ s is computable in time t. 20/32

  31. Computability and complexity Definition A strategy is s is computable if ¯ s is computable. Definition atempt A function is computable in time t, if it is represented by a strat- egy s such that ¯ s is computable in time t. Theorem Every computable function has a polynomial strategy. Proof. s can gain time by asking many useless questions. 20/32

Recommend


More recommend