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.
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