LTL types FRP: linear-time temporal logic propositions as types, proofs as functional reactive programs

Functional Reactive Programming (FRP) is a form of reactive programming whose model is pure functions over signals. FRP is often expressed in terms of arrows with loops, which is the type class for a Freyd category (that is a premonoidal category with a cartesian centre) equipped with a premonoidal trace. This type system suffices to define the dataflow structure of a reactive program, but does not express its temporal properties. In this paper, we show that Linear-time Temporal Logic (LTL) is a natural extension of the type system for FRP, which constrains the temporal behaviour of reactive programs. We show that a constructive LTL can be defined in a dependently typed functional language, and that reactive programs form proofs of constructive LTL properties. In particular, implication in LTL gives rise to stateless functions on streams, and the "constrains" modality gives rise to causal functions. We show that reactive programs form a partially traced monoidal category, and hence can be given as a form of arrows with loops, where the type system enforces that only decoupled functions can be looped.

[1]  Radha Jagadeesan,et al.  Full Abstraction for PCF , 1994, Inf. Comput..

[2]  Conal Elliott,et al.  Functional Implementations of Continuous Modeled Animation (Expanded Version) , 1998 .

[3]  Zohar Manna,et al.  Completing the Temporal Picture , 1989, Theor. Comput. Sci..

[4]  Matthew Hennessy,et al.  Full Abstraction for a Simple Parallel Programming Language , 1979, MFCS.

[5]  A. W. Roscoe,et al.  A Timed Model for Communicating Sequential Processes , 1986, Theor. Comput. Sci..

[6]  Kedar S. Namjoshi,et al.  On the Competeness of Compositional Reasoning , 2000, CAV.

[7]  Henrik Nilsson,et al.  Safe functional reactive programming through dependent types , 2009, ICFP.

[8]  Robin Milner,et al.  Communication and concurrency , 1989, PHI Series in computer science.

[9]  Rudi van Drunen,et al.  Localization of Random Pulse Point Sources Using Physically Implementable Search Algorithms , 2020, Optoelectronics, Instrumentation and Data Processing.

[10]  Fred Kröger,et al.  Temporal Logic of Programs , 1987, EATCS Monographs on Theoretical Computer Science.

[11]  Nick Benton,et al.  Traced Premonoidal Categories , 2003, RAIRO Theor. Informatics Appl..

[12]  Dirk Pattinson,et al.  Representations of Stream Processors Using Nested Fixed Points , 2009, Log. Methods Comput. Sci..

[13]  P. Selinger A Survey of Graphical Languages for Monoidal Categories , 2009, 0908.3347.

[14]  L. McMillanmcmillan Circular Compositional Reasoning about Liveness , 1999 .

[15]  Nick Benton,et al.  Ultrametric Semantics of Reactive Programs , 2011, 2011 IEEE 26th Annual Symposium on Logic in Computer Science.

[16]  Magnus Carlsson,et al.  Fudgets - Purely Functional Processes with applications to Graphical User Interfaces , 1998 .

[17]  Edmund Robinson,et al.  Premonoidal categories and notions of computation , 1997, Mathematical Structures in Computer Science.

[18]  Antony Courtney,et al.  Genuinely Functional User Interfaces , 2001 .

[19]  David Harel,et al.  Process logic: Expressiveness, decidability, completeness , 1980, 21st Annual Symposium on Foundations of Computer Science (sfcs 1980).

[20]  Ross Paterson,et al.  A new notation for arrows , 2001, ICFP '01.

[21]  Abbas Edalat,et al.  A new representation for exact real numbers , 1997, MFPS.

[22]  Philip J. Scott,et al.  Towards a typed Geometry of Interaction , 2005, Mathematical Structures in Computer Science.

[23]  P. Panangaden,et al.  Nuclear and trace ideals in tensored-categories , 1998, math/9805102.

[24]  Atsushi Igarashi,et al.  Constructive linear-time temporal logic: Proof systems and Kripke semantics , 2011, Inf. Comput..

[25]  Amir Pnueli,et al.  A Choppy Logic , 1986, LICS.

[26]  Wolfgang Jeltsch Signals, Not Generators! , 2009, Trends in Functional Programming.

[27]  Conal Elliott,et al.  Push-pull functional reactive programming , 2009, Haskell.

[28]  Paul Hudak,et al.  Arrows, Robots, and Functional Reactive Programming , 2002, Advanced Functional Programming.

[29]  Hayo Thielecke,et al.  Closed Freyd- and kappa-categories , 1999, ICALP.

[30]  Paul Hudak,et al.  Functional reactive animation , 1997, ICFP '97.

[31]  Julian Rathke,et al.  The Lax Braided Structure of Streaming I/O , 2011, CSL.

[32]  John Hughes,et al.  Generalising monads to arrows , 2000, Sci. Comput. Program..