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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Bennet, C.: Logical reversibility of computation. IBM Journal of Research and Development 6, 525–532 (1973)
Early, D.: A Mathematical Analysis of the \(\mathcal{MOQA}\) Language. Ph.D. thesis, University College Cork (2010)
Hickey, D.: Tracking data structures for automated average time analysis. Ph.D. thesis, University College Cork (2008)
Landauer, R.: Irreversibility and heat generation in the computing process. IBM Journal of Research and Development 5, 183–191 (1961)
Schellekens, M.: A Modular Calculus for the Average Cost of Data Structuring, 240 p. Springer (2008)
Schellekens, M.: A random bag preserving product operation. Electronic Notes in Theoretical Computer Science 225 (2009)
Schellekens, M.: \(\mathcal{MOQA}\); Unlocking the Potential of Compositional Static Average-Case Analysis. Journal of Logic and Algebraic Programming 79(1), 61–83 (2010)
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)
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)
Toffoli, T.: Reversible Computing. In: Proceedings of the 7th Colloquium on Automata, Languages and Programming, pp. 632–644 (1980)
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)
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)
Zeitz, P.: The Art and Craft of Problem Solving. John Wiley & Sons, Inc. (1999)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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)