Advertisement

Program Derivation via List Introduction

  • Alberto Pettorossi
  • Maurizio Proietti
Chapter
Part of the IFIP Advances in Information and Communication Technology book series (IFIPAICT)

Abstract

We present a new program transformation strategy based on the introduction of lists. This strategy overcomes some of the limitations of the tupling strategy, and in particular, it allows us to derive linear recursive programs when the tupling strategy is not successful. The linear recursive programs one may derive using this new strategy, have in most cases very good time and space performance. We present our list introduction strategy in the case of definite logic programs, but it can also be applied in the case of functional programs thereby improving some transformation techniques proposed by Cohen (1983) and by Chin and Hagiya (1995).

Keywords

Program transformation logic programming unfolding/folding transformation rules tupling strategy generalization strategy list introduction strategy 

References

  1. [1]
    Aho, A., Hoperoft, J.E. and Ullman, J.D. (1983) Data Structures and Algorithms. Addison-Wesley.zbMATHGoogle Scholar
  2. [2]
    Bird, R.S. (1984) The Promotion and Accumulation Strategies in Transformational Programming. A CM Transactions on Programming Languages and Systems, 6 (4): 487–504.zbMATHMathSciNetCrossRefGoogle Scholar
  3. [3]
    Bird, R.S. and Meertens, L.G.L.T. (1987) Two Exercises Found in a Book on Algorithmics. In L.G.L.T. Meertens, editor, TC2/WG 2.1 Working Conference on Program Specification and Transformation, Bad Tölz, Germany, 451–457. North-Holland.Google Scholar
  4. [4]
    Bruynooghe, M., De Schreye, D. and Krekels, B. (1989) Compiling control. Journal of Logic Programming, 6: 135–162.zbMATHCrossRefGoogle Scholar
  5. [5]
    Burstall, R.M. and Darlington, J. (1977) A transformation system for developing recursive programs. Journal of the ACM, 24 (1): 44–67.zbMATHMathSciNetCrossRefGoogle Scholar
  6. [6]
    Chin, W.-N. (1993) Towards an automated tupling strategy. In Proceedings of ACM SIGPLAN Symposium on Partial Evaluation and Semantics Based Program Manipulation, PEPM ’93, Copenhagen, Denmark, 119–132. ACM Press.Google Scholar
  7. [7]
    Chin, W.-N. and Hagiya, M. (1995) A transformational method for dynamic-sized tabulation. Acta Informatica, 32: 93–115.zbMATHCrossRefGoogle Scholar
  8. [8]
    Cohen, N.H. (1983) Eliminating redundant recursive calls. ACM Transactions on Programming Languages and Systems, 5 (3): 265–299.zbMATHCrossRefGoogle Scholar
  9. [9]
    Darlington, J. (1978) A synthesis of several sorting algorithms. Acta Informatica, 11: 1–30.zbMATHMathSciNetCrossRefGoogle Scholar
  10. [10]
    Darlington, J. (1981) An experimental program transformation system. Artificial Intelligence, 16: 1–46.CrossRefGoogle Scholar
  11. [11]
    Jones, N.D., Gomard, C.K. and Sestoft, P. (1993) Partial Evaluation and Automatic Program Generation. Prentice Hall.zbMATHGoogle Scholar
  12. [12]
    Pettorossi, A. (1977) Transformation of programs and use of tupling strategy. In Proceedings Informatica 77, Bled, Yugoslavia, 1–6.Google Scholar
  13. [13]
    Pettorossi, A. and Proietti, M. (1994) Transformation of logic programs: Foundations and techniques. Journal of Logic Programming, 19, 20: 261–320.MathSciNetCrossRefGoogle Scholar
  14. [14]
    Proietti, M. and Pettorossi, A. (1995) Unfolding-definition-folding, in this order, for avoiding unnecessary variables in logic programs. Theoretical Computer Science, 142 (1): 89–124.zbMATHMathSciNetCrossRefGoogle Scholar
  15. [15]
    Sterling, L.S. and Shapiro, E. (1994) The Art of Prolog. The MIT Press, Cambridge, Massachusetts. Second Edition.zbMATHGoogle Scholar
  16. [16]
    Tamaki, H. and Sato, T. (1984) Unfold/fold transformation of logic programs. In S.-A. Tärnlund, editor, Proceedings of the Second International Conference on Logic Programming, Uppsala, Sweden, 127–138. Uppsala University.Google Scholar
  17. [17]
    Tarau, P. and Boyer, M. (1990) Elementary logic programs. In P. Deransart and J. Maluszynski, editors, Proceedings PLILP ’90, 159–173. Springer-Verlag.Google Scholar
  18. [18]
    Turchin, V.F. (1986) The concept of a supercompiler. ACM TOPLAS, 8 (3): 292–325.zbMATHMathSciNetCrossRefGoogle Scholar
  19. [19]
    Wadler, P.L. (1990) Deforestation: Transforming programs to eliminate trees. Theoretical Computer Science, 73, 231–248.zbMATHMathSciNetCrossRefGoogle Scholar
  20. [20]
    Wand, M. (1980) Continuation-based program transformation strategies. Journal of the ACM, 27 (1): 164–180.zbMATHMathSciNetCrossRefGoogle Scholar

Copyright information

© IFIP 1997

Authors and Affiliations

  • Alberto Pettorossi
    • 1
  • Maurizio Proietti
    • 2
  1. 1.Department of InformaticsUniversity of Roma Tor VergataRomaItaly
  2. 2.IASI-CNRRomaItaly

Personalised recommendations