NREVERSAL of fortune — The thermodynamics of garbage collection

  • Henry G. Baker
Invited Speaker
Part of the Lecture Notes in Computer Science book series (LNCS, volume 637)


The need to reverse a computation arises in many contexts—debugging, editor undoing, optimistic concurrency undoing, speculative computation undoing, trace scheduling, exception handling undoing, database recovery, optimistic discrete event simulations, subjunctive computing, etc. The need to analyze a reversed computation arises in the context of static analysis—liveness analysis, strictness analysis, type inference, etc. Traditional means for restoring a computation to a previous state involve checkpoints; checkpoints require time to copy, as well as space to store, the copied material. Traditional reverse abstract interpretation produces relatively poor information due to its inability to guess the previous values of assigned-to variables.

We propose an abstract computer model and a programming language—Ψ-Lisp—whose primitive operations are injective and hence reversible, thus allowing arbitrary undoing without the overheads of checkpointing. Such a computer can be built from reversible conservative logic circuits, with the serendipitous advantage of dissipating far less heat than traditional Boolean AND/OR/NOT circuits. Unlike functional languages, which have one “state” for all times, Ψ-Lisp has at all times one “state”, with unique predecessor and successor states.

Compiling into a reversible pseudocode can have benefits even when targeting a traditional computer. Certain optimizations, e.g., update-in-place, and compile-time garbage collection may be more easily performed, because the information may be elicited without the difficult and time-consuming iterative abstract interpretation required for most non-reversible models.

In a reversible machine, garbage collection for recycling storage can always be performed by a reversed (sub)computation. While this “collection is reversed mutation” insight does not reduce space requirements when used for the computation as a whole, it does save space when used to recycle at finer scales. This insight also provides an explanation for the fundamental importance of the push-down stack both for recognizing palindromes and for managing storage.

Reversible computers are related to Prolog, linear logic and chemical abstract machines.


Garbage Collection Functional Language Reversible Computer Lambda Calculus Garbage Collector 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. Abadi, M. & Plotkin, G.D. “A Logical View of Composition and Refinement”. Proc. ACM POPL 18 (Jan. 1991),323–332.Google Scholar
  2. Agrawal, H. et al. “An Execution-Backtracking Approach to Debugging”. IEEE Software 8,3 (May 1991),21–26.CrossRefGoogle Scholar
  3. Appel, A.W. “Simple Generational Garbage Collection and Fast Allocation”. Soft. Prac. & Exper. 19,2 (Feb. 1989), 171–183.Google Scholar
  4. Appel, A.W. “A Runtime System”. Lisp & Symbolic Comput. 3,4 (Nov. 1990),343–380.Google Scholar
  5. Archer, J.E., et al. “User recovery and reversal in interactive systems”. ACM TOPLAS 6,1 (Jan. 1984),1–19.CrossRefGoogle Scholar
  6. Bacon, David F., et al. “Optimistic Parallelization of Communicating Sequential Processes”. Proc. 3rd ACM Sigplan PPOPP, Williamsburg, VA, April, 1991,155–166.Google Scholar
  7. Baker, H.G. “Shallow Binding in Lisp 1.5”. CACM 21,7 (July 1978),565–569.Google Scholar
  8. Baker, H.G. “Unify and Conquer (Garbage, Updating, Aliasing, ...) in Functional Languages”. Proc. 1990 ACM Conf. on Lisp and Functional Progr., June 1990,218–226.Google Scholar
  9. Baker, H.G. “The Nimble Type Inferencer for Common Lisp-84”. Submitted to ACM TOPLAS, 1990.Google Scholar
  10. Baker, H.G. “CONS Should not CONS its Arguments, or, A Lazy Alloc is a Smart Alloc”. ACM Sigplan Not. 27,3 (March 1992),24–34.Google Scholar
  11. Baker, H.G. “Equal Rights for Functional Objects”. ACM OOPS Messenger, 1992, to appear.Google Scholar
  12. Baker, H.G. “Cache-Conscious Copying Collectors”. OOPSLA'91 GC Workshop, Oct. 1991.Google Scholar
  13. Baker, H.G. “Lively Linear Lisp — ‘Look Ma, No Garbage!'”. ACM Sigplan Not., 1992, to appear.Google Scholar
  14. Balzer, R.M. “EXDAMS: Extendable Debugging and Monitoring System”. Proc. AFIPS 1969 SJCC 34, AFIPS Press, Montvale, NJ,567–580.Google Scholar
  15. Barghouti, N.S. & Kaiser, G.E. “Concurrency Control in Advanced Database Applications”. ACM Comput. Surv. 23,3 (Sept. 1991),269–317.CrossRefGoogle Scholar
  16. Barth, J. “Shifting garbage collection overhead to compile time”. CACM 20,7 (July 1977),513–518.Google Scholar
  17. Barth, Paul S., et al. “M-Structures: Extending a Parallel, Non-strict, Functional Language with State”. Proc. Funct. Progr. Langs. & Computer Arch., LNCS 523, Springer-Verlag, Aug. 1991,538–568.Google Scholar
  18. Barton, Ed. Conservative Logic. 6.895 Term Paper, MIT, May, 1978.Google Scholar
  19. Bawden, Alan. “Connection Graphs”. Proc. ACM Conf. Lisp & Funct. Progr., Camb., MA, Aug. 1986.Google Scholar
  20. Beeler, M., Gosper, R.W, and Schroeppel, R. “HAKMEM”. AI Memo 239, MIT AI Lab., Feb. 1972. Important items: 102, 103, 104, 149, 150, 161, 166, 172.Google Scholar
  21. Benioff, Paul. “Quantum Mechanical Hamiltonian Models of Discrete Processes that Erase Their Own Histories: Application to Turing Machines”. Int'l. J. Theor. Phys. 21 (1982),177–201.CrossRefGoogle Scholar
  22. Bennett, Charles. “Logical Reversibility of Computation”. IBM J. Res. Develop. 6 (1973),525–532.Google Scholar
  23. Bennett, Charles. “Thermodynamics of Computation”. Int'l. J. Theor. Phys. 21 (1982),905–940.CrossRefGoogle Scholar
  24. Bennett, Charles. “Notes on the History of Reversible Computation”. IBM J. Res. Develop. 32,1 (1988),16–23.Google Scholar
  25. Bennett, Charles. “Time/Space Trade-offs for Reversible Computation”. SIAM J. Computing 18,4 (Aug. 1989).Google Scholar
  26. Berry, G., and Boudol, G. “The Chemical Abstract Machine”. ACM POPL 17, San Francisco, CA, Jan. 1990.Google Scholar
  27. Chase, David. “Garbage Collection and Other Optimizations”. PhD Thesis, Rice U., Nov. 1987.Google Scholar
  28. Chen, W., and Udding, J.T. “Program Inversion: More than Fun!”. Sci. of Computer Progr. 15 (1990),1–13.CrossRefGoogle Scholar
  29. Chen, W. “A formal approach to program inversion”. Proc. ACM 18th Comp. Sci. Conf., Feb., 1990,398–403.Google Scholar
  30. Cheney, C.J. “A Nonrecursive List Compacting Algorithm”. CACM 13,11 (Nov. 1970),677–678.Google Scholar
  31. Clarke, E.M. “Synthesis of resource invariants for concurrent programs”. ACM TOPLAS 2,3 (July 1980).Google Scholar
  32. Cohen, Jacques. “Non-Deterministic Algorithms”. Comput. Surveys 11,2 (June 1979),79–94.CrossRefGoogle Scholar
  33. Corman, T.H., et al. Introduction to Algorithms. MIT Press, Cambridge, MA, 1990.Google Scholar
  34. Cousot, P., and Cousot, R. “Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints”. Proc. ACM POPL 4 (1977),238–252.Google Scholar
  35. Coveney, P.V. & Marcer, P.J. “Irreversibility and computation”. Specs. in Sci. & Tech. 14,1 (1991?),51–55.Google Scholar
  36. Deutsch, D. “Quantum Theory, the Church-Turing Hypothesis, and Universal Quantum Computers”. Proc. Roy. Soc. (1985).Google Scholar
  37. Dijkstra, E.W. A Discipline of Programming. Prentice-Hall, Englewood Cliffs, NJ, 1976.Google Scholar
  38. Dobkin, D.P., and Munro, J.I. “Efficient Uses of the Past”. Proc. ACM FOCS 21 (1980),200–206.Google Scholar
  39. Drescher, G.L. “Demystifying Quantum Mechanics: A Simple Universe with Quantum Uncertainty”. Complex Sys. 5 (1991),207–237.Google Scholar
  40. Feldman, S., and Brown, C. “IGOR: A System for Program Debugging via Reversible Execution”. Proc. Sigplan/Sigops WS on Parl & Distr. Debugging, May 1988,112–123.Google Scholar
  41. Feynman, Richard P., et al. The Feynman Lectures on Physics, Vol. I. Addison-Wesley, Reading, MA, 1963.Google Scholar
  42. Feynman, Richard P. “Quantum Mechanical Computers”. Founds. of Physics 16,6 (1986),507–531.CrossRefGoogle Scholar
  43. Fisher, J. “Trace scheduling: A technique for global microcode compaction”. IEEE Tr. Comps. C-30,7 (July 1981),478–490.Google Scholar
  44. Floyd, R.W. “Nondeterministic Algorithms”. J. ACM 14,4 (Oct. 1967),636–644.CrossRefGoogle Scholar
  45. Fredkin, E., and Toffoli, T. “Conservative Logic”. Int'l. J. Theor. Physics 21,3/4 (1982),219–253.CrossRefGoogle Scholar
  46. Girard, J.-Y. “Linear Logic”. Theoretical Computer Sci. 50 (1987),1–102.CrossRefGoogle Scholar
  47. Grishman, R. “The debugging system AIDS”. AFIPS 1970 SJCC 41, AFIPS Press, Montvale, NJ 1193–1202.Google Scholar
  48. Halpern, J.Y., et al. “The Semantics of Local Storage, or What Makes the Free-List Free?”. ACM POPL 11, 1984,245–257.Google Scholar
  49. Harel, David. First Order Dynamic Logic. Springer-Verlag LNCS 68, 1979.Google Scholar
  50. Harms, D.E., and Weide, B.W. “Copying and Swapping: Influences on the Design of Reusable Software Components”. IEEE Trans. SW Engrg. 17,5 (May 1991),424–435.CrossRefGoogle Scholar
  51. Harrison, P.G. “Function Inversion”. In Jones, N., et al, eds. Proc. Workshop on Partial Evaluation and Mixed Computation, Gammel Avernaes, Denmark, Oct. 1987, North-Holland, 1988.Google Scholar
  52. Hederman, Lucy. “Compile Time Garbage Collection”. MS Thesis, Rice U. Comp. Sci. Dept., Sept. 1988.Google Scholar
  53. Heering, J., and Klint, P. “Towards monolingual programming environments”. ACM TOPLAS 7,2 (April 1985),183–213.CrossRefGoogle Scholar
  54. Herlihy, Maurice. “Wait-Free Synchronization”. ACM TOPLAS 11,1 (Jan. 1991), 124–149.CrossRefGoogle Scholar
  55. Hofstadter, Douglas R. Gödel, Escher, Bach: an Eternal Golden Braia. Vintage Bks., Random House, NY, 1979.Google Scholar
  56. Inoue, K., et al. “Analysis of functional programs to detect run-time garbage cells”. ACM TOPLAS 10,4 (Oct. 1988),555–578.CrossRefGoogle Scholar
  57. Johnsson, T. “Lambda lifting: transforming programs to recursive equations”. Proc. FPCA, Nancy, France, Springer LNCS 201, 1985,190–203.Google Scholar
  58. Kay, A.C. “Microelectronics and the Personal Computer”. Sci. Amer. 237,3 (Sept. 1977),230–244.Google Scholar
  59. Keller, Robert M., et al. “An Architecture for a Loosely-Coupled Parallel Processor”. Tech. Rep. UUCS-78-105, Oct. 1978,50p.Google Scholar
  60. Kieburtz, Richard B. “Programming without pointer variables”. Proc. Conf. on Data: Abstraction, Definition and Structure, Sigplan Not. 11 (special issue 1976),95–107.Google Scholar
  61. Kieburtz, R. B. “The G-machine: a fast, graph-reduction evaluator”. Proc. IFIP FPCA, Nancy, France, 1985.Google Scholar
  62. Kieburtz, Richard B. “A RISC Architecture for Symbolic Computation”. Proc. ASPLOS II, Sigplan Not. 22,10 (Oct. 1987),146–155.Google Scholar
  63. Korth, H.F., et al. “Formal approach to recovery by compensating transactions”. Proc. 16th Int'l. Conf. on Very Large Databases, 1990.Google Scholar
  64. Kung, H.T. & Robinson, J.T. “On optimistic methods for concurrency control”. ACM Trans. on DB Sys. 6,2 (June 1981).Google Scholar
  65. Jefferson, David R. “Virtual Time”. ACM TOPLAS 7,3 (July 1985),404–425.CrossRefGoogle Scholar
  66. Lafont, Yves. “The Linear Abstract Machine”. Theor. Computer Sci. 59 (1988),157–180.CrossRefGoogle Scholar
  67. Lafont, Yves. “Interaction Nets”. ACM POPL 17, San Franciso, CA, Jan. 1990,95–108.Google Scholar
  68. Lafont, Yves. “The Paradigm of Interaction (Short Version)”. Unpubl. manuscript, July 12, 1991, 18p.Google Scholar
  69. Lafora, F. & Soffa, M.L. “Reverse Execution in a Generalized Control Regime”. Comp. Lang. 9,3/4 (1984), 183–192.CrossRefGoogle Scholar
  70. Landauer, R. “Dissipation and Noise Immunity in Computation and Communication”. Nature 335 (Oct. 1988),779–784.CrossRefGoogle Scholar
  71. LeBlanc, T.J., and Mellor-Crummey, J.M. “Debugging parallel programs with Instant Replay”. IEEE Tr. Comp. 36,4 (April 1987),471–482.Google Scholar
  72. Leeman, G.B. “Building undo/redo operations into the C language”. Proc. IEEE 15th Annual Int'l. Symp. on Fault-Tolerant Computing, 1985,410–415.Google Scholar
  73. Leeman, G.B. “A Formal Approach to Undo Operations in Programming Languages”. ACM TOPLAS 8,1 (Jan. 1986),50–87.CrossRefGoogle Scholar
  74. Levy, E., et al. “An Optimistic Commit Protocol for Distributed Transaction Management”. Proc. ACM SIGMOD, Denver, CO, May 1991,88–97.Google Scholar
  75. Lewis, H.R., & Papadimitriou, C.H. “Symmetric Space-bounded Computation”. Theor. Comp. Sci. 19 (1982),161–187.CrossRefGoogle Scholar
  76. Lieberman, H., & Hewitt, C. “A Real-Time Garbage Collector Based on the Lifetimes of Objects”. CACM 26,6 (June 1983),419–429.Google Scholar
  77. Lindstrom, Gary. “Efficiency in Nondeterministic Control through Non-Forgetful Backtracking”. Tech. Rep. UUCS-77-114, Oct. 1977,18p.Google Scholar
  78. MacLennan, B.J. “Values and Objects in Programming Languages”. Sigplan Not. 17,12 (Dec. 1982),70–79.Google Scholar
  79. Manthey, M.J., & Moret, B.M.E. “The Computational Metaphor and Quantum Physics”. CACM 26,2 (Feb. 1983),137–145.Google Scholar
  80. Margolus, Norman. “Physics-Like Models of Computation”. Elsevier North-Holland, Physica 10D (1984),81–95.Google Scholar
  81. Margolus, Norman H. Physics and Computation. Ph.D. Thesis, MIT/LCS/TR-415, March 1988,188p.Google Scholar
  82. Mattson, R.L., et al. “Evaluation Techniques for Storage Hierarchies”. IBM Sys. J. 9,2 (1970),78–117.Google Scholar
  83. McCarthy, John. “The Inversion of Functions defined by Turing Machines”. In Shannon, CE., and McCarthy, J., eds. Automata Studies, Princeton, 1956,177–181.Google Scholar
  84. McDowell, C.E. & Helmbold, D.P. “Debugging concurrent programs”. ACM Comput. Surv. 21,4 (Dec. 1989),593–622.CrossRefGoogle Scholar
  85. Miller, B.P. & Choi, J.-D. “A mechanism for efficient debugging of parallel programs”. Proc. ACM PLDI, 1988,135–144.Google Scholar
  86. Morita, K. “A Simple Construction Method of a Reversible Finite Automaton out of Fredkin Gates, and its Related Problem”. Trans. IEICE E 73, 6 (1990),978–984.Google Scholar
  87. Nylin, W.C.Jr., and Harvill, J.B. “Multiple Tense Computer Programming”. Sigplan Not. 11,12 (Dec. 1976),74–93.Google Scholar
  88. Pan, D.Z., and Linton, M.A. “Supporting reverse execution of parallel programs”. Proc. ACM Sigplan/Sigops WS on Par. & Distr. Debugging, May 1988,112–123.Google Scholar
  89. Penrose, R. The Emperor's New Mind: Concerning Computers, Minds, and the Laws of Physics. Penguin Bks, London, 1989.Google Scholar
  90. Peyton-Jones, S.L. The Implementation of Functional Programming Languages. Prentice-Hall, NY, 1987.Google Scholar
  91. Planck, Max. Treatise on Thermodynamics. Transl. Ogg, A., Dover Publ., NY, 1945.Google Scholar
  92. Ressler, A.L. The Design of a Conservative Logic Computer and a Graphical Editor Simulator. M.S. Th., MIT, 1981, 128p.Google Scholar
  93. de Roever, Willem P. “On Backtracking and Greatest Fixpoints”. In Neuhold, Erich J., Ed. Formal Description of Programming Concepts, North-Holland, Amsterdam, 1978.Google Scholar
  94. Romanenko, Alexander. “Inversion and Metacomputation”. ACM PEPM'91, New Haven, CT, June 1991,12-22.Google Scholar
  95. Rosenschein, Stanley J. “Plan Synthesis: A Logical Perspective”. Proc. IJCAI-81, Vancouver, Canada, Aug. 1981, 331–337.Google Scholar
  96. Ruggieri, C. & Murtagh, T. P. “Lifetime analysis of dynamically allocated objects”. ACM POPL 88,285–293.Google Scholar
  97. Schorr, H., & Waite, W.M. “An efficient machine-independent procedure for garbage collection in various list structures”. CACM 10,8 (Aug. 1967),501–506.Google Scholar
  98. Shoman, Y., and McDermott, D.V. “Directed Relations and Inversion of Prolog Programs”. Proc. Conf. of 5th Gen. Comp. Sys., ICOT, 1984.Google Scholar
  99. Sleator, D.D. & Tarjan, R.E. “Amortized Efficiency of List Update and Paging Rules”. CACM 28,2 (Feb. 1985),202–208.Google Scholar
  100. Smith, J.M., and Maguire, G.Q., Jr. “Transparent concurrent execution of mutually exclusive alternatives”. Proc. 9th Int'l. Conf. on Distr. Computer Sys., Newport Bch., CA, June 1989.Google Scholar
  101. Strom, R.E., et al. “A recoverable object store”. IBM Watson Research Ctr., 1988.Google Scholar
  102. Strothotte, T.W., and Cormack, G.V. “Structured Program Lookahead”. Comput. Lang. 12,2 (1987),95–108.CrossRefGoogle Scholar
  103. Suzuki, N. “Analysis of Pointer ‘Rotation'”. CACM 25,5 (May 1982)330–335.Google Scholar
  104. Toffoli, T. “Reversible Computing”. MIT/LCS/TM-151, Feb. 1980, 36p.Google Scholar
  105. Toffoli, T. “Reversible Computing”. In De Bakker & van Leeuwen, eds. Automata, Languages and Programming. Springer-Verlag (1980),632–644.Google Scholar
  106. Toffoli, T. “Bicontinuous Extensions of Invertible Combinatorial Functions”. Math. Sys. Theor. 14 (1981),13–23.CrossRefGoogle Scholar
  107. Toffoli, T. “Physics and Computation”. Int'l. J. Theor. Phys. 21, 3/4 (1982),165–175.CrossRefGoogle Scholar
  108. Tolmach, A.P., and Appel, A.W. “Debugging Standard ML without Reverse Engineering”. Proc. ACM Lisp & Funct. Progr. Conf., Nice, France, June 1990,1–12.Google Scholar
  109. Turner, D. “A New Implementation Technique for Applicative Languages”. SW—Pract.&Exper. 9 (1979),31–49.Google Scholar
  110. Vitter, J.S. “US&R: a new framework for redoing”. ACM Symp. on Pract. SW Dev. Envs., Pitts., PA, April 1984,168–176.Google Scholar
  111. Wadler, P. “Views: A way for pattern matching to cohabit with data abstraction”. ACM POPL 14 (1987),307–313.Google Scholar
  112. Wadler, P. “Is there a use for linear logic?”. Proc. ACM PEPM'91, New Haven, June, 1991,255–273.Google Scholar
  113. Wakeling, D. & Runciman, C. “Linearity and Laziness”. Proc. Funct. Progr. & Comp. Arch., Springer LNCS 523, 1991,215–240.Google Scholar
  114. Wilson, P.R. & Moher, T.G. “Demonic memory for process histories”. Proc. Sigplan PLDI, June 1989.Google Scholar
  115. Zelkowitz, M.V. “Reversible Execution”. CACM 16,9 (Sept. 1973),566–566.Google Scholar
  116. Zurek, W.H., ed. Complexity, Entropy and the Physics of Information. Addison-Wesley, Redwood City, 1990.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1992

Authors and Affiliations

  • Henry G. Baker
    • 1
  1. 1.Nimble Computer CorporationEncinoUSA

Personalised recommendations