## Erasure and Polymorphism in Pure Type Systems

Citations: | 14 - 0 self |

### BibTeX

@MISC{Mishra-linger_erasureand,

author = {Nathan Mishra-linger and Tim Sheard},

title = {Erasure and Polymorphism in Pure Type Systems},

year = {}

}

### OpenURL

### Abstract

Abstract. We introduce Erasure Pure Type Systems, anextensionto Pure Type Systems with an erasure semantics centered around a type constructor ∀ indicating parametric polymorphism. The erasure phase is guided by lightweight program annotations. The typing rules guarantee that well-typed programs obey a phase distinction between erasable (compile-time) and non-erasable (run-time) terms. The erasability of an expression depends only on how its value is used in the rest of the program. Despite this simple observation, most languages treat erasability as an intrinsic property of expressions, leading to code duplication problems. Our approach overcomes this deficiency by treating erasability extrinsically. Because the execution model of EPTS generalizes the familiar notions of type erasure and parametric polymorphism, we believe functional programmers will find it quite natural to program in such a setting. 1

### Citations

1119 | Proof-carrying code
- Necula
- 1997
(Show Context)
Citation Context ...ved ever more expressive type systems. The drive towards increased expressiveness inevitably leads to dependent types, a proven technology for verifying strong correctness properties of real programs =-=[15,9,5,8]-=-. For this reason, researchers have long sought practical ways to include dependent types in programming languages. Heavy use of the expressive power of dependent types involves the embedding of proof... |

527 | Lambda Calculi with Types
- Barendregt
(Show Context)
Citation Context ...cation problem. We have one type A and therefore functions over A can be written once. Pure Type Systems (PTS) are a well-known family of typed λ-calculi that encompass a wide variety of type systems =-=[4]-=-. Most dependently typed languages 3 Some work on representations of inductive types in Epigram notes that values of type families need not store certain indices that, regardless of their type, are un... |

334 | Theorems for Free
- Wadler
- 1989
(Show Context)
Citation Context ... constructor. Parametricity is a property of such languages enabling one to derive “free theorems” about polymorphic terms basedErasure and Polymorphism in Pure Type Systems 363 solely on their type =-=[21]-=-. We conjecture that the ∀-types of EPTS satisfy parametricity properties similar to those of System F. Many studies of parametricity for System F are based on denotational semantics. It seems impossi... |

294 | Dependent types in practical programming
- Xi, Pfenning
- 1999
(Show Context)
Citation Context ... whereby types and program values may not depend on each other computationally. Singleton types are then used to simulate dependently typed programming. Examples of this approach include Dependent ML =-=[22]-=-, Ωmega [20,19], Applied Type Systems [7], and Haskell with generalized algebraic datatypes [16]. Singleton types are type families T :I → Type for which each type index i:I uniquely determines the on... |

230 | Formal certification of a compiler back-end or: programming a compiler with a proof assistant
- Leroy
- 2006
(Show Context)
Citation Context ...ved ever more expressive type systems. The drive towards increased expressiveness inevitably leads to dependent types, a proven technology for verifying strong correctness properties of real programs =-=[15,9,5,8]-=-. For this reason, researchers have long sought practical ways to include dependent types in programming languages. Heavy use of the expressive power of dependent types involves the embedding of proof... |

218 | Cayenne - a language with dependent types
- Augustsson
- 1998
(Show Context)
Citation Context ...guages in this category start with full dependent types. An erasure phase then strips out parts of the program that are irrelevant to its run-time execution. Examples of this approach include Cayenne =-=[3]-=-, Coq [1], and Epigram [12,6]. In Cayenne and Coq, the erasability of a subterm depends on its type. All types (subterms of type Type) are erased in Cayenne and Epigram 3 .Coq’sprogram extraction mech... |

160 | Simple unification-based type inference for GADTs
- Jones, Vytiniotis, et al.
- 2006
(Show Context)
Citation Context ...are then used to simulate dependently typed programming. Examples of this approach include Dependent ML [22], Ωmega [20,19], Applied Type Systems [7], and Haskell with generalized algebraic datatypes =-=[16]-=-. Singleton types are type families T :I → Type for which each type index i:I uniquely determines the one value of type Ti. For example, the declarations datakind Nat↑ : kind where Zero↑ : Nat↑ Succ↑ ... |

158 |
The view from the left
- McBride, McKinna
(Show Context)
Citation Context ...art with full dependent types. An erasure phase then strips out parts of the program that are irrelevant to its run-time execution. Examples of this approach include Cayenne [3], Coq [1], and Epigram =-=[12,6]-=-. In Cayenne and Coq, the erasability of a subterm depends on its type. All types (subterms of type Type) are erased in Cayenne and Epigram 3 .Coq’sprogram extraction mechanism supports erasure of pro... |

125 | A logic for parametric polymorphism
- Plotkin, Abadi
- 1993
(Show Context)
Citation Context ...ased on denotational semantics. It seems impossible to develop a semantic model for an arbitrary EPTS. We think a proof-theoretic approach is necessary, somehow generalizing existing work on System F =-=[18,2,11]-=-. 9 Conclusions Languages combining dependent types with erasure semantics sometimes require users to maintain more than one copy of a datatype in order to ensure erasure of some of its values but not... |

109 |
Computation and reasoning: a type theory for computer science
- Luo
- 1994
(Show Context)
Citation Context ...roducts. This358 N. Mishra-Linger and T. Sheard calculus is modeled after Miquel’s Implicit Calculus of Constructions (ICC) [14,13], a Curry-style variant of Luo’s Extended Calculus of Constructions =-=[10]-=-. ICC has a rich notion of subtyping that orders Church encodings at various levels of type refinement in a natural way [13]. IPTS is both more and less general than ICC. It is more general because IP... |

87 | H.: Combining Programming with Theorem Proving
- Chen, Xi
- 2005
(Show Context)
Citation Context ...depend on each other computationally. Singleton types are then used to simulate dependently typed programming. Examples of this approach include Dependent ML [22], Ωmega [20,19], Applied Type Systems =-=[7]-=-, and Haskell with generalized algebraic datatypes [16]. Singleton types are type families T :I → Type for which each type index i:I uniquely determines the one value of type Ti. For example, the decl... |

72 | Languages of the future
- Sheard
- 2004
(Show Context)
Citation Context ...es and program values may not depend on each other computationally. Singleton types are then used to simulate dependently typed programming. Examples of this approach include Dependent ML [22], Ωmega =-=[20,19]-=-, Applied Type Systems [7], and Haskell with generalized algebraic datatypes [16]. Singleton types are type families T :I → Type for which each type index i:I uniquely determines the one value of type... |

60 | Formal verification of a C compiler front-end
- Blazy, Dargaye, et al.
- 2006
(Show Context)
Citation Context ...ved ever more expressive type systems. The drive towards increased expressiveness inevitably leads to dependent types, a proven technology for verifying strong correctness properties of real programs =-=[15,9,5,8]-=-. For this reason, researchers have long sought practical ways to include dependent types in programming languages. Heavy use of the expressive power of dependent types involves the embedding of proof... |

30 | Practical Implementation of a Dependently Typed Functional Programming Language
- Brady
- 2005
(Show Context)
Citation Context ...art with full dependent types. An erasure phase then strips out parts of the program that are irrelevant to its run-time execution. Examples of this approach include Cayenne [3], Coq [1], and Epigram =-=[12,6]-=-. In Cayenne and Coq, the erasability of a subterm depends on its type. All types (subterms of type Type) are erased in Cayenne and Epigram 3 .Coq’sprogram extraction mechanism supports erasure of pro... |

27 | Outline of a proof theory of parametricity
- Mairson
- 1991
(Show Context)
Citation Context ...ased on denotational semantics. It seems impossible to develop a semantic model for an arbitrary EPTS. We think a proof-theoretic approach is necessary, somehow generalizing existing work on System F =-=[18,2,11]-=-. 9 Conclusions Languages combining dependent types with erasure semantics sometimes require users to maintain more than one copy of a datatype in order to ensure erasure of some of its values but not... |

20 |
The implicit calculus of constructions
- Miquel
- 2001
(Show Context)
Citation Context ...ther PTS variant called Implicit Pure Type Systems (IPTS) that serves as the target language of the erasure phase. This language is very closely related to Miquel’s Implicit Calculus of Constructions =-=[13]-=-. Section 5 introduces our erasure translation from EPTS to IPTS. This operation is the basis for the erasure semantics of EPTS (Section 6). We prove that erasure exhibits properties one would expect:... |

19 |
Le Calcul des Constructions Implicite: Syntaxe et Sémantique. Theèses de Doctorat, Université
- Miquel
- 2001
(Show Context)
Citation Context ...ly typed (Curry-style) calculus with both explicit and implicit dependent products. This358 N. Mishra-Linger and T. Sheard calculus is modeled after Miquel’s Implicit Calculus of Constructions (ICC) =-=[14,13]-=-, a Curry-style variant of Luo’s Extended Calculus of Constructions [10]. ICC has a rich notion of subtyping that orders Church encodings at various levels of type refinement in a natural way [13]. IP... |

18 | E.: Meta-programming with built-in type equality
- Sheard, Pašalić
- 2004
(Show Context)
Citation Context ...es and program values may not depend on each other computationally. Singleton types are then used to simulate dependently typed programming. Examples of this approach include Dependent ML [22], Ωmega =-=[20,19]-=-, Applied Type Systems [7], and Haskell with generalized algebraic datatypes [16]. Singleton types are type families T :I → Type for which each type index i:I uniquely determines the one value of type... |

13 | Foundational typed assembly language with certified garbage collection
- Lin, McCreight, et al.
- 2007
(Show Context)
Citation Context |

2 |
proof irrelevance in modal type theory
- Pfenning, extensionality
- 2001
(Show Context)
Citation Context ...e program, all free occurrences of x in M must appear either inside a type annotation or inside an @ c argument. The typing rules enforce this invariant using the following technique, due to Pfenning =-=[17]-=-. Each λ c -bound variable x is marked with c when it is added to the typing context. This mark is then locally switched off (reset) whenever we check a type annotation or @ c argument. We then requir... |