![]() This mentions no names (and works on a "scope", a non "opened term" with 1 deBruijn variable still in it).īut then you have the fresh names in the normal form! You need to abstract over the name again before applying the Lambda constructor. You don't actually need to do this with the second pattern match! When opening a term and immediately substituting, you can skip a step and call instantiate directly. In OCaml, you can cheat a little and create a statefull fresh : unit -> name function that always produces a never-seen-before name. We were kind of hoping to not have to care about generating fresh variables with locally nameless. Lambda Calculus: Reducing to Normal Form Ask Question Asked 9 years, 11 months ago Modified 9 years, 11 months ago Viewed 2k times 2 I'm having trouble understanding how to reduce lambda terms to normal form. What name do you want to open with? Well it probably needs to be a name you haven't opened with "above", aka a fresh variable. instantiate the top level deBruijn index with a name. The locally nameless version is exactly the same, except that you need to open the lambdas right after pattern matching on one, i.e. | Lambda (v, t'') -> norm (subst v u' t'') Machine-checked Proof of the Church-Rosser Theorem for the Lambda Calculus Using the Barendregt Variable Convention in Constructive Type Theory The 12th Workshop on Logical and Semantic Frameworks, with Applications (LSFA 2017), Electronic Notes in Theoretical Computer Science, 338 ( 2018 ), pp. (Thanks to De Bruijn indices, we can see at a glance they differ. In other words, we have combined K and I to produce a closed lambda term distinct to either one. In particular, take a naive call-by-name normalization algorithm on terms with named binders that ignores variable capture (in OCaml syntax): let rec norm t = match t with Then we find for any a, b: K I a b ( x y. (\lambda x.f (f x)), the function which takes a function f f as input and returns a function that applies f f twice. ![]() A good rule of thumb with locally nameless is "pattern matching on a binder is opening". In pure untyped lambda calculus, we can define natural numbers using the Church numerals: the number n n is represented by the operation of n n -fold iteration.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |