arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2307.13844cs.PL
收藏

多态可达性类型:追踪高阶泛型程序中的新鲜性、别名与分离

Polymorphic Reachability Types: Tracking Freshness, Aliasing, and Separation in Higher-Order Generic Programs

Guannan Wei, Oliver Bračevac, Songlin Jia, Yuyan Bao, Tiark Rompf

AI总结:

本文重新设计可达性追踪,仅跟踪单步可达变量并按需计算传递闭包,引入新鲜性限定符,实现精确、健全且参数化的可达性多态,并在 Coq 中证明类型健全性与分离保持。

摘要:

可达性类型是最近提出的一种方案,在扩展到高阶但单态的场景中展现出潜力,在受分离逻辑启发的基底之上追踪别名和分离。先前的 $λ^*$ 可达性类型系统用可达变量集合限定类型,并保证如果两个项具有不相交的限定符则它们分离。然而,朴素地扩展类型多态和/或精确可达性多态是不健全的,使得 $λ^*$ 不适合在实际语言中采用。结合可达性和精确、健全且参数化的类型多态仍然是一个开放挑战。本文重新思考了可达性追踪的设计,并提出了解决可达性多态这一关键挑战的方案。与原始设计中始终追踪可达变量的传递闭包不同,我们仅追踪单步可达的变量,仅在必要时计算传递闭包,从而保留已知变量上的可达性链,这些链可以通过替换进行细化。为了实现这一特性,我们引入了一种新的新鲜性限定符,它指示其可达性集合在求值步骤中可能增长的变量。这些想法产生了带有精确轻量级(即无量词)可达性多态的简单类型 $λ^\diamond$-演算,以及带有类型和可达性限定符上有界参数多态的 $\mathsf{F}_{<:}^\diamond$-演算。我们在 Coq 中证明了类型健全性和分离性质的保持。

英文摘要:

Reachability types are a recent proposal that has shown promise in scaling to higher-order but monomorphic settings, tracking aliasing and separation on top of a substrate inspired by separation logic. The prior $λ^*$ reachability type system qualifies types with sets of reachable variables and guarantees separation if two terms have disjoint qualifiers. However, naive extensions with type polymorphism and/or precise reachability polymorphism are unsound, making $λ^*$ unsuitable for adoption in real languages. Combining reachability and type polymorphism that is precise, sound, and parametric remains an open challenge. This paper presents a rethinking of the design of reachability tracking and proposes a solution to the key challenge of reachability polymorphism. Instead of always tracking the transitive closure of reachable variables as in the original design, we only track variables reachable in a single step and compute transitive closures only when necessary, thus preserving chains of reachability over known variables that can be refined using substitution. To enable this property, we introduce a new freshness qualifier, which indicates variables whose reachability sets may grow during evaluation steps. These ideas yield the simply-typed $λ^\diamond$-calculus with precise lightweight, i.e., quantifier-free, reachability polymorphism, and the $\mathsf{F}_{<:}^\diamond$-calculus with bounded parametric polymorphism over types and reachability qualifiers. We prove type soundness and a preservation of separation property in Coq.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑