Design and Specification of Iterators Using the Swapping Paradigm

How should iterators be abstracted and encapsulated in modern imperative languages? We consider the combined impact of several factors on this question: the need for a common interface model for user defined iterator abstractions, the importance of formal methods in specifying such a model, and problems involved in modular correctness proofs of iterator implementations and clients. A series of iterator designs illustrates the advantages of the swapping paradigm over the traditional copying paradigm. Specifically, swapping based designs admit more efficient implementations while offering relatively straightforward formal specifications and the potential for modular reasoning about program behavior. The final proposed design schema is a common interface model for an iterator for any generic collection. >

[1]  Jeannette M. Wing A specifier's introduction to formal methods , 1990, Computer.

[2]  Stuart H. Zweben,et al.  Reusable Software Components , 1991, Adv. Comput..

[3]  Stephen Edwards,et al.  An Approach for Constructing Reusable Software Components in Ada , 1990 .

[4]  David Alex Lamb Specification of Iterators , 1990, IEEE Trans. Software Eng..

[5]  Grady Booch,et al.  Software Component with ADA , 1987 .

[6]  David Alex Lamb,et al.  The property vector specification of a multiset iterator , 1992, International Conference on Software Engineering.

[7]  Wilf R. LaLonde Designing families of data types using exemplars , 1989, TOPL.

[8]  William F. Ogden,et al.  Modular Verification of Ada Generics , 1991, Comput. Lang..

[9]  William F. Ogden,et al.  Modular Verification of Data Abstractions with Shared Realizations , 1994, IEEE Trans. Software Eng..

[10]  Stephen H. Edwards Common Interface Models for Reusable Software , 1993, Int. J. Softw. Eng. Knowl. Eng..

[11]  Bruce W. Weide,et al.  Copying and Swapping: Influences on the Design of Reusable Software Components , 1991, IEEE Trans. Software Eng..

[12]  Mary Shaw,et al.  Abstraction and verification in Alphard: Defining and specifying iteration and generators , 1977 .

[13]  Joseph Eugene Hollingsworth Software component design-for-reuse: a language-independent discipline applied to ADA , 1992 .

[14]  Will Tracz Parameterization: a case study , 1989, ALET.

[15]  Robert D. Cameron Efficient high-level iteration with accumulators , 1989, TOPL.

[16]  Craig Schaffert,et al.  Abstraction mechanisms in CLU , 1977 .

[17]  Lonnie R. Welch,et al.  On Specification of Reusable Software Components , 1993, Int. J. Softw. Eng. Knowl. Eng..

[18]  Judith Bishop,et al.  The Effect of Data Abstraction on Loop Programming Techniques , 1990, IEEE Trans. Software Eng..