Abstract
Following the paradigm of encapsulation of side effects via monads, the Java execution mechanism has been described by the so-called Java monad, encorporating essentially stateful computation and exceptions, which are heavily used in Java control flow. A technical problem that appears in this model is the fact that the return exception in Java is parametrized by the return value, so that method calls actually move between slightly different monads, depending on the type of the return value. We provide a treatment of this problem in the general framework of exception monads as introduced in earlier work by some of the authors; this framework includes generic partial and total Hoare calculi for abrupt termination. Moreover, we illustrate this framework by means of a verification of a pattern match algorithm.
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Claessen, K.: A poor man’s concurrency monad. J. Funct. Programming 9, 313–323 (1999)
Führmann, C.: Varieties of effects. In: Nielsen, M., Engberg, U. (eds.) FOSSACS 2002. LNCS, vol. 2303, pp. 144–158. Springer, Heidelberg (2002)
The Haskell mailing list (2002), http://www.haskell.org/mailinglist.html
Huisman, M., Jacobs, B.: Java program verification via a Hoare logic with abrupt termination. In: Maibaum, T. (ed.) FASE 2000. LNCS, vol. 1783, pp. 284–303. Springer, Heidelberg (2000)
Jacobs, B., Poll, E.: A logic for the Java Modeling Language JML. In: Hussmann, H. (ed.) FASE 2001. LNCS, vol. 2029, pp. 284–299. Springer, Heidelberg (2001)
Jacobs, B., Poll, E.: Coalgebras and Monads in the Semantics of Java. Theoret. Comput. Sci. 291, 329–349 (2003)
Joy, B., Steele, G., Gosling, J., Bracha, G.: The Java language specification. Addison-Wesley, Reading (2000)
Moggi, E.: An abstract view of programming languages, Tech. Report ECS-LFCS-90-113, Univ. of Edinburgh (1990)
Moggi, E.: Notions of computation and monads. Inform. and Comput. 93, 55–92 (1991)
Mossakowski, T.: Heterogeneous specification and the heterogeneous tool set, Habilitation thesis, University of Bremen (2005)
Peyton-Jones, S. (ed.): Haskell 1998 language and libraries — the revised report, Cambridge (2003) also J. Funct. Programming 13 (2003)
Regensburger, F.: HOLCF: Higher order logic of computable functions. In: Schubert, E.T., Alves-Foss, J., Windley, P. (eds.) HUG 1995. LNCS, vol. 971, pp. 293–307. Springer, Heidelberg (1995)
Schröder, L., Mossakowski, T.: HASCASL: Towards integrated specification and development of functional programs. In: Kirchner, H., Ringeissen, C. (eds.) AMAST 2002. LNCS, vol. 2422, pp. 99–116. Springer, Heidelberg (2002)
Schröder, L., Mossakowski, T.: Monad-independent hoare logic in HASCASL. In: Pezzé, M. (ed.) FASE 2003. LNCS, vol. 2621, pp. 261–277. Springer, Heidelberg (2003)
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)
Schröder, L., Mossakowski, T.: Monad-independent dynamic logic in HasCASL. J. Logic Comput. 14, 571–619 (2004)
Schröder, L., Mossakowski, T., Maeder, C.: HasCASL – Integrated functional specification and programming. Language summary, available at http://www.informatik.uni-bremen.de/agbkb/forschung/formal_methods/CoFI/HasCASL
Wadler, P.: How to declare an imperative. ACM Computing Surveys 29, 240–263 (1997)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2005 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Walter, D., Schröder, L., Mossakowski, T. (2005). Parametrized Exceptions. In: Fiadeiro, J.L., Harman, N., Roggenbach, M., Rutten, J. (eds) Algebra and Coalgebra in Computer Science. CALCO 2005. Lecture Notes in Computer Science, vol 3629. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11548133_27
Download citation
DOI: https://doi.org/10.1007/11548133_27
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-28620-2
Online ISBN: 978-3-540-31876-7
eBook Packages: Computer ScienceComputer Science (R0)