Affiliation:
1. IT University of Copenhagen, Denmark
Abstract
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.
Publisher
Association for Computing Machinery (ACM)
Subject
Safety, Risk, Reliability and Quality,Software
Cited by
9 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Productivity Verification for Functional Programs by Reduction to Termination Verification;Proceedings of the 2024 ACM SIGPLAN International Workshop on Partial Evaluation and Program Manipulation;2024-01-11
2. Asynchronous Modal FRP;Proceedings of the ACM on Programming Languages;2023-08-30
3. Asynchronous Reactive Programming with Modal Types in Haskell;Practical Aspects of Declarative Languages;2023
4. Reactive Programming on the Bare Metal: A Formal Model for a Low-Level Reactive Virtual Machine;Proceedings of the 9th ACM SIGPLAN International Workshop on Reactive and Event-Based Languages and Systems;2022-11-29
5. A Graph-Based Formal Semantics of Reactive Programming from First Principles;Proceedings of the 24th ACM International Workshop on Formal Techniques for Java-like Programs;2022-06-07