论文标题

钻石不是永远的:用守卫的递归中的反应性编程

Diamonds are not forever: Liveness in reactive programming with guarded recursion

论文作者

Bahr, Patrick, Graulund, Christian Uldal, Møgelberg, Rasmus

论文摘要

在设计功能性反应性编程(FRP)的语言时,主要的挑战是为用户提供一个简单,灵活的界面,用于在高级抽象上编写程序,同时确保所有程序都可以用低级语言有效地实现。为了应对这一挑战,已经提出了一个新的模态FRP语言家庭,其中,中Nakano保护的固定点运算符的变体用于编写递归程序,以保证诸如因果关系和生产力之类的属性。作为明显的扩展,还建议将线性时间逻辑(LTL)用作通过咖喱 - 霍华德同构的反应性编程的语言,从而允许在类型的类型中编码终止,可观和公平性等属性。但是,这两个想法相互冲突,因为固定点运算符将不终止的归纳类型引入了应该提供终止保证的归纳类型。 在本文中,我们表明,通过关于LTL的模态时间步长操作员,用于保护递归的递归(而不是等于它们)的子模式,可以获得能够表达能够表达Livices属性的模态类型的系统,同时保留了保护的固定点运算符的功率。我们介绍了Later Lively Ratt,这是一种模态FRP语言,具有守护的固定点运算符和LTL中的“直到”类型构造函数,并展示如何使用事件和公平流进行编程。使用步骤索引的Kripke逻辑关系,我们证明了活泼的Ratt的操作特性,包括生产力和因果关系,以及LTL类型期望的终止和livesition和Livices属性。最后,我们证明了活泼的Ratt的类型系统可以保证没有隐式空间泄漏。

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.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源