Hoare Logic in the Abstract

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.

[1]  Frank D. Valencia,et al.  Formal Methods for Components and Objects , 2002, Lecture Notes in Computer Science.

[2]  S. Lane Categories for the Working Mathematician , 1971 .

[3]  Peter W. O'Hearn,et al.  Local Reasoning about Programs that Alter Data Structures , 2001, CSL.

[4]  Gordon D. Plotkin,et al.  Complete axioms for categorical fixed-point operators , 2000, Proceedings Fifteenth Annual IEEE Symposium on Logic in Computer Science (Cat. No.99CB36332).

[5]  Rajagopal Nagarajan,et al.  Specification Structures and Propositions-as-Types for Concurrency , 1996, Banff Higher Order Workshop.

[6]  Martín Hötzel Escardó,et al.  Calculus in coinductive form , 1998, Proceedings. Thirteenth Annual IEEE Symposium on Logic in Computer Science (Cat. No.98CB36226).

[7]  John C. Reynolds,et al.  Separation logic: a logic for shared mutable data structures , 2002, Proceedings 17th Annual IEEE Symposium on Logic in Computer Science.

[8]  Andreas Blass,et al.  The Underlying Logic of Hoare Logic , 2000, Bull. EATCS.

[9]  Robert W. Floyd,et al.  Assigning Meanings to Programs , 1993 .

[10]  Vaughan R. Pratt,et al.  SEMANTICAL CONSIDERATIONS ON FLOYD-HOARE LOGIC , 1976, FOCS 1976.

[11]  Vaughan R. Pratt,et al.  Semantical consideration on floyo-hoare logic , 1976, 17th Annual Symposium on Foundations of Computer Science (sfcs 1976).

[12]  Thomas A. Henzinger,et al.  Hybrid Systems: Computation and Control , 1998, Lecture Notes in Computer Science.

[13]  Alex K. Simpson,et al.  Computational Adequacy in an Elementary Topos , 1998, CSL.

[14]  Krzysztof R. Apt,et al.  Ten Years of Hoare's Logic: A Survey—Part I , 1981, TOPL.

[15]  Michael A. Arbib,et al.  Algebraic Approaches to Program Semantics , 1986, Texts and Monographs in Computer Science.

[16]  Dexter Kozen On Hoare logic and Kleene algebra with tests , 2000, TOCL.

[17]  Richard J. Boulton,et al.  A Hoare Logic for Single-Input Single-Output Continuous-Time Control Systems , 2003, HSCC.

[18]  Zoltán Ésik,et al.  Floyd-Hoare logic in iteration theories , 1991, JACM.

[19]  Ross Street,et al.  Traced monoidal categories , 1996 .

[20]  E. S. Bainbridge Feedback and Generalized Logic , 1976, Inf. Control..

[21]  Stephen A. Cook,et al.  Soundness and Completeness of an Axiom System for Program Verification , 1978, SIAM J. Comput..

[22]  C. A. R. HOARE,et al.  An axiomatic basis for computer programming , 1969, CACM.

[23]  Nobuko Yoshida,et al.  A logical analysis of aliasing in imperative higher-order functions , 2007, J. Funct. Program..

[24]  Jan J. M. M. Rutten An Application of Stream Calculus to Signal Flow Graphs , 2003, FMCO.