Abstract
In this paper, we describe a hierarchy of program transformers, capable of performing fusion to eliminate intermediate data structures, in which the transformer at each level of the hierarchy builds on top of those at lower levels. The program transformer at level 1 of the hierarchy corresponds to positive supercompilation, and that at level 2 corresponds to distillation. We give a number of examples of the application of our transformers at different levels in the hierarchy and look at the speedups that are obtained. We determine the maximum speedups that can be obtained at each level, and prove that the transformers at each level terminate.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
References
Amtoft, T.: Sharing of Computations. Ph.D. thesis, DAIMI, Aarhus University (1993)
Andersen, L.O., Gomard, C.K.: Speedup analysis in partial evaluation: preliminary results. In: ACM SIGPLAN Workshop on Partial Evaluation and Semantics-Based Program Manipulation, pp. 1–7 (1992)
Bol, R.: Loop checking in partial deduction. J. Log. Program. 16(1–2), 25–46 (1993)
Burstall, R., Darlington, J.: A transformation system for developing recursive programs. J. ACM 24(1), 44–67 (1977)
Dershowitz, N., Jouannaud, J.P.: Rewrite systems. In: van Leeuwen, J. (ed.) Handbook of Theoretical Computer Science, pp. 243–320. Elsevier, MIT Press (1990)
Glück, R., Klimov, A., Nepeivoda, A.: Non-linear configurations for superlinear speedup by supercompilation. In: Proceedings of the Fifth International Workshop on Metacomputation in Russia (2016)
Glück, R., Hatcliff, J., Jørgensen, J.: Generalization in hierarchies of online program specialization systems. In: Flener, P. (ed.) LOPSTR 1998. LNCS, vol. 1559, pp. 179–198. Springer, Heidelberg (1999). https://doi.org/10.1007/3-540-48958-4_10
Glück, R., Jørgensen, J.: Generating transformers for deforestation and supercompilation. In: Le Charlier, B. (ed.) SAS 1994. LNCS, vol. 864, pp. 432–448. Springer, Heidelberg (1994). https://doi.org/10.1007/3-540-58485-4_57
Hamilton, G.W.: Distillation: extracting the essence of programs. In: Proceedings of the ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation, pp. 61–70 (2007)
Hamilton, G.W.: A hierarchy of program transformers. In: Proceedings of the Second International Workshop on Metacomputation in Russia (2012)
Hamilton, G.W., Jones, N.D.: Distillation with labelled transition systems. In: Proceedings of the ACM Workshop on Partial Evaluation and Program Manipulation, pp. 15–24. ACM (2012)
Higman, G.: Ordering by divisibility in abstract algebras. Proc. Lond. Math. Soc. 2, 326–336 (1952)
Huet, G.: The zipper. J. Funct. Program. 7(5), 549–554 (1997)
Jones, N.D., Gomard, C.K., Sestoft, P.: Partial Evaluation and Automatic Program Generation. Prentice Hall, Hoboken (1993)
Klyuchnikov, I.: Supercompiler HOSC 1.1: Proof of Termination. Preprint 21, Keldysh Institute of Applied Mathematics, Moscow (2010)
Klyuchnikov, I.: Towards higher-level supercompilation. In: Proceedings of the Second International Workshop on Metacomputation in Russia, pp. 82–101 (2010)
Kott, L.: A system for proving equivalences of recursive programs. In: 5th Conference on Automated Deduction, pp. 63–69 (1980)
Kott, L.: Unfold/fold transformations. In: Nivat, M., Reynolds, J. (eds.) Algebraic Methods in Semantics, chap. 12, pp. 412–433. CUP (1985)
Kruskal, J.: Well-quasi ordering, the tree theorem, and vazsonyi’s conjecture. Trans. Am. Math. Soc. 95, 210–225 (1960)
Leuschel, M.: On the power of homeomorphic embedding for online termination. In: Levi, G. (ed.) SAS 1998. LNCS, vol. 1503, pp. 230–245. Springer, Heidelberg (1998). https://doi.org/10.1007/3-540-49727-7_14
Marlet, R.: Vers une Formalisation de l’Évaluation Partielle. Ph.D. thesis, Université de Nice - Sophia Antipolis (1994)
Pettorossi, A., Proietti, M.: A theory of totally correct logic program transformations. In: Proceedings of the ACM SIGPLAN Workshop on Partial Evaluation and Semantics-Based Program Manipulation (PEPM), pp. 159–168 (2004)
Roychoudhury, A., Kumar, K., Ramakrishnan, C., Ramakrishnan, I.: An unfold/fold transformation framework for definite logic programs. ACM Trans. Program. Lang. Syst. 26(3), 464–509 (2004)
Sørensen, M.H.: Turchin’s Supercompiler Revisited. Master’s thesis, Department of Computer Science, University of Copenhagen (1994). dIKU-rapport 94/17
Sørensen, M.H., Glück, R.: An algorithm of generalization in positive supercompilation. Lect. Notes Comput. Sci. 787, 335–351 (1994)
Sørensen, M.H., Glück, R., Jones, N.D.: A positive supercompiler. J. Funct. Program. 6(6), 811–838 (1996)
Turchin, V.F.: The concept of a supercompiler. ACM Trans. Program. Lang. Syst. 8(3), 90–121 (1986)
Turchin, V.F.: Program transformation with metasystem transitions. ACM Trans. Program. Lang. Syst. 3(3), 283–313 (1993)
Wadler, P.: The Concatenate Vanishes (December 1987). fP Electronic Mailing List
Wadler, P.: Deforestation: transforming programs to eliminate trees. In: Ganzinger, H. (ed.) ESOP 1988. LNCS, vol. 300, pp. 344–358. Springer, Heidelberg (1988). https://doi.org/10.1007/3-540-19027-9_23
Zhu, H.: How powerful are folding/unfolding transformations? J. Funct. Program. 4(1), 89–112 (1994)
Acknowledgements
The author would like to thank the anonymous referees, who provided very useful feedback and suggested improvements to this paper. This work owes a lot to the input of Neil D. Jones, who provided many useful insights and ideas on the subject matter presented here.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2022 Springer Nature Switzerland AG
About this paper
Cite this paper
Hamilton, G. (2022). The Next 700 Program Transformers. In: De Angelis, E., Vanhoof, W. (eds) Logic-Based Program Synthesis and Transformation. LOPSTR 2021. Lecture Notes in Computer Science, vol 13290. Springer, Cham. https://doi.org/10.1007/978-3-030-98869-2_7
Download citation
DOI: https://doi.org/10.1007/978-3-030-98869-2_7
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-98868-5
Online ISBN: 978-3-030-98869-2
eBook Packages: Computer ScienceComputer Science (R0)