Skip to main content

Reference Counting for Reversible Languages

  • Conference paper
Reversible Computation (RC 2014)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 8507))

Included in the following conference series:

Abstract

Modern programming languages and operating systems use heap memory that allows allocation and deallocation of memory to be decoupled, so they don’t follow a stack discipline. Axelsen and Glück have presented a reversible heap manager where allocation and deallocation are each other’s logical inverses: Freeing a block of memory is done by running the allocation procedure backwards.

Axelsen and Glück use this heap manager to sketch implementation of a simple reversible functional language where pattern matching a constructor is the inverse of construction, so pattern-matching implies deallocation. This requires the language to be linear: A pointer can not be copied and it can only be eliminated by deallocating the node to which it points.

We overcome this limitation by adding reference counts to nodes: Copying a pointer to a node increases the reference count of the node and eliminating a pointer decreases the reference count. We show reversible implementations of operations on nodes with reference counts. We then show these operations can be used when implementing a reversible functional language RCFUN to the reversible imperative language Janus.

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

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Axelsen, H.B.: Clean translation of an imperative reversible programming language. In: Knoop, J. (ed.) CC 2011. LNCS, vol. 6601, pp. 144–163. Springer, Heidelberg (2011)

    Chapter  Google Scholar 

  2. Axelsen, H.B., Glück, R.: Reversible representation and manipulation of constructor terms in the heap. In: Dueck, G.W., Miller, D.M. (eds.) RC 2013. LNCS, vol. 7948, pp. 96–109. Springer, Heidelberg (2013)

    Chapter  Google Scholar 

  3. Baker, H.G.: Nreversal of fortune–the thermodynamics of garbage collection. In: Bekkers, Y., Cohen, J. (eds.) IWMM-GIAE 1992. LNCS, vol. 637, pp. 507–524. Springer, Heidelberg (1992)

    Chapter  Google Scholar 

  4. Goto, E.: Monocopy and associative algorithms in an extended lisp. Technical Report TR 74-03, University of Tokyo (1974)

    Google Scholar 

  5. Lutz, C.: Janus: a time-reversible language. A letter to Landauer (1986), http://www.cise.uf1.edu/~mpf/rc/janus.html

  6. Mogensen, T.Æ.: Report on an implementation of a semi-inverter. In: Virbitskaite, I., Voronkov, A. (eds.) PSI 2006. LNCS, vol. 4378, pp. 322–334. Springer, Heidelberg (2007)

    Chapter  Google Scholar 

  7. Mogensen, T.Æ.: Partial evaluation of janus part 2: Assertions and procedures. In: Clarke, E., Virbitskaite, I., Voronkov, A. (eds.) PSI 2011. LNCS, vol. 7162, pp. 289–301. Springer, Heidelberg (2012)

    Chapter  Google Scholar 

  8. Yokoyama, T., Axelsen, H.B., Glück, R.: Principles of a reversible programming language. In: Proceedings of the 5th Conference on Computing Frontiers, CF 2008, pp. 43–54. ACM, New York (2008)

    Chapter  Google Scholar 

  9. Yokoyama, T., Axelsen, H.B., Glück, R.: Towards a reversible functional language. In: De Vos, A., Wille, R. (eds.) RC 2011. LNCS, vol. 7165, pp. 14–29. Springer, Heidelberg (2012)

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2014 Springer International Publishing Switzerland

About this paper

Cite this paper

Mogensen, T.Æ. (2014). Reference Counting for Reversible Languages. In: Yamashita, S., Minato, Si. (eds) Reversible Computation. RC 2014. Lecture Notes in Computer Science, vol 8507. Springer, Cham. https://doi.org/10.1007/978-3-319-08494-7_7

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-08494-7_7

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-08493-0

  • Online ISBN: 978-3-319-08494-7

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics