Skip to main content

Towards a Reversible Functional Language

  • Conference paper

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

Abstract

We identify concepts of reversibility for a functional language by means of a set of semantic rules with specific properties. These properties include injectivity along with local backward determinism, an important operational property for an efficient reversible language. We define a concise reversible first-order functional language in which access to the backward semantics is provided to the programmer by inverse function calls. Reversibility guarantees that in this language a backward run (inverse interpretation) is as fast as the corresponding forward run itself. By adopting a symmetric first-match policy for case expressions, we can write overlapping patterns in case branches, as is customary in ordinary functional languages, and also in leaf expressions, unlike existing inverse interpreter methods, which enables concise programs. In patterns, the use of a duplication/equality operator also simplifies inverse computation and program inversion. We discuss the advantages of a reversible functional language using example programs, including run-length encoding. Program inversion is seen to be as lightweight as for imperative reversible languages and realized by recursive descent. Finally, we show that the proposed language is r-Turing complete.

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

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   54.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   69.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

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Abramov, S.M., Glück, R.: Principles of Inverse Computation and the Universal Resolving Algorithm. In: Mogensen, T.Æ., Schmidt, D.A., Sudborough, I.H. (eds.) The Essence of Computation. LNCS, vol. 2566, pp. 269–295. Springer, Heidelberg (2002)

    Chapter  Google Scholar 

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

  3. Axelsen, H.B., Glück, R.: What Do Reversible Programs Compute? In: Hofmann, M. (ed.) FOSSACS 2011. LNCS, vol. 6604, pp. 42–56. Springer, Heidelberg (2011)

    Chapter  Google Scholar 

  4. Baker, H.G.: NREVERSAL of Fortune — The Thermodynamics of Garbage Collection. In: Bekkers, Y., Cohen, J. (eds.) IWMM 1992. LNCS, vol. 637, pp. 507–524. Springer, Heidelberg (1992)

    Chapter  Google Scholar 

  5. Bennett, C.H.: Logical reversibility of computation. IBM Journal of Research and Development 17(6), 525–532 (1973)

    Article  MATH  Google Scholar 

  6. Bowman, W.J., James, R.P., Sabry, A.: Dagger traced symmetric monoidal categories and reversible programming. In: De Vos, A., Wille, R. (eds.) 3rd Workshop on Reversible Computation, pp. 51–56. University of Gent. (2011)

    Google Scholar 

  7. De Vos, A.: Reversible Computing: Fundamentals, Quantum Computing, and Applications. Wiley-VCH (2010)

    Google Scholar 

  8. Frank, M.P.: Reversibility for efficient computing. Ph.D. thesis, EECS Dept. MIT, Cambridge, Massachusetts (1999)

    Google Scholar 

  9. Glück, R., Kawabe, M.: A Program Inverter for a Functional Language with Equality and Constructors. In: Ohori, A. (ed.) APLAS 2003. LNCS, vol. 2895, pp. 246–264. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  10. Glück, R., Kawabe, M.: A method for automatic program inversion based on LR(0) parsing. Fundamenta Informaticae 66(4), 367–395 (2005)

    MathSciNet  MATH  Google Scholar 

  11. Gries, D.: Inverting Programs. In: The Science of Programming. Texts and Monographs in Computer Science, ch. 21, pp. 265–274. Springer, Heidelberg (1981)

    Google Scholar 

  12. Lutz, C.: Janus: a time-reversible language. Letter to R. Landauer (1986), http://www.tetsuo.jp/ref/janus.html

  13. McCarthy, J.: The inversion of functions defined by Turing machines. In: Shannon, C.E., McCarthy, J. (eds.) Automata Studies, pp. 177–181. Princeton University Press (1956)

    Google Scholar 

  14. Mogensen, T.Æ.: Partial evaluation of the reversible language Janus. In: Proceedings of Partial Evaluation and Program Manipulation, pp. 23–32. ACM Press (2011)

    Google Scholar 

  15. Morita, K.: Reversible computing and cellular automata — A survey. Theoretical Computer Science 395(1), 101–131 (2008)

    Article  MathSciNet  MATH  Google Scholar 

  16. Mu, S.C., Hu, Z., Takeichi, M.: An Injective Language for Reversible Computation. In: Kozen, D. (ed.) MPC 2004. LNCS, vol. 3125, pp. 289–313. Springer, Heidelberg (2004)

    Chapter  Google Scholar 

  17. Wille, R., Drechsler, R.: Towards a Design Flow for Reversible Logic. Springer, Heidelberg (2010)

    Book  MATH  Google Scholar 

  18. Yokoyama, T., Axelsen, H., Glück, R.: Principles of a reversible programming language. In: Proceedings of Computing Frontiers, pp. 43–54. ACM Press (2008)

    Google Scholar 

  19. Yokoyama, T., Axelsen, H.B., Glück, R.: Optimizing clean reversible simulation of injective functions. Journal of Multiple-Valued Logic and Soft Computing 18(1), 5–24 (2012)

    MathSciNet  Google Scholar 

  20. Yokoyama, T., Glück, R.: A reversible programming language and its invertible self-interpreter. In: Proceedings of Partial Evaluation and Semantics-Based Program Manipulation, pp. 144–153. ACM Press (2007)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2012 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Yokoyama, T., Axelsen, H.B., Glück, R. (2012). Towards a Reversible Functional Language. In: De Vos, A., Wille, R. (eds) Reversible Computation. RC 2011. Lecture Notes in Computer Science, vol 7165. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-29517-1_2

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-29517-1_2

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-29516-4

  • Online ISBN: 978-3-642-29517-1

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics