From the finite to the transfinite: Λµ-terms and streams WIR 2014 Fanny He f.he@bath.ac.uk Alexis Saurin alexis.saurin@pps.univ-paris-diderot.fr 12 July 2014
The Λµ-calculus Syntax of Λµ t ::= x λx.t (t)u µα.t (t)α λ-variables: x..., µ-variables: α, β... Type system for Λµ: Γ, x : A x : A Var Γ, x : A t : B λabs Γ λx A.t : A B Γ t : A B Γ u : A λapp Γ (t)u : B Γ t :, α : A Γ µα A.t : A µabs Γ t : A, α : A Γ (t)α :, α : A µapp
Example with Peirce s law: Var Γ, x : A t : B Γ, x : A x : A λabs Γ λx A.t : A B Γ t : A B Γ u : A λapp Γ (t)u : B Γ t :, α : A Γ t : A, α : A µabs µapp Γ µα A.t : A Γ (t)α :, α : A λx.µα.((x)λy.µβ.(y)α)α : ((A B) A) A Var y : A y : A µapp y : A (y)α : α : A µabs y : A µβ.(y)α : B α : A Var λabs x : (A B) A x : (A B) A λy.µβ.(y)α : A B α : A λapp x : (A B) A (x)λy.µβ.(y)α : A α : A µapp x : (A B) A ((x)λy.µβ.(y)α)α : α : A µabs x : (A B) A µα.((x)λy.µβ.(y)α)α : A λabs call/cc : ((A B) A) A
fst -reduction An example with the reduction fst : µα. z 1 λx 1 µα. z
fst -reduction An example with the reduction fst : µα. z 2 λx 1 λx 2 µα. z
fst -reduction An example with the reduction fst : µα. z 3 λx 1 λx 2 λx 3 µα. z and so on...
fst -reduction µα.z n fst λx 1... x n.µα.z x 1,..., x n z, n ω µα.t fst λx.µβ.t{(u)xβ/(u)α} µα λx 1 x 2...
Outline Böhm trees for the Λµ-calculus Transfinite calculi and Λµ Current directions
Böhm trees for λ-calculus Let t Λ, then t can be written: λ x 0. (t 0 ) t 1 where t 0 variable or redex : If t has no hnf, B t = Ω If t λx 1... x n.(x)t 1... t k, and B 1,..., B k Böhm trees of t 1,..., t k B t = λx 1... λx n. x B 1... B k Böhm trees B for λ-calculus : B ::= Ω λ(x i ) i ν.(y)(b j ) j γ ν, γ ω
Böhm trees for λ-calculus Any term can be written: λ x 0. (t 0 ) t 1 where t 0 variable or redex Böhm trees B for λ-calculus : B ::= Ω λ(x i ) i ν.(y)(b j ) j γ ν, γ ω Böhm trees for Λµ Any Λµ-term can be written: λ x 0 µα 0... µα n λx n+1.(t 0 ) t 1 β 1... β m t m+1, where t 0 variable or pre-redex Böhm trees for ΛµB Λµ-BT: B ::= Ω λ(x i ) i ν.(y)(b j ) j γ ν, γ ω 2
An example Let t = µα.λx.µβ.λy.((x)y (( ) )β) β. Intuition: t λx1 α... λx. λx β 1 }{{}... λy.((x)y (( ) ) x β 1 }{{}... ) x β 1 }{{}}{{.. }. ω ω ω ω B = λ(z i ) i ω 2+1.(z ω )(B j ) j ω with B 0 = z ω 2, B 1 = Ω and B j+1 = z ω+j for 1 j < ω. λ(z i ) i ω 2+1. z ω z ω 2... z ω+1 z ω+2 Ω
Outline Böhm trees for the Λµ-calculus Transfinite calculi and Λµ Current directions
Infinite terms from Λµ-terms Limits at root-positions: infinitary representations of µα.(x)α: @. @ x x 1 λx 1 λx 2.. x 2 x λx 1 λx 2 @ @ s x 1 @ s. x2.. To solve this issue we introduce a constructor for streams: Terms Streams t ::= x λx.t (t)u µα.t (t)s S ::= α [t S] µα.t fst λx.µβ.(t{[x β]/α}) The resulting terms are not infinitary terms since they have subterms at infinite depth: See Ketema et al.
Outline Böhm trees for the Λµ-calculus Transfinite calculi and Λµ Current directions
Ketema et al. transfinite terms Transfinite (Tr.) position p : length(p) N, Tr. term t : P Σ X, P set of positions p P q < p, q P, t(p) function symbol of arity n = (p i P iff 1 i n), (p has limit ordinal length and q < p, q P) = p P
Ketema et al. transfinite terms Transfinite (Tr.) position p : length(p) N, Tr. term t : P Σ X, P set of positions p P q < p, q P, t(p) function symbol of arity n = (p i P iff 1 i n), (p has limit ordinal length and q < p, q P) = p P Tr. Term Rewriting System (ttrs): pair (Σ, R), where Σ set of symbols of finite arity, R set of tr. rewrite rules, Tr. rewrite steps: rewriting a tr. term s = C[σ(l)] into t = C[σ(r)] if l r R, C[ ] one-hole context and σ substitution.
Intuition behind Ketema et al. transfinite terms Two representations for the transfinite term (f 1 (f 2 (f 3 (... x)))): @ f 1 @ f2 @ f 1 f 2... x f 3. f 3 x
Contrasting transfinite terms with infinitary Λµ-terms (I) Transfinite terms that extend Λµ-terms: Example of µα.(y ) λf.f and µα.x: λx λx λx 1 λx 2 λx. λx 3. x (Y ) λx. (f )x (f )(f )... : subterm at limit ordinal not defined @ f @ f f @...
Contrasting transfinite terms with infinitary Λµ-terms (II) Weak convergence with fst Weak convergence with β βs µγ.(µα.x) γ: fst? Consider µγ.x βs µγ.(µα.x) γ 2 fst λzµγ.(λyµα.x) [z γ] β λzµγ.(µα.x) γ }{{}}{{}}{{} A B A A and B alternate in the reduction sequence After fst reductions: λx 1x 2.... (λy 1y 2.... t)x 1x 2..., β-redex at constant depth Consider fst separately from β
Contrasting transfinite terms with infinitary Λµ-terms (III): Push down/pull up In ΛµS µα 0.x fst λx α 0.µα 1.x fst... fst λx α 0 x α 1... x α n.µα n+1.x fst... Push down: λx α 0 x α 1... x α n....x λx 1 x 2.... (λy 1 y 2.... t)x 1 x 2... could be pulled up to λx 1 x 2.... t. In Ketema et al. In µα 0.x, x is pushed down but µα stays: λx α 0 x α 1... x α n....µα.x We would want λx 1 x 2.... (λy 1 y 2.... t)x 1 x 2... to become λx 1 x 2.... t after ω steps: pull up t
Contrasting transfinite terms with infinitary Λµ-terms (IV) Study fst separately from β-reduction Find a more trivial topology than Ketema et al. Consider infinitary terms: λx1λx 2.... t Balls that do not only include prefixes of a term (non-haussdorff) Conjecture on the limits via fst Example: t = µα λy µβ.(y)α should converge to: λxαλx 1 α 2... λy λxβλx 1 β 2....(y)[xα 1 xα 2... ]
Perspectives Strong convergence for fst Interaction between β and fst What we expect: Understand properties: separability Extend to more general calculi: stream hierarchy