Monad-independent Hoare logic in HasCasl

  • Authors:
  • Lutz Schröder;Till Mossakowski

  • Affiliations:
  • BISS, Department of Computer Science, University of Bremen;BISS, Department of Computer Science, University of Bremen

  • Venue:
  • FASE'03 Proceedings of the 6th international conference on Fundamental approaches to software engineering
  • Year:
  • 2003

Quantified Score

Hi-index 0.00

Visualization

Abstract

Monads have been recognized by Moggi as an elegant device for dealing with stateful computation in functional programming languages. It is thus natural to develop a Hoare calculus for reasoning about computational monads. While this has previously been done only for the state monad, we here provide a generic, monad-independent approach, which applies also to further computational monads such as exceptions, input/output, and non-determinism. All this is formalized within the logic of HASCASL, a higher-order language for functional specification and programming. Combination of monadic features can be obtained by combining their loose specifications. As an application, we prove partial correctness of Dijkstra's nondeterministic version of Euclid's algorithm in a monad with nondeterministic dynamic references.