Advertisement

Parametrized Exceptions

  • Dennis Walter
  • Lutz Schröder
  • Till Mossakowski
Part of the Lecture Notes in Computer Science book series (LNCS, volume 3629)

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.

Keywords

Dynamic Logic High Order Logic Total Correctness Pattern Match Algorithm Hoare Logic 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Claessen, K.: A poor man’s concurrency monad. J. Funct. Programming 9, 313–323 (1999)zbMATHCrossRefGoogle Scholar
  2. 2.
    Führmann, C.: Varieties of effects. In: Nielsen, M., Engberg, U. (eds.) FOSSACS 2002. LNCS, vol. 2303, pp. 144–158. Springer, Heidelberg (2002)CrossRefGoogle Scholar
  3. 3.
    The Haskell mailing list (2002), http://www.haskell.org/mailinglist.html
  4. 4.
    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)CrossRefGoogle Scholar
  5. 5.
    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)CrossRefGoogle Scholar
  6. 6.
    Jacobs, B., Poll, E.: Coalgebras and Monads in the Semantics of Java. Theoret. Comput. Sci. 291, 329–349 (2003)zbMATHCrossRefMathSciNetGoogle Scholar
  7. 7.
    Joy, B., Steele, G., Gosling, J., Bracha, G.: The Java language specification. Addison-Wesley, Reading (2000)Google Scholar
  8. 8.
    Moggi, E.: An abstract view of programming languages, Tech. Report ECS-LFCS-90-113, Univ. of Edinburgh (1990)Google Scholar
  9. 9.
    Moggi, E.: Notions of computation and monads. Inform. and Comput. 93, 55–92 (1991)zbMATHCrossRefMathSciNetGoogle Scholar
  10. 10.
    Mossakowski, T.: Heterogeneous specification and the heterogeneous tool set, Habilitation thesis, University of Bremen (2005)Google Scholar
  11. 11.
    Peyton-Jones, S. (ed.): Haskell 1998 language and libraries — the revised report, Cambridge (2003) also J. Funct. Programming 13 (2003)Google Scholar
  12. 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
  13. 13.
    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)CrossRefGoogle Scholar
  14. 14.
    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)CrossRefGoogle Scholar
  15. 15.
    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)CrossRefGoogle Scholar
  16. 16.
    Schröder, L., Mossakowski, T.: Monad-independent dynamic logic in HasCASL. J. Logic Comput. 14, 571–619 (2004)zbMATHCrossRefMathSciNetGoogle Scholar
  17. 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
  18. 18.
    Wadler, P.: How to declare an imperative. ACM Computing Surveys 29, 240–263 (1997)CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2005

Authors and Affiliations

  • Dennis Walter
    • 1
  • Lutz Schröder
    • 1
  • Till Mossakowski
    • 1
  1. 1.BISS, Department of Computer ScienceUniversity of Bremen 

Personalised recommendations