Towards a Reversible Functional Language

  • Tetsuo Yokoyama
  • Holger Bock Axelsen
  • Robert Glück
Conference paper

DOI: 10.1007/978-3-642-29517-1_2

Part of the Lecture Notes in Computer Science book series (LNCS, volume 7165)
Cite this paper as:
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

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.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Copyright information

© Springer-Verlag Berlin Heidelberg 2012

Authors and Affiliations

  • Tetsuo Yokoyama
    • 1
  • Holger Bock Axelsen
    • 2
  • Robert Glück
    • 2
  1. 1.Department of Software EngineeringNanzan UniversityJapan
  2. 2.DIKU, Department of Computer ScienceUniversity of CopenhagenDenmark

Personalised recommendations