Derivation of efficient DAG marking algorithms

The best known linear-time list marking algorithms also require a linear amount of workspace. Algorithms working in bounded workspace have been obtained only by allowing quadratic execution time or by restricting the list structures to trees. We improve on this here by deriving a new linear-time, bounded workspace marking algorithm that works for dags. The algorithm is derived using correctness-preserving program transformations, which prove the correctness of the algorithm. Our derivation of the marking algorithm provides an example where this method has actually been used to derive a new, more efficient algorithm, rather than just to establish the correctness of a previously known algorithm.

[1]  Gary Lindstrom,et al.  Scanning List Structures Without Stacks or Tag Bits , 1973, Information Processing Letters.

[2]  John Darlington,et al.  A Transformation System for Developing Recursive Programs , 1977, J. ACM.

[3]  Manfred Broy,et al.  Combining Algebraic and Algorithmic Reasoning: An Approach to the Schorr-Waite Algorithm , 1982, TOPL.

[4]  C. A. R. Hoare,et al.  Proof of correctness of data representation , 1975, Language Hierarchies and Interfaces.

[5]  Gary Lindstrom,et al.  Copying list structures using bounded workspace , 1974, Commun. ACM.

[6]  John Michael Robson A bounded storage algorithm for copying cyclic structures , 1977, CACM.

[7]  Willem P. de Roever,et al.  On Backtracking and Greatest Fixpoints , 1977, ICALP.

[8]  Nachum Dershowitz,et al.  The Schorr-Waite Marking Algorithm Revisited , 1980, Inf. Process. Lett..

[9]  Donald E. Knuth,et al.  The Art of Computer Programming, Volume I: Fundamental Algorithms, 2nd Edition , 1997 .

[10]  Donald Ervin Knuth,et al.  The Art of Computer Programming , 1968 .

[11]  Tomasz Kowaltowski Data Structures and Correctness of Programs , 1979, JACM.

[12]  Willem P. de Roever,et al.  The evolution of list-copying algorithms and the need for structured program verification , 1979, POPL.

[13]  Ben Wegbreit,et al.  A Space-Efficient List Structure Tracing Algorithm , 1972, IEEE Transactions on Computers.

[14]  Ralph-Johan Back,et al.  Correctness preserving program refinements: Proof theory and applications , 1980 .

[15]  Susan L. Gerhart,et al.  Correctness-preserving program transformations , 1975, POPL '75.

[16]  William M. Waite,et al.  An efficient machine-independent procedure for garbage collection in various list structures , 1967, CACM.

[17]  H.B.M. Jonkers,et al.  Abstraction, specification and implementation techniques : with an application to garbage collection , 1983 .

[18]  David Gries The Schorr-Waite Graph Marking Algorithm , 1978, Program Construction.

[19]  Arthur G. Duncan,et al.  Abstractions, instantiations, and proofs of marking algorithms , 1977 .

[20]  Thomas A. Standish Data Structure Techniques , 1980 .