A Graded Modal Dependent Type Theory with a Universe and Erasure, Formalized

Author:

Abel Andreas1ORCID,Danielsson Nils Anders1ORCID,Eriksson Oskar1ORCID

Affiliation:

1. Chalmers University of Technology, Sweden / University of Gothenburg, Sweden

Abstract

We present a graded modal type theory, a dependent type theory with grades that can be used to enforce various properties of the code. The theory has Π-types, weak and strong Σ-types, natural numbers, an empty type, and a universe, and we also extend the theory with a unit type and graded Σ-types. The theory is parameterized by a modality, a kind of partially ordered semiring, whose elements (grades) are used to track the usage of variables in terms and types. Different modalities are possible. We focus mainly on quantitative properties, in particular erasure: with the erasure modality one can mark function arguments as erasable. The theory is fully formalized in Agda. The formalization, which uses a syntactic Kripke logical relation at its core and is based on earlier work, establishes major meta-theoretic properties such as subject reduction, consistency, normalization, and decidability of definitional equality. We also prove a substitution theorem for grade assignment, and preservation of grades under reduction. Furthermore we study an extraction function that translates terms to an untyped λ-calculus and removes erasable content, in particular function arguments with the “erasable” grade. For a certain class of modalities we prove that extraction is sound, in the sense that programs of natural number type have the same value before and after extraction. Soundness of extraction holds also for open programs, as long as all variables in the context are erasable, the context is consistent, and erased matches are not allowed for weak Σ-types.

Funder

Vetenskapsrådet

Publisher

Association for Computing Machinery (ACM)

Subject

Safety, Risk, Reliability and Quality,Software

Reference37 articles.

1. Polarized Subtyping for Sized Types

2. Andreas Abel. 2018. Resourceful Dependent Types. In 24th International Conference on Types for Proofs and Programs, TYPES 2018, Abstracts. 7–8. https://types2018.projj.eu/book-of-abstracts/

3. A unified view of modalities in type systems

4. Andreas Abel, Thierry Coquand, and Bassel Mannaa. 2016. On the Decidability of Conversion in Type Theory. In TYPES 2016, Types for Proofs and Programs, 22nd Meeting, Book of Abstracts. 5–6. http://www.types2016.uns.ac.rs/images/abstracts/abel1.pdf

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

1. Functional Ownership through Fractional Uniqueness;Proceedings of the ACM on Programming Languages;2024-04-29

2. Polynomial Time and Dependent Types;Proceedings of the ACM on Programming Languages;2024-01-05

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

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

www.globalauthorid.com

TOP

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