Advertisement

A Transformation Based on the Equality between Terms

  • Ulrich Neumerkel
Conference paper
Part of the Workshops in Computing book series (WORKSHOPS COMP.)

Abstract

We present a new transformation of Prolog programs preserving operational equivalence. Our transformation — EBC (equality based continuation) transformation — relies on the introduction of equations between terms. These equations are used to introduce alternative and more efficient representations of terms. When applied to binary Prolog programs, EBC is able to perform the following optimizations by mere source to source transformations: removal of existential variables in programs using difference lists and accumulators, reduction of the number of occur-checks, interprocedural register allocation when executed on the WAM, linearization of recursions, optimization of continuation-like user data structures.

Keywords

Logic Program Function Symbol Predicate Symbol Conservative Extension Grammar Rule 
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]
    A. Appel. Compiling with Continuations. Cambridge University Press, 1992. ISBN 0–521–41695–7.Google Scholar
  2. [2]
    F. Baader and J. Siekmann. Unification theory. In D. Gabbay, C. Hogger, and J. Robinson, editors, Handbook of Logic in Artificial Intelligence and Logic Programming. Oxford University Press, Oxford, UK, 1993. To appear.Google Scholar
  3. [3]
    J. Beer. The occur-check problem revisited. The Journal of Logic Programming, 5 (3): 243–262, September 1988.MATHCrossRefGoogle Scholar
  4. [4]
    J. Beer. Concepts, Design, and Performance Analysis of a Parallel Prolog Machine, volume 404 of Lecture Notes in Computer Science. Springer-Verlag, 1989.Google Scholar
  5. [5]
    J.-L. Bouquard. Etude des rapports entre Grammaire Attribuées et Programmation Logique: Application au test d’occurrence et à l’analyse statique. PhD thesis, Université d’Orleans, 1992.Google Scholar
  6. [6]
    R. Burstall and J. Darlington. A transformation system for developing recursive programs. Journal of the ACM, 24: 44–67, 1977.MathSciNetMATHCrossRefGoogle Scholar
  7. [7]
    B. Demoen. On the transformation of a Prolog program to a more efficient binary program. Technical Report 130, K.U.Leuven Department of Computer Science, revised version LOPSTR92, 1992.Google Scholar
  8. [8]
    P. Deransart and J. Maluszynski. Relating logic programs and attribute grammars. Journal of Logic Programming, 2 (2): 119–155, 1985.MathSciNetMATHCrossRefGoogle Scholar
  9. [9]
    J. Gallager and M. Bruynooghe. Some low-level source transformations for logic programs. In M. Bruynooghe, editor, Proceedings of the Second Workshop on Meta-programming in Logic, pages 229–244. K.U. Leuven, Department of Computer Science, Apr. 1990.Google Scholar
  10. [10]
    J. V. Guttag and J. J. Horning. The algebraic specification of abstract data types. Acta Informatica, 10: 27–52, 1978.MathSciNetMATHCrossRefGoogle Scholar
  11. [11]
    G. Hamilton and S. Jones. Compile-time garbage collection by necessity analysis. In S. P. Jones, G. Hutton, and C. Holst, editors, Functional Programming, Glasgow 1990, pages 66–70. Springer-Verlag, London, 1991.Google Scholar
  12. [12]
    C. Julié and D. Parigot. Space optimization in the FNC-2 attribute grammar system. In P. Deransart and M. Jourdan, editors, Attribute Grammars and their Applications (WAGA), volume 461 of Lecture Notes in Computer Science, pages 29–45. Springer-Verlag, Sept. 1990.CrossRefGoogle Scholar
  13. [13]
    U. Kastens and M. Schmidt. Lifetime analysis for procedure parameters. In B. Robinet and R. Wilhelm, editors, Proceedings of the 1st European Symposium on Programming (ESOP ‘86), volume 213 of Lecture Notes in Computer Science, pages 53–69. Springer-Verlag, Mar. 1986.Google Scholar
  14. [14]
    F. Kluiniak. Compile time garbage collection for Ground Prolog. In R. A. Kowalski and K. A. Bowen, editors, Proceedings of the Fifth International Conference and Symposium on Logic Programming, pages 1490–1505, Seatle, 1988. ALP, IEEE, The MIT Press.Google Scholar
  15. [15]
    S. Le Huitouze, P. Louvet, and O. Ridoux. Logic grammars and λ-Prolog. In D. Warren, editor, Proceedings of the Tenth International Conference on Logic Programming, pages 64–79, Budapest, Hungary, 1993. The MIT Press.Google Scholar
  16. [16]
    J. Lloyd and J. Shepherdson. Partial evaluation in logic programming. Journal of Logic Programming, 11: 217–242, 1991.MathSciNetMATHCrossRefGoogle Scholar
  17. [17]
    M. Meier. Recursion vs. iteration in Prolog. In K. Furukawa, editor, Proceedings of the Eighth International Conference on Logic Programming, pages 157–169, Paris, France, 1991. The MIT Press.Google Scholar
  18. [18]
    A. Mulkers, W. Winsborough, and M. Bruynooghe. Analysis of shared data structures for compile-time garbage. In D. H. D. Warren and P. Szeredi, editors, Proceedings of the Seventh International Conference on Logic Programming, pages 747–762, Jerusalem, 1990. The MIT Press.Google Scholar
  19. [19]
    U. Neumerkel. Specialization of Prolog programs with partially static goals and binarization, Dissertation. Bericht TR 1851–1992–12, Institut für Computersprachen, Technische Universität Wien, 1992.Google Scholar
  20. [20]
    U. Neumerkel. Une transformation de programme basée sur la notion d’équations entre termes. In Secondes journées francophones sur la programmation en logique (JFPL’98), Nimes-Avingnon, France, 1993.Google Scholar
  21. [21]
    M. Proietti and A. Pettorossi. Unfolding-definition-folding in this order, for avoiding unnecessary variables in logic programs. In J. Maluszynski and M. Wirsing, editors, Programming Languages Implementation and Logic Programming, volume 528 of Lecture Notes in Computer Science, pages 347–358, Passau, Germany, Aug. 1991. Springer-Verlag.Google Scholar
  22. [22]
    P. V. Roy. A useful extension to Prolog’s Definite Clause Grammar notation. SIGPLAN notices, 24 (11): 132–134, Nov. 1989.CrossRefGoogle Scholar
  23. [23]
    T. Sato and H. Tarnaki. Existential continuation. New Generation Computing, 6 (4): 421–438, 1989.MATHCrossRefGoogle Scholar
  24. [24]
    H. Tamaki and T. Sato. Unfold/fold transformation of logic programs. In S.-A. Tärnlund, editor, Second International Logic Programming Conference, pages 127–138, Uppsala, 1984.Google Scholar
  25. [25]
    P. Tarau and M. Boyer. Elementary logic programs. In P. Deransart and J. Maluszynski, editors, Programming Languages Implementation and Logic Programming, volume 456 of Lecture Notes in Computer Science, pages 159–173, Linköping, Sweden, Aug. 1990. Springer-Verlag.Google Scholar
  26. [26]
    M. Wand. Continuation-based program transformation strategies. Journal of the Association for Computing Machinery, 27 (1): 164–180, 1980.MathSciNetMATHCrossRefGoogle Scholar

Copyright information

© British Computer Society 1994

Authors and Affiliations

  • Ulrich Neumerkel
    • 1
  1. 1.Institut für ComputersprachenTechnische Universität WienÖsterreich

Personalised recommendations