strict ideal completions of the lambda calculus
play

Strict Ideal Completions of the Lambda Calculus Patrick Bahr IT - PowerPoint PPT Presentation

Strict Ideal Completions of the Lambda Calculus Patrick Bahr IT University of Copenhagen FSCD 2018 Infinitary Lambda Calculus N N y N y y . . . where N = ( x . x x y )( x . x x y ) 1 / 13 Infinitary Lambda Calculus N N


  1. Strict Ideal Completions of the Lambda Calculus Patrick Bahr IT University of Copenhagen FSCD 2018

  2. Infinitary Lambda Calculus N → N y → N y y → . . . where N = ( λ x . x x y )( λ x . x x y ) 1 / 13

  3. Infinitary Lambda Calculus N → N y → N y y → . . . where N = ( λ x . x x y )( λ x . x x y ) ◮ Can we give a meaningful (infinite) result term for such a non-terminating reduction? 1 / 13

  4. Infinitary Lambda Calculus N → N y → N y y → . . . where N = ( λ x . x x y )( λ x . x x y ) app ◮ Can we give a meaningful app y (infinite) result term for such a non-terminating reduction? app y ◮ How about the infinite term (( . . . y ) y ) y ? y 1 / 13

  5. Infinitary Lambda Calculus N → N y → N y y → . . . where N = ( λ x . x x y )( λ x . x x y ) app ◮ Can we give a meaningful app y (infinite) result term for such a non-terminating reduction? app y ◮ How about the infinite term (( . . . y ) y ) y ? y ◮ There is no single true answer to this question. 1 / 13

  6. Different Infinitary Calculi ◮ Infinite normal forms induce a model of the lambda calculus, e.g. ◮ B¨ ohm Trees, Levy-Longo Trees, Berarducci Trees 2 / 13

  7. Different Infinitary Calculi ◮ Infinite normal forms induce a model of the lambda calculus, e.g. ◮ B¨ ohm Trees, Levy-Longo Trees, Berarducci Trees ◮ In the infinitary lambda calculus corresponding to Berarducci Trees, the reduction N → N y → N y y → . . . converges to (( . . . y ) y ) y ◮ but does not converge in the calculi corresp. to B¨ ohm Trees and Levy-Longo Trees 2 / 13

  8. When do infinite reductions converge? Many variants of infinitary calculi ◮ metric spaces � metric completion ◮ partial orders � ideal completion ◮ topological spaces ◮ coinductive definitions 3 / 13

  9. When do infinite reductions converge? Many variants of infinitary calculi ◮ metric spaces � metric completion ◮ partial orders � ideal completion ◮ topological spaces ◮ coinductive definitions 3 / 13

  10. When do infinite reductions converge? Many variants of infinitary calculi ◮ metric spaces � metric completion ◮ partial orders � ideal completion ◮ topological spaces ◮ coinductive definitions Metric completion approach ◮ adjusting the metric yields different calculi This talk ◮ Can we do the same for partial orders? 3 / 13

  11. Overview 1. Metric Completion 2. Ideal Completion 3. Results

  12. Metric Completion N. Dershowitz, S. Kaplan, D.A. Plaisted. Rewrite, rewrite, rewrite, rewrite, rewrite, ... Theoretical Computer Science, 83(1):71–96, 1991. R. Kennaway, J.W. Klop, M.R. Sleep, and F.-J. de Vries. Infinitary lambda calculus. Theoretical Computer Science, 175(1):93–125, 1997.

  13. Metric on lambda terms Standard metric on terms d ( M , N ) = 2 − d d ( M , M ) = 0 , and if M � = N , where d = minimum depth at which M , N differ 4 / 13

  14. Metric on lambda terms Standard metric on terms d ( M , N ) = 2 − d d ( M , M ) = 0 , and if M � = N , where d = minimum depth at which M , N differ Example d ( λ x . x , x y ) = 2 − 0 = 1 d ( λ x . x , λ x . y ) = 2 − 1 = 1 2 4 / 13

  15. Metric on lambda terms Standard metric on terms d ( M , N ) = 2 − d d ( M , M ) = 0 , and if M � = N , where d = minimum depth at which M , N differ Example d ( λ x . x , x y ) = 2 − 0 = 1 d ( λ x . x , λ x . y ) = 2 − 1 = 1 2 4 / 13

  16. Metric on lambda terms Standard metric on terms d ( M , N ) = 2 − d d ( M , M ) = 0 , and if M � = N , where d = minimum depth at which M , N differ Example d ( λ x . x , x y ) = 2 − 0 = 1 d ( λ x . x , λ x . y ) = 2 − 1 = 1 2 We can manipulate d by changing the notion of depth. 4 / 13

  17. Strictness A triple abc ∈ { 0 , 1 } 3 describes how to measure depth. ◮ a = 1 iff lambda abstraction is counted ◮ b = 1 iff application from the left is counted ◮ c = 1 iff application from the right is counted 5 / 13

  18. Strictness A triple abc ∈ { 0 , 1 } 3 describes how to measure depth. ◮ a = 1 iff lambda abstraction is counted ◮ b = 1 iff application from the left is counted ◮ c = 1 iff application from the right is counted Example d 111 ( λ x . x x , λ x . x y ) = 2 − 2 = 1 / 4 5 / 13

  19. Strictness A triple abc ∈ { 0 , 1 } 3 describes how to measure depth. ◮ a = 1 iff lambda abstraction is counted ◮ b = 1 iff application from the left is counted ◮ c = 1 iff application from the right is counted = standard metric d Example d 111 ( λ x . x x , λ x . x y ) = 2 − 2 = 1 / 4 5 / 13

  20. Strictness A triple abc ∈ { 0 , 1 } 3 describes how to measure depth. ◮ a = 1 iff lambda abstraction is counted ◮ b = 1 iff application from the left is counted ◮ c = 1 iff application from the right is counted Example d 111 ( λ x . x x , λ x . x y ) = 2 − 2 = 1 / 4 d 011 ( λ x . x x , λ x . x y ) = 2 − 1 = 1 / 2 d 001 ( λ x . x x , λ x . x y ) = 2 − 1 = 1 / 2 d 010 ( λ x . x x , λ x . x y ) = 2 − 0 = 1 5 / 13

  21. Strictness A triple abc ∈ { 0 , 1 } 3 describes how to measure depth. ◮ a = 1 iff lambda abstraction is counted ◮ b = 1 iff application from the left is counted ◮ c = 1 iff application from the right is counted Example d 111 ( λ x . x x , λ x . x y ) = 2 − 2 = 1 / 4 d 011 ( λ x . x x , λ x . x y ) = 2 − 1 = 1 / 2 d 001 ( λ x . x x , λ x . x y ) = 2 − 1 = 1 / 2 d 010 ( λ x . x x , λ x . x y ) = 2 − 0 = 1 The infinite term (( . . . y ) y ) y is in the metric completion of d 010 but not d 001 . 5 / 13

  22. Infinitary Lambda Calculus A reduction t 0 → t 1 → t 2 → . . . converges to t iff ◮ depth of contracted redexes tends to infinity, ◮ lim i → ω t i = t . 6 / 13

  23. Infinitary Lambda Calculus A reduction t 0 → t 1 → t 2 → . . . converges to t iff ◮ depth of contracted redexes tends to infinity, ◮ lim i → ω t i = t . B¨ ohm reduction In addition, we need rewrite rules t → ⊥ for each t that is root-active (= can be contracted at depth 0 arbitrarily often) 6 / 13

  24. Properties of the metric completion Theorem ([Kennaway et al.]) ◮ Infinitary B¨ ohm reduction is confluent (for 001 , 101 , and 111 ) and normalising (in general). ◮ Its unique normal forms are B¨ ohm Trees (001), Levy-Longo Trees (101), and Berarducci Trees (111). 7 / 13

  25. Properties of the metric completion Theorem ([Kennaway et al.]) ◮ Infinitary B¨ ohm reduction is confluent (for 001 , 101 , and 111 ) and normalising (in general). ◮ Its unique normal forms are B¨ ohm Trees (001), Levy-Longo Trees (101), and Berarducci Trees (111). Example N → N y → N y y → . . . converges to the infinite term (( . . . y ) y ) y in 111, but not in 001, 101 ((( . . . y ) y ) y is not even a valid term in 001, 101). 7 / 13

  26. Ideal Completion

  27. Partial on lambda terms Standard partial order on terms Least monotone, partial order ≤ ⊥ such that ⊥ ≤ ⊥ M , for any M i.e. M ≤ ⊥ N if N is obtained from M by replacing ⊥ with arbitrary terms 8 / 13

  28. Partial on lambda terms Standard partial order on terms Least monotone, partial order ≤ ⊥ such that ⊥ ≤ ⊥ M , for any M i.e. M ≤ ⊥ N if N is obtained from M by replacing ⊥ with arbitrary terms 8 / 13

  29. Partial on lambda terms Standard partial order on terms Least monotone, partial order ≤ ⊥ such that ⊥ ≤ ⊥ M , for any M i.e. M ≤ ⊥ N if N is obtained from M by replacing ⊥ with arbitrary terms Generalisation to ≤ abc ⊥ ◮ We adjust definition of ≤ ⊥ by restricting monotonicity ◮ For example: λ x . ⊥ �≤ 011 λ x . M . ⊥ 8 / 13

  30. Partial order ≤ abc ⊥ Least partial order ≤ abc such that ⊥ ⊥ ≤ abc M ⊥ λ x . M ≤ abc λ x . M ′ if M ≤ abc M ′ ⊥ ⊥ 9 / 13

  31. Partial order ≤ abc ⊥ Least partial order ≤ abc such that ⊥ ⊥ ≤ abc M ⊥ M ′ and M � = ⊥ or a = 1 λ x . M ≤ abc λ x . M ′ if M ≤ abc ⊥ ⊥ 9 / 13

  32. Partial order ≤ abc ⊥ Least partial order ≤ abc such that ⊥ ⊥ ≤ abc M ⊥ M ′ and M � = ⊥ or a = 1 λ x . M ≤ abc λ x . M ′ if M ≤ abc ⊥ ⊥ M ′ and M � = ⊥ or b = 1 MN ≤ abc M ′ N if M ≤ abc ⊥ ⊥ N ′ and N � = ⊥ or c = 1 MN ′ MN ≤ abc if N ≤ abc ⊥ ⊥ 9 / 13

  33. Partial order ≤ abc ⊥ Least partial order ≤ abc such that ⊥ ⊥ ≤ abc M monotonicity ⊥ M ′ and M � = ⊥ or a = 1 λ x . M ≤ abc λ x . M ′ if M ≤ abc ⊥ ⊥ M ′ and M � = ⊥ or b = 1 MN ≤ abc M ′ N if M ≤ abc ⊥ ⊥ N ′ and N � = ⊥ or c = 1 MN ′ MN ≤ abc if N ≤ abc ⊥ ⊥ 9 / 13

  34. Partial order ≤ abc ⊥ Least partial order ≤ abc such that ⊥ ⊥ ≤ abc M monotonicity ⊥ M ′ and M � = ⊥ or a = 1 λ x . M ≤ abc λ x . M ′ if M ≤ abc ⊥ ⊥ M ′ and M � = ⊥ or b = 1 MN ≤ abc M ′ N if M ≤ abc ⊥ ⊥ N ′ and N � = ⊥ or c = 1 MN ′ MN ≤ abc if N ≤ abc ⊥ ⊥ � ≤ 111 is just the standard partial order ≤ ⊥ ⊥ 9 / 13

Recommend


More recommend