skip to main content
research-article
Open Access

Fault tolerant functional reactive programming (functional pearl)

Published:30 July 2018Publication History
Skip Abstract Section

Abstract

Highly critical application domains, like medicine and aerospace, require the use of strict design, implementation and validation techniques. Functional languages have been used in these domains to develop synchronous dataflow programming languages for reactive systems. Causal stream functions and Functional Reactive Programming capture the essence of those languages in a way that is both elegant and robust.

To guarantee that critical systems can operate under high stress over long periods of time, these applications require clear specifications of possible faults and hazards, and how they are being handled. Modeling failure is straightforward in functional languages, and many Functional Reactive abstractions incorporate support for failure or termination. However, handling unknown types of faults, and incorporating fault tolerance into Functional Reactive Programming, requires a different construction and remains an open problem.

This work presents extensions to an existing functional reactive abstraction to facilitate tagging reactive transformations with hazard tags or confidence levels. We present a prototype framework to quantify the reliability of a reactive construction, by means of numeric factors or probability distributions, and demonstrate how to aid the design of fault-tolerant systems, by constraining the allowed reliability to required boundaries. By applying type-level programming, we show that it is possible to improve static analysis and have compile-time guarantees of key aspects of fault tolerance. Our approach is powerful enough to be used in systems with realistic complexity, and flexible enough to be used to guide their analysis and design, to test system properties, to verify fault tolerance properties, to perform runtime monitoring, to implement fault tolerance during execution and to address faults during runtime. We present implementations in Haskell and in Idris.

Skip Supplemental Material Section

Supplemental Material

a96-perez.webm

webm

78.7 MB

References

  1. 1992. DO-178B: Software Considerations in Airborne Systems and Equipment Certification. (1992).Google ScholarGoogle Scholar
  2. Algirdas Avižienis. 1967. Design of Fault-tolerant Computers. In Proceedings of the November 14-16, 1967, Fall Joint Computer Conference (AFIPS ’67 (Fall)). ACM, New York, NY, USA, 733–743.Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Algirdas Avižienis. 1976. Fault-tolerant systems. IEEE Trans. Computers 25, 12 (1976), 1304–1312. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Manuel Bärenz and Ivan Perez. 2018. Rhine - FRP with type-level clocks. In Haskell Symposium. (Submitted).Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Manuel Bärenz, Ivan Perez, and Henrik Nilsson. 2016. Mathematical Properties of Monadic Stream Functions. http: //cs.nott.ac.uk/~ixp/papers/msfmathprops.pdf . (2016).Google ScholarGoogle Scholar
  6. Gérard Berry, Amar Bouali, Xavier Fornari, Emmanuel Ledinot, Eric Nassor, and Robert De Simone. 2000. Esterel: A formal method applied to avionic software development. Science of Computer Programming 36, 1 (2000), 5–25. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Frédéric Boussinot and Robert De Simone. 1991. The ESTEREL language. Proc. IEEE 79, 9 (1991), 1293–1304.Google ScholarGoogle ScholarCross RefCross Ref
  8. Jan Bracker and Henrik Nilsson. 2015. Polymonad Programming in Haskell. In Proceedings of the 27th Symposium on the Implementation and Application of Functional Programming Languages (IFL ’15). ACM, New York, NY, USA, Article 3, 12 pages. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Jan Bracker and Henrik Nilsson. 2016. Supermonads: One Notion to Bind Them All. In Proceedings of the 9th International Symposium on Haskell (Haskell 2016). ACM, New York, NY, USA, 158–169. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Edwin Brady. 2013. Programming and reasoning with algebraic effects and dependent types. In ACM SIGPLAN Notices, Vol. 48. ACM, 133–144. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Ricky W. Butler. 2008. A Primer on Architectural Level Fault Tolerance. Technical Report NASA/TM-2008-215108, L-19403. NASA Langley Research Center.Google ScholarGoogle Scholar
  12. Koen Claessen and John Hughes. 2000. QuickCheck: A Lightweight Tool for Random Testing of Haskell Programs. In Proceedings of the Fifth ACM SIGPLAN International Conference on Functional Programming (ICFP ’00). ACM, New York, NY, USA, 268–279. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Antony Courtney, Henrik Nilsson, and John Peterson. 2003. The Yampa arcade. In Haskell Workshop. 7–18. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Judith Crow and Ben Di Vito. 1998. Formalizing Space Shuttle software requirements: Four case studies. ACM Transactions on Software Engineering and Methodology (TOSEM) 7, 3 (1998), 296–332. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Ben L Di Vito. 1996. Formalizing new navigation requirements for NASA’s space shuttle. In International Symposium of Formal Methods Europe. Springer, 160–178. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Ben L Di Vito. 1999. A model of cooperative noninterference for integrated modular avionics. In Dependable Computing for Critical Applications 7, 1999. IEEE, 269–286. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Ben L DiVito and Larry W Roberts. 1996. Using formal methods to assist in the requirements analysis of the space shuttle GPS change request. (1996).Google ScholarGoogle Scholar
  18. Francois-Xavier Dormoy. 2008. Scade 6: a model based solution for safety critical software development. In Proceedings of the 4th European Congress on Embedded Real Time Software (ERTSâĂŹ08). 1–9.Google ScholarGoogle Scholar
  19. Bruno Dutertre and Victoria Stavridou. 1997. Formal requirements analysis of an avionics control system. IEEE Transactions on Software Engineering 23, 5 (1997), 267–278. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Conal Elliott and Paul Hudak. 1997. Functional Reactive Animation. In ACM SIGPLAN Notices, Vol. 32(8). 263–273. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Jeff Epstein, Andrew P Black, and Simon Peyton-Jones. 2011. Towards Haskell in the cloud. In ACM SIGPLAN Notices, Vol. 46. ACM, 118–129. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Martin Erwig and Steve Kollmansberger. 2006. Functional pearls: Probabilistic functional programming in Haskell. Journal of Functional Programming 16, 1 (2006), 21–34. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Nicholas Halbwachs, Paul Caspi, Pascal Raymond, and Daniel Pilaud. 1991. The synchronous data flow programming language LUSTRE. Proc. IEEE 79, 9 (1991), 1305–1320.Google ScholarGoogle Scholar
  24. Frank Huch and Ulrich Norbisrath. 2000. Distributed programming in Haskell with ports. In Symposium on Implementation and Application of Functional Languages. Springer, 107–121. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. John Hughes. 2000. Generalising monads to arrows. Science of Computer Programming 37, 1 (2000), 67 – 111. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Shin-ya Katsumata. 2014. Parametric effect monads and semantics of effect systems. ACM SIGPLAN Notices 49, 1 (2014), 633–645. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Oleg Kiselyov, Amr Sabry, and Cameron Swords. 2013. Extensible effects: an alternative to monad transformers. In ACM SIGPLAN Notices, Vol. 48. ACM, 59–70. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Gerwin Klein, June Andronick, Kevin Elphinstone, Toby Murray, Thomas Sewell, Rafal Kolanski, and Gernot Heiser. 2014. Comprehensive formal verification of an OS microkernel. ACM Transactions on Computer Systems (TOCS) 32, 1 (2014), 2. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Gerwin Klein, Kevin Elphinstone, Gernot Heiser, June Andronick, David Cock, Philip Derrin, Dhammika Elkaduwe, Kai Engelhardt, Rafal Kolanski, Michael Norrish, et al. 2009. seL4: Formal verification of an OS kernel. In Proceedings of the ACM SIGOPS 22nd symposium on Operating systems principles. ACM, 207–220. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Sheng Liang, Paul Hudak, and Mark Jones. 1995a. Monad transformers and modular interpreters. In Symposium on Principles of programming languages. 333–343. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Sheng Liang, Paul Hudak, and Mark Jones. 1995b. Monad transformers and modular interpreters. In Proceedings of the 22nd ACM SIGPLAN-SIGACT symposium on Principles of programming languages. ACM, 333–343. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Patrick Lincoln and John Rushby. {n. d.}. Formal verification of an interactive consistency algorithm for the Draper FTP architecture under a hybrid fault model. In Computer Assurance, 1994. COMPASS’94 Safety, Reliability, Fault Tolerance, Concurrency and Real Time, Security. Proceedings of the Ninth Annual Conference on. IEEE, 107–120.Google ScholarGoogle Scholar
  33. Patrick Lincoln and John Rushby. 1993. A formally verified algorithm for interactive consistency under a hybrid fault model. In Fault-Tolerant Computing, 1993. FTCS-23. Digest of Papers., The Twenty-Third International Symposium on. IEEE, 402–411. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. Patrick Maier, Robert Stewart, and Phil Trinder. 2014. The HdpH DSLs for Scalable Reliable Computation. In Proceedings of the 2014 ACM SIGPLAN Symposium on Haskell (Haskell ’14). ACM, New York, NY, USA, 65–76. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. Henrik Nilsson, Antony Courtney, and John Peterson. 2002. Functional reactive programming, continued. In Haskell Workshop. 51–64. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. Dominic Orchard and Tomas Petricek. 2014. Embedding Effect Systems in Haskell. In Proceedings of the 2014 ACM SIGPLAN Symposium on Haskell (Haskell ’14). ACM, New York, NY, USA, 13–24. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. Dominic Orchard and Tomas Petricek. 2015. Embedding effect systems in Haskell. ACM SIGPLAN Notices 49, 12 (2015), 13–24. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. Dominic A. Orchard, Tomas Petricek, and Alan Mycroft. 2014. The semantic marriage of monads and effects. CoRR abs/1401.5391 (2014). arXiv: 1401.5391 http://arxiv.org/abs/1401.5391Google ScholarGoogle Scholar
  39. Sam Owre, Sreeranga Rajan, John M Rushby, Natarajan Shankar, and Mandayam Srivas. 1996. PVS: Combining specification, proof checking, and model checking. In International Conference on Computer Aided Verification. Springer, 411–414. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. S. Owre, J. M. Rushby, , and N. Shankar. 1992. PVS: A Prototype Verification System. In 11th International Conference on Automated Deduction (CADE) (Lecture Notes in Artificial Intelligence), Deepak Kapur (Ed.), Vol. 607. Springer-Verlag, Saratoga, NY, 748–752. http://www.csl.sri.com/papers/cade92-pvs/ Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. Sam Owre, Natarajan Shankar, John M Rushby, and David WJ Stringer-Calvert. {n. d.}. PVS language reference. ({n. d.}).Google ScholarGoogle Scholar
  42. Bruno Pagano, Olivier Andrieu, Thomas Moniot, Benjamin Canou, Emmanuel Chailloux, Philippe Wang, Pascal Manoury, and Jean-Louis Colaço. 2009. Experience Report: Using Objective Caml to Develop Safety-critical Embedded Tools in a Certification Framework. In Proceedings of the 14th ACM SIGPLAN International Conference on Functional Programming (ICFP ’09). ACM, New York, NY, USA, 215–220. Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. Ivan Perez. 2017. Back to the Future: Time Travel in FRP. In Proceedings of the 10th ACM SIGPLAN International Haskell Symposium (Haskell 2017). ACM, New York, NY, USA, 12. Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. Ivan Perez, Manuel Bärenz, and Henrik Nilsson. 2016. Functional Reactive Programming, Refactored. In Proceedings of the 9th International Symposium on Haskell (Haskell 2016). ACM, New York, NY, USA, 33–44. Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. Ivan Perez and Henrik Nilsson. 2017. Testing and Debugging Functional Reactive Programming. Proc. ACM Program. Lang. 1, ICFP, Article 2 (Aug. 2017), 27 pages. Google ScholarGoogle ScholarDigital LibraryDigital Library
  46. Holger Pfeifer, Detlef Schwier, and Friedrich W Von Henke. 1999. Formal verification for time-triggered clock synchronization. In Dependable Computing for Critical Applications 7, 1999. IEEE, 207–226. Google ScholarGoogle ScholarDigital LibraryDigital Library
  47. Lee Pike, Alwyn Goodloe, Robin Morisset, and Sebastian Niller. 2010. Copilot: a hard real-time runtime monitor. In International Conference on Runtime Verification. Springer, 345–359. Google ScholarGoogle ScholarDigital LibraryDigital Library
  48. Lee Pike, Sebastian Niller, and Nis Wegmann. 2012. Runtime Verification for Ultra-Critical Systems. In Runtime Verification, Sarfraz Khurshid and Koushik Sen (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg, 310–324. Google ScholarGoogle ScholarDigital LibraryDigital Library
  49. John Rushby. {n. d.}. PVS Bibliography. http://pvs.csl.sri.com/documentation.shtml . ({n. d.}).Google ScholarGoogle Scholar
  50. Butler RW. 1996. An introduction to requirements capture using PVS: Specification of a simple autopilot. (1996).Google ScholarGoogle Scholar
  51. Mike Spivey. 1990. A functional theory of exceptions. Science of computer programming 14, 1 (1990), 25–42. Google ScholarGoogle ScholarDigital LibraryDigital Library
  52. Robert Stewart. 2013. Reliable massively parallel symbolic computing: fault tolerance for a distributed Haskell. Ph.D. Dissertation. Heriot-Watt University.Google ScholarGoogle Scholar
  53. Robert Stewart, Patrick Maier, and Phil Trinder. 2016. Transparent fault tolerance for scalable functional computation. Journal of Functional Programming 26 (2016).Google ScholarGoogle Scholar
  54. Robert Stewart, Phil Trinder, and Patrick Maier. 2013. Supervised Workpools for Reliable Massively Parallel Computing. In Trends in Functional Programming, Hans-Wolfgang Loidl and Ricardo Peña (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg, 247–262. Google ScholarGoogle ScholarDigital LibraryDigital Library
  55. Phil Trinder, Robert Pointon, and Hans-Wolfgang Loidl. 2000. Towards Runtime System Level Fault Tolerance for a Distributed Functional Language. Trends in Functional Programming 2 (2000), 103.Google ScholarGoogle Scholar
  56. Steve Vinoski. 2007. Reliability with Erlang. IEEE Internet Computing 11, 6 (2007). Google ScholarGoogle ScholarDigital LibraryDigital Library
  57. Philip Wadler. 1985. How to replace failure by a list of successes. In Conference on Functional Programming Languages and Computer Architecture. Springer, 113–128. Google ScholarGoogle ScholarDigital LibraryDigital Library
  58. David Walker, Lester Mackey, Jay Ligatti, George A. Reis, and David I. August. 2006. Static Typing for a Faulty Lambda Calculus. In Proceedings of the Eleventh ACM SIGPLAN International Conference on Functional Programming (ICFP ’06). ACM, New York, NY, USA, 38–49. Google ScholarGoogle ScholarDigital LibraryDigital Library
  59. Libin Xu, Yuebin Bai, Kun Cheng, Lingyu Ge, Danning Nie, Lijun Zhang, and Wenjia Liu. 2016. Towards Fault-Tolerant RealTime Scheduling in the seL4 Microkernel. In High Performance Computing and Communications; IEEE 14th International Conference on Smart City; IEEE 2nd International Conference on Data Science and Systems (HPCC/SmartCity/DSS), 2016 IEEE 18th International Conference on. IEEE, 711–718.Google ScholarGoogle Scholar

Index Terms

  1. Fault tolerant functional reactive programming (functional pearl)

        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 Proceedings of the ACM on Programming Languages
          Proceedings of the ACM on Programming Languages  Volume 2, Issue ICFP
          September 2018
          1133 pages
          EISSN:2475-1421
          DOI:10.1145/3243631
          Issue’s Table of Contents

          Copyright © 2018 ACM

          Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 30 July 2018
          Published in pacmpl Volume 2, Issue ICFP

          Permissions

          Request permissions about this article.

          Request Permissions

          Check for updates

          Qualifiers

          • research-article

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader