A Reasonably Exceptional Type Theory

Abstract : Traditional approaches to compensate for the lack of exceptions in type theories for proof assistants have severe drawbacks from both a programming and a reasoning perspective. Pédrot and Tabareau recently extended the Calculus of Inductive Constructions (CIC) with exceptions. The new exceptional type theory is interpreted by a translation into CIC, covering full dependent elimination, decidable type-checking and canonicity. However, the exceptional theory is inconsistent as a logical system. To recover consistency, Pédrot and Tabareau propose an additional translation that uses parametricity to enforce that all exceptions are caught locally. While this enforcement brings logical expressivity gains over CIC, it completely prevents reasoning about exceptional programs such as partial functions. This work addresses the dilemma between exceptions and consistency in a more flexible manner, with the Reasonably Exceptional Type Theory (RETT). RETT is structured in three layers: (a) the exceptional layer, in which all terms can raise exceptions; (b) the mediation layer, in which exceptional terms must be provably parametric; (c) the pure layer, in which terms are non-exceptional, but can refer to exceptional terms. We present the general theory of RETT, where each layer is realized by a predicative hierarchy of universes, and develop an instance of RETT in Coq: the impure layer corresponds to the predicative universe hierarchy, the pure layer is realized by the impredicative universe of propositions, and the mediation layer is reified via a parametricity type class. RETT is the first full dependent type theory to support consistent reasoning about exceptional terms, and the CoqRETT plugin readily brings this ability to Coq programmers.
Complete list of metadatas

Cited literature [33 references]  Display  Hide  Download

https://hal.inria.fr/hal-02189128
Contributor : Nicolas Tabareau <>
Submitted on : Friday, July 19, 2019 - 10:02:51 AM
Last modification on : Wednesday, December 11, 2019 - 10:36:53 AM

File

icfp19main-p108-p-48a52d2-4176...
Files produced by the author(s)

Identifiers

Citation

Pierre-Marie Pédrot, Nicolas Tabareau, Hans Fehrmann, Éric Tanter. A Reasonably Exceptional Type Theory. Proceedings of the ACM on Programming Languages, ACM, 2019, Issue ICFP, 3, pp.1-29. ⟨10.1145/3341712⟩. ⟨hal-02189128⟩

Share

Metrics

Record views

173

Files downloads

731