当前位置: X-MOL 学术Sci. Comput. Program. › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
Abstracting gradual references
Science of Computer Programming ( IF 1.5 ) Pub Date : 2020-06-08 , DOI: 10.1016/j.scico.2020.102496
Matías Toro , Éric Tanter

Gradual typing is an effective approach to integrate static and dynamic typing, which supports the smooth transition between both extremes via the imprecision of type annotations. Gradual typing has been applied in many scenarios such as objects, subtyping, effects, ownership, typestates, information-flow typing, parametric polymorphism, etc. In particular, the combination of gradual typing and mutable references has been explored by different authors, giving rise to four different semantics—invariant, guarded, monotonic and permissive references. These semantics were specially crafted to reflect different design decisions with respect to precision and efficiency tradeoffs. Since then, progress has been made in the formulation of methodologies to systematically derive gradual counterparts of statically-typed languages, but these have not been applied to study mutable references.

In this article, we explore how the Abstracting Gradual Typing (AGT) methodology, which has been shown to be effective in a variety of settings, applies to mutable references. Starting from a standard statically-typed language with references, we systematically derive with AGT a novel gradual language, called λREF˜. We establish the properties of λREF˜; in particular, it is the first gradual language with mutable references that is proven to satisfy the gradual guarantee. We then compare λREF˜ with the main four existing approaches to gradual references, and show that the application of AGT does justify one of the proposed semantics: we formally prove that the treatment of references in λREF˜ corresponds to the guarded semantics, by presenting a bisimilation with the coercion semantics of Herman et al. In the process, we uncover that any direct application of AGT yields a gradual language that is not space-efficient. We consequently adjust the dynamic semantics of λREF˜ to recover space efficiency. We then show how to extend λREF˜ to support both monotonic and permissive references as well. Finally, we provide the first proof of the dynamic gradual guarantee for monotonic references. As a result, this paper sheds further light on the design space of gradual languages with mutable references and contributes to deepening the understanding of the AGT methodology.



中文翻译:

抽象渐进参考

渐进式打字是一种将静态和动态打字集成在一起的有效方法,它通过不精确的类型注释支持两种极端情况之间的平滑过渡。逐步类型化已应用于许多情况下,例如对象,子类型,效果,所有权,类型状态,信息流类型化,参数多态性等。特别是,不同作者探索了逐步类型化和可变引用的组合,从而产生了到四种不同的语义-不变,防护,单调和允许的引用。这些语义经过特殊设计,以反映有关精度和效率权衡的不同设计决策。从那时起,在系统地制定方法方面取得了进展 派生静态类型语言的渐进对应物,但是这些尚未应用于研究可变引用。

在本文中,我们探讨了已被证明在各种设置中都有效的抽象渐变键入(AGT)方法如何应用于可变引用。从带有引用的标准静态类型语言开始,我们使用AGT系统地推导一种新颖的渐进语言,称为λ参考。我们建立以下属性λ参考; 特别是,它是第一种具有可变引用的渐进语言,被证明能够满足渐进保证。然后我们比较λ参考 现有的主要四种渐进引用方法,并表明AGT的应用确实证明了所提议的语义之一:我们正式证明对引用的处理 λ参考对应于受保护的语义,通过与Herman等人的强制语义进行二义化来实现。在此过程中,我们发现AGT的任何直接应用都会产生一种渐进式的语言,这种语言不节省空间。因此,我们调整了动态语义λ参考恢复空间效率。然后,我们展示如何扩展λ参考同时支持单调和允许的引用。最后,我们为单调引用提供了动态渐进保证的第一个证明。结果,本文进一步阐明了具有可变参考的渐进语言的设计空间,并有助于加深对AGT方法论的理解。

更新日期:2020-06-08
down
wechat
bug