Advertisement

Improving Functional Logic Programs by Difference-Lists

  • Elvira Albert
  • César Ferri
  • Frank Steiner
  • Germán Vidal
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 1961)

Abstract

Modern multi-paradigm declarative languages integrate features from functional, logic, and concurrent programming. Since programs in these languages make extensive use of list-processing functions, we consider of much interest the development of list-processing optimization techniques. In this work, we consider the adaptation of the well-known difference-lists transformation from the logic programming paradigm to our integrated setting. Unfortunately, the use of differencelists is impractical due to the absence of non-strict equality in lazy (callby-name) languages. Despite all, we have developed a novel, stepwise transformation which achieves a similar effect over functional logic programs. We also show a simple and practical approach to incorporate the optimization into a real compiler. Finally, we have conducted a number of experiments which show the practicality of our proposal.

Keywords

functional logic programming program transformation compiler optimization 

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    E. Albert, C. Ferri, F. Steiner, and G. Vidal. List-Processing Optimizations in a Multi-Paradigm Declarative Language. Technical Report DSIC, UPV, 2000. Available from URL: http://www.dsic.upv.es/users/elp/papers.html.
  2. 2.
    M. Alpuente, M. Falaschi, G. Moreno, and G. Vidal. A Transformation System for Lazy Functional Logic Programs. In A. Middeldorp and T. Sato, editors, Proc. of FLOPS’99, pages 147–162. Springer LNCS 1722, 1999.Google Scholar
  3. 3.
    S. Antoy. Definitional trees. In Proc. of the 3rd Int’l Conference on Algebraic and Logic Programming, ALP’92, pages 143–157. Springer LNCS 632, 1992.Google Scholar
  4. 4.
    S. Antoy, R. Echahed, and M. Hanus. A Needed Narrowing Strategy. Journal of the ACM, 47(4):776–822, 2000.CrossRefMathSciNetGoogle Scholar
  5. 5.
    N. Dershowitz and J.-P. Jouannaud. Rewrite Systems. In J. van Leeuwen, editor, Handbook of Theoretical Computer Science, volume B: Formal Models and Semantics, pages 243–320. Elsevier, Amsterdam, 1990.Google Scholar
  6. 6.
    A. J. Gill, J. Launchbury, and S. L. Peyton Jones. A Short Cut to Deforestation. In Proc. of FPLCA’93, pages 223–232, New York, NY (USA), 1993. ACM Press.Google Scholar
  7. 7.
    M. Hanus. The Integration of Functions into Logic Programming: From Theory to Practice. Journal of Logic Programming, 19&20:583–628, 1994.CrossRefMathSciNetGoogle Scholar
  8. 8.
    M. Hanus, S. Antoy, J. Koj, P. Niederau, R. Sadre, and F. Steiner. PAKCS 1.2: User Manual. Technical report, CAU Kiel, 2000. Available at http://www.informatik.uni-kiel.de/~pakcs.
  9. 9.
    M. Hanus (ed.). Curry: An Integrated Functional Logic Language. Available at http://www.informatik.uni-kiel.de/~curry, 2000.
  10. 10.
    G. Huet and J. J. Lévy. Computations in orthogonal rewriting systems, Part I + II. In J. L. Lassez and G. D. Plotkin, editors, Computational Logic — Essays in Honor of Alan Robinson, pages 395–443, 1992.Google Scholar
  11. 11.
    J. Hughes. A Novel representation of Lists and its Application to the Function reverse. Tech. Report PMG-38, Chalmers Institute of Technology, Sweden, 1984.Google Scholar
  12. 12.
    K. Marriott and H. Søndergaard. Difference-list Transformation for Prolog. New Generation Computing, 11(2):125–157, October 1993.Google Scholar
  13. 13.
    L. Sterling and E. Shapiro. The Art of Prolog: Advanced Programming Techniques. MIT Press, 1986.Google Scholar
  14. 14.
    H. Tamaki and T. Sato. Unfold/Fold Transformations of Logic Programs. In Proc. of Second Int’l Conf. on Logic Programming, pages 127–139, 1984.Google Scholar
  15. 15.
    P. L. Wadler. The Concatenate Vanishes. Technical report, Department of Computing Science, University of Glasgow, UK, 1987.Google Scholar
  16. 16.
    P. L. Wadler. Deforestation: Transforming programs to eliminate trees. Theoretical Computer Science, 73:231–248, 1990.zbMATHCrossRefMathSciNetGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2000

Authors and Affiliations

  • Elvira Albert
    • 1
  • César Ferri
    • 1
  • Frank Steiner
    • 2
  • Germán Vidal
    • 1
  1. 1.Camino de Vera s/nDSIC, UPVValenciaSpain
  2. 2.Institut für InformatikCAU KielKielGermany

Personalised recommendations