Skip to main content

NREVERSAL of fortune — The thermodynamics of garbage collection

  • Invited Speaker
  • Conference paper
  • First Online:

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 637))

Abstract

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.

Apologies to Alan Dershowitz.

This is a preview of subscription content, log in via an institution.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  • Abadi, M. & Plotkin, G.D. “A Logical View of Composition and Refinement”. Proc. ACM POPL 18 (Jan. 1991),323–332.

    Google Scholar 

  • Agrawal, H. et al. “An Execution-Backtracking Approach to Debugging”. IEEE Software 8,3 (May 1991),21–26.

    Article  Google Scholar 

  • Appel, A.W. “Simple Generational Garbage Collection and Fast Allocation”. Soft. Prac. & Exper. 19,2 (Feb. 1989), 171–183.

    Google Scholar 

  • Appel, A.W. “A Runtime System”. Lisp & Symbolic Comput. 3,4 (Nov. 1990),343–380.

    Google Scholar 

  • Archer, J.E., et al. “User recovery and reversal in interactive systems”. ACM TOPLAS 6,1 (Jan. 1984),1–19.

    Article  Google Scholar 

  • Bacon, David F., et al. “Optimistic Parallelization of Communicating Sequential Processes”. Proc. 3rd ACM Sigplan PPOPP, Williamsburg, VA, April, 1991,155–166.

    Google Scholar 

  • Baker, H.G. “Shallow Binding in Lisp 1.5”. CACM 21,7 (July 1978),565–569.

    Google Scholar 

  • 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 

  • Baker, H.G. “The Nimble Type Inferencer for Common Lisp-84”. Submitted to ACM TOPLAS, 1990.

    Google Scholar 

  • 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 

  • Baker, H.G. “Equal Rights for Functional Objects”. ACM OOPS Messenger, 1992, to appear.

    Google Scholar 

  • Baker, H.G. “Cache-Conscious Copying Collectors”. OOPSLA'91 GC Workshop, Oct. 1991.

    Google Scholar 

  • Baker, H.G. “Lively Linear Lisp — ‘Look Ma, No Garbage!'”. ACM Sigplan Not., 1992, to appear.

    Google Scholar 

  • Balzer, R.M. “EXDAMS: Extendable Debugging and Monitoring System”. Proc. AFIPS 1969 SJCC 34, AFIPS Press, Montvale, NJ,567–580.

    Google Scholar 

  • Barghouti, N.S. & Kaiser, G.E. “Concurrency Control in Advanced Database Applications”. ACM Comput. Surv. 23,3 (Sept. 1991),269–317.

    Article  Google Scholar 

  • Barth, J. “Shifting garbage collection overhead to compile time”. CACM 20,7 (July 1977),513–518.

    Google Scholar 

  • 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 

  • Barton, Ed. Conservative Logic. 6.895 Term Paper, MIT, May, 1978.

    Google Scholar 

  • Bawden, Alan. “Connection Graphs”. Proc. ACM Conf. Lisp & Funct. Progr., Camb., MA, Aug. 1986.

    Google Scholar 

  • 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 

  • 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.

    Article  Google Scholar 

  • Bennett, Charles. “Logical Reversibility of Computation”. IBM J. Res. Develop. 6 (1973),525–532.

    Google Scholar 

  • Bennett, Charles. “Thermodynamics of Computation”. Int'l. J. Theor. Phys. 21 (1982),905–940.

    Article  Google Scholar 

  • Bennett, Charles. “Notes on the History of Reversible Computation”. IBM J. Res. Develop. 32,1 (1988),16–23.

    Google Scholar 

  • Bennett, Charles. “Time/Space Trade-offs for Reversible Computation”. SIAM J. Computing 18,4 (Aug. 1989).

    Google Scholar 

  • Berry, G., and Boudol, G. “The Chemical Abstract Machine”. ACM POPL 17, San Francisco, CA, Jan. 1990.

    Google Scholar 

  • Chase, David. “Garbage Collection and Other Optimizations”. PhD Thesis, Rice U., Nov. 1987.

    Google Scholar 

  • Chen, W., and Udding, J.T. “Program Inversion: More than Fun!”. Sci. of Computer Progr. 15 (1990),1–13.

    Article  Google Scholar 

  • Chen, W. “A formal approach to program inversion”. Proc. ACM 18th Comp. Sci. Conf., Feb., 1990,398–403.

    Google Scholar 

  • Cheney, C.J. “A Nonrecursive List Compacting Algorithm”. CACM 13,11 (Nov. 1970),677–678.

    Google Scholar 

  • Clarke, E.M. “Synthesis of resource invariants for concurrent programs”. ACM TOPLAS 2,3 (July 1980).

    Google Scholar 

  • Cohen, Jacques. “Non-Deterministic Algorithms”. Comput. Surveys 11,2 (June 1979),79–94.

    Article  Google Scholar 

  • Corman, T.H., et al. Introduction to Algorithms. MIT Press, Cambridge, MA, 1990.

    Google Scholar 

  • 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 

  • Coveney, P.V. & Marcer, P.J. “Irreversibility and computation”. Specs. in Sci. & Tech. 14,1 (1991?),51–55.

    Google Scholar 

  • Deutsch, D. “Quantum Theory, the Church-Turing Hypothesis, and Universal Quantum Computers”. Proc. Roy. Soc. (1985).

    Google Scholar 

  • Dijkstra, E.W. A Discipline of Programming. Prentice-Hall, Englewood Cliffs, NJ, 1976.

    Google Scholar 

  • Dobkin, D.P., and Munro, J.I. “Efficient Uses of the Past”. Proc. ACM FOCS 21 (1980),200–206.

    Google Scholar 

  • Drescher, G.L. “Demystifying Quantum Mechanics: A Simple Universe with Quantum Uncertainty”. Complex Sys. 5 (1991),207–237.

    Google Scholar 

  • 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 

  • Feynman, Richard P., et al. The Feynman Lectures on Physics, Vol. I. Addison-Wesley, Reading, MA, 1963.

    Google Scholar 

  • Feynman, Richard P. “Quantum Mechanical Computers”. Founds. of Physics 16,6 (1986),507–531.

    Article  Google Scholar 

  • Fisher, J. “Trace scheduling: A technique for global microcode compaction”. IEEE Tr. Comps. C-30,7 (July 1981),478–490.

    Google Scholar 

  • Floyd, R.W. “Nondeterministic Algorithms”. J. ACM 14,4 (Oct. 1967),636–644.

    Article  Google Scholar 

  • Fredkin, E., and Toffoli, T. “Conservative Logic”. Int'l. J. Theor. Physics 21,3/4 (1982),219–253.

    Article  Google Scholar 

  • Girard, J.-Y. “Linear Logic”. Theoretical Computer Sci. 50 (1987),1–102.

    Article  Google Scholar 

  • Grishman, R. “The debugging system AIDS”. AFIPS 1970 SJCC 41, AFIPS Press, Montvale, NJ 1193–1202.

    Google Scholar 

  • 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 

  • Harel, David. First Order Dynamic Logic. Springer-Verlag LNCS 68, 1979.

    Google Scholar 

  • 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.

    Article  Google Scholar 

  • 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 

  • Hederman, Lucy. “Compile Time Garbage Collection”. MS Thesis, Rice U. Comp. Sci. Dept., Sept. 1988.

    Google Scholar 

  • Heering, J., and Klint, P. “Towards monolingual programming environments”. ACM TOPLAS 7,2 (April 1985),183–213.

    Article  Google Scholar 

  • Herlihy, Maurice. “Wait-Free Synchronization”. ACM TOPLAS 11,1 (Jan. 1991), 124–149.

    Article  Google Scholar 

  • Hofstadter, Douglas R. Gödel, Escher, Bach: an Eternal Golden Braia. Vintage Bks., Random House, NY, 1979.

    Google Scholar 

  • Inoue, K., et al. “Analysis of functional programs to detect run-time garbage cells”. ACM TOPLAS 10,4 (Oct. 1988),555–578.

    Article  Google Scholar 

  • Johnsson, T. “Lambda lifting: transforming programs to recursive equations”. Proc. FPCA, Nancy, France, Springer LNCS 201, 1985,190–203.

    Google Scholar 

  • Kay, A.C. “Microelectronics and the Personal Computer”. Sci. Amer. 237,3 (Sept. 1977),230–244.

    Google Scholar 

  • Keller, Robert M., et al. “An Architecture for a Loosely-Coupled Parallel Processor”. Tech. Rep. UUCS-78-105, Oct. 1978,50p.

    Google Scholar 

  • 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 

  • Kieburtz, R. B. “The G-machine: a fast, graph-reduction evaluator”. Proc. IFIP FPCA, Nancy, France, 1985.

    Google Scholar 

  • Kieburtz, Richard B. “A RISC Architecture for Symbolic Computation”. Proc. ASPLOS II, Sigplan Not. 22,10 (Oct. 1987),146–155.

    Google Scholar 

  • Korth, H.F., et al. “Formal approach to recovery by compensating transactions”. Proc. 16th Int'l. Conf. on Very Large Databases, 1990.

    Google Scholar 

  • Kung, H.T. & Robinson, J.T. “On optimistic methods for concurrency control”. ACM Trans. on DB Sys. 6,2 (June 1981).

    Google Scholar 

  • Jefferson, David R. “Virtual Time”. ACM TOPLAS 7,3 (July 1985),404–425.

    Article  Google Scholar 

  • Lafont, Yves. “The Linear Abstract Machine”. Theor. Computer Sci. 59 (1988),157–180.

    Article  Google Scholar 

  • Lafont, Yves. “Interaction Nets”. ACM POPL 17, San Franciso, CA, Jan. 1990,95–108.

    Google Scholar 

  • Lafont, Yves. “The Paradigm of Interaction (Short Version)”. Unpubl. manuscript, July 12, 1991, 18p.

    Google Scholar 

  • Lafora, F. & Soffa, M.L. “Reverse Execution in a Generalized Control Regime”. Comp. Lang. 9,3/4 (1984), 183–192.

    Article  Google Scholar 

  • Landauer, R. “Dissipation and Noise Immunity in Computation and Communication”. Nature 335 (Oct. 1988),779–784.

    Article  Google Scholar 

  • 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 

  • 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 

  • Leeman, G.B. “A Formal Approach to Undo Operations in Programming Languages”. ACM TOPLAS 8,1 (Jan. 1986),50–87.

    Article  Google Scholar 

  • Levy, E., et al. “An Optimistic Commit Protocol for Distributed Transaction Management”. Proc. ACM SIGMOD, Denver, CO, May 1991,88–97.

    Google Scholar 

  • Lewis, H.R., & Papadimitriou, C.H. “Symmetric Space-bounded Computation”. Theor. Comp. Sci. 19 (1982),161–187.

    Article  Google Scholar 

  • Lieberman, H., & Hewitt, C. “A Real-Time Garbage Collector Based on the Lifetimes of Objects”. CACM 26,6 (June 1983),419–429.

    Google Scholar 

  • Lindstrom, Gary. “Efficiency in Nondeterministic Control through Non-Forgetful Backtracking”. Tech. Rep. UUCS-77-114, Oct. 1977,18p.

    Google Scholar 

  • MacLennan, B.J. “Values and Objects in Programming Languages”. Sigplan Not. 17,12 (Dec. 1982),70–79.

    Google Scholar 

  • Manthey, M.J., & Moret, B.M.E. “The Computational Metaphor and Quantum Physics”. CACM 26,2 (Feb. 1983),137–145.

    Google Scholar 

  • Margolus, Norman. “Physics-Like Models of Computation”. Elsevier North-Holland, Physica 10D (1984),81–95.

    Google Scholar 

  • Margolus, Norman H. Physics and Computation. Ph.D. Thesis, MIT/LCS/TR-415, March 1988,188p.

    Google Scholar 

  • Mattson, R.L., et al. “Evaluation Techniques for Storage Hierarchies”. IBM Sys. J. 9,2 (1970),78–117.

    Google Scholar 

  • 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 

  • McDowell, C.E. & Helmbold, D.P. “Debugging concurrent programs”. ACM Comput. Surv. 21,4 (Dec. 1989),593–622.

    Article  Google Scholar 

  • Miller, B.P. & Choi, J.-D. “A mechanism for efficient debugging of parallel programs”. Proc. ACM PLDI, 1988,135–144.

    Google Scholar 

  • 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 

  • Nylin, W.C.Jr., and Harvill, J.B. “Multiple Tense Computer Programming”. Sigplan Not. 11,12 (Dec. 1976),74–93.

    Google Scholar 

  • 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 

  • Penrose, R. The Emperor's New Mind: Concerning Computers, Minds, and the Laws of Physics. Penguin Bks, London, 1989.

    Google Scholar 

  • Peyton-Jones, S.L. The Implementation of Functional Programming Languages. Prentice-Hall, NY, 1987.

    Google Scholar 

  • Planck, Max. Treatise on Thermodynamics. Transl. Ogg, A., Dover Publ., NY, 1945.

    Google Scholar 

  • Ressler, A.L. The Design of a Conservative Logic Computer and a Graphical Editor Simulator. M.S. Th., MIT, 1981, 128p.

    Google Scholar 

  • 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 

  • Romanenko, Alexander. “Inversion and Metacomputation”. ACM PEPM'91, New Haven, CT, June 1991,12-22.

    Google Scholar 

  • Rosenschein, Stanley J. “Plan Synthesis: A Logical Perspective”. Proc. IJCAI-81, Vancouver, Canada, Aug. 1981, 331–337.

    Google Scholar 

  • Ruggieri, C. & Murtagh, T. P. “Lifetime analysis of dynamically allocated objects”. ACM POPL 88,285–293.

    Google Scholar 

  • 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 

  • Shoman, Y., and McDermott, D.V. “Directed Relations and Inversion of Prolog Programs”. Proc. Conf. of 5th Gen. Comp. Sys., ICOT, 1984.

    Google Scholar 

  • Sleator, D.D. & Tarjan, R.E. “Amortized Efficiency of List Update and Paging Rules”. CACM 28,2 (Feb. 1985),202–208.

    Google Scholar 

  • 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 

  • Strom, R.E., et al. “A recoverable object store”. IBM Watson Research Ctr., 1988.

    Google Scholar 

  • Strothotte, T.W., and Cormack, G.V. “Structured Program Lookahead”. Comput. Lang. 12,2 (1987),95–108.

    Article  Google Scholar 

  • Suzuki, N. “Analysis of Pointer ‘Rotation'”. CACM 25,5 (May 1982)330–335.

    Google Scholar 

  • Toffoli, T. “Reversible Computing”. MIT/LCS/TM-151, Feb. 1980, 36p.

    Google Scholar 

  • Toffoli, T. “Reversible Computing”. In De Bakker & van Leeuwen, eds. Automata, Languages and Programming. Springer-Verlag (1980),632–644.

    Google Scholar 

  • Toffoli, T. “Bicontinuous Extensions of Invertible Combinatorial Functions”. Math. Sys. Theor. 14 (1981),13–23.

    Article  Google Scholar 

  • Toffoli, T. “Physics and Computation”. Int'l. J. Theor. Phys. 21, 3/4 (1982),165–175.

    Article  Google Scholar 

  • 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 

  • Turner, D. “A New Implementation Technique for Applicative Languages”. SW—Pract.&Exper. 9 (1979),31–49.

    Google Scholar 

  • 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 

  • Wadler, P. “Views: A way for pattern matching to cohabit with data abstraction”. ACM POPL 14 (1987),307–313.

    Google Scholar 

  • Wadler, P. “Is there a use for linear logic?”. Proc. ACM PEPM'91, New Haven, June, 1991,255–273.

    Google Scholar 

  • Wakeling, D. & Runciman, C. “Linearity and Laziness”. Proc. Funct. Progr. & Comp. Arch., Springer LNCS 523, 1991,215–240.

    Google Scholar 

  • Wilson, P.R. & Moher, T.G. “Demonic memory for process histories”. Proc. Sigplan PLDI, June 1989.

    Google Scholar 

  • Zelkowitz, M.V. “Reversible Execution”. CACM 16,9 (Sept. 1973),566–566.

    Google Scholar 

  • Zurek, W.H., ed. Complexity, Entropy and the Physics of Information. Addison-Wesley, Redwood City, 1990.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Yves Bekkers Jacques Cohen

Rights and permissions

Reprints and permissions

Copyright information

© 1992 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Baker, H.G. (1992). NREVERSAL of fortune — The thermodynamics of garbage collection. In: Bekkers, Y., Cohen, J. (eds) Memory Management. IWMM 1992. Lecture Notes in Computer Science, vol 637. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0017210

Download citation

  • DOI: https://doi.org/10.1007/BFb0017210

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-55940-5

  • Online ISBN: 978-3-540-47315-2

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics