## Implementing a normalizer using sized heterogeneous types (2006)

### Cached

### Download Links

Venue: | In Workshop on Mathematically Structured Functional Programming, MSFP |

Citations: | 7 - 1 self |

### BibTeX

@INPROCEEDINGS{Abel06implementinga,

author = {Andreas Abel},

title = {Implementing a normalizer using sized heterogeneous types},

booktitle = {In Workshop on Mathematically Structured Functional Programming, MSFP},

year = {2006}

}

### OpenURL

### Abstract

In the simply-typed lambda-calculus, a hereditary substitution replaces a free variable in a normal form r by another normal form s of type a, removing freshly created redexes on the fly. It can be defined by lexicographic induction on a and r, thus, giving rise to a structurally recursive normalizer for the simply-typed lambda-calculus. We generalize this scheme to simultaneous substitutions, preserving its simple termination argument. We further implement hereditary simultaneous substitutions in a functional programming language with sized heterogeneous inductive types, Fωb, arriving at an interpreter whose termination can be tracked by the type system of its host programming language.

### Citations

921 | Categories for the working mathematician - Lane - 1998 |

121 | Proving the Correctness of Reactive Systems Using Sized Types
- Hughes, Pareto, et al.
(Show Context)
Citation Context ...ed Heterogeneous Types gets a type system that accepts structurally recursive functions, hence, guarantees termination of well-typed programs. This idea has been taken up by Hughes, Pareto, and Sabry =-=[17]-=-, Giménez [16], Amadio and Coupet-Grimal [9], Barthe et al. [10], Blanqui [14] and myself [1, 2]. My thesis [5] describes Fω�, an extension of the higher-order polymorphic lambda-calculus Fω by sized ... |

94 |
Inductive Types and Type Constraints in the Second-Order Lambda Calculus
- Mendler
- 1991
(Show Context)
Citation Context ... α F for some α < λ, hence fix s t ∈ C. Since t was arbitrary, fix s ∈ µ λ F → C. Up to now, we have considered the semantics of inductive types and the justification of semantical functions. Mendler =-=[22]-=- first observed that by turning these semantical concepts into syntax, 2 one 1 Research supported by the coordination action TYPES (510996) and thematic network Applied Semantics II (IST-200138957) of... |

77 | Monadic presentations of lambda terms using generalized inductive types
- Altenkirch, Reus
- 1999
(Show Context)
Citation Context ... simultaneous substitutions, necessary to handle de Bruijn-style λ-terms with static guarantee of well-scopedness. Such de Bruijn terms can be represented using a data structure of heterogeneous type =-=[8, 13]-=-. In Fω�, heterogeneous types can be expressed by higher-kinded inductive types, i. e., type µ a F where F is an operator on type constructors instead of just types. As a result, we obtain an implemen... |

69 |
Algebraic Theories
- Manes
- 1974
(Show Context)
Citation Context ... terminating recursion. De Bruijn representation by a heterogeneous type. Since the 1960s it is known that simultaneous substitution can be viewed as the bind operation of a suitable monad [19, VI.4] =-=[20]-=-. For terms with binders, the idea was taken up by Bird and Paterson [13] as a case study for heterogeneous (nested, resp.) types in Haskell. Altenkirch and Reus [8] implement simultaneous substitutio... |

68 | R.: De Bruijn notation as a nested datatype
- Bird, Paterson
- 1999
(Show Context)
Citation Context ... simultaneous substitutions, necessary to handle de Bruijn-style λ-terms with static guarantee of well-scopedness. Such de Bruijn terms can be represented using a data structure of heterogeneous type =-=[8, 13]-=-. In Fω�, heterogeneous types can be expressed by higher-kinded inductive types, i. e., type µ a F where F is an operator on type constructors instead of just types. As a result, we obtain an implemen... |

39 | Type-based termination of recursive definitions
- Barthe, Frade, et al.
(Show Context)
Citation Context ...lly recursive functions, hence, guarantees termination of well-typed programs. This idea has been taken up by Hughes, Pareto, and Sabry [17], Giménez [16], Amadio and Coupet-Grimal [9], Barthe et al. =-=[10]-=-, Blanqui [14] and myself [1, 2]. My thesis [5] describes Fω�, an extension of the higher-order polymorphic lambda-calculus Fω by sized inductive types and structural recursion. A sized inductive type... |

32 | Structural recursive definitions in type theory
- Giménez
- 1998
(Show Context)
Citation Context ...us Types gets a type system that accepts structurally recursive functions, hence, guarantees termination of well-typed programs. This idea has been taken up by Hughes, Pareto, and Sabry [17], Giménez =-=[16]-=-, Amadio and Coupet-Grimal [9], Barthe et al. [10], Blanqui [14] and myself [1, 2]. My thesis [5] describes Fω�, an extension of the higher-order polymorphic lambda-calculus Fω by sized inductive type... |

28 | Termination checking with types
- Abel
- 2002
(Show Context)
Citation Context ..., guarantees termination of well-typed programs. This idea has been taken up by Hughes, Pareto, and Sabry [17], Giménez [16], Amadio and Coupet-Grimal [9], Barthe et al. [10], Blanqui [14] and myself =-=[1, 2]-=-. My thesis [5] describes Fω�, an extension of the higher-order polymorphic lambda-calculus Fω by sized inductive types and structural recursion. A sized inductive type µ a F is the syntactic equivale... |

25 |
A Polymorphic Lambda-Calculus with Sized Higher-Order Types
- Abel
- 2006
(Show Context)
Citation Context ...nation of well-typed programs. This idea has been taken up by Hughes, Pareto, and Sabry [17], Giménez [16], Amadio and Coupet-Grimal [9], Barthe et al. [10], Blanqui [14] and myself [1, 2]. My thesis =-=[5]-=- describes Fω�, an extension of the higher-order polymorphic lambda-calculus Fω by sized inductive types and structural recursion. A sized inductive type µ a F is the syntactic equivalent of an iterat... |

21 |
A type-based termination criterion for dependently-typed higher-order rewrite systems
- BLANQUI
(Show Context)
Citation Context ...functions, hence, guarantees termination of well-typed programs. This idea has been taken up by Hughes, Pareto, and Sabry [17], Giménez [16], Amadio and Coupet-Grimal [9], Barthe et al. [10], Blanqui =-=[14]-=- and myself [1, 2]. My thesis [5] describes Fω�, an extension of the higher-order polymorphic lambda-calculus Fω by sized inductive types and structural recursion. A sized inductive type µ a F is the ... |

14 |
Short proofs of normalization
- Joachimski, Matthes
(Show Context)
Citation Context ...ogical framework LF extended to linearity and concurrency [25]. Implicitly, hereditary substitutions are present already in Joachimski and Matthes’ normalization proof for the simply-typed λ-calculus =-=[18]-=-. Let us first introduce some overloaded notation on results ˆr. The operation ˆr discards the type annotation on the result if present, i. e., r a = r and r = r. This operation is to be applied impli... |

14 |
Types for Crash Prevention
- Pareto
- 2000
(Show Context)
Citation Context ...eneous types like this article’s Tm. Blanqui [14, 15] extended type-based termination to dependent types and rewriting. Independently of these “type-theoretic” developments, Hughes, Pareto, and Sabry =-=[17, 24]-=- have explored sized types for preventing crashes of functional programs. They arrived at a similar rule for type-based terminating recursion. De Bruijn representation by a heterogeneous type. Since t... |

11 | Weak normalization for the simply-typed lambda-calculus
- Abel
- 2004
(Show Context)
Citation Context ...e weak normalization proof in Isabelle and automatically extracted a normalizer, being much more complicated and keeping some intermediate data structures. I have implemented a similar proof in Twelf =-=[3]-=-. The termination checker of Twelf is capable to certify termination of the normalization proof, if viewed as a recursive function. Watkins et al. [25] define hereditary substitutions for terms of the... |

11 |
Polarized subtyping for sized types
- Abel
- 2006
(Show Context)
Citation Context ...s relation is extended appropriately to all type constructors and to higher-order, taking the variance information into account. (For more details, see the article about higher-order subtyping in Fω� =-=[4]-=-.) Programs (terms). Fω� is a purely functional language with categorical datatypes 3 and recursion. Programs are given by the following grammar. e, f ::= x | λx.e | f e λ-calculus | 〈〉 inhabitant of ... |

10 |
A concurrent logical framework I: Judgements and properties
- Watkins, Cervesato, et al.
- 2003
(Show Context)
Citation Context ...f a structurally recursive function whose termination is automatically established using sized types: a β-normalizer for simply-typed λ-terms. The heart of the normalizer are hereditary substitutions =-=[25]-=-: substitution of a normal form into another one, potentially triggering new substitutions, until a normal form is returned. Surprisingly, this process can be formulated by a lexicographic recursion o... |

8 |
Formalized metatheory with terms represented by an indexed family of types
- Adams
- 2006
(Show Context)
Citation Context ...ly recursive. McBride considers the object language of simply-typed terms in a dependently typed meta language; this way, he even establishes that substitution and renaming are type-preserving. Adams =-=[7]-=- has carried out metatheory of pure type systems using de Bruijn representations as a heterogeneous type. He found that he had to pass from small-step statements, which speak about a single variable, ... |

7 | Termination and guardedness checking with continuous types
- Abel
- 2003
(Show Context)
Citation Context ..., guarantees termination of well-typed programs. This idea has been taken up by Hughes, Pareto, and Sabry [17], Giménez [16], Amadio and Coupet-Grimal [9], Barthe et al. [10], Blanqui [14] and myself =-=[1, 2]-=-. My thesis [5] describes Fω�, an extension of the higher-order polymorphic lambda-calculus Fω by sized inductive types and structural recursion. A sized inductive type µ a F is the syntactic equivale... |

6 |
Practical inference for typebased termination in a polymorphic setting
- Barthe, Grégoire, et al.
- 2005
(Show Context)
Citation Context ... [23] first devised a typing rule for general recursive programs that would single out the ones that are iterative—like ���� for lists. Mendler’s system was extended by Giménez [16] and Barthe et al. =-=[10, 11]-=- to account for course-of-value recursion—covering functions like quicksort. I have explored how the type of a recursive function may depend on the size index [1]—now functions like breadth-first trav... |

5 | Type-preserving renaming and substitution
- McBride
- 2005
(Show Context)
Citation Context ...aming— performed in substitution under a binder—also by an invocation of substitution. Thus, termination of substitution becomes more complicated; they justify it by a lexicographic argument. McBride =-=[21]-=- stratifies this situation by exhibiting a common scheme which substitution and renaming as special instances. This scheme is again structurally recursive. McBride considers the object language of sim... |

2 |
Tarmo Uustalu. Iteration schemes for higher-order and nested datatypes
- Abel, Matthes
(Show Context)
Citation Context ... r〉) MSFP 2006 7sImplementing a Normalizer using Sized Heterogeneous Types Note that the first argument to abs is the object-level type of the abstraction: abs a r represents λx:a. r. A whole article =-=[6]-=- has been devoted to functions defined by iteration over heterogeneous data types such as Tm. Fω� can simulate all the systems discussed in that article, hence, all examples in that article can be rep... |

2 |
and Solange Coupet-Grimal. Analysis of a guard condition in type theory (extended abstract
- Amadio
(Show Context)
Citation Context ...t accepts structurally recursive functions, hence, guarantees termination of well-typed programs. This idea has been taken up by Hughes, Pareto, and Sabry [17], Giménez [16], Amadio and Coupet-Grimal =-=[9]-=-, Barthe et al. [10], Blanqui [14] and myself [1, 2]. My thesis [5] describes Fω�, an extension of the higher-order polymorphic lambda-calculus Fω by sized inductive types and structural recursion. A ... |

2 | Extracting a normalization algorithm in Isabelle/HOL
- Berghofer
- 2005
(Show Context)
Citation Context ...raphic induction on types and derivations, similar to the one we have given in Section 3. They hand-extract a general recursive normalization algorithm which may diverge on ill-typed input. Berghofer =-=[12]-=- implemented the weak normalization proof in Isabelle and automatically extracted a normalizer, being much more complicated and keeping some intermediate data structures. I have implemented a similar ... |