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.

Highlights

  • EXCEPTIONAL TRANSLATION AND PARAMETRICITYWe first provide a quick introduction to the key technical ideas of the Exceptional Type Theory (ETT) of Pédrot and Tabareau [2018], on which our technical development is based

  • The contribution of this paper is to present a new type theory, dubbed the Reasonably Exceptional Type Theory (RETT), which supports consistent reasoning about exceptional programs

  • To put consistent reasoning about exceptional terms on a solid type theoretic footing, we propose the Reasonably Exceptional Type Theory (RETT)

Read more

Summary

A Reasonably Exceptional Type Theory

PIERRE-MARIE PÉDROT, Inria, France NICOLAS TABAREAU, Inria, France HANS JACOB FEHRMANN, University of Chile, Chile ÉRIC TANTER, University of Chile, Chile and Inria Paris, France. 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. 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. ACM Reference Format: Pierre-Marie Pédrot, Nicolas Tabareau, Hans Jacob Fehrmann, and Éric Tanter. Lang. 3, ICFP, Article 108 (August 2019), 29 pages. https://doi.org/10.1145/ 3341712

FAILURE IN TYPE THEORY
BACKGROUND
REASONABLY EXCEPTIONAL TYPE THEORY
Negative Fragment
Navigating Between Hierarchies
A SYNTACTIC MODEL OF RETT
Exceptional Layer
Mixed Eliminators
Modalities
IMPLEMENTATION IN COQ
CoqRETT
P as a Type Class
RELATED WORK
CONCLUSION AND FUTURE WORK
Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call