# Synthesizing Functional Reactive Programs

**Authors:** Bernd Finkbeiner, Felix Klein, Ruzica Piskac, Mark Santolucito

arXiv: 1905.09825 · 2019-05-27

## TL;DR

This paper presents a method to synthesize executable functional reactive programs from Temporal Stream Logic specifications, enabling automatic generation of reactive code across software and hardware platforms.

## Contribution

It introduces a novel approach to transform Control Flow Models derived from TSL into FRP code, bridging the gap between formal specifications and practical implementations.

## Key findings

- Successful translation of CFMs into FRP code for desktop, web, and hardware applications.
- Demonstrated applicability on a real-world kitchen timer example.
- Effective integration with existing FRP libraries like Yampa, threepenny-gui, and ClaSH.

## Abstract

Functional Reactive Programming (FRP) is a paradigm that has simplified the construction of reactive programs. There are many libraries that implement incarnations of FRP, using abstractions such as Applicative, Monads, and Arrows. However, finding a good control flow, that correctly manages state and switches behaviors at the right times, still poses a major challenge to developers. An attractive alternative is specifying the behavior instead of programming it, as made possible by the recently developed logic: Temporal Stream Logic (TSL). However, it has not been explored so far how Control Flow Models (CFMs), as synthesized from TSL specifications, can be turned into executable code that is compatible with libraries building on FRP. We bridge this gap, by showing that CFMs are indeed a suitable formalism to be turned into Applicative, Monadic, and Arrowized FRP. We demonstrate the effectiveness of our translations on a real-world kitchen timer application, which we translate to a desktop application using the Arrowized FRP library Yampa, a web application using the Monadic threepenny-gui library, and to hardware using the Applicative hardware description language ClaSH.

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/1905.09825/full.md

## Figures

26 figures with captions in the complete paper: https://tomesphere.com/paper/1905.09825/full.md

## References

51 references — full list in the complete paper: https://tomesphere.com/paper/1905.09825/full.md

---
Source: https://tomesphere.com/paper/1905.09825