Quantitative aspects of linear and affine closed lambda terms - - PowerPoint PPT Presentation

quantitative aspects of linear and affine closed lambda
SMART_READER_LITE
LIVE PREVIEW

Quantitative aspects of linear and affine closed lambda terms - - PowerPoint PPT Presentation

Quantitative aspects of linear and affine closed lambda terms Pierre Lescanne Ecole normale sup erieure de Lyon On ideas of Olivier Bodini Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 1 / 40 1 Affine, Linear, Closed 2


slide-1
SLIDE 1

Quantitative aspects of linear and affine closed lambda terms

Pierre Lescanne

´ Ecole normale sup´ erieure de Lyon On ideas of Olivier Bodini

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 1 / 40

slide-2
SLIDE 2

1 Affine, Linear, Closed 2 De Bruijn indices 3 Swiss Cheese 4 Counting closed linear terms 5 Counting closed affine terms 6 Generating functions 7 Effective computations 8 Generating terms 9 Other results

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 2 / 40

slide-3
SLIDE 3

Lambda Terms

Lambda terms are abstractions for representing functions A λ-term is a variable x or an application M N or an abstraction λx.M. For instance, λx.(x x) λx.λy.x λx(x y) (λx.x) (λx.λy(y x))

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 3 / 40

slide-4
SLIDE 4

Lambda Terms

Lambda terms are abstractions for representing functions A λ-term is a variable x or an application M N or an abstraction λx.M. For instance, λx.(x x) is the same as λy.(y y) λx.λy.x is the same as λy.λxy λx(x y) is the same as λz.(z y) (λx.x) (λx.λy(y x)) is the same as (λz.z) (λx.λz(z x))

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 3 / 40

slide-5
SLIDE 5

Lambda Terms

Lambda terms are abstractions for representing functions A λ-term is a variable x or an application M N or an abstraction λx.M. For instance, λx.(x x) is the same as λy.(y y) λx.λy.x is the same as λy.λxy λx(x y) is the same as λz.(z y) (λx.x) (λx.λy(y x)) is the same as (λz.z) (λx.λz(z x))

We count λ-terms up-to α-conversion.

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 3 / 40

slide-6
SLIDE 6

Closed terms

A variable x is bound if it appears in the scope of λx. Otherwise x is free In λx(x y) x is bound, y is free.

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 4 / 40

slide-7
SLIDE 7

Closed terms

A variable x is bound if it appears in the scope of λx. Otherwise x is free In λx(x y) x is bound, y is free.

Definition

A term is closed if all its variables are bound. λx.(x x) λx.λy.x λx(x y) (λx.x) (λx.λy(y x))

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 4 / 40

slide-8
SLIDE 8

Closed terms

A variable x is bound if it appears in the scope of λx. Otherwise x is free In λx(x y) x is bound, y is free.

Definition

A term is closed if all its variables are bound. λx.(x x) closed λx.λy.x λx(x y) (λx.x) (λx.λy(y x))

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 4 / 40

slide-9
SLIDE 9

Closed terms

A variable x is bound if it appears in the scope of λx. Otherwise x is free In λx(x y) x is bound, y is free.

Definition

A term is closed if all its variables are bound. λx.(x x) closed λx.λy.x closed λx(x y) (λx.x) (λx.λy(y x))

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 4 / 40

slide-10
SLIDE 10

Closed terms

A variable x is bound if it appears in the scope of λx. Otherwise x is free In λx(x y) x is bound, y is free.

Definition

A term is closed if all its variables are bound. λx.(x x) closed λx.λy.x closed λx(x y)

  • pen

(λx.x) (λx.λy(y x))

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 4 / 40

slide-11
SLIDE 11

Closed terms

A variable x is bound if it appears in the scope of λx. Otherwise x is free In λx(x y) x is bound, y is free.

Definition

A term is closed if all its variables are bound. λx.(x x) closed λx.λy.x closed λx(x y)

  • pen

(λx.x) (λx.λy(y x)) closed

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 4 / 40

slide-12
SLIDE 12

Closed terms

A variable x is bound if it appears in the scope of λx. Otherwise x is free In λx(x y) x is bound, y is free.

Definition

A term is closed if all its variables are bound. λx.(x x) closed λx.λy.x closed λx(x y)

  • pen

(λx.x) (λx.λy(y x)) closed

We will count closed λ-terms.

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 4 / 40

slide-13
SLIDE 13

Affine terms

Definition

A term is affine if each λ binds at most one variable.

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 5 / 40

slide-14
SLIDE 14

Affine terms

Definition

A term is affine if each λ binds at most one variable. λx.(x x) λx.λy.x λx(x y) (λx.x) (λx.λy(y x))

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 5 / 40

slide-15
SLIDE 15

Affine terms

Definition

A term is affine if each λ binds at most one variable. λx.(x x) no λx.λy.x λx(x y) (λx.x) (λx.λy(y x))

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 5 / 40

slide-16
SLIDE 16

Affine terms

Definition

A term is affine if each λ binds at most one variable. λx.(x x) no λx.λy.x yes λx(x y) (λx.x) (λx.λy(y x))

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 5 / 40

slide-17
SLIDE 17

Affine terms

Definition

A term is affine if each λ binds at most one variable. λx.(x x) no λx.λy.x yes λx(x y) yes (λx.x) (λx.λy(y x))

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 5 / 40

slide-18
SLIDE 18

Affine terms

Definition

A term is affine if each λ binds at most one variable. λx.(x x) no λx.λy.x yes λx(x y) yes (λx.x) (λx.λy(y x)) yes

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 5 / 40

slide-19
SLIDE 19

Affine terms

Definition

A term is affine if each λ binds at most one variable. λx.(x x) no λx.λy.x yes λx(x y) yes (λx.x) (λx.λy(y x)) yes Affine terms are simply typable

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 5 / 40

slide-20
SLIDE 20

Linear terms

Definition

A term is linear if

1 it is affine and 2 moreover each λ binds at least one variable (λIterms)

Each λ binds one and only one variable.

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 6 / 40

slide-21
SLIDE 21

Linear terms

Definition

A term is linear if

1 it is affine and 2 moreover each λ binds at least one variable (λIterms)

Each λ binds one and only one variable. λx.(x x) λx.λy.x λx(x y) (λx.x) (λx.λy(y x))

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 6 / 40

slide-22
SLIDE 22

Linear terms

Definition

A term is linear if

1 it is affine and 2 moreover each λ binds at least one variable (λIterms)

Each λ binds one and only one variable. λx.(x x) no λx.λy.x λx(x y) (λx.x) (λx.λy(y x))

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 6 / 40

slide-23
SLIDE 23

Linear terms

Definition

A term is linear if

1 it is affine and 2 moreover each λ binds at least one variable (λIterms)

Each λ binds one and only one variable. λx.(x x) no λx.λy.x no λx(x y) (λx.x) (λx.λy(y x))

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 6 / 40

slide-24
SLIDE 24

Linear terms

Definition

A term is linear if

1 it is affine and 2 moreover each λ binds at least one variable (λIterms)

Each λ binds one and only one variable. λx.(x x) no λx.λy.x no λx(x y) yes (λx.x) (λx.λy(y x))

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 6 / 40

slide-25
SLIDE 25

Linear terms

Definition

A term is linear if

1 it is affine and 2 moreover each λ binds at least one variable (λIterms)

Each λ binds one and only one variable. λx.(x x) no λx.λy.x no λx(x y) yes (λx.x) (λx.λy(y x)) yes

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 6 / 40

slide-26
SLIDE 26

1 Affine, Linear, Closed 2 De Bruijn indices 3 Swiss Cheese 4 Counting closed linear terms 5 Counting closed affine terms 6 Generating functions 7 Effective computations 8 Generating terms 9 Other results

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 7 / 40

slide-27
SLIDE 27

De Bruijn indices

We want to count representatives of equivalence classes of λ-terms modulo α conversion. Variables are replaced by natural numbers. If x is replaced by n if to reach the binder λx of x

  • ne crosses n λ .

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 8 / 40

slide-28
SLIDE 28

De Bruijn indices

We want to count representatives of equivalence classes of λ-terms modulo α conversion. Variables are replaced by natural numbers. If x is replaced by n if to reach the binder λx of x

  • ne crosses n λ .

λx.(x x) λx.λy.x λx(x y) (λx.x) (λx.λy(y x))

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 8 / 40

slide-29
SLIDE 29

De Bruijn indices

We want to count representatives of equivalence classes of λ-terms modulo α conversion. Variables are replaced by natural numbers. If x is replaced by n if to reach the binder λx of x

  • ne crosses n λ .

λx.(x x) λ(0 0) λx.λy.x λx(x y) (λx.x) (λx.λy(y x))

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 8 / 40

slide-30
SLIDE 30

De Bruijn indices

We want to count representatives of equivalence classes of λ-terms modulo α conversion. Variables are replaced by natural numbers. If x is replaced by n if to reach the binder λx of x

  • ne crosses n λ .

λx.(x x) λ(0 0) λx.λy.x λλ1 λx(x y) (λx.x) (λx.λy(y x))

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 8 / 40

slide-31
SLIDE 31

De Bruijn indices

We want to count representatives of equivalence classes of λ-terms modulo α conversion. Variables are replaced by natural numbers. If x is replaced by n if to reach the binder λx of x

  • ne crosses n λ .

λx.(x x) λ(0 0) λx.λy.x λλ1 λx(x y) ??? (λx.x) (λx.λy(y x))

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 8 / 40

slide-32
SLIDE 32

De Bruijn indices

We want to count representatives of equivalence classes of λ-terms modulo α conversion. Variables are replaced by natural numbers. If x is replaced by n if to reach the binder λx of x

  • ne crosses n λ .

λx.(x x) λ(0 0) λx.λy.x λλ1 λx(x y) ??? (λx.x) (λx.λy(y x)) (λ0) (λλ0 1)

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 8 / 40

slide-33
SLIDE 33

Size of terms

Abstractions λ are of size 1. Applications are of size 0. Three methods for counting de Bruijn indices: De Bruijn indices have size 0, De Bruijn indices have size 1 De Bruijn indices n have size n + 1 Variable size 0 Variable size 1 natural size λ(0 0) 2 4 4 λλ1 2 3 4 (λ0) (λλ(0 1)) 5 8 9

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 9 / 40

slide-34
SLIDE 34

1 Affine, Linear, Closed 2 De Bruijn indices 3 Swiss Cheese 4 Counting closed linear terms 5 Counting closed affine terms 6 Generating functions 7 Effective computations 8 Generating terms 9 Other results

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 10 / 40

slide-35
SLIDE 35

@ λ λ λ @ λ λ λ @ 3 λ λ 1

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 11 / 40

slide-36
SLIDE 36

@ λ λ λ @ λ λ λ @ 3 λ λ 1 @ λ λ λ @ λ λ

  • λ
  • @

3

  • λ

λ 1

  • Pierre Lescanne (ENS Lyon)

Linear and Affine Closed Terms 11 / 40

slide-37
SLIDE 37

@ λ λ λ @ λ λ λ @ 3 λ λ 1 λ λ λ λ @ 3 λ λ 1 λ @ λ

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 12 / 40

slide-38
SLIDE 38

λ λ λ λ @ 3 λ λ 1 λ @ λ λ λ λ @ 3 λ λ 1 @ λ

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 13 / 40

slide-39
SLIDE 39

λ λ λ @ 3 λ λ 1 @ λ λ λ @ 2 λ λ 1 λ

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 14 / 40

slide-40
SLIDE 40

λ λ λ @ 3 λ λ 1 (0, 0, 0, 1, 0, 0, ...) @ λ (1, 0, 0, 0, ...) λ λ @ 2 λ λ 1 (0, 0, 1, 0, 0, ...) λ

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 14 / 40

slide-41
SLIDE 41

Swiss Cheeses

To count closed affine or linear λ-terms, we are interested in λ-terms with holes, which we call SwissCheeses. A Swiss Cheese is a closed λ-term with holes at p levels. The p levels of holes are 0,... p−1. A hole i is a location for a variable at level i, that is under i λ’s. An m-SwissCheese has m0 holes at level 0, m1 holes at level 1, ... mp−1 holes at level p − 1. m = (m0, ..., mp−1) the characteristics

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 15 / 40

slide-42
SLIDE 42

Building Swiss Cheeses

We assume that either bound variables occur at most once (affine SwissCheeses),

  • r bound variables occur once and only once (linear SwissCheese),

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 16 / 40

slide-43
SLIDE 43

Building a SwissCheese by application

c1 = λ @ 1 c2 = @ λ 1 @ c1 c2 = @ λ @ @ λ 1 1

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 17 / 40

slide-44
SLIDE 44

Building a SwissCheese by abstraction

Abstraction with no binding c2 = @ λ 1 λ c2 = λ @ λ 1 2

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 18 / 40

slide-45
SLIDE 45

Building a SwissCheese by abstraction

Abstraction with no binding c2 = @ λ 1 λ c2 = λ @ λ 1 2 λ is put on the top. Indices of boxes are incremented.

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 18 / 40

slide-46
SLIDE 46

Building a SwissCheese by abstraction

Abstraction with binding @ λ @ @ λ 1 1 λ @ λ @ @ λ 1 2 1

A box i is chosen. The box i is replaced by index i. Indices of boxes are incremented.

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 19 / 40

slide-47
SLIDE 47

1 Affine, Linear, Closed 2 De Bruijn indices 3 Swiss Cheese 4 Counting closed linear terms 5 Counting closed affine terms 6 Generating functions 7 Effective computations 8 Generating terms 9 Other results

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 20 / 40

slide-48
SLIDE 48

Counting closed linear terms

We consider natural size. lν

n,m is the number of linear Swiss Cheeses of size n with characteristics

m= (m0, ..., mp−1). n = 0 There is only one Swiss Cheese of size 0 namely 0. This means that the number of SwissCheeses of size 0 is 1 if and only if m = (1, 0, 0, ...): l0,m = [m0 = 1 ∧

p−1

  • j=1

mj = 0]

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 21 / 40

slide-49
SLIDE 49

Counting closed linear terms

n + 1 and Application

  • qr =m

n

  • k=0

lk,q ln−1−k,r is the componentwise addition of tuples. n + 1 and Abstraction with binding

p−1

  • i=0

(mi + 1) lν

n−i,m↑i

m↑i = (..., mi + 1, ...).

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 22 / 40

slide-50
SLIDE 50

Counting closed linear terms

n+1,0:m

=

  • qr = 0:m

n

  • k=0

k,q lν n−k,r + p−1

  • i=0

(mi + 1) lν

n−i,m↑i

n+1,(h+1):m

=

  • qr=(h+1):m

n

  • k=0

k,q lν n−k,r

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 23 / 40

slide-51
SLIDE 51

1 Affine, Linear, Closed 2 De Bruijn indices 3 Swiss Cheese 4 Counting closed linear terms 5 Counting closed affine terms 6 Generating functions 7 Effective computations 8 Generating terms 9 Other results

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 24 / 40

slide-52
SLIDE 52

Counting closed affine terms

Like closed linear terms except that Abstraction with no binding is added. aν

n,m

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 25 / 40

slide-53
SLIDE 53

Counting closed affine terms

Like closed linear terms except that Abstraction with no binding is added. aν

n,m

n+1,0:m

=

  • qr = 0:m

n

  • k=0

k,q aν n−k,r + p−1

  • i=0

(mi + 1) aν

n−i,m↑i + aν n,m

n+1,(h+1):m

=

  • qr=(h+1):m

n

  • k=0

k,q aν n−k,r

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 25 / 40

slide-54
SLIDE 54

Counting closed affine terms

Like closed linear terms except that Abstraction with no binding is added. aν

n,m

n+1,0:m

=

  • qr = 0:m

n

  • k=0

k,q aν n−k,r + p−1

  • i=0

(mi + 1) aν

n−i,m↑i + aν n,m

n+1,(h+1):m

=

  • qr=(h+1):m

n

  • k=0

k,q aν n−k,r

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 25 / 40

slide-55
SLIDE 55

Number of closed affine terms up to 50

1 2 1 3 1 4 2 5 5 6 12 7 25 8 64 9 166 10 405 11 1050 12 2763 13 7239 14 19190 15 51457 16 138538 17 374972 18 1020943 19 2792183 20 7666358 21 21126905 22 58422650 23 162052566 24 450742451 25 1256974690 26 3513731861 27 9843728012 28 27633400879 29 77721141911 30 218984204904 31 618021576627 32 1746906189740 33 4945026080426 34 14017220713131 35 39784695610433 36 113057573020242 37 321649935953313 38 916096006168770 39 2611847503880831 40 7453859187221508 41 21292177500898858 42 60875851617670699 43 174195916730975850 44 498863759031591507 45 1429753835635525063 46 4100730353324163138 47 11769771167532816128 48 33804054749367200891 49 97151933333668422006 50 279385977720772581435

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 26 / 40

slide-56
SLIDE 56

1 Affine, Linear, Closed 2 De Bruijn indices 3 Swiss Cheese 4 Counting closed linear terms 5 Counting closed affine terms 6 Generating functions 7 Effective computations 8 Generating terms 9 Other results

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 27 / 40

slide-57
SLIDE 57

Generating functions for linear Swiss Cheeses

m is an infinite tuple. Lν

0:m(z)

= z

  • m′m′′=0:m

m′(z)Lν m′′(z) + z ∞

  • i=0

(mi + 1)ziLν

m↑i(z)

(h+1):m(z)

= [h = 0 +

  • i=0

mi = 0] + z

  • m′m′′=(h+1):m

m′(z)Lν m′′(z)

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 28 / 40

slide-58
SLIDE 58

Double series for linear Swiss Cheeses

u is u0, u1, ... ad infinitum.

Double series (Bodini)

Lν(z, u) = u0 + z(Lν(z, u))2 +

  • i=1

zi ∂Lν(z, tail (u)) ∂ui Lν

0ω(z) = Lν(z, 0ω) is the generating function for closed linear λ-terms.

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 29 / 40

slide-59
SLIDE 59

Generating functions for affine Swiss Cheeses

0:m(z)

= z

  • m′m′′=0:m

m′(z)Aν m′′(z) + z ∞

  • i=0

(mi + 1)ziAν

m↑i (z) + z Aν m(z)

(h+1):m(z)

= [h = 0 +

  • i=0

mi = 0] + z

  • m′m′′=(h+1):m

m′(z)Aν m′′(z)

Double series (Bodini)

Aν(z, u) = u0 + z(Aν(z, u))2 +

  • i=1

zi ∂Aν(z, tail (u)) ∂ui + zAν(z, tail (u))

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 30 / 40

slide-60
SLIDE 60

1 Affine, Linear, Closed 2 De Bruijn indices 3 Swiss Cheese 4 Counting closed linear terms 5 Counting closed affine terms 6 Generating functions 7 Effective computations 8 Generating terms 9 Other results

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 31 / 40

slide-61
SLIDE 61

We compute a n m. where m is a tuple of size n. If we look for a 0 m for a given n, we set length of m to n. Due to the high level of recursion one needs a memoization mechanism. One uses a memory and the call by need of Haskell. One counts all the value a n m’ for m’ componentwise less than m.

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 32 / 40

slide-62
SLIDE 62

1 Affine, Linear, Closed 2 De Bruijn indices 3 Swiss Cheese 4 Counting closed linear terms 5 Counting closed affine terms 6 Generating functions 7 Effective computations 8 Generating terms 9 Other results

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 33 / 40

slide-63
SLIDE 63

Generating terms

Slight changes on the programs. Due to the many terms to be generated the process is limited: 23 for linear terms (1420053 terms) and 19 for affine terms (2792183 terms). Random terms A random closed affine term of size 19: λλλλλ(λ((λ0 λλ(1 0)) 0) 0) A random closed linear term of size 23: λλλλ((λ(0 λ0) (3 (0 2))) 1)

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 34 / 40

slide-64
SLIDE 64

1 Affine, Linear, Closed 2 De Bruijn indices 3 Swiss Cheese 4 Counting closed linear terms 5 Counting closed affine terms 6 Generating functions 7 Effective computations 8 Generating terms 9 Other results

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 35 / 40

slide-65
SLIDE 65

Counting terms with variable size 0

For variable size 0, one replaces

p−1

  • i=0

(mi + 1) lν

n−i,m↑i

by

p

  • i=0

(mi + 1) l0

n,m↑i

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 36 / 40

slide-66
SLIDE 66

Counting terms with variable size 0

For variable size 0, one replaces

p−1

  • i=0

(mi + 1) lν

n−i,m↑i

by

p

  • i=0

(mi + 1) l0

n,m↑i

For variable size 1:

p

  • i=0

(mi + 1) l1

n−1,m↑i

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 36 / 40

slide-67
SLIDE 67

Counting β-normal forms

anf ν

0,m

= aneν

0,m

anf ν

n+1,m

= aneν

n+1,m + anf νλwn+1,m + anf νλnn+1,m

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 37 / 40

slide-68
SLIDE 68

Counting β-normal forms

anf ν

0,m

= aneν

0,m

anf ν

n+1,m

= aneν

n+1,m + anf νλwn+1,m + anf νλnn+1,m

aneν

0,m

= m0 = 1 ∧

p

  • j=1

mj = 0 aneν

n+1,m

=

  • qr = 0:m

n

  • k=0

aneν

k,q anf ν n−k,r Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 37 / 40

slide-69
SLIDE 69

Counting β-normal forms

anf ν

0,m

= aneν

0,m

anf ν

n+1,m

= aneν

n+1,m + anf νλwn+1,m + anf νλnn+1,m

aneν

0,m

= m0 = 1 ∧

p

  • j=1

mj = 0 aneν

n+1,m

=

  • qr = 0:m

n

  • k=0

aneν

k,q anf ν n−k,r

anf νλwn+1,m =

n

  • i=0

(mi + 1) anf ν

n−i,m↑i

anf νλnn+1,m = anf ν

n,m Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 37 / 40

slide-70
SLIDE 70

Further works

(Dan Dougherty) A generic framework for

◮ plain terms and ◮ linear and affine terms.

To generate random terms further than 19 and 23.

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 38 / 40

slide-71
SLIDE 71

Questions ?

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 39 / 40

slide-72
SLIDE 72

Generating functions of m-open λ-terms with natural size. Pm(z) = z(1 − zm) 1 − z + zP2

m(z) + zPm+1(z)

m replaces the characteristics.

Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 40 / 40