Skip to main content

A Transformation Based on the Equality between Terms

  • Conference paper
Book cover Logic Program Synthesis and Transformation

Part of the book series: Workshops in Computing ((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.

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

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. A. Appel. Compiling with Continuations. Cambridge University Press, 1992. ISBN 0–521–41695–7.

    Google Scholar 

  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. J. Beer. The occur-check problem revisited. The Journal of Logic Programming, 5 (3): 243–262, September 1988.

    Article  MATH  Google Scholar 

  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. 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. R. Burstall and J. Darlington. A transformation system for developing recursive programs. Journal of the ACM, 24: 44–67, 1977.

    Article  MathSciNet  MATH  Google Scholar 

  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. P. Deransart and J. Maluszynski. Relating logic programs and attribute grammars. Journal of Logic Programming, 2 (2): 119–155, 1985.

    Article  MathSciNet  MATH  Google Scholar 

  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. J. V. Guttag and J. J. Horning. The algebraic specification of abstract data types. Acta Informatica, 10: 27–52, 1978.

    Article  MathSciNet  MATH  Google Scholar 

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

    Chapter  Google Scholar 

  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. 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. 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. J. Lloyd and J. Shepherdson. Partial evaluation in logic programming. Journal of Logic Programming, 11: 217–242, 1991.

    Article  MathSciNet  MATH  Google Scholar 

  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. 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. 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. 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. 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. P. V. Roy. A useful extension to Prolog’s Definite Clause Grammar notation. SIGPLAN notices, 24 (11): 132–134, Nov. 1989.

    Article  Google Scholar 

  23. T. Sato and H. Tarnaki. Existential continuation. New Generation Computing, 6 (4): 421–438, 1989.

    Article  MATH  Google Scholar 

  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. 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. M. Wand. Continuation-based program transformation strategies. Journal of the Association for Computing Machinery, 27 (1): 164–180, 1980.

    Article  MathSciNet  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 1994 British Computer Society

About this paper

Cite this paper

Neumerkel, U. (1994). A Transformation Based on the Equality between Terms. In: Deville, Y. (eds) Logic Program Synthesis and Transformation. Workshops in Computing. Springer, London. https://doi.org/10.1007/978-1-4471-3234-9_15

Download citation

  • DOI: https://doi.org/10.1007/978-1-4471-3234-9_15

  • Publisher Name: Springer, London

  • Print ISBN: 978-3-540-19864-2

  • Online ISBN: 978-1-4471-3234-9

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics