skip to main content
research-article

Fair reactive programming

Published:08 January 2014Publication History
Skip Abstract Section

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.

Skip Supplemental Material Section

Supplemental Material

d2_right_t6.mp4

References

  1. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  2. T. Altenkirch. Constructions, Inductive Types and Strong Normalization. PhD thesis, University of Edinburgh, November 1993.Google ScholarGoogle Scholar
  3. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  4. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  5. L. Birkedal, A. Bizjak, and J. Schwinghammer. Step-indexed relational reasoning for countable nondeterminism. Submitted, journal version of CSL'11 paper, 2013.Google ScholarGoogle Scholar
  6. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  7. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  8. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  9. J. Donham. Functional reactive programming in OCaml. URL https://github.com/jaked/froc.Google ScholarGoogle Scholar
  10. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  11. 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 ScholarGoogle Scholar
  12. J.-Y. Girard, Y. Lafont, and P. Tayor. Proofs and types. Cambridge University Press, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  14. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  15. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  16. A. Jeffrey. Functional reactive programming with liveness guarantees. In 18th International Confernece on Functional Programming. ACM, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  18. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  19. J.-P. Jouannaud and M. Okada. Abstract data type systems. Theoretical Computer Science, 173(2):349--391, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  21. D. Kozen. Results on the propositional λ-calculus. Theoretical Computer Science, 27(3):333--354, 1983.Google ScholarGoogle ScholarCross RefCross Ref
  22. N. R. Krishnaswami. Higher-order functional reactive programming without spacetime leaks. In 18th International Confernece on Functional Programming. ACM, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  24. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  25. O. Lichtenstein. Decidability, Completeness, and Extensions of Linear Time Temporal Logic. PhD thesis, TheWeizmann Institute of Science, 1991.Google ScholarGoogle Scholar
  26. Z. Luo. An Extended Calculus of Constructions. PhD thesis, University of Edinburgh, 1990.Google ScholarGoogle Scholar
  27. R. Matthes. Extensions of System F by Iteration and Primitive Recursion on Monotone Inductive Types. PhD thesis, University of Munich, 1998.Google ScholarGoogle Scholar
  28. N. P. Mendler. Inductive Definition in Type Theory. PhD thesis, Cornell University, 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  30. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  31. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  32. M. Pouzet. Lucid Synchrone, version 3. Tutorial and reference manual. Université Paris-Sud, LRI, April 2006.Google ScholarGoogle Scholar
  33. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  34. W. W. Tait. Intensional interpretations of functionals of finite type i. The Journal of Symbolic Logic, 32(2):pp. 198--212, 1967.Google ScholarGoogle ScholarCross RefCross Ref

Index Terms

  1. Fair reactive programming

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in

    Full Access

    • Published in

      cover image ACM SIGPLAN Notices
      ACM SIGPLAN Notices  Volume 49, Issue 1
      POPL '14
      January 2014
      661 pages
      ISSN:0362-1340
      EISSN:1558-1160
      DOI:10.1145/2578855
      Issue’s Table of Contents
      • cover image ACM Conferences
        POPL '14: Proceedings of the 41st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages
        January 2014
        702 pages
        ISBN:9781450325448
        DOI:10.1145/2535838

      Copyright © 2014 ACM

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 8 January 2014

      Check for updates

      Qualifiers

      • research-article

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader
    About Cookies On This Site

    We use cookies to ensure that we give you the best experience on our website.

    Learn more

    Got it!