当前位置: 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.)
Diamonds are not forever: Liveness in reactive programming with guarded recursion
arXiv - CS - Programming Languages Pub Date : 2020-03-06 , DOI: arxiv-2003.03170
Patrick Bahr, Christian Uldal Graulund, Rasmus M{\o}gelberg

When designing languages for functional reactive programming (FRP) the main challenge is to provide the user with a simple, flexible interface for writing programs on a high level of abstraction while ensuring that all programs can be implemented efficiently in a low-level language. To meet this challenge, a new family of modal FRP languages has been proposed, in which variants of Nakano's guarded fixed point operator are used for writing recursive programs guaranteeing properties such as causality and productivity. As an apparent extension to this it has also been suggested to use Linear Temporal Logic (LTL) as a language for reactive programming through the Curry-Howard isomorphism, allowing properties such as termination, liveness and fairness to be encoded in types. However, these two ideas are in conflict with each other, since the fixed point operator introduces non-termination into the inductive types that are supposed to provide termination guarantees. In this paper we show that by regarding the modal time step operator of LTL a submodality of the one used for guarded recursion (rather than equating them), one can obtain a modal type system capable of expressing liveness properties while retaining the power of the guarded fixed point operator. We introduce the language Lively RaTT, a modal FRP language with a guarded fixed point operator and an `until' type constructor as in LTL, and show how to program with events and fair streams. Using a step-indexed Kripke logical relation we prove operational properties of Lively RaTT including productivity and causality as well as the termination and liveness properties expected of types from LTL. Finally, we prove that the type system of Lively RaTT guarantees the absence of implicit space leaks.

中文翻译:

钻石不是永远的:具有保护递归的反应式编程的活力

在为函数式反应式编程 (FRP) 设计语言时,主要挑战是为用户提供一个简单、灵活的界面,用于在高级抽象上编写程序,同时确保所有程序都可以用低级语言高效实现。为了应对这一挑战,提出了一个新的模态 FRP 语言系列,其中使用了 Nakano 的受保护不动点运算符的变体来编写保证因果关系和生产力等属性的递归程序。作为对此的明显扩展,还建议使用线性时间逻辑 (LTL) 作为通过 Curry-Howard 同构进行反应式编程的语言,允许将终止、活性和公平等属性编码为类型。然而,这两个想法是相互冲突的,因为定点运算符将非终止引入了应该提供终止保证的归纳类型。在本文中,我们表明,通过将 LTL 的模态时间步算子视为用于保护递归的子模态(而不是将它们等同),可以获得一种能够表达活性属性的模态类型系统,同时保留保护递归的能力。定点运算符。我们介绍了 Lively RaTT 语言,这是一种模态 FRP 语言,具有受保护的定点运算符和 LTL 中的“直到”类型构造函数,并展示如何使用事件和公平流进行编程。使用步进索引的 Kripke 逻辑关系,我们证明了 Lively RaTT 的操作属性,包括生产力和因果关系以及 LTL 类型预期的终止和活跃属性。最后,
更新日期:2020-08-21
down
wechat
bug