Graded Type Theory provides a mechanism to track and reason about resource usage in type systems. In this paper, we develop GraD, a novel version of such a graded dependent type system that includes functions, tensor products, additive sums, and a unit type. Since standard operational semantics is resource-agnostic, we develop a heap-based operational semantics and prove a soundness theorem that shows correct accounting of resource usage. Several useful properties, including the standard type soundness theorem, non-interference of irrelevant resources in computation and single pointer property for linear resources, can be derived from this theorem. We hope that our work will provide a base for integrating linearity, irrelevance and dependent types in practical programming languages like Haskell.
翻译:在本文中,我们开发了GraD, 这是一种新型的分级依赖型系统, 包括功能、 高产品、 添加量和单位类型。 由于标准的操作语义是资源不可知性的, 我们开发了一个基于堆积的操作语义, 并证明是一个正确计算资源使用情况的稳健性理论。 一些有用的属性, 包括标准类型稳健性理论、 计算中不相关的资源不受干扰, 以及线性资源的单一指针属性, 可以从该理论中衍生出来。 我们希望我们的工作将为将直线性语言( 如Haskell)的直线性、 不相干性和依赖类型整合提供一个基础。