Generic Hoare Logic for Order-Enriched Effects with Exceptions

  • Christoph Rauch
  • Sergey Goncharov
  • Lutz Schröder
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 10644)


In programming semantics, monads are used to provide a generic encapsulation of side-effects. We introduce a monad-based metalanguage that extends Moggi’s computational metalanguage with native exceptions and iteration, interpreted over monads supporting a dcpo structure. We present a Hoare calculus with abnormal postconditions for this metalanguage and prove relative completeness using weakest liberal preconditions, extending earlier work on the exception-free case.


  1. 1.
    Adámek, J., Milius, S., Velebil, J.: Equational properties of iterative monads. Inf. Comput. 208(12), 1306–1348 (2010)MathSciNetCrossRefzbMATHGoogle Scholar
  2. 2.
    Barr, M., Wells, C. (eds.): Category Theory for Computing Science, 2nd edn. Prentice Hall International (UK) Ltd., London (1995)zbMATHGoogle Scholar
  3. 3.
    Bloom, S.L., Ésik, Z.: Iteration Theories: The Equational Logic of Iterative Processes. Springer-Verlag New York, Inc., New York (1993). CrossRefzbMATHGoogle Scholar
  4. 4.
    Cenciarelli, P., Moggi, E.: A syntactic approach to modularity in denotational semantics. In: Category Theory and Computer Science, CTCS 1993 (1993)Google Scholar
  5. 5.
    Dijkstra, E.W.: Guarded commands, nondeterminacy and formal derivation of programs. Commun. ACM 18(8), 453–457 (1975)MathSciNetCrossRefzbMATHGoogle Scholar
  6. 6.
    Goncharov, S., Rauch, C., Schröder, L.: Unguarded recursion on coinductive resumptions. In: Mathematical Foundations of Programming Semantics, MFPS 2015. ENTCS (2015)Google Scholar
  7. 7.
    Goncharov, S., Schröder, L.: A relatively complete Hoare logic for order-enriched effects. In: Logic in Computer Science, LICS 2013, pp. 273–282. IEEE (2013)Google Scholar
  8. 8.
    Hasuo, I.: Generic weakest precondition semantics from monads enriched with order. Theoret. Comput. Sci. 604, 2–29 (2015)MathSciNetCrossRefzbMATHGoogle Scholar
  9. 9.
    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
  10. 10.
    Moggi, E.: A modular approach to denotational semantics. In: Pitt, D.H., Curien, P.-L., Abramsky, S., Pitts, A.M., Poigné, A., Rydeheard, D.E. (eds.) CTCS 1991. LNCS, vol. 530, pp. 138–139. Springer, Heidelberg (1991). CrossRefGoogle Scholar
  11. 11.
    Moggi, E.: Notions of computation and monads. Inf. Comput. 93, 55–92 (1991)MathSciNetCrossRefzbMATHGoogle Scholar
  12. 12.
    Nordio, M., Calcagno, C., Müller, P., Meyer, B.: A sound and complete program logic for Eiffel. In: Oriol, M., Meyer, B. (eds.) TOOLS EUROPE 2009. LNBIP, vol. 33, pp. 195–214. Springer, Heidelberg (2009). CrossRefGoogle Scholar
  13. 13.
    von Oheimb, D.: Hoare logic for Java in Isabelle/HOL. Concurr. Comput.: Pract. Exp. 13, 1173–1214 (2001)CrossRefzbMATHGoogle Scholar
  14. 14.
    Piróg, M., Gibbons, J.: The coinductive resumption monad. In: Mathematical Foundations of Programming Semantics, MFPS 2014. ENTCS, vol. 308, pp. 273–288 (2014)Google Scholar
  15. 15.
    Plotkin, G., Power, J.: Algebraic operations and generic effects. Appl. Categ. Struct. 11, 69–94 (2003)CrossRefzbMATHGoogle Scholar
  16. 16.
    Poetzsch-Heffter, A., Rauch, N.: Soundness and relative completeness of a programming logic for a sequential Java subset. Technical report, TU Kaiserlautern (2004)Google Scholar
  17. 17.
    Schröder, L., Mossakowski, T.: Monad-independent dynamic logic in HasCasl. In: Wirsing, M., Pattinson, D., Hennicker, R. (eds.) WADT 2002. LNCS, vol. 2755, pp. 425–441. Springer, Heidelberg (2003). CrossRefGoogle Scholar
  18. 18.
    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
  19. 19.
    Simpson, A.K.: Recursive types in Kleisli categories. Technical report, MFPS Tutorial, April 2007 (1992)Google Scholar
  20. 20.
    Vickers, S.: Topology via Logic. Cambridge University Press, Cambridge (1989)zbMATHGoogle Scholar
  21. 21.
    Wadler, P.: How to declare an imperative. ACM Comput. Surv. 29, 240–263 (1997)CrossRefGoogle Scholar

Copyright information

© IFIP International Federation for Information Processing 2017

Authors and Affiliations

  • Christoph Rauch
    • 1
  • Sergey Goncharov
    • 1
  • Lutz Schröder
    • 1
  1. 1.Friedrich-Alexander-Universität Erlangen-NürnbergErlangenGermany

Personalised recommendations