Propositional equality for gradual dependently typed programming

Author:

Eremondi Joseph1ORCID,Garcia Ronald1ORCID,Tanter Éric2ORCID

Affiliation:

1. University of British Columbia, Canada

2. University of Chile, Chile

Abstract

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 refl is the only closed value of an equality type, a gradual extension of the Calculus of Inductive Constructions (CIC) with propositional equality violates static observational equivalences. Extensionally-equal functions should be indistinguishable at run time, but they can be distinguished using a combination of equality and type imprecision. This work presents a gradual dependently typed language that supports propositional equality. We avoid the above issues by devising an equality type of which refl is not the only closed inhabitant. Instead, each equality proof is accompanied by 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. We thus 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, weak canonicity, and the gradual guarantees of Siek et al., which ensure that reducing a program’s precision introduces no new static or dynamic errors.

Funder

CONICYT FONDECYT

Publisher

Association for Computing Machinery (ACM)

Subject

Safety, Risk, Reliability and Quality,Software

Reference35 articles.

1. Observational equality, now!

2. Abstracting gradual typing moving forward: precise and space-efficient

3. Edwin Brady. 2017. Type-driven development with Idris. Manning. isbn:9781617293023 https://www.manning.com/books/type-driven-development-with-idris Edwin Brady. 2017. Type-driven development with Idris. Manning. isbn:9781617293023 https://www.manning.com/books/type-driven-development-with-idris

4. Partial type equivalences for verified dependent interoperability

5. Foundations of dependent interoperability

Cited by 4 articles. 订阅此论文施引文献 订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献

1. Gradual Indexed Inductive Types;Proceedings of the ACM on Programming Languages;2024-08-15

2. GTP Benchmarks for Gradual Typing Performance;Proceedings of the 2023 ACM Conference on Reproducibility and Replicability;2023-06-27

3. Live Pattern Matching with Typed Holes;Proceedings of the ACM on Programming Languages;2023-04-06

4. A reasonably gradual type theory;Proceedings of the ACM on Programming Languages;2022-08-29

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

"同舟云学术"是以全球学者为主线,采集、加工和组织学术论文而形成的新型学术文献查询和分析系统,可以对全球学者进行文献检索和人才价值评估。用户可以通过关注某些学科领域的顶尖人物而持续追踪该领域的学科进展和研究前沿。经过近期的数据扩容,当前同舟云学术共收录了国内外主流学术期刊6万余种,收集的期刊论文及会议论文总量共计约1.5亿篇,并以每天添加12000余篇中外论文的速度递增。我们也可以为用户提供个性化、定制化的学者数据。欢迎来电咨询!咨询电话:010-8811{复制后删除}0370

www.globalauthorid.com

TOP

Copyright © 2019-2024 北京同舟云网络信息技术有限公司
京公网安备11010802033243号  京ICP备18003416号-3