Title :
Design and specification of iterators using the swapping paradigm
Author :
Weide, Bruce W. ; Edwards, Stephen H. ; Harms, Douglas E. ; Lamb, David Alex
Author_Institution :
Dept. of Comput. & Inf. Sci., Ohio State Univ., Columbus, OH, USA
fDate :
8/1/1994 12:00:00 AM
Abstract :
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
Keywords :
data encapsulation; formal specification; program verification; common interface model; formal methods; formal specification; imperative languages; iterator designs; iterators; modular correctness proofs; modular reasoning; program verification; proof of correctness; swapping; swapping paradigm; user defined iterator abstractions; Computerized monitoring; Formal specifications; Forward contracts; Information science; Military computing; Modems; Packaging; Proposals; Reasoning about programs; Senior members;
Journal_Title :
Software Engineering, IEEE Transactions on