This Article 
 Bibliographic References 
 Add to: 
Specification of Iterators
December 1990 (vol. 16 no. 12)
pp. 1352-1360

Iterators are defined, and previously published methods for defining their meanings are outlined. It is shown how to use trace specifications to define a common form of iterator module (Alphard-style iterators). A form of specification for an iterator is shown which can capture the key differences between a set and a sequence at a few particular places in the specification. The trace specification of a sequence iterator is compared to an algebraic specification. It is concluded that the algebraic specification is possible but somewhat clumsier. Traces are used to give partial specifications of iterator construct that make sequences of calls on procedural parameters.

[1] W. Bartussek and D. L. Parnas, "Using assertions about traces to write abstract specifications for software modules," inProc. 2nd Conf. Euro. Cooperation Inform.Berlin, Germany: Springer-Verlag, 1978.
[2] J. Guttag, J. Horning, and J. Wing, "Some notes on putting specifications to productive use,"Sci. Comput. Program., vol. 2, no. 1, pp. 53-68, Oct. 1982.
[3] D. Hoffman and R. Snodgrass, "Trace specifications: Methodology and models,"IEEE Trans. Software Eng., vol. 14, no. 9, pp. 1243-1252, Sept. 1988; an earlier version appeared as Univ. Victoria Dep. Comput. Sci. Tech. Rep. DCS-53-IR, Mar. 1986.
[4] D. A. Lamb,Software Engineering: Planning for Change. Englewood Cliffs, NJ: Prentice-Hall, 1988.
[5] B. Liskov, R. Atkinson, T. Bloom, E. Moss, J. C. Schaffert, and A. Snyder,CLU Reference Manual. New York: Springer-Verlag, 1981; also appeared as MIT Lab. Comput. Sci. Tech. Rep. MIT/LCS/TR-225, Oct. 1979.
[6] J. McLean, "A formal foundation for the abstract specification of software,"J. ACM, vol. 31, no. 3, pp. 600-627, July 1984.
[7] D. L. Parnas and Y. Wang, "The trace assertion method of module interface specification," Dep. Comput. Inform. Sci., Queen's Univ., Tech. Rep. ISSN-0836-0227-89-261, Oct. 1989.
[8] M. Shaw, W. A. Wulf, and R. London, "Abstraction and verification in Alphard: Iteration and generators," inAlphard: Form and Content, M. Shaw, Ed. New York: Springer-Verlag, 1981, pp. 73-116.
[9] M. Shaw,Alphard: Form and Content. New York: Springer-Verlag, 1981.

Index Terms:
trace specifications; common form; iterator module; Alphard-style iterators; sequence iterator; algebraic specification; partial specifications; iterator construct; procedural parameters; data structures; formal specification; high level languages
D.A. Lamb, "Specification of Iterators," IEEE Transactions on Software Engineering, vol. 16, no. 12, pp. 1352-1360, Dec. 1990, doi:10.1109/32.62444
Usage of this product signifies your acceptance of the Terms of Use.