Synchronization analyses for multiple recursion parameters
Tupling is a transformation tactic to obtain new functions, without redundant calls and/or multiple traversals of common inputs. In [Chi93], we presented an automatic method for tupling functions with a single recursion parameter each.
In this paper, we propose a new family of parameter analyses, called synchronization analyses, to help extend the tupling method to functions with multiple recursion parameters. To achieve better optimisation, we formulate three different forms of tupling optimisations for the elimination of intra-call traversals, the elimination of inter-call traversals and the elimination of redundant calls. We also guarantee the safety of the extended method by ensuring that its transformation terminates.
KeywordsFunction Call Recursive Call Synchronization Point Synchronization Analysis Recursion Parameter
Unable to display preview. Download preview PDF.
- [Aug85]Lennart Augustsson. Compiling pattern-matching. In 2nd ACM Functional Programming Languages and Computer Architecture Conference, Nancy, France, (Lect. Notes Comput. Sc., vol 201, pp. 368–381) Berlin Heidelberg New York: Springer, 1985.Google Scholar
- [BD77]R.M. Burstall and J. Darlington. A transformation system for developing recursive programs. Journal of ACM, 24(1):44–67, January 1977.Google Scholar
- [Bir80]Richard S. Bird. Tabulation techniques for recursive programs. ACM Computing Surveys, 12(4):403–417, December 1980.Google Scholar
- [Chi90]Wei-Ngan Chin. Automatic Methods for Program Transformation. PhD thesis, Imperial College, University of London, March 1990.Google Scholar
- [Chi93]Wei-Ngan Chin. Towards an automated tupling strategy. In 3rd ACM Symposium on Partial Evaluation and Semantics-Based Program Manipulation, ACM Press, pages 119–132, Copenhagen, Denmark, ACM Press, June 1993.Google Scholar
- [Chi95]Wei-Ngan Chin. Tupling: an automatic compile-time memoisation transformation. Technical report, Dept of IS/CS, NUS, May 1995.Google Scholar
- [CK93]Wei-Ngan Chin and Siau-Cheng Khoo. Tupling functions with multiple recursion parameters. In 3rd International Workshop on Static Analysis, Padova, Italy, (Lect. Notes Comput. Sc., vol 724, pp. 124–140) Berlin Heidelberg New York: Springer, 1993.Google Scholar
- [Coh83]Norman H. Cohen. Eliminating redundant recursive calls. ACM Trans. on Programming Languages and Systems, 5(3):265–299, July 1983.Google Scholar
- [Hol91]Carsten Kehler Holst. Finiteness analysis. In 5th ACM Functional Programming Languages and Computer Architecture Conference, pages 473–495, Cambridge, Massachusetts, August 1991.Google Scholar
- [Mic68]Donald Michie. Memo functions and machine learning. Nature, 218:19–22, 1968.Google Scholar
- [Pet84]Alberto Pettorossi. A powerful strategy for deriving programs by transformation. In 3rd ACM LISP and Functional Programming Conference, pages 273–281, 1984.Google Scholar
- [Pip80]N. Pippenger. Pebbling. Rc 8258 (# 35937), IBM Thomas J Watson Research Centre, May 1980.Google Scholar
- [PP91]M. Proietti and A. Pettorossi. Unfolding — definition — folding, in this order for avoiding unnecessary variables in logic programs. In Proceedings of PLILP, Passau, Germany, (Lect. Notes Comput. Sc., vol 528, pp. 347–258) Berlin Heidelberg New York: Springer, 1991.Google Scholar
- [RFJ89]C. Runciman, M. Firth, and N. Jagger. Transformation in a non-strict language: An approach to instantiation. In Glasgow Functional Programming Workshop, August 1989.Google Scholar
- [Wad88]Phil Wadler. Deforestation: Transforming programs to eliminate trees. In European Symposium on Programming, pages 344–358, Nancy, France, March 1988.Google Scholar