skip to main content
article

Modelling deterministic concurrent I/O

Published:16 September 2006Publication History
Skip Abstract Section

Abstract

The problem of expressing I/O and side effects in functional languages is a well-established one. This paper addresses this problem from a general semantic viewpoint by giving a unified framework for describing shared state, I/O and deterministic concurrency. We develop a modified state transformer which lets us mathematically model the API, then investigate and machine verify some broad conditions under which confluence holds. This semantics is used as the basis for a small deterministic Haskell language extension called CURIO, which enforces determinism using runtime checks.Our confluence condition is first shown to hold for a variety of small components, such as individual shared variables, 1-to-1 communication channels, and I-structures. We then show how models of substantial APIs (like a modification of Haskell's file I/O API which permits inter-process communication) may be constructed from these smaller components using "combinators" in such a way that determinism is always preserved. We describe combinators for product, name-indexing and dynamic allocation, the last of which requires some small extensions to cater for process locality.

References

  1. Peter Achten and Rinus Plasmeijer. The Ins and Outs of Clean I/O. Journal of Functional Programming, 5(1):81--110, January 1995.]]Google ScholarGoogle ScholarCross RefCross Ref
  2. Arvind, Rishiyur S. Nikhil, and Keshav K. Pingali. I-structures: Data Structures for Parallel Computing. ACM Transactions on Programming Language Systems, 11(4):598--632, 1989.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Erik Barendsen and Sjaak Smetsers. Uniqueness Typing for Functional Languages with Graph Rewriting Semantics. Mathematical Structures in Computer Science, 6(6):579--612, 1996.]]Google ScholarGoogle ScholarCross RefCross Ref
  4. John Boyland. Checking Interference with Fractional Permissions. In Radhia Cousot, editor, SAS, volume LNCS2694, pages 55--72. Springer, 2003.]]Google ScholarGoogle Scholar
  5. Andrew Butterfield and Glenn Strong. Proving Correctness of Programs with I/O - a Paradigm Comparison. In Thomas Arts and Markus Mohnen, editors, Proceedings of IFL2001, volume LNCS2312, pages 72--87, 2001.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Karl Crary, David Walker, and Greg Morrisett. Typed Memory Management in a Calculus of Capabilities. In POPL '99: Proceedings of the 26th Symposium on Principles of Programming Languages, pages 262--275, New York, NY, USA, 1999. ACM Press.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Maarten de Mol, Marko van Eekelen, and Rinus Plasmeijer. Theorem Proving for Functional Programmers. In Thomas Arts and Markus Mohnen, editors, Proceedings of IFL2001, volume LNCS2312, pages 55--71. Springer-Verlag, 2001.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Robert DeLine and Manuel Fäahndrich. Enforcing High-Level Protocols in Low-Level Software. In PLDI '01: Proceedings of the 2001 Conference on Programming Language Design and Implementation, pages 59--69, New York, NY, USA, 2001. ACM Press.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Malcolm Dowse. A Semantic Framework for Deterministic Functional Input/Output. PhD thesis, Department of Computer Science, University of Dublin, 2006.]]Google ScholarGoogle Scholar
  10. Malcolm Dowse, Andrew Butterfield, and Marko van Eekelen. Reasoning about Deterministic Concurrent Functional I/O. In Clemens Grelck and Frank Huch, editors, Proceedings of IFL 2004, volume LNCS3474, pages 177--194. Springer-Verlag, 2005.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Malcolm Dowse, Glenn Strong, and Andrew Butterfield. Proving "make" Correct - I/O Proofs in Haskell and Clean. In Ricardo Peña and Thomas Arts, editors, Proceedings of IFL 2002, volume LNCS2670, pages 68--83, 2002.]]Google ScholarGoogle Scholar
  12. Andrew Gordon. Functional Programming and Input/Output. Distinguished Dissertations in Computer Science. Cambridge University Press, 1994.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Andrew Gordon. Bisimilarity as a Theory of Functional Programming: Mini-course. Notes Series BRICS-NS-95-3, BRICS, Department of Computer Science, University of Aarhus, July 1995.]]Google ScholarGoogle Scholar
  14. Cordelia Hall and Kevin Hammond. A Dynamic Semantics for Haskell (draft), May 20 1993.]]Google ScholarGoogle Scholar
  15. Thomas Hallgren, Mark Jones, Rebekah Leslie, and Andrew Tolmach. A Principled Approach to Operating System Construction in Haskell. In ICFP '05: Proceedings of the 10th International Conference on Functional Programming, pages 116--128, New York, NY, USA, 2005. ACM Press.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Tim Harris, Simon Marlow, Simon Peyton Jones, and Maurice Herlihy. Composable Memory Transactions. In Proceedings of the 10th Symposium on Principles and Practice of Parallel Programming, pages 48--60, New York, NY, USA, 2005. ACM Press.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Ian Holyer and Eleni Spiliopoulou. Concurrent Monadic Interfacing. In Kevin Hammond, Antony Davie, and Chris Clack, editors, Proceedings of IFL '98, volume LNCS1595, pages 73--89. Springer-Verlag, 1999.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Mark Jones and Paul Hudak. Implicit and Explicit Parallel Programming in Haskell. Technical Report YALEU/DCS/RR-982, Department of Computer Science, Yale University, August 1993.]]Google ScholarGoogle Scholar
  19. John Launchbury and Simon Peyton Jones. Lazy Functional State Threads. In PLDI '94: Proceedings of the 1994 Conference on Programming Language Design and Implementation, pages 24--35, Orlando, Florida, June 20-24, 1994.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Robin Milner, Mads Tofte, and David MacQueen. The Definition of Standard ML. MIT Press, Cambridge, MA, USA, 1997.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Flemming Nielson and Hanne Riis Nielson. Type and Effect Systems. In Correct System Design, Recent Insight and Advances, pages 114--136, London, UK, 1999. Springer-Verlag.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Simon Peyton Jones. Wearing the Hair Shirt: A retrospective on Haskell. Invited talk at POPL 2003.]]Google ScholarGoogle Scholar
  23. Simon Peyton Jones. Tackling the Awkward Squad - monadic input/output, concurrency, exceptions, and foreign language calls in Haskell. In CAR Hoare, M Broy, and R Stein-brueggen, editors, Engineering theories of software construction, Marktoberdorf Summer School 2000, pages 47--96. IOS Press, 2001.]]Google ScholarGoogle Scholar
  24. Simon Peyton Jones, Andrew Gordon, and Sigbjorn Finne. Concurrent Haskell. In POPL '96: Proceedings of the 23rd Symposium on Principles of Programming Languages, pages 295--308, New York, NY, USA, 1996. ACM Press.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Simon Peyton Jones and Philip Wadler. Imperative Functional Programming. In POPL '93: Proceedings of the 20th Symposium on Principles of Programming Languages, pages 71--84, New York, NY, USA, 1993. ACM Press.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Rinus Plasmeijer and Marko van Eekelen. Functional Programming and Parallel Graph Rewriting. Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA, 1993.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Peter Sewell. On Implementations and Semantics of a Concurrent Programming Language. In CONCUR '97: Proceedings of the 8th International Conference on Concurrency Theory, pages 391--405, London, UK, 1997. Springer-Verlag.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Eleni Spiliopoulou. Concurrent and Distributed Functional Systems. PhD thesis, University of Bristol, Department of Computing Science, August 1999.]]Google ScholarGoogle Scholar
  29. Tachio Terauchi and Alex Aiken. Witnessing Side-Effects. In ICFP '05: Proceedings of the 10th International Conference on Functional Programming, pages 105--115, New York, NY, USA, 2005. ACM Press.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Simon Thompson. Interactive Functional Programs: a method and a formal semantics. Technical Report 48*, Computing Laboratory, University of Kent,, November 1987.]]Google ScholarGoogle Scholar
  31. Mads Tofte and Jean-Pierre Talpin. Region-Based Memory Management. Information and Computation, 132(2):109--176, 1997.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. David Turner. An overview of Miranda. ACM SIGPLAN Notices, 21(12):158--166, December 1986.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Philip Wadler. The Essence of Functional Programming. In POPL '92: Proceedings of the 19th Symposium on Principles of Programming Languages, pages 1--14, New York, NY, USA, 1992. ACM Press.]] Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Modelling deterministic concurrent I/O

        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 41, Issue 9
          Proceedings of the 2006 ICFP conference
          September 2006
          296 pages
          ISSN:0362-1340
          EISSN:1558-1160
          DOI:10.1145/1160074
          Issue’s Table of Contents
          • cover image ACM Conferences
            ICFP '06: Proceedings of the eleventh ACM SIGPLAN international conference on Functional programming
            September 2006
            308 pages
            ISBN:1595933093
            DOI:10.1145/1159803
            • General Chair:
            • John Reppy,
            • Program Chair:
            • Julia Lawall

          Copyright © 2006 ACM

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 16 September 2006

          Check for updates

          Qualifiers

          • 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!