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

03/06/2020
by   Patrick Bahr, et al.
0

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.

READ FULL TEXT
POST COMMENT

Comments

There are no comments yet.

Authors

page 1

page 2

page 3

page 4

03/14/2019

Simply RaTT: A Fitch-style Modal Calculus for Reactive Programming without Space Leaks

Functional reactive programming (FRP) is a paradigm for programming with...
03/14/2019

Simply RaTT: A Fitch-style Modal Calculus for Reactive Programming

Functional reactive programming (FRP) is a paradigm for programming with...
05/13/2021

Circular Proofs as Processes: Type-Based Termination via Arithmetic Refinements

Type systems for concurrent programs guarantee such desirable properties...
03/19/2019

Semantic programming: method Δ_0^p-enrichments and polynomial computable fixed points

Computer programs fast entered in our live and the questions associated ...
03/19/2019

Semantic programming: method of Δ_0^p-enrichments and polynomial analogue of the Gandy fixed point theorem

Computer programs fast entered in our life and the questions associated ...
12/11/2019

Practical Sized Typing for Coq

Termination of recursive functions and productivity of corecursive funct...
05/14/2018

Predicate Liftings and Functor Presentations in Coalgebraic Expression Languages

We introduce a generic expression language describing behaviours of fini...
This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.