Skip to main content

Frugal Encoding in Reversible \(\mathcal{MOQA}\): A Case Study for Quicksort

  • Conference paper
Reversible Computation (RC 2012)

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

Included in the following conference series:

Abstract

\(\mathcal{MOQA}\) is a high-level data structuring language, designed to allow for modular static timing analysis. In essence, \(\mathcal{MOQA}\) allows the programmer to determine the average running time of a broad class of programmes directly from the code in a (semi-)automated way. The \(\mathcal{MOQA}\) language has the property of randomness preservation which means that applying any operation to a random structure, results in an output isomorphic to one or more random structures, which is the key to systematic timing. The language, its implementation and the associated timing tool have been reported on in the literature. Randomness preservation is key in ensuring modular timing derivation. A degree of reversibility in turn is a key aspect of ensuring randomness preservation. All operations of the \(\mathcal{MOQA}\) language can be made reversible with minimal additional bookkeeping. A challenge in achieving this encoding in a frugal way is to ensure subsets of data can be stored without excessive overheads. The paper focuses on illustrating such an encoding for the case of the Quicksort algorithm. Similar encodings are explored to ensure efficient reversibility of all \(\mathcal{MOQA}\) operations. The paper is self contained, i.e. no prior knowledge of the \(\mathcal{MOQA}\) language is needed to follow the encoding argument. We show how to efficiently encode the information needed to reverse the split of a list into two sublists. The code for reversible Quicksort is provided and an example illustrates the algorithm’s reverse execution.

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 49.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. Bennet, C.: Logical reversibility of computation. IBM Journal of Research and Development 6, 525–532 (1973)

    Article  Google Scholar 

  2. Early, D.: A Mathematical Analysis of the \(\mathcal{MOQA}\) Language. Ph.D. thesis, University College Cork (2010)

    Google Scholar 

  3. Hickey, D.: Tracking data structures for automated average time analysis. Ph.D. thesis, University College Cork (2008)

    Google Scholar 

  4. Landauer, R.: Irreversibility and heat generation in the computing process. IBM Journal of Research and Development 5, 183–191 (1961)

    Article  MathSciNet  MATH  Google Scholar 

  5. Schellekens, M.: A Modular Calculus for the Average Cost of Data Structuring, 240 p. Springer (2008)

    Google Scholar 

  6. Schellekens, M.: A random bag preserving product operation. Electronic Notes in Theoretical Computer Science 225 (2009)

    Google Scholar 

  7. Schellekens, M.: \(\mathcal{MOQA}\); Unlocking the Potential of Compositional Static Average-Case Analysis. Journal of Logic and Algebraic Programming 79(1), 61–83 (2010)

    Article  MathSciNet  MATH  Google Scholar 

  8. Schellekens, M., Early, D., Popovici, E., Vasudevan, D.: A high level reversible language for modular average-case analysis. Preliminary Proceedings of the Reversible Computing Workshop-RC 2009, A Satellite Workshop of ETAPS 2009 (2009)

    Google Scholar 

  9. Schellekens, M., Hickey, D., Bollella, G.: \(\mathcal{MOQA}\), a Linearly-Compositional Programming Language for (semi-) automated Average-Case Analysis. In: WIP Proceedings, 25th IEEE International Real-Time Systems Symposium, Lisbon, Portugal (2004)

    Google Scholar 

  10. Toffoli, T.: Reversible Computing. In: Proceedings of the 7th Colloquium on Automata, Languages and Programming, pp. 632–644 (1980)

    Google Scholar 

  11. Ye, T., Vasudevan, D., Chen, J., Popovici, E., Schellekens, M.: Static Average Case Power Analysis for Block Ciphers. In: The 13th EUROMICRO Conference on Digital System Design, EUROMICRO-DSD 2010, Lille, France (2010)

    Google Scholar 

  12. Yokoyama, T., Glueck, R.: A Reversible Programming Language and its Invertible Self- Interpreter. In: Proc. ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation, PEPM, pp. 144–153 (2007)

    Google Scholar 

  13. Zeitz, P.: The Art and Craft of Problem Solving. John Wiley & Sons, Inc. (1999)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2013 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Early, D., Gao, A., Schellekens, M. (2013). Frugal Encoding in Reversible \(\mathcal{MOQA}\): A Case Study for Quicksort. In: Glück, R., Yokoyama, T. (eds) Reversible Computation. RC 2012. Lecture Notes in Computer Science, vol 7581. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-36315-3_7

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-36315-3_7

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-36314-6

  • Online ISBN: 978-3-642-36315-3

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics