University of Oxford Laboratoire d’informatique de Paris Nord MIMUW Automata seminar, June 24th, 2020 1/19 Implicit automata in typed λ -calculi Pierre PRADIC — pierre.pradic@cs.ox.ac.uk j.w.w. NGUYỄN Lê Thành Dũng (a.k.a. Tito) — nltd@nguyentito.eu
Big project: the same thing for automata instead of complexity The idea Our starting point: Hillebrand & Kanellakis’s theorem (1996) DeYoung & Pfenning 2016 / Kuperberg et al. 2019, using circular proofs Other “implicit automata” results: cf. MIMUW automata seminar 2020-05-13 constructive logics): theoretical basis for e.g. Haskell -calculi ( Typed -calculus choice of encodings) in the simply typed booleans (for a certain L defjnable by a program regular L this work Many equivalent defjnitions of regular languages: subsystems of MSO automata theory implicit complexity descriptive complexity complexity classes functional declarative programming paradigm using high-level programming languages Implicit complexity : machine-free characterizations of complexity classes regexps, automata (deterministic or not), MSO, … 2/19
The idea Our starting point: Hillebrand & Kanellakis’s theorem (1996) DeYoung & Pfenning 2016 / Kuperberg et al. 2019, using circular proofs Other “implicit automata” results: cf. MIMUW automata seminar 2020-05-13 constructive logics): theoretical basis for e.g. Haskell -calculi ( Typed -calculus choice of encodings) in the simply typed booleans (for a certain L defjnable by a program regular L this work Many equivalent defjnitions of regular languages: subsystems of MSO automata theory implicit complexity descriptive complexity complexity classes functional declarative programming paradigm using high-level programming languages Implicit complexity : machine-free characterizations of complexity classes regexps, automata (deterministic or not), MSO, programming languages , … 2/19 Big project: the same thing for automata instead of complexity
The idea descriptive complexity DeYoung & Pfenning 2016 / Kuperberg et al. 2019, using circular proofs Other “implicit automata” results: cf. MIMUW automata seminar 2020-05-13 Our starting point: Hillebrand & Kanellakis’s theorem (1996) this work subsystems of MSO Many equivalent defjnitions of regular languages: implicit complexity automata theory complexity classes functional declarative programming paradigm using high-level programming languages Implicit complexity : machine-free characterizations of complexity classes regexps, automata (deterministic or not), MSO, programming languages , … 2/19 Big project: the same thing for automata instead of complexity ⇒ L defjnable by a program Σ ∗ → booleans (for a certain L ⊆ Σ ∗ regular ⇐ choice of encodings) in the simply typed λ -calculus Typed λ -calculi ( ∼ = constructive logics): theoretical basis for e.g. Haskell
The idea descriptive complexity DeYoung & Pfenning 2016 / Kuperberg et al. 2019, using circular proofs Other “implicit automata” results: cf. MIMUW automata seminar 2020-05-13 Our starting point: Hillebrand & Kanellakis’s theorem (1996) this work subsystems of MSO Many equivalent defjnitions of regular languages: implicit complexity automata theory complexity classes functional declarative programming paradigm using high-level programming languages Implicit complexity : machine-free characterizations of complexity classes regexps, automata (deterministic or not), MSO, programming languages , … 2/19 Big project: the same thing for automata instead of complexity ⇒ L defjnable by a program Σ ∗ → booleans (for a certain L ⊆ Σ ∗ regular ⇐ choice of encodings) in the simply typed λ -calculus Typed λ -calculi ( ∼ = constructive logics): theoretical basis for e.g. Haskell
true false 3/19 (multiple arguments: x x y x x y y y No primitive data; encodings using functions x x y x ) Also encodings of natural numbers, strings… (later!) Untyped -calculus is Turing-complete Useful example: booleans for the smallest equivalence relation containing 1, we have f 42 For f u ( t with x substituted by u ) t x x t u Operational semantics: program execution by rewriting 1 … 42 2 We write x 2 x The λ -calculus λ -terms: meant to be a naive syntactic theory of functions t , u ::= x | t u | λ x . t f t ≈ f ( t ) λ x . t ≈ ( x �→ t ) Notational conventions: t u v = ( t u ) v and λ x . t u = λ x . ( t u )
true false x -calculus is Turing-complete Untyped Also encodings of natural numbers, strings… (later!) x ) x y x y (multiple arguments: x y y x y x 3/19 Useful example: booleans No primitive data; encodings using functions Operational semantics: program execution by rewriting The λ -calculus λ -terms: meant to be a naive syntactic theory of functions t , u ::= x | t u | λ x . t f t ≈ f ( t ) λ x . t ≈ ( x �→ t ) Notational conventions: t u v = ( t u ) v and λ x . t u = λ x . ( t u ) For f : x �→ x 2 + 1, we have f ( 42 ) = 42 2 + 1 … ( λ x . t ) u − → β t { x := u } ( t with x substituted by u ) We write = β for the smallest equivalence relation containing − → β
3/19 Operational semantics: program execution by rewriting -calculus is Turing-complete Untyped Also encodings of natural numbers, strings… (later!) Useful example: booleans No primitive data; encodings using functions The λ -calculus λ -terms: meant to be a naive syntactic theory of functions t , u ::= x | t u | λ x . t f t ≈ f ( t ) λ x . t ≈ ( x �→ t ) Notational conventions: t u v = ( t u ) v and λ x . t u = λ x . ( t u ) For f : x �→ x 2 + 1, we have f ( 42 ) = 42 2 + 1 … ( λ x . t ) u − → β t { x := u } ( t with x substituted by u ) We write = β for the smallest equivalence relation containing − → β true = λ x . λ y . x false = λ x . λ y . y (multiple arguments: x �→ ( y �→ x ) ∼ = ( x , y ) �→ x )
3/19 Operational semantics: program execution by rewriting Also encodings of natural numbers, strings… (later!) Useful example: booleans No primitive data; encodings using functions The λ -calculus λ -terms: meant to be a naive syntactic theory of functions t , u ::= x | t u | λ x . t f t ≈ f ( t ) λ x . t ≈ ( x �→ t ) Notational conventions: t u v = ( t u ) v and λ x . t u = λ x . ( t u ) For f : x �→ x 2 + 1, we have f ( 42 ) = 42 2 + 1 … ( λ x . t ) u − → β t { x := u } ( t with x substituted by u ) We write = β for the smallest equivalence relation containing − → β true = λ x . λ y . x false = λ x . λ y . y (multiple arguments: x �→ ( y �→ x ) ∼ = ( x , y ) �→ x ) Untyped λ -calculus is Turing-complete
true false true or t false (for t closed , i.e. w/ no free vars) x f a f b f b x Str a b Idea: w f a f b , w f w n o o o o f w 1 4/19 for w a b o o A Bool ( A is any simple type) (for w Str therefore w Str o A ) Languages : Str f b o o Typed booleans x y x x y y Bool o o so that t Bool t Pro: all well-typed programs terminate Con: loss of Turing-completeness Church encoding of strings abb f a The simply typed λ -calculus Simple types: specifjcations for λ -calculus programs A , B ::= o (base type) | A → B (functions from A to B ) Convention: A → B → C = A → ( B → C ) t : A (“ t is of type A ”) defjned by induction on the syntax
x f a f b f b x Str a b Idea: w f a f b , w 4/19 Languages : Str f w 1 f w n for w a b o o A Bool ( A is any simple type) (for w Str therefore w Str o A ) o o o Typed booleans o o f b f a abb Church encoding of strings Con: loss of Turing-completeness Pro: all well-typed programs terminate The simply typed λ -calculus Simple types: specifjcations for λ -calculus programs A , B ::= o (base type) | A → B (functions from A to B ) Convention: A → B → C = A → ( B → C ) t : A (“ t is of type A ”) defjned by induction on the syntax true = λ x . λ y . x false = λ x . λ y . y Bool = o → o → o ⇒ t = β true or t = β false (for t closed , i.e. w/ no free vars) so that t : Bool ⇐
x f a f b f b x Str a b Idea: w f a f b , w 4/19 Languages : Str f w 1 f w n for w a b o o A Bool ( A is any simple type) (for w Str therefore w Str o A ) o o o Typed booleans o o f b f a abb Church encoding of strings Con: loss of Turing-completeness Pro: all well-typed programs terminate The simply typed λ -calculus Simple types: specifjcations for λ -calculus programs A , B ::= o (base type) | A → B (functions from A to B ) Convention: A → B → C = A → ( B → C ) t : A (“ t is of type A ”) defjned by induction on the syntax true = λ x . λ y . x false = λ x . λ y . y Bool = o → o → o ⇒ t = β true or t = β false (for t closed , i.e. w/ no free vars) so that t : Bool ⇐
, w 4/19 Languages : Str A ) o Str Typed booleans therefore w Str (for w Bool ( A is any simple type) Pro: all well-typed programs terminate Con: loss of Turing-completeness Church encoding of strings A o The simply typed λ -calculus Simple types: specifjcations for λ -calculus programs A , B ::= o (base type) | A → B (functions from A to B ) Convention: A → B → C = A → ( B → C ) t : A (“ t is of type A ”) defjned by induction on the syntax true = λ x . λ y . x false = λ x . λ y . y Bool = o → o → o ⇒ t = β true or t = β false (for t closed , i.e. w/ no free vars) so that t : Bool ⇐ abb = λ f a . λ f b . λ x . f a ( f b ( f b x )) : Str { a , b } = ( o → o ) → ( o → o ) → o → o Idea: w ≈ ( f a , f b ) �→ f w [ 1 ] ◦ . . . ◦ f w [ n ] for w ∈ { a , b } ∗
Recommend
More recommend