跟踪类型中捕获的变量
Tracking Captured Variables in Types
摘要:
类型系统通常表征值的形状,但不表征它们的自由变量。然而,如果可以跟踪引用如何逃逸,则可以保证许多期望的安全属性。例如,如果可以保证能力本身不会超出效果处理程序的作用域,则可以使用能力(一个允许执行效果的值)安全地实现代数效果处理程序。为此,我们研究了$\textrm{CF}_{<:}$演算,一个保守的和轻量级的扩展$\textrm{System F}_{<:}$,跟踪值和它们的引用可以被捕获和逃逸。我们表明,现有的条款在$\textrm{System F}_{<:}$嵌入自然在我们的演算,许多自然的问题可以表示在一个系统中,跟踪变量引用,就像我们在$\textrm{CF}_{<:}$。我们还给出了$\textrm{CF}_{<:}$在Coq中的可靠性的机械化证明。$\textrm{CF}_{<:}$中提供的类型系统足够强大,可以在$\textrm{CF}_{<:}$的许多自然扩展(如基于区域的内存管理、非本地返回和效果处理程序)的上下文中推理安全性。
英文摘要:
Type systems usually characterize the shape of values but not their free variables. However, there are many desirable safety properties one could guarantee if one could track how references can escape. For example, one may implement algebraic effect handlers using capabilities -- a value which permits one to perform the effect -- safely if one can guarantee that the capability itself does not escape the scope bound by the effect handler. To this end, we study the $\textrm{CF}_{<:}$ calculus, a conservative and lightweight extension of $\textrm{System F}_{<:}$, to track how values and their references can be captured and escape. We show that existing terms in $\textrm{System F}_{<:}$ embed naturally in our calculus, and that many natural problems can be expressed in a system that tracks variable references like we do in $\textrm{CF}_{<:}$. We also give mechanized proofs of the soundness properties of $\textrm{CF}_{<:}$ in Coq. The type system presented in $\textrm{CF}_{<:}$ is powerful enough to reason about safety in the context of many natural extensions of $\textrm{CF}_{<:}$ such as region-based memory-management, non-local returns, and effect handlers.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。