Skip to main content

Kleene Monads: Handling Iteration in a Framework of Generic Effects

  • Conference paper
Book cover Algebra and Coalgebra in Computer Science (CALCO 2009)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 5728))

Included in the following conference series:

Abstract

Monads are a well-established tool for modelling various computational effects. They form the semantic basis of Moggi’s computational metalanguage, the metalanguage of effects for short, which made its way into modern functional programming in the shape of Haskell’s do-notation. Standard computational idioms call for specific classes of monads that support additional control operations. Here, we introduce Kleene monads, which additionally feature nondeterministic choice and Kleene star, i.e. nondeterministic iteration, and we provide a metalanguage and a sound calculus for Kleene monads, the metalanguage of control and effects, which is the natural joint extension of Kleene algebra and the metalanguage of effects. This provides a framework for studying abstract program equality focussing on iteration and effects. These aspects are known to have decidable equational theories when studied in isolation. However, it is well known that decidability breaks easily; e.g. the Horn theory of continuous Kleene algebras fails to be recursively enumerable. Here, we prove several negative results for the metalanguage of control and effects; in particular, already the equational theory of the unrestricted metalanguage of control and effects over continuous Kleene monads fails to be recursively enumerable. We proceed to identify a fragment of this language which still contains both Kleene algebra and the metalanguage of effects and for which the natural axiomatisation is complete, and indeed the equational theory is decidable.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Benton, P.N., Bierman, G.M., de Paiva, V.: Computational types from a logical perspective. J. Funct. Prog. 8(2), 177–193 (1998)

    Article  MathSciNet  MATH  Google Scholar 

  2. Curien, P.-L., di Cosmo, R.: A confluent reduction for the lambda-calculus with surjective pairing and terminal object. J. Funct. Program. 6(2), 299–327 (1996)

    Article  MathSciNet  MATH  Google Scholar 

  3. Fluet, M., Morrisett, G., Ahmed, A.J.: Linear regions are all you need. In: Sestoft, P. (ed.) ESOP 2006. LNCS, vol. 3924, pp. 7–21. Springer, Heidelberg (2006)

    Chapter  Google Scholar 

  4. Hinze, R.: Deriving backtracking monad transformers. ACM SIGPLAN Notices 35(9), 186–197 (2000)

    Article  MATH  Google Scholar 

  5. Hyland, M., Plotkin, G.D., Power, J.: Combining effects: Sum and tensor. Theoret. Comput. Sci. 357, 70–99 (2006)

    Article  MathSciNet  MATH  Google Scholar 

  6. Jacobs, B., Poll, E.: Coalgebras and Monads in the Semantics of Java. Theoret. Comput. Sci. 291, 329–349 (2003)

    Article  MathSciNet  MATH  Google Scholar 

  7. Jouannaud, J.-P., Munoz, M.: Termination of a set of rules modulo a set of equations. In: Shostak, R.E. (ed.) CADE 1984. LNCS, vol. 170, pp. 175–193. Springer, Heidelberg (1984)

    Google Scholar 

  8. Kiselyov, O., Shan, C., Friedman, D., Sabry, A.: Backtracking, interleaving, and terminating monad transformers. In: Functional Programming, ICFP 2005, pp. 192–203. ACM Press, New York (2005)

    Google Scholar 

  9. Kozen, D.: A completeness theorem for Kleene algebras and the algebra of regular events. Inf. Comput. 110, 366–390 (1994)

    Article  MathSciNet  MATH  Google Scholar 

  10. Kozen, D.: Kleene algebra with tests and commutativity conditions. In: Margaria, T., Steffen, B. (eds.) TACAS 1996. LNCS, vol. 1055, pp. 14–33. Springer, Heidelberg (1996)

    Chapter  Google Scholar 

  11. Kozen, D.: Nonlocal flow of control and Kleene algebra with tests. In: Logic in Computer Science, LICS 2008, pp. 105–117. IEEE Computer Society Press, Los Alamitos (2008)

    Google Scholar 

  12. Moggi, E.: Notions of computation and monads. Inf. Comput. 93, 55–92 (1991)

    Article  MathSciNet  MATH  Google Scholar 

  13. Moggi, E., Sabry, A.: Monadic encapsulation of effects: A revised approach (extended version). J. Funct. Prog. 11, 591–627 (2001)

    Article  MathSciNet  MATH  Google Scholar 

  14. Mossakowski, T., Schröder, L., Goncharov, S.: A generic complete dynamic logic for reasoning about purity and effects (Extended version to appear in Formal Aspects of Computing). In: Fiadeiro, J.L., Inverardi, P. (eds.) FASE 2008. LNCS, vol. 4961, pp. 199–214. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

  15. Peyton Jones, S. (ed.): Haskell 98 Language and Libraries — The Revised Report. Cambridge University Press (2003); J. Funct. Prog. 13 (2003)

    MATH  Google Scholar 

  16. Schröder, L., Mossakowski, T.: Generic exception handling and the Java monad. In: Rattray, C., Maharaj, S., Shankland, C. (eds.) AMAST 2004. LNCS, vol. 3116, pp. 443–459. Springer, Heidelberg (2004)

    Chapter  Google Scholar 

  17. Schröder, L., Mossakowski, T.: Monad-independent dynamic logic in HasCASL. J. Logic Comput. 14, 571–619 (2004)

    Article  MathSciNet  MATH  Google Scholar 

  18. Stockmeyer, L.J., Meyer, A.R.: Word problems requiring exponential time: Preliminary report. In: Symposium on Theory of Computing, STOC 1973, pp. 1–9. ACM Press, New York (1973)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2009 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Goncharov, S., Schröder, L., Mossakowski, T. (2009). Kleene Monads: Handling Iteration in a Framework of Generic Effects. In: Kurz, A., Lenisa, M., Tarlecki, A. (eds) Algebra and Coalgebra in Computer Science. CALCO 2009. Lecture Notes in Computer Science, vol 5728. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-03741-2_3

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-03741-2_3

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-03740-5

  • Online ISBN: 978-3-642-03741-2

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics