Theory and Generality of Complete Traversals
Standard iteration mechanisms, even ones of such generality as those in the C++ Standard Template Library (STL), do not allow insertions to be made in a container during a traversal of the container. Since ad hoc ways of handling such iterations are tedious to program and error-prone, programmers should ideally have at their command an efficient generic solution. In earlier work we formally characterized the complete traversal problem and presented generic solutions by means of two generic algorithms and a container adaptor, all defined within the STL framework. Here we develop additional theory for reasoning about complete traversals and address the question of how general the complete traversal problem is by showing that it subsumes well-known graph (or relation) problems such as reachability and transitive closure.
KeywordsGeneric Programming Standard Template Library (STL) Iterators Containers Adaptors Iteration Mechanisms Closures
Unable to display preview. Download preview PDF.
- 1.A. V. Aho, R. Sethi, and J. D. Ullman. Compilers—Principles, Techniques, and Tools. Addison-Wesley, 1986.Google Scholar
- 2.A. V. Aho and J. D. Ullman. The Theory of Parsing, Translation, and Compiling. Volume I: Parsing. Prentice-Hall, 1972.Google Scholar
- 3.M. H. Austern. Generic Programming and the STL-Using and Extending the C++ Standard Template Library. Addison-Wesley, 1999.Google Scholar
- 4.D. Bailey. Java Structures—Data Structures in Java for the Principled Programmer. WCB/McGraw-Hill, 1999.Google Scholar
- 5.A. Frick, W. Zimmer, and W. Zimmermann. Karla: An Extensible Library of Data Structures and Algorithms. Part I: Design Rationale. Karlsruhe University, Faculty of Computer Science, August 1994.Google Scholar
- 6.A. Frick and W. Zimmermann. Karla: An Extensible Library of Data Structures and Algorithms. Part II: Usage for Beginners. Karlsruhe University, Faculty of Computer Science, January 1995.Google Scholar
- 7.E. Gamess, D. R. Musser, and A. J. Sánchez-Ruíz. Complete traversals and their implementation using the standard template library. In Raúl Monge Anwandter, editor, Proceedings of the XXIII Latinamerican Conference on Informatics, volume I, pages 221–230, Valaparaíso, Chile, November 1997. CLEI.Google Scholar
- 8.G. Goos. Sather-K, the language. Technical report, Karlsruhe University, April 1996.Google Scholar
- 9.G. Huet and D. Oppen. Equations and rewrite rules: a survey. In R. Book, editor, Formal Languages: Perspectives and Open Problems. Academic Press, New York, 1980.Google Scholar
- 11.H. R. Lewis and Ch. H. Papadimitriou. Elements of the Theory of Computation. Prentice-Hall, second edition, 1998.Google Scholar
- 13.D. R. Musser and A. Saini. STL Tutorial and Reference Guide. Addison-Wesley, 1996.Google Scholar
- 14.David R. Musser. Automated theorem proving for analysis and synthesis of computations. In G. Birtwistle and P. Subrahmanyam, editors, Current Trends in Hardware Verification and Automated Theorem Proving. Springer-Verlag, New York, 1989.Google Scholar
- 15.ObjectSpace. Objectspace—JGL, the Generic Collection Library for Java. http://www.objectspace.com/jgl, 1997.
- 16.A. A. Stepanov and M. Lee. The standard template library. Technical Report HP-94-93, Hewlett-Packard, 1995.Google Scholar
- 17.Sun Microsystems. Java 2 Platform API Specification. http://java.sun.com/products/jdk/1.2/docs/api/index.html, 1999.