Nothing Special   »   [go: up one dir, main page]

skip to main content
research-article
Open access

Fault tolerant functional reactive programming (functional pearl)

Published: 30 July 2018 Publication History

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.

Supplementary Material

WEBM File (a96-perez.webm)

References

[1]
1992. DO-178B: Software Considerations in Airborne Systems and Equipment Certification. (1992).
[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.
[3]
Algirdas Avižienis. 1976. Fault-tolerant systems. IEEE Trans. Computers 25, 12 (1976), 1304–1312.
[4]
Manuel Bärenz and Ivan Perez. 2018. Rhine - FRP with type-level clocks. In Haskell Symposium. (Submitted).
[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).
[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.
[7]
Frédéric Boussinot and Robert De Simone. 1991. The ESTEREL language. Proc. IEEE 79, 9 (1991), 1293–1304.
[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.
[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.
[10]
Edwin Brady. 2013. Programming and reasoning with algebraic effects and dependent types. In ACM SIGPLAN Notices, Vol. 48. ACM, 133–144.
[11]
Ricky W. Butler. 2008. A Primer on Architectural Level Fault Tolerance. Technical Report NASA/TM-2008-215108, L-19403. NASA Langley Research Center.
[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.
[13]
Antony Courtney, Henrik Nilsson, and John Peterson. 2003. The Yampa arcade. In Haskell Workshop. 7–18.
[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.
[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.
[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.
[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).
[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.
[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.
[20]
Conal Elliott and Paul Hudak. 1997. Functional Reactive Animation. In ACM SIGPLAN Notices, Vol. 32(8). 263–273.
[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.
[22]
Martin Erwig and Steve Kollmansberger. 2006. Functional pearls: Probabilistic functional programming in Haskell. Journal of Functional Programming 16, 1 (2006), 21–34.
[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.
[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.
[25]
John Hughes. 2000. Generalising monads to arrows. Science of Computer Programming 37, 1 (2000), 67 – 111.
[26]
Shin-ya Katsumata. 2014. Parametric effect monads and semantics of effect systems. ACM SIGPLAN Notices 49, 1 (2014), 633–645.
[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.
[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.
[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.
[30]
Sheng Liang, Paul Hudak, and Mark Jones. 1995a. Monad transformers and modular interpreters. In Symposium on Principles of programming languages. 333–343.
[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.
[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.
[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.
[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.
[35]
Henrik Nilsson, Antony Courtney, and John Peterson. 2002. Functional reactive programming, continued. In Haskell Workshop. 51–64.
[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.
[37]
Dominic Orchard and Tomas Petricek. 2015. Embedding effect systems in Haskell. ACM SIGPLAN Notices 49, 12 (2015), 13–24.
[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.5391
[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.
[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/
[41]
Sam Owre, Natarajan Shankar, John M Rushby, and David WJ Stringer-Calvert. {n. d.}. PVS language reference. ({n. d.}).
[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.
[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.
[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.
[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.
[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.
[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.
[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.
[49]
John Rushby. {n. d.}. PVS Bibliography. http://pvs.csl.sri.com/documentation.shtml . ({n. d.}).
[50]
Butler RW. 1996. An introduction to requirements capture using PVS: Specification of a simple autopilot. (1996).
[51]
Mike Spivey. 1990. A functional theory of exceptions. Science of computer programming 14, 1 (1990), 25–42.
[52]
Robert Stewart. 2013. Reliable massively parallel symbolic computing: fault tolerance for a distributed Haskell. Ph.D. Dissertation. Heriot-Watt University.
[53]
Robert Stewart, Patrick Maier, and Phil Trinder. 2016. Transparent fault tolerance for scalable functional computation. Journal of Functional Programming 26 (2016).
[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.
[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.
[56]
Steve Vinoski. 2007. Reliability with Erlang. IEEE Internet Computing 11, 6 (2007).
[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.
[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.
[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.

Cited By

View all
  • (2023)The Beauty and Elegance of Functional Reactive AnimationProceedings of the 11th ACM SIGPLAN International Workshop on Functional Art, Music, Modelling, and Design10.1145/3609023.3609806(8-20)Online publication date: 30-Aug-2023
  • (2020)Runtime verification and validation of functional reactive systemsJournal of Functional Programming10.1017/S095679682000021030Online publication date: 26-Aug-2020
  • (2020)Fault-tolerant functional reactive programming (extended version)Journal of Functional Programming10.1017/S095679682000011830Online publication date: 7-May-2020
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

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
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 for this article.

Check for updates

Author Tags

  1. dependent types
  2. fault tolerance
  3. functional reactive programming
  4. monad transformers
  5. monads
  6. reactive programming
  7. stream programming
  8. streams

Qualifiers

  • Research-article

Funding Sources

  • NASA

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)158
  • Downloads (Last 6 weeks)20
Reflects downloads up to 25 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2023)The Beauty and Elegance of Functional Reactive AnimationProceedings of the 11th ACM SIGPLAN International Workshop on Functional Art, Music, Modelling, and Design10.1145/3609023.3609806(8-20)Online publication date: 30-Aug-2023
  • (2020)Runtime verification and validation of functional reactive systemsJournal of Functional Programming10.1017/S095679682000021030Online publication date: 26-Aug-2020
  • (2020)Fault-tolerant functional reactive programming (extended version)Journal of Functional Programming10.1017/S095679682000011830Online publication date: 7-May-2020
  • (2019)Formal Verification of System States for Spacecraft Automatic ManeuveringAIAA Scitech 2019 Forum10.2514/6.2019-1187Online publication date: 6-Jan-2019
  • (2019)Fault-Tolerant Swarms2019 IEEE International Conference on Space Mission Challenges for Information Technology (SMC-IT)10.1109/SMC-IT.2019.00011(47-54)Online publication date: Jul-2019
  • (2018)Rhine: FRP with type-level clocksACM SIGPLAN Notices10.1145/3299711.324275753:7(145-157)Online publication date: 17-Sep-2018
  • (2018)Rhine: FRP with type-level clocksProceedings of the 11th ACM SIGPLAN International Symposium on Haskell10.1145/3242744.3242757(145-157)Online publication date: 17-Sep-2018

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Full Access

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media