Hoare Logic in the Abstract

  • Ursula Martin
  • Erik A. Mathiesen
  • Paulo Oliva
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 4207)


We present an abstraction of Hoare logic to traced symmetric monoidal categories, a very general framework for the theory of systems. We first identify a particular class of functors – which we call ‘verification functors’ – between traced symmetric monoidal categories and subcategories of Preord (the category of preordered sets and monotone mappings). We then give an abstract definition of Hoare triples, parametrised by a verification functor, and prove a single soundness and completeness theorem for such triples. In the particular case of the traced symmetric monoidal category of while programs we get back Hoare’s original rules. We discuss how our framework handles extensions of the Hoare logic for while programs, e.g. the extension with pointer manipulations via separation logic. Finally, we give an example of how our theory can be used in the development of new Hoare logics: we present a new sound and complete set of Hoare-logic-like rules for the verification of linear dynamical systems, modelled via stream circuits.


Disjoint Union Monoidal Category Completeness Theorem Pointer Program Separation 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.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Abramsky, S., Gay, S., Nagarajan, R.: Specification structures and propositions-as-types for concurrency. In: Birtwistle, G., Moller, F. (eds.) Logics for Concurrency: Structure vs. Automata, pp. 5–40. Springer, Heidelberg (1996)Google Scholar
  2. 2.
    Apt, K.R.: Ten years of Hoare’s logic: A survey – Part 1. ACM Transactions on Programming Languages and Systems 3(4), 431–483 (1981)MATHCrossRefGoogle Scholar
  3. 3.
    Bainbridge, E.S.: Feedback and generized logic. Information and Control 31, 75–96 (1976)MATHCrossRefMathSciNetGoogle Scholar
  4. 4.
    Berger, M., Honda, K., Yoshida, N.: A logical analysis of aliasing in imperative higher-order functions. In: ICFP 2005, pp. 280–293 (2005)Google Scholar
  5. 5.
    Blass, A., Gurevich, Y.: The underlying logic of Hoare logic. Bull. of the Euro. Assoc. for Theoretical Computer Science 70, 82–110 (2000)MATHMathSciNetGoogle Scholar
  6. 6.
    Bloom, S.L., Ésik, Z.: Floyd-Hoare logic in iteration theories. J. ACM 38(4), 887–934 (1991)MATHCrossRefGoogle Scholar
  7. 7.
    Boulton, R.J., Hardy, R., Martin, U.: A Hoare logic for single-input single-output continuous time control systems. In: Maler, O., Pnueli, A. (eds.) HSCC 2003. LNCS, vol. 2623, pp. 113–125. Springer, Heidelberg (2003)CrossRefGoogle Scholar
  8. 8.
    Cook, S.A.: Soundness and completeness of an axiom system for program verification. SIAM J. Comput. 7(1), 70–90 (1978)MATHCrossRefMathSciNetGoogle Scholar
  9. 9.
    Escardó, M.H., Pavlovic, D.: Calculus in coinductive form. In: LICS 1998, Indiana, USA (June 1998)Google Scholar
  10. 10.
    Floyd, R.W.: Assigning meanings to programs. Proc. Amer. Math. Soc. Symposia in Applied Mathematics 19, 19–31 (1967)MathSciNetGoogle Scholar
  11. 11.
    Haghverdi, E., Scott, P.: Towards a typed geometry of interaction. In: Ong, L. (ed.) CSL 2005. LNCS, vol. 3634, pp. 216–231. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  12. 12.
    Hoare, C.A.R.: An axiomatic basis for computer programming. Communications of the ACM 12(10), 576–585 (1969)MATHCrossRefGoogle Scholar
  13. 13.
    Joyal, A., Street, R., Verity, D.: Traced monoidal categories. Mathematical Proceedings of the Cambridge Philosophical Society 119, 447–468 (1996)MATHCrossRefMathSciNetGoogle Scholar
  14. 14.
    Kozen, D.: On Hoare logic and Kleene algebra with tests. ACM Transactions on Computational Logic (TOCL) 1(1), 60–76 (2000)CrossRefMathSciNetGoogle Scholar
  15. 15.
    Mac Lane, S.: Categories for the Working Mathematician. Graduate texts in mathematics, 2nd edn., vol. 5. Springer, Heidelberg (1998)MATHGoogle Scholar
  16. 16.
    Manes, E.G., Arbib, M.A.: Algebraic Approaches to Program Semantics. AKM series in theoretical computer science. Springer, New York (1986)MATHGoogle Scholar
  17. 17.
    O’Hearn, P., Reynolds, J., Yang, H.: Local reasoning about programs that alter data structures. In: Fribourg, L. (ed.) CSL 2001. LNCS, vol. 2142, pp. 1–19. Springer, Heidelberg (2001)CrossRefGoogle Scholar
  18. 18.
    Pratt, V.R.: Semantical considerations on Floyd-Hoare logic. In: FoCS 1976, pp. 109–121 (1976)Google Scholar
  19. 19.
    Reynolds, J.C.: Separation logic: A logic for shared mutable data structures. In: LICS 2002, pp. 55–74 (2002)Google Scholar
  20. 20.
    Rutten, J.J.M.M.: An application of stream calculus to signal flow graphs. In: de Boer, F.S., Bonsangue, M.M., Graf, S., de Roever, W.-P. (eds.) FMCO 2003. LNCS, vol. 3188, pp. 276–291. Springer, Heidelberg (2004)CrossRefGoogle Scholar
  21. 21.
    Simpson, A.K., Plotkin, G.D.: Complete axioms for categorical fixed-point operators. In: LICS 2000, pp. 30–41 (2000)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2006

Authors and Affiliations

  • Ursula Martin
    • 1
  • Erik A. Mathiesen
    • 1
  • Paulo Oliva
    • 1
  1. 1.Department of Computer ScienceQueen Mary, University of LondonLondonUK

Personalised recommendations