Skip to main content

The Next 700 Program Transformers

  • Conference paper
  • First Online:
Logic-Based Program Synthesis and Transformation (LOPSTR 2021)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 13290))

  • 303 Accesses

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Similar content being viewed by others

References

  1. Amtoft, T.: Sharing of Computations. Ph.D. thesis, DAIMI, Aarhus University (1993)

    Google Scholar 

  2. 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)

    Google Scholar 

  3. Bol, R.: Loop checking in partial deduction. J. Log. Program. 16(1–2), 25–46 (1993)

    Article  MathSciNet  Google Scholar 

  4. Burstall, R., Darlington, J.: A transformation system for developing recursive programs. J. ACM 24(1), 44–67 (1977)

    Article  MathSciNet  Google Scholar 

  5. Dershowitz, N., Jouannaud, J.P.: Rewrite systems. In: van Leeuwen, J. (ed.) Handbook of Theoretical Computer Science, pp. 243–320. Elsevier, MIT Press (1990)

    Google Scholar 

  6. 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)

    Google Scholar 

  7. 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

    Chapter  Google Scholar 

  8. 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

    Chapter  Google Scholar 

  9. 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)

    Google Scholar 

  10. Hamilton, G.W.: A hierarchy of program transformers. In: Proceedings of the Second International Workshop on Metacomputation in Russia (2012)

    Google Scholar 

  11. 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)

    Google Scholar 

  12. Higman, G.: Ordering by divisibility in abstract algebras. Proc. Lond. Math. Soc. 2, 326–336 (1952)

    Article  MathSciNet  Google Scholar 

  13. Huet, G.: The zipper. J. Funct. Program. 7(5), 549–554 (1997)

    Article  MathSciNet  Google Scholar 

  14. Jones, N.D., Gomard, C.K., Sestoft, P.: Partial Evaluation and Automatic Program Generation. Prentice Hall, Hoboken (1993)

    Google Scholar 

  15. Klyuchnikov, I.: Supercompiler HOSC 1.1: Proof of Termination. Preprint 21, Keldysh Institute of Applied Mathematics, Moscow (2010)

    Google Scholar 

  16. Klyuchnikov, I.: Towards higher-level supercompilation. In: Proceedings of the Second International Workshop on Metacomputation in Russia, pp. 82–101 (2010)

    Google Scholar 

  17. Kott, L.: A system for proving equivalences of recursive programs. In: 5th Conference on Automated Deduction, pp. 63–69 (1980)

    Google Scholar 

  18. Kott, L.: Unfold/fold transformations. In: Nivat, M., Reynolds, J. (eds.) Algebraic Methods in Semantics, chap. 12, pp. 412–433. CUP (1985)

    Google Scholar 

  19. Kruskal, J.: Well-quasi ordering, the tree theorem, and vazsonyi’s conjecture. Trans. Am. Math. Soc. 95, 210–225 (1960)

    MathSciNet  MATH  Google Scholar 

  20. 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

    Chapter  Google Scholar 

  21. Marlet, R.: Vers une Formalisation de l’Évaluation Partielle. Ph.D. thesis, Université de Nice - Sophia Antipolis (1994)

    Google Scholar 

  22. 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)

    Google Scholar 

  23. 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)

    Article  Google Scholar 

  24. Sørensen, M.H.: Turchin’s Supercompiler Revisited. Master’s thesis, Department of Computer Science, University of Copenhagen (1994). dIKU-rapport 94/17

    Google Scholar 

  25. Sørensen, M.H., Glück, R.: An algorithm of generalization in positive supercompilation. Lect. Notes Comput. Sci. 787, 335–351 (1994)

    Article  Google Scholar 

  26. Sørensen, M.H., Glück, R., Jones, N.D.: A positive supercompiler. J. Funct. Program. 6(6), 811–838 (1996)

    Article  Google Scholar 

  27. Turchin, V.F.: The concept of a supercompiler. ACM Trans. Program. Lang. Syst. 8(3), 90–121 (1986)

    Article  Google Scholar 

  28. Turchin, V.F.: Program transformation with metasystem transitions. ACM Trans. Program. Lang. Syst. 3(3), 283–313 (1993)

    MathSciNet  Google Scholar 

  29. Wadler, P.: The Concatenate Vanishes (December 1987). fP Electronic Mailing List

    Google Scholar 

  30. 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

    Chapter  Google Scholar 

  31. Zhu, H.: How powerful are folding/unfolding transformations? J. Funct. Program. 4(1), 89–112 (1994)

    Article  MathSciNet  Google Scholar 

Download references

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

Authors

Corresponding author

Correspondence to Geoff Hamilton .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2022 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

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)

Publish with us

Policies and ethics