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.
- Peter Achten and Rinus Plasmeijer. The Ins and Outs of Clean I/O. Journal of Functional Programming, 5(1):81--110, January 1995.]]Google Scholar
Cross Ref
- 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 Scholar
Digital Library
- 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 Scholar
Cross Ref
- John Boyland. Checking Interference with Fractional Permissions. In Radhia Cousot, editor, SAS, volume LNCS2694, pages 55--72. Springer, 2003.]]Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- Malcolm Dowse. A Semantic Framework for Deterministic Functional Input/Output. PhD thesis, Department of Computer Science, University of Dublin, 2006.]]Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
- Andrew Gordon. Functional Programming and Input/Output. Distinguished Dissertations in Computer Science. Cambridge University Press, 1994.]] Google Scholar
Digital Library
- 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 Scholar
- Cordelia Hall and Kevin Hammond. A Dynamic Semantics for Haskell (draft), May 20 1993.]]Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
- 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 Scholar
Digital Library
- Robin Milner, Mads Tofte, and David MacQueen. The Definition of Standard ML. MIT Press, Cambridge, MA, USA, 1997.]] Google Scholar
Digital Library
- 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 Scholar
Digital Library
- Simon Peyton Jones. Wearing the Hair Shirt: A retrospective on Haskell. Invited talk at POPL 2003.]]Google Scholar
- 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 Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- Rinus Plasmeijer and Marko van Eekelen. Functional Programming and Parallel Graph Rewriting. Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA, 1993.]] Google Scholar
Digital Library
- 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 Scholar
Digital Library
- Eleni Spiliopoulou. Concurrent and Distributed Functional Systems. PhD thesis, University of Bristol, Department of Computing Science, August 1999.]]Google Scholar
- 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 Scholar
Digital Library
- Simon Thompson. Interactive Functional Programs: a method and a formal semantics. Technical Report 48*, Computing Laboratory, University of Kent,, November 1987.]]Google Scholar
- Mads Tofte and Jean-Pierre Talpin. Region-Based Memory Management. Information and Computation, 132(2):109--176, 1997.]] Google Scholar
Digital Library
- David Turner. An overview of Miranda. ACM SIGPLAN Notices, 21(12):158--166, December 1986.]] Google Scholar
Digital Library
- 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 Scholar
Digital Library
Index Terms
Modelling deterministic concurrent I/O
Recommendations
Modelling deterministic concurrent I/O
ICFP '06: Proceedings of the eleventh ACM SIGPLAN international conference on Functional programmingThe 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 ...
Type-directed language extension for effectful computations
SCALA '14: Proceedings of the Fifth Annual Scala WorkshopComputation types such as functors, applicative functors and monads have become common abstractions for modeling effectful computations in functional programming languages. They are often used together with special language extensions intended to ...
Safe nondeterminism in a deterministic-by-default parallel language
POPL '11A number of deterministic parallel programming models with strong safety guarantees are emerging, but similar support for nondeterministic algorithms, such as branch and bound search, remains an open question. We present a language together with a type ...







Comments