Abstract
This paper presents the specification and (modular) verification of Java’s AbstractCollection class. This work is done as a case study within the LOOP project (at the university of Nijmegen). It is the first major verification within the project using the theorem prover Isabelle. The class AbstractCollection is automatically translated into a series of Isabelle theories. The specifications, written in the Java Modeling Language (JML), give rise to appropriate proof obligations. The paper explains how the specifications are constructed and verified. When working on this case study, it became clear that there is a problem that is not documented in the informal documentation: when a collection contains a reference to itself it has unexpected behaviour. It is discussed how the specifications are adapted to overcome this problem.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
P. America. Designing an object-oriented programming language with behavioural subtyping. In J.W. de Bakker, W.P. de Roever, and G. Rozenberg, editors, Foundations of Object-Oriented Languages, number 489 in LNCS, pages 60–90. Springer, 1990.
K. Arnold, J. Gosling, and D. Holmes. The Java Programming Language. Addison-Wesley, 3nd edition, 2000.
J. van den Berg, M. Huisman, B. Jacobs, and E. Poll. A type-theoretic memory model for verification of sequential Java programs. In D. Bert, C. Choppy, and P.D. Mosses, editors, Recent Trends in Algebraic Development Techniques, number 1827 in LNCS, pages 1–21. Springer, 2000.
J. van den Berg and B. Jacobs. The LOOP compiler for Java and JML. In T. Mar-garia and W. Yi, editors, Tools and Algorithms for the Construction and Analysis of Systems (TACAS 2001), number 2031 in LNCS, pages 299–312. Springer, 2001.
J. van den Berg, B. Jacobs, and E. Poll. Formal Specification and Verification of JavaCard’s Application Identifier Class. In Java on Smart Cards: Programming and Security, number 2041 in LNCS, pages 137–150. Springer, 2001.
C. Breunesse, B. Jacobs, and J. van den Berg. Specifying and Verifying an Example: a decimal representation in Java for smartcards, 2002. Manuscript.
T. Budd. Understanding Object-oriented programming with Java-updated edition. Addison-Wesley, 2000.
N. Cataño and M. Huisman. Formal specification of Gemplus’ electronic purse case study. In Formal Methods Europe (FME’02), LNCS. Springer, 2002. To appear.
S. Drossopoulou and S. Eisenbach. Java is type safe-probably. In M. Aksit, editor, European Conference on Object-Oriented Programming, number 1241 in LNCS, pages 389–418. Springer, 1997.
ESC/Java specifications for the JavaCard API. http://www.cs.kun.nl/~erikpoll/publications/jc211_specs.html.
J. Guttag, J. Horning, and J. Wing. The Larch family of specification languages. IEEE Software, 2(5):24–36, 1985.
C.A.R. Hoare. Proof of correctness of data representations. Acta Informatica, 1:271–281, 1972.
M. Huisman. Specifications of Java’s Collection class. http://www-sop.inria.fr/lemme/Marieke.Huisman/collection.html.
M. Huisman. Reasoning about Java programs in higher order logic using PVS and Isabelle. PhD thesis, Computing Science Institute, University of Nijmegen, 2001.
M. Huisman and B. Jacobs. Java program verification via a Hoare logic with abrupt termination. In T. Maibaum, editor, Fundamental Approaches to Software Engineering (FASE 2000), number 1783 in LNCS, pages 284–303. Springer, 2000.
M. Huisman, B. Jacobs, and J. van den Berg. A Case Study in Class Library Verification: Java’s Vector Class. Software Tools for Technology Transfer, 3/3:332–352, 2001.
K. Huizing and R. Kuiper. Reinforcing fragile base classes. In Proceedings of Workshop on Formal Techniques for Java Programs (FTfJP), 2001.
B. Jacobs and E. Poll. A logic for the Java Modeling Language JML. In H. Hussmann, editor, Fundamental Approaches to Software Engineering (FASE 2001), number 2029 in LNCS, pages 284–299. Springer, 2001.
Java™ 2 platform, standard edition, version 1.3 API specification. http://www.java.sun.com/j2se/1.3/docs/api/index.html.
G.T. Leavens, A.L. Baker, and C. Ruby. Preliminary design of JML: A behavioral interface specification language for Java. Technical Report 98-06, Iowa State University, Department of Computer Science, 1998.
K.R.M. Leino. Toward Reliable Modular Programs. PhD thesis, California Inst. of Techn., 1995.
K.R.M. Leino, G. Nelson, and J. B. Saxe. ESC/Java User’s Manual. Technical Report SRC 2000-002, Compaq System Research Center, 2000.
B.H. Liskov and J.M. Wing. A behavioral notion of subtyping. ACM Trans. on Progr. Lang. and Systems, 16(1):1811–1841, 1994.
The LOOP project. http://www.cs.kun.nl/~bart/LOOP/index.html.
B. Meyer. Object-Oriented Software Construction. Prentice Hall, 2nd rev. edition, 1997.
D. von Oheimb and T. Nipkow. Machine-checking the Java specification: Proving type-safety. In J. Alves-Foss, editor, Formal Syntax and Semantics of Java, number 1523 in LNCS, pages 119–156. Springer, 1999.
S. Owre, J. Rushby, N. Shankar, and F von Henke. Formal verification for fault-tolerant architectures: Prolegomena to the design of PVS. IEEE Transactions on Software Engineering, 21(2):107–125, 1995.
L.C. Paulson. Isabelle-a generic theorem prover. Number 828 in LNCS. Springer, 1994. With contributions by Tobias Nipkow.
D. Syme. Proving Java type soundness. In J. Alves-Foss, editor, Formal Syntax and Semantics of Java, number 1523 in LNCS, pages 83–118. Springer, 1999.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2002 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Huisman, M. (2002). Verification of Java’s AbstractCollection Class: A Case Study. In: Boiten, E.A., Möller, B. (eds) Mathematics of Program Construction. MPC 2002. Lecture Notes in Computer Science, vol 2386. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-45442-X_11
Download citation
DOI: https://doi.org/10.1007/3-540-45442-X_11
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-43857-1
Online ISBN: 978-3-540-45442-7
eBook Packages: Springer Book Archive