A Hoare Calculus for Verifying Java Realizations of OCL-Constrained Design Models

The Object Constraint Language OCL offers a formal notation for constraining the modelling elements occurring in UML diagrams. In this paper we apply OCL for developing Java realizations of UML design models and introduce a new Hoare-Calculus for Java classes which uses OCL as assertion language. The Hoare rules are as usual for while programs, blocks and (possibly recursive) method calls. Update of instance variables is handled by an explicit substitution operator which also takes care of aliasing. For verifying a Java subsystem w.r.t. a design subsystem specified using OCL constraints we define an appropriate realization relation and illustrate our approach by an example.

[1]  Ivar Jacobson,et al.  The unified modeling language reference manual , 2010 .

[2]  Martin Wirsing,et al.  From Sequential to Multi-Threaded Java: An Event-Based Operational Semantics , 1997, AMAST.

[3]  David von Oheimb Hoare Logic for Mutual Recursion and Local Variables , 1999, FSTTCS.

[4]  Martín Abadi,et al.  A Logic of Object-Oriented Programs , 1997, Verification: Theory and Practice.

[5]  Martin Wirsing,et al.  Formal Syntax and Semantics of Java , 1999 .

[6]  Gary T. Leavens,et al.  JML: notations and tools supporting detailed design in Java , 2000 .

[7]  Martin Wirsing,et al.  An Event-Based Structural Operational Semantics of Multi-Threaded Java , 1999, Formal Syntax and Semantics of Java.

[8]  Peter W. O'Hearn,et al.  Semantic analysis of pointer aliasing, allocation and disposal in Hoare logic , 2000, PPDP '00.

[9]  Ernst-Rüdiger Olderog,et al.  Verification of Sequential and Concurrent Programs , 1997, Graduate Texts in Computer Science.

[10]  Bart Jacobs,et al.  JML (poster session): notations and tools supporting detailed design in Java , 2000, OOPSLA '00.

[11]  Jeannette M. Wing,et al.  A behavioral notion of subtyping , 1994, TOPL.

[12]  Guy L. Steele,et al.  The Java Language Specification , 1996 .

[13]  Arnd Poetzsch-Heffter,et al.  A Programming Logic for Sequential Java , 1999, ESOP.

[14]  Richard Bornat,et al.  Proving Pointer Programs in Hoare Logic , 2000, MPC.

[15]  Anish Arora,et al.  Book Review: Verification of Sequential and Concurrent Programs by Krzysztof R. Apt and Ernst-Riidiger Olderog (Springer-Verlag New York, 1997) , 1998, SIGA.

[16]  Martin Wirsing,et al.  Correct Realization of Interface Constraints with OCL , 1999, UML.

[17]  Desmond D'Souza,et al.  Objects, Components, and Frameworks with UML: The Catalysis Approach , 1998 .

[18]  Frank S. de Boer,et al.  A WP-calculus for OO , 1999, FoSSaCS.

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

[20]  Anneke Kleppe,et al.  The object constraint language: precise modeling with UML , 1998 .