当前位置: X-MOL 学术arXiv.cs.PL › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
Tracking Captured Variables in Types
arXiv - CS - Programming Languages Pub Date : 2021-05-25 , DOI: arxiv-2105.11896
Aleksander Boruch-Gruszecki, Jonathan Immanuel Brachthäuser, Edward Lee, Ondřej Lhoták, Martin Odersky

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.

中文翻译:

跟踪类型中的捕获变量

类型系统通常表征值的形状,但不表征其自由变量。但是,如果可以跟踪引用如何逃逸,则可以保证有许多理想的安全属性。例如,如果可以确保功能本身不会逃脱效果处理程序所限制的范围,则可以安全地使用功能(允许人执行效果的值)来实现代数效果处理程序。为此,我们研究了$ \ textrm {CF} _ {<:} $演算,它是$ \ textrm {System F} _ {<:} $的保守轻量级扩展,以跟踪值及其引用的方式被俘和逃脱。我们表明$ \ textrm {System F} _ {<:} $中的现有术语自然地嵌入了我们的演算中,并且可以像在$ \ textrm {CF}中那样,在跟踪变量引用的系统中表达许多自然问题。 _ {<:} $。我们还给出了Coq中$ \ textrm {CF} _ {<:} $的健全性的机械化证明。$ \ textrm {CF} _ {<:} $中提供的类型系统功能强大,足以在$ \ textrm {CF} _ {<:} $的许多自然扩展(例如基于区域的内存)的背景下进行安全性推理。管理,非本地退货和效果处理程序。
更新日期:2021-05-26
down
wechat
bug