Abstract
Functional Reactive Programming (FRP) models reactive systems with events and signals, which have previously been observed to correspond to the "eventually" and "always" modalities of linear temporal logic (LTL). In this paper, we define a constructive variant of LTL with least fixed point and greatest fixed point operators in the spirit of the modal mu-calculus, and give it a proofs-as-programs interpretation as a foundational calculus for reactive programs. Previous work emphasized the propositions-as-types part of the correspondence between LTL and FRP; here we emphasize the proofs-as-programs part by employing structural proof theory. We show that the type system is expressive enough to enforce liveness properties such as the fairness of schedulers and the eventual delivery of results. We illustrate programming in this calculus using (co)iteration operators. We prove type preservation of our operational semantics, which guarantees that our programs are causal. We give also a proof of strong normalization which provides justification that our programs are productive and that they satisfy liveness properties derived from their types.
Supplemental Material
- A. Abel and T. Altenkirch. A predicative strong normalisation proof for a lambda-calculus with interleaving inductive types. In TYPES, pages 21--40, 1999. Google Scholar
Digital Library
- T. Altenkirch. Constructions, Inductive Types and Strong Normalization. PhD thesis, University of Edinburgh, November 1993.Google Scholar
- G. Berry and L. Cosserat. The esterel synchronous programming language and its mathematical semantics. In Seminar on Concurrency, Carnegie-Mellon University, pages 389--448, London, UK, UK, 1985. Springer-Verlag. ISBN 3-540-15670-4. Google Scholar
Digital Library
- L. Birkedal, R. E. Mogelberg, J. Schwinghammer, and K. Stovring. First steps in synthetic guarded domain theory: Step-indexing in the topos of trees. In Proceedings of the 26th Annual IEEE Symposium on Logic in Computer Science (LICS), pages 55--64. IEEE Computer Society, 2011. Google Scholar
Digital Library
- L. Birkedal, A. Bizjak, and J. Schwinghammer. Step-indexed relational reasoning for countable nondeterminism. Submitted, journal version of CSL'11 paper, 2013.Google Scholar
- P. Caspi, D. Pilaud, N. Halbwachs, and J. A. Plaice. Lustre: a declarative language for real-time programming. In Proceedings of the 14th ACM SIGACT-SIGPLAN Symposium on Principles of Programming Languages, POPL '87, pages 178--188. ACM, 1987. Google Scholar
Digital Library
- G. H. Cooper and S. Krishnamurthi. Embedding dynamic dataflow in a call-by-value language. In Proceedings of the 15th European Conference on Programming Languages and Systems, ESOP'06, pages 294--308. Springer-Verlag, 2006. Google Scholar
Digital Library
- A. Courtney. Frappé functional reactive programming in java. In Proceedings of the Third International Symposium on Practical Aspects of Declarative Languages, PADL '01, pages 29--44. Springer-Verlag, 2001. Google Scholar
Digital Library
- J. Donham. Functional reactive programming in OCaml. URL https://github.com/jaked/froc.Google Scholar
- C. Elliott and P. Hudak. Functional reactive animation. In Proceedings of the second ACM SIGPLAN International Conference on Functional Programming, pages 263--273. ACM, 1997. Google Scholar
Digital Library
- J. Y. Girard. Interprétation fonctionnelle et elimination des coupures de l'arithmtique d'ordre supérieur. These d'état, Université de Paris 7, 1972.Google Scholar
- J.-Y. Girard, Y. Lafont, and P. Tayor. Proofs and types. Cambridge University Press, 1990. Google Scholar
Digital Library
- H. Hiroshi Nakano. A modality for recursion. In Proceedings of the 15th Annual IEEE Symposium on Logic in Computer Science, pages 255--266. IEEE Computer Society, 2000. Google Scholar
Digital Library
- A. Jeffrey. LTL types FRP: linear-time temporal logic propositions as types, proofs as functional reactive programs. In Proceedings of the sixth Workshop on Programming Languages meets Program Verification, pages 49--60. ACM, 2012. Google Scholar
Digital Library
- A. Jeffrey. Causality for free! parametricity implies causality for functional reactive programs. In Proceedings of the seventh Workshop on Programming Languages meets Program Verification, pages 57--68. ACM, 2013. Google Scholar
Digital Library
- A. Jeffrey. Functional reactive programming with liveness guarantees. In 18th International Confernece on Functional Programming. ACM, 2013. Google Scholar
Digital Library
- W. Jeltsch. Towards a common categorical semantics for linear-time temporal logic and functional reactive programming. Electronic Notes in Theoretical Computer Science, 286(0):229--242, 2012. Google Scholar
Digital Library
- W. Jeltsch. Temporal logic with until: Functional reactive programming with processes and concrete process categories. In Proceedings of the seventh Workshop on Programming Languages meets Program Verification, pages 69--78. ACM, 2013. Google Scholar
Digital Library
- J.-P. Jouannaud and M. Okada. Abstract data type systems. Theoretical Computer Science, 173(2):349--391, 1997. Google Scholar
Digital Library
- K. Kojima and A. Igarashi. Constructive linear-time temporal logic: Proof systems and kripke semantics. Information and Computation, 209(12):1491--1503, 2011. ISSN 0890-5401. ¡ce:title¿Intuitionistic Modal Logic and Applications (IMLA 2008)¡/ce:title¿. Google Scholar
Digital Library
- D. Kozen. Results on the propositional λ-calculus. Theoretical Computer Science, 27(3):333--354, 1983.Google Scholar
Cross Ref
- N. R. Krishnaswami. Higher-order functional reactive programming without spacetime leaks. In 18th International Confernece on Functional Programming. ACM, 2013. Google Scholar
Digital Library
- N. R. Krishnaswami and N. Benton. Ultrametric semantics of reactive programs. In Proceedings of the 2011 IEEE 26th Annual Symposium on Logic in Computer Science, pages 257--266. IEEE Computer Society, 2011. Google Scholar
Digital Library
- N. R. Krishnaswami, N. Benton, and J. Hoffmann. Higher-order functional reactive programming in bounded space. In Proceedings of the 39th annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 45--58. ACM, 2012. Google Scholar
Digital Library
- O. Lichtenstein. Decidability, Completeness, and Extensions of Linear Time Temporal Logic. PhD thesis, TheWeizmann Institute of Science, 1991.Google Scholar
- Z. Luo. An Extended Calculus of Constructions. PhD thesis, University of Edinburgh, 1990.Google Scholar
- R. Matthes. Extensions of System F by Iteration and Primitive Recursion on Monotone Inductive Types. PhD thesis, University of Munich, 1998.Google Scholar
- N. P. Mendler. Inductive Definition in Type Theory. PhD thesis, Cornell University, 1988. Google Scholar
Digital Library
- H. Nilsson, A. Courtney, and J. Peterson. Functional reactive programming, continued. In Proceedings of the 2002 ACM SIGPLAN workshop on Haskell, pages 51--64. ACM, 2002. Google Scholar
Digital Library
- D. M. R. Park. Concurrency and automata on infinite sequences. In P. Deussen, editor, Theoretical Computer Science, Proceedings of the 5th GI-Conference, Lecture Notes in Computer Science (LNCS 104, pages 167--183. Springer, 1981. Google Scholar
Digital Library
- A. Pnueli. The temporal logic of programs. In Proceedings of the 18th Annual Symposium on Foundations of Computer Science, pages 46--57. IEEE Computer Society, 1977. Google Scholar
Digital Library
- M. Pouzet. Lucid Synchrone, version 3. Tutorial and reference manual. Université Paris-Sud, LRI, April 2006.Google Scholar
- P. G. Severi and F.-J. J. de Vries. Pure type systems with corecursion on streams: from finite to infinitary normalisation. SIGPLAN Not., 47 (9):141--152, Sept. 2012. ISSN 0362-1340. Google Scholar
Digital Library
- W. W. Tait. Intensional interpretations of functionals of finite type i. The Journal of Symbolic Logic, 32(2):pp. 198--212, 1967.Google Scholar
Cross Ref
Index Terms
Fair reactive programming
Recommendations
Fair reactive programming
POPL '14: Proceedings of the 41st ACM SIGPLAN-SIGACT Symposium on Principles of Programming LanguagesFunctional Reactive Programming (FRP) models reactive systems with events and signals, which have previously been observed to correspond to the "eventually" and "always" modalities of linear temporal logic (LTL). In this paper, we define a constructive ...
Towards a Common Categorical Semantics for Linear-Time Temporal Logic and Functional Reactive Programming
Linear-time temporal logic (LTL) and functional reactive programming (FRP) are related via a Curry-Howard correspondence. Based on this observation, we develop a common categorical semantics for a subset of LTL and its corresponding flavor of FRP. We ...
Functional reactive types
CSL-LICS '14: Proceedings of the Joint Meeting of the Twenty-Third EACSL Annual Conference on Computer Science Logic (CSL) and the Twenty-Ninth Annual ACM/IEEE Symposium on Logic in Computer Science (LICS)Functional Reactive Programming (FRP) is an approach to streaming data with a pure functional semantics as time-indexed values. In previous work, we showed that Linear-time Temporal Logic (LTL) can be used as a type system for discrete-time FRP, and ...







Comments