Advertisement

A comparative revisitation of some program transformation techniques

  • Alberto Pettorossi
  • Maurizio Proietti
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 1110)

Abstract

We revisit the main techniques of program transformation which are used in partial evaluation, mixed computation, supercompilation, generalized partial computation, rule-based program derivation, program specialization, compiling control, and the like. We present a methodology which underlines these techniques as a ‘common pattern of reasoning’ and explains the various correspondences which can be established among them. This methodology consists of three steps: i) symbolic computation, ii) search for regularities, and iii) program extraction. We also discuss some control issues which occur when performing these steps.

Keywords

Logic Program Logic Programming Symbolic Computation Partial Evaluation Abstract Interpretation 
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.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    J. Arsac and Y. Kodratoff. Some techniques for recursion removal from recursive functions. ACM Transactions on Programming Languages and Systems, 4(2):295–322, 1982.Google Scholar
  2. 2.
    R. Barbuti, R. Giacobazzi, and G. Levi. A general framework for semantics-based bottom-up abstract interpretation of logic programs. ACM Transactions on Programming Languages and Systems, 15(1):133–181, 1993.Google Scholar
  3. 3.
    R. S. Bird. Tabulation techniques for recursive programs. ACM Computing Surveys, 12(4):403–418, 1980.Google Scholar
  4. 4.
    R. S. Bird. The promotion and accumulation strategies in transformational programming. ACM Toplas, 6(4):487–504, 1984.Google Scholar
  5. 5.
    D. Bjørner, A. P. Ershov, and N. D. Jones, editors. Partial Evaluation and Mixed Computation. North-Holland, 1988. IFIP TC2 Workshop on Partial and Mixed Computation, Gammel AvernÆs, Denmark, 1987.Google Scholar
  6. 6.
    M. Bruynooghe and D. Boulanger. Abstract interpretation for (constraint) logic programming. In B. Mayoh, E. Tyugu, and J. Penjam, editors, Constraint Programming, NATO ASI Series F, Vol. 131, pages 228–260. Springer-Verlag, 1994.Google Scholar
  7. 7.
    M. Bruynooghe, D. De Schreye, and B. Krekels. Compiling control. Journal of Logic Programming, 6:135–162, 1989.Google Scholar
  8. 8.
    M. Bruynooghe, D. De Schreye, and B. Martens. A general criterion for avoiding infinite unfolding during partial deduction of logic programs. New Generation Computing, 11:47–79, 1992.Google Scholar
  9. 9.
    M. A. Bulyonkov. Polyvariant mixed computation for analyzer programs. Acta Informatica, 21:473–484, 1984.Google Scholar
  10. 10.
    R. M. Burstall and J. Darlington. A transformation system for developing recursive programs. Journal of the ACM, 24(1):44–67, January 1977.Google Scholar
  11. 11.
    W.-N. Chin. Safe fusion of functional expressions. In Proceedings of ACM SIGPLAN Symposium on Lisp and Functional Programming, San Francisco, Calif, U.S.A., pages 11–20. ACM Press, 1992.Google Scholar
  12. 12.
    C. Consel and O. Danvy. Tutorial notes on partial evaluation. In Proceedings 20th ACM SIGPLAN-SIGACT Symposium on Princples of Programming Languages (POPL '93), pages 493–501. ACM Press, 1993.Google Scholar
  13. 13.
    P. Cousot and R. Cousot. Abstract interpretation: A unified lattice model for static analysis of programs by construction of approximation of fixpoints. In Proceedings 4th ACM-SIGPLAN Symposium on Princples of Programming Languages (POPL '77), pages 238–252. ACM Press, 1977.Google Scholar
  14. 14.
    J. Darlington. An experimental program transformation system. Artificial Intelligence, 16:1–46, 1981.Google Scholar
  15. 15.
    A. P. Ershov. On the partial computation principle. Information Processing Letters, 6(2):38–41, 1977.Google Scholar
  16. 16.
    A. P. Ershov. Mixed computation: Potential applications and problems for study. Theoretical Computer Science, 18(1):41–67, 1982.Google Scholar
  17. 17.
    A.P. Ershov, D. Bjørner, Y. Futamura, K. Furukawa, A. Haraldson, and W. Scherlis, editors. Special Issue of New Generation Computing: Workshop on Partial Evaluation and Mixed Computation, volume 6, Nos. 2&3. Ohmsha Ltd. and Springer-Verlag, 1988.Google Scholar
  18. 18.
    M. S. Feather. A survey and classification of some program transformation techniques. In L. G. L. T. Meertens, editor, Proceedings IFIP TC2 Working Conference on Program Specification and Transformation, Bad Tölz, Germany, pages 165–195. North-Holland, 1987.Google Scholar
  19. 19.
    Y. Futamura, K. Nogi, and A. Takano. Essence of generalized partial computation. Theoretical Computer Science, 90:61–79, 1991.Google Scholar
  20. 20.
    J. P. Gallagher. Transforming programs by specializing interpreters. In Proceedings Seventh European Conference on Artificial Intelligence, ECAI '86, pages 109–122, 1986.Google Scholar
  21. 21.
    J. P. Gallagher. Tutorial on specialization of logic programs. In Proceedings of ACM SIGPLAN Symposium on Partial Evaluation and Semantics Based Program Manipulation, PEPM '93, Copenhagen, Denmark, pages 88–98. ACM Press, 1993.Google Scholar
  22. 22.
    J. P. Gallagher and M. Bruynooghe. The derivation of an algorithm for program specialisation. New Generation Computing, 6(2):305–333, 1991.Google Scholar
  23. 23.
    J. P. Gallagher and D.A. de Waal. Fast and precise regular approximation of logic programs and their uses. In Proceedings of the 11th International Conference on Logic Programming, ICLP'94, pages 599–613. MIT Press, 1994.Google Scholar
  24. 24.
    R. Glück. On the mechanics of metasystem hierarchies in program transformation. In M. Proietti, editor, Proceedings of LOPSTR '95, Utrecht, The Netherlands, Lecture Notes in Computer Science 1048, pages 234–251. Springer-Verlag, 1996.Google Scholar
  25. 25.
    R. Glück and M. H. Sørensen. Partial deduction and driving are equivalent. In M. Hermenegildo and J. Penjam, editors, International Symposium on Programming Language Implementation and Logic Programming, PLILP '94, Lecture Notes in Computer Science 844, pages 165–181. Springer-Verlag, 1994.Google Scholar
  26. 26.
    N. D. Jones, C. K. Gomard, and P. Sestoft. Partial Evaluation and Automatic Program Generation. Prentice Hall, 1993.Google Scholar
  27. 27.
    N. D. Jones, P. Sestoft, and H. Søndergaard. Mix: A self-applicable partial evaluator for experiments in compiler generation. LISP and Symbolic Computation, 2(1):9–50, 1989.Google Scholar
  28. 28.
    L. Kott. The McCarthy's induction principle: ‘oldy’ but ‘goody'. Calcolo, 19(1):59–69, 1982.Google Scholar
  29. 29.
    R. A. Kowalski. Algorithm=Logic + Control. Communications of the ACM, 22 (7):424–436, 1979.Google Scholar
  30. 30.
    M. Leuschel. Ecological partial deduction: Preserving characteristic trees without constraints. In Proceedings of LOPSTR '95, Utrecht, The Netherlands, Lecture Notes in Computer Science, pages 1–16. Springer-Verlag, 1996.Google Scholar
  31. 31.
    J. W. Lloyd and J. C. Shepherdson. Partial evaluation in logic programming. Journal of Logic Programming, 11:217–242, 1991.Google Scholar
  32. 32.
    K. Marriott, H. Søndergaard, and N. D. Jones. Denotational abstract interpretation of logic programs. ACM Transactions on Programming Languages and Systems, 16(1):35–101, 1994.Google Scholar
  33. 33.
    L. Naish. Negation and Control in Prolog. Lecture Notes in Computer Science 238. Springer-Verlag, 1985.Google Scholar
  34. 34.
    H. R. Nielson and F. Nielson. Automatic binding time analysis for a typed λ-calculus. In Proceedings of the ACM Symposium on Principles of Programming Languages, pages 98–106, 1988.Google Scholar
  35. 35.
    R. Paige. Symbolic finite differencing — Part I. In N. D. Jones, editor, Third European Symposium on Programming, ESOP '90, Lecture Notes in Computer Science 432, pages 36–56. Springer-Verlag, 1990.Google Scholar
  36. 36.
    R. Paige and S. Koenig. Finite differencing of computable expressions. ACM Transactions on Programming Languages and Systems, 4(3):402–454, 1982.Google Scholar
  37. 37.
    R. Paige, J. Reif, and R. Wachter, editors. Parallel Algorithm Derivation and Program Transformation, Proc. Workshop at Courant Institute of Mathematical Sciences, New York, USA, 1991. Kluwer Academic Publishers, 1993.Google Scholar
  38. 38.
    A. Pettorossi. A powerful strategy for deriving efficient programs by transformation. In ACM Symposium on Lisp and Functional Programming, pages 273–281. ACM Press, 1984.Google Scholar
  39. 39.
    A. Pettorossi and R. M. Burstall. Deriving very efficient algorithms for evaluating linear recurrence relations using the program transformation technique. Acta Informatica, 18:181–206, 1982.Google Scholar
  40. 40.
    A. Pettorossi and M. Proietti. Rules and strategies for program transformation. In B. Möller, H. Partsch, and S. Schuman, editors, Formal Program Development, IFIP TC2/W.G. 2.1 State-of-the-Art Report, Lecture Notes in Computer Science 755, pages 263–304. Springer-Verlag, 1993.Google Scholar
  41. 41.
    A. Pettorossi and M. Proietti. Transformation of logic programs: Foundations and techniques. Journal of Logic Programming, 19, 20:261–320, 1994.Google Scholar
  42. 42.
    A. Pettorossi and A. Skowron. The lambda abstraction strategy for program derivation. Fundamenta Informaticae, XII(4):541–561, 1989.Google Scholar
  43. 43.
    M. Proietti and A. Pettorossi. Synthesis of eureka predicates for developing logic programs. In N. D. Jones, editor, Third European Symposium on Programming, ESOP '90, Lecture Notes in Computer Science 432, pages 306–325. Springer-Verlag, 1990.Google Scholar
  44. 44.
    M. Proietti and A. Pettorossi. The loop absorption and the generalization strategies for the development of logic programs and partial deduction. Journal of Logic Programming, 16(1-2):123–161, 1993.Google Scholar
  45. 45.
    M. Proietti and A. Pettorossi. Synthesis of programs from unfold/fold proofs. In Y. Deville, editor, Logic Program Synthesis and Transformation, Proceedings of LOPSTR '93, Louvain-la-Neuve, Belgium, Workshops in Computing, pages 141–158. Springer-Verlag, 1994.Google Scholar
  46. 46.
    W. L. Scherlis. Program improvement by internal specialization. In Proc. 8th ACM Symposium on Principles of Programming Languages, Williamsburgh, Va, pages 41–49. ACM Press, 1981.Google Scholar
  47. 47.
    M. H. Sørensen and R. Glück. An algorithm of generalization in positive supercompilation. In J. W. Lloyd, editor, Proceedings of the 1995 International Logic Programming Symposium (ILPS '95), pages 465–479. MIT Press, 1995.Google Scholar
  48. 48.
    M. H. Sørensen, R. Glück, and N. D. Jones. Towards unifying partial evaluation, deforestation, supercompilation, and GPC. In D. Sannella, editor, Fifth European Symposium on Programming Languages and Systems, ESOP '94, Lecture Notes in Computer Science 788, pages 485–500. Springer-Verlag, 1994.Google Scholar
  49. 49.
    L. S. Sterling and E. Shapiro. The Art of Prolog. The MIT Press, Cambridge, Massachusetts, 1994. Second Edition.Google Scholar
  50. 50.
    H. Tamaki and T. Sato. Unfold/fold transformation of logic programs. In S. å. Tärnlund, editor, Proceedings Second International Conference on Logic Programming, Uppsala, Sweden, pages 127–138. Uppsala University, 1984.Google Scholar
  51. 51.
    V. F. Turchin. The use of metasystem transition in theorem proving and program optimization. In Proceedings of 7th Colloquium on Automata, Languages and Programming, Lecture Notes in Computer Science 85, pages 645–657. Springer-Verlag, 1980.Google Scholar
  52. 52.
    V. F. Turchin. The concept of a supercompiler. ACM TOPLAS, 8(3):292–325, 1986.Google Scholar
  53. 53.
    V. F. Turchin. The algorithm of generalization in the supercompiler. In D. Bjørner, A. P. Ershov, and N. D. Jones, editors, Partial Evaluation and Mixed Computation, Proc. of the IFIP TC2 Working Conference, Gammel Avern∄s, Denmark, 1987. North-Holland, 1988.Google Scholar
  54. 54.
    V. F. Turchin. Program transformation with metasystem transitions. Journal of Functional Programming, 3(3):283–313, 1993.Google Scholar
  55. 55.
    P. L. Wadler. Deforestation: Transforming programs to eliminate trees. In Proceedings of ESOP '88, Lecture Notes in Computer Science 300, pages 344–358. Springer-Verlag, 1988.Google Scholar
  56. 56.
    H. Zhu. How powerful are folding / unfolding transformations? Journal of Functional Programming, 4(1):89–112, 1994.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1996

Authors and Affiliations

  • Alberto Pettorossi
    • 1
  • Maurizio Proietti
    • 2
  1. 1.Department of Informatics, Systems, and ProductionUniversity of Roma Tor VergataRomaItaly
  2. 2.IASI-CNRRomaItaly

Personalised recommendations