Propositional Equality for Gradual Dependently Typed Programming

by   Joseph Eremondi, et al.

Gradual dependent types can help with the incremental adoption of dependently typed code by providing a principled semantics for imprecise types and proofs, where some parts have been omitted. Current theories of gradual dependent types, though, lack a central feature of type theory: propositional equality. Lennon-Bertrand et al. show that, when the reflexive proof π‘Ÿπ‘’π‘“π‘™ is the only closed value of an equality type, a gradual extension of CIC with propositional equality violates static observational equivalences. Extensionally-equal functions should be indistinguishable at run time, but the combination of equality and type imprecision allows for contexts that distinguish extensionally-equal but syntactically-different functions. This work presents a gradually typed language that supports propositional equality. We avoid the above issues by devising an equality type where π‘Ÿπ‘’π‘“π‘™ is not the only closed inhabitant. Instead, each equality proof carries a term that is at least as precise as the equated terms, acting as a witness of their plausible equality. These witnesses track partial type information as a program runs, raising errors when that information shows that two equated terms are undeniably inconsistent. Composition of type information is internalized as a construct of the language, and is deferred for function bodies whose evaluation is blocked by variables. By deferring, we ensure that extensionally equal functions compose without error, thereby preventing contexts from distinguishing them. We describe the challenges of designing consistency and precision relations for this system, along with solutions to these challenges. Finally, we prove important metatheory: type-safety, conservative embedding of CIC, canonicity, and the gradual guarantees of Siek et al.


page 1

page 2

page 3

page 4

βˆ™ 11/19/2019

Failure of Normalization in Impredicative Type Theory with Proof-Irrelevant Propositional Equality

In type theory with an impredicative universe of propositions and a proo...
βˆ™ 08/05/2020

Extensional equality preservation and verified generic programming

In verified generic programming, one cannot exploit the structure of con...
βˆ™ 07/10/2021

Approximate Normalization and Eager Equality Checking for Gradual Inductive Families

Harnessing the power of dependently typed languages can be difficult. Pr...
βˆ™ 06/15/2019

Approximate Normalization for Gradual Dependent Types

Dependent types help programmers write highly reliable code. However, th...
βˆ™ 04/18/2019

Cubical Syntax for Reflection-Free Extensional Equality

We contribute XTT, a cubical reconstruction of Observational Type Theory...
βˆ™ 02/17/2021

Predicative Aspects of Order Theory in Univalent Foundations

We investigate predicative aspects of order theory in constructive univa...
βˆ™ 10/31/2021

Size Matters in Univalent Foundations

We investigate predicative aspects of constructive univalent foundations...

Please sign up or login with your details

Forgot password? Click here to reset