The taming of the Rew

A type theory with computational assumptions

Journal Article (2021)
Author(s)

Jesper Cockx (TU Delft - Programming Languages)

Nicolas Tabareau (Inria)

Théo Winterhalter (Inria)

Research Group
Programming Languages
Copyright
© 2021 J.G.H. Cockx, Nicolas Tabareau, Théo Winterhalter
DOI related publication
https://doi.org/10.1145/3434341
More Info
expand_more
Publication Year
2021
Language
English
Copyright
© 2021 J.G.H. Cockx, Nicolas Tabareau, Théo Winterhalter
Research Group
Programming Languages
Issue number
POPL
Volume number
5
Reuse Rights

Other than for strictly personal use, it is not permitted to download, forward or distribute the text or part of it, without the consent of the author(s) and/or copyright holder(s), unless the work is under an open content license such as Creative Commons.

Abstract

Dependently typed programming languages and proof assistants such as Agda and Coq rely on computation to automatically simplify expressions during type checking. To overcome the lack of certain programming primitives or logical principles in those systems, it is common to appeal to axioms to postulate their existence. However, one can only postulate the bare existence of an axiom, not its computational behaviour. Instead, users are forced to postulate equality proofs and appeal to them explicitly to simplify expressions, making axioms dramatically more complicated to work with than built-in primitives. On the other hand, the equality reflection rule from extensional type theory solves these problems by collapsing computation and equality, at the cost of having no practical type checking algorithm. This paper introduces Rewriting Type Theory (RTT), a type theory where it is possible to add computational assumptions in the form of rewrite rules. Rewrite rules go beyond the computational capabilities of intensional type theory, but in contrast to extensional type theory, they are applied automatically so type checking does not require input from the user. To ensure type soundness of RTT-as well as effective type checking-we provide a framework where confluence of user-defined rewrite rules can be checked modularly and automatically, and where adding new rewrite rules is guaranteed to preserve subject reduction. The properties of RTT have been formally verified using the MetaCoq framework and an implementation of rewrite rules is already available in the Agda proof assistant.