Home / Papers / Specifying java iterators with JML and Esc/Java2

Specifying java iterators with JML and Esc/Java2

9 Citations2006
D. Cok
journal unavailable

This note provides a specification in the Java Modeling Language (JML) for the Java interfaces Iterator and Iterable that captures the interactions between these two interfaces.

Abstract

The 2006 SAVCBS Workshop has posed a Challenge Problem on the topic of specifying iterators. This note provides a specification in the Java Modeling Language (JML) [1, 2] for the Java interfaces Iterator and Iterable that captures the interactions between these two interfaces. An example program that uses these interfaces is checked using Esc/Java2 [3, 4, 5], demonstrating by example that the Esc/Java2 tool checks that the interfaces are used only as required by the specifications. The concluding section contains some observations on the limitations of JML for this specification task.