一句话:论文拆分可变引用的设计空间,区分对过去/未来分配的依赖,并以类型宇宙层级对应 Kripke 世界构造语义,消除类型-世界循环。
可变高阶引用的语义设计长期存在“类型-世界循环”等难题,现有语义还混淆了引用依赖哪些分配。本文重新解构可变高阶引用的设计空间:除高阶引用与完全基引用之分外,引入分配依赖过去分配还是未来分配的区别。作者将只量化过去分配的引用称为直谓引用;在这类引用以及非高阶非直谓引用中,类型-世界循环消失。论文为设计空间中每个点给出语法与语义:语法借助依赖类型论风格的类型宇宙层级,为被分配项的类型分类并分层分配,每个类型宇宙对应一个语义 Kripke 世界,从而以轻量语法机制设计和限制堆形状。其语义与 region 研究相似,并讨论了宇宙系统与 region 之间的联系。
What are mutable references; what do they mean? The answers to these questions have spawned lots of important theoretical work and form the foundation of many impactful tools. However, existing semantics collapse a key distinction: which allocations does a reference depend on? In this paper, we deconstruct the space of mutable higher-order references. We formalize a novel distinction–splitting the design space of references not only into higher-order vs (full-)ground references, but also dependency of an allocation on past vs future allocations. This distinction is fundamental to a thorny issue that arises in constructing semantic models of mutable references–the type-world circularity. The issue disappears for what we call predicative references, those that only quantify over past, not future, allocations, and for non-higher-order impredicative references. We design a syntax and semantics for each point in our newly described space. The syntax relies on a type universe hierarchy, à la dependent type theory, to kind the types of allocated terms, and stratify allocations. Each type universe corresponds to a semantic Kripke world, giving a lightweight syntactic mechanism to design and restrict heap shapes. The semantics bear a resemblance to work on regions, and suggest some connection between universe systems and regions, which we describe in some detail.