Abstract
Tupling is a transformation tactic to obtain new functions, without redundant calls and/or multiple traversals of common inputs. It achieves this feat by allowing a set (tuple) of function calls to be computed recursively from its previous set. In [Chi93c], a safe (terminating) unfold/fold transformation algorithm was proposed for a class of functions which has a single recursion parameter per function.
In this paper, we propose two new classes of functions with multiple recursion parameters that could also be safely tupled. The first class of functions has a set of tightly-synchronised recursion parameters. This class of functions could be used to eliminate multiple traversals due to a common variable being shared by its multiple recursion arguments. The second class of functions has loosely-synchronised recursion parameters. The loose-synchronisation property is specified indirectly by the ability to convert (in an effective way) the multiple recursion parameters into a single recursion parameter.
These two new classes of functions help to widen the applicability of the tupling tactic. In particular, they allow us to combine both the tupling and fusion tactics together to achieve new optimisations which were not possible from either tactic individually.
Keywords
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
This is a preview of subscription content, log in via an institution.
Preview
Unable to display preview. Download preview PDF.
References
Lennart Augustsson. Compiling pattern-matching. In Conference on Functional Programming and Computer Architecture (LNCS 201, ed Jouannaud), pages 368–381, Nancy, France, 1985.
Wei-Ngan Chin. Safe fusion of functional expressions. In ACM Lisp and Functional Programming Conference, pages 11–20, San Francisco, California, June 1992.
Wei-Ngan Chin. A modular strategy for combining the fusion and tupling methods. In Unpublished, April 1993.
Wei-Ngan Chin. Synchronisation analysis. In (in preparation), July 1993.
Wei-Ngan Chin. Towards an automated tupling strategy. In ACM Symposium on Partial Evaluation and Semantics-Based Program Manipulation, Copenhagen, Denmark, June 1993.
Alberto Pettorossi. A powerful strategy for deriving programs by transformation. In ACM Lisp and Functional Programming Conference, pages 273–281, 1984.
M Proietti and A Pettorossi. Unfolding — definition — folding, in this order for avoiding unnecessary variables in logic programs. In Proc PLILP'91, LNCS 528, pages 347–358, Passau, Germany, August 1991.
Phil Wadler. Listlessness is better than laziness: Lazy evaluation and garbage collection at compile-time. In ACM Symposium on Lisp and Functional Programming, pages 45–52, Austin, Texas, August 1984.
Phil Wadler. Deforestation: Transforming programs to eliminate trees. In European Symposium on Programming, pages 344–358, Nancy, France, March 1988.
Richard C Waters. Automatic transformation of series expressions into loops. ACM Transaction on Programming Languages and Systems, 13(1):52–98, January 1991.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1993 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Chin, WN., Khoo, SC. (1993). Tupling functions with multiple recursion parameters. In: Cousot, P., Falaschi, M., Filé, G., Rauzy, A. (eds) Static Analysis. WSA 1993. Lecture Notes in Computer Science, vol 724. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-57264-3_35
Download citation
DOI: https://doi.org/10.1007/3-540-57264-3_35
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-57264-0
Online ISBN: 978-3-540-48027-3
eBook Packages: Springer Book Archive