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.
KeywordsDynamic Logic High Order Logic Total Correctness Pattern Match Algorithm Hoare Logic
Unable to display preview. Download preview PDF.
- 3.The Haskell mailing list (2002), http://www.haskell.org/mailinglist.html
- 7.Joy, B., Steele, G., Gosling, J., Bracha, G.: The Java language specification. Addison-Wesley, Reading (2000)Google Scholar
- 8.Moggi, E.: An abstract view of programming languages, Tech. Report ECS-LFCS-90-113, Univ. of Edinburgh (1990)Google Scholar
- 10.Mossakowski, T.: Heterogeneous specification and the heterogeneous tool set, Habilitation thesis, University of Bremen (2005)Google Scholar
- 11.Peyton-Jones, S. (ed.): Haskell 1998 language and libraries — the revised report, Cambridge (2003) also J. Funct. Programming 13 (2003)Google Scholar
- 12.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)Google Scholar
- 17.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