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 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
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
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 ) is the same as λ x .λ y . x λ 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
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
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
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
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
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
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 ) open ( λ x . x ) ( λ x .λ y ( y x )) Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 4 / 40
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 ) open ( λ x . x ) ( λ x .λ y ( y x )) closed Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 4 / 40
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 ) open ( λ x . x ) ( λ x .λ y ( y x )) closed We will count closed λ -terms. Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 4 / 40
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
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
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
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
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
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
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
Linear terms Definition A term is linear if 1 it is affine and 2 moreover each λ binds at least one variable ( λ I terms) Each λ binds one and only one variable. Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 6 / 40
Linear terms Definition A term is linear if 1 it is affine and 2 moreover each λ binds at least one variable ( λ I terms) 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
Linear terms Definition A term is linear if 1 it is affine and 2 moreover each λ binds at least one variable ( λ I terms) 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
Linear terms Definition A term is linear if 1 it is affine and 2 moreover each λ binds at least one variable ( λ I terms) 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
Linear terms Definition A term is linear if 1 it is affine and 2 moreover each λ binds at least one variable ( λ I terms) 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
Linear terms Definition A term is linear if 1 it is affine and 2 moreover each λ binds at least one variable ( λ I terms) 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
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
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 one crosses n λ . Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 8 / 40
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 one 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
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 one 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
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 one crosses n λ . λ x . ( x x ) λ (0 0) λλ 1 λ x .λ y . x λ x ( x y ) ( λ x . x ) ( λ x .λ y ( y x )) Pierre Lescanne (ENS Lyon) Linear and Affine Closed Terms 8 / 40
Recommend
More recommend