Advertisement

Avoiding dynamic delays in functional logic programs

  • Johan Boye
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 714)

Abstract

In several functional logic programming languages, functional expressions must be evaluated before unification with another term, but this can only be done if the functional expression is ground. If the functional expression is non-ground, then unification must be delayed until all the arguments have become instantiated to ground terms. If the delaying mechanism uses dynamic tests, the program will be unnecessarily inefficient.

We present an analysis method for statically determining at what point in the program a given functional expression can be evaluated. This analysis is then used for transforming a functional logic program into an equivalent program, in which most dynamic delays are avoided. We show that this transformation can lead to considerable improvements in performance, compared to a dynamic delaying strategy.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    H. Aït-Kaci. An overview of LIFE. In Schmidt, Stogny (eds.) Next generation information system technology, pp. 42–58, LNCS 504, Springer-Verlag, 1990.Google Scholar
  2. 2.
    H. Aït-Kaci, P. Lincoln and R. Nasr. LeFun: Logic, Equations and FUNctions. In Proc. 4th IEEE international symposium on logic programming, pp. 17–23, 1987.Google Scholar
  3. 3.
    K. Apt and A. Pellegrini. Why the occur-check is not a problem. In Programming language implementation and logic programming, pp. 69–86, LNCS 631, Springer-Verlag, 1992.Google Scholar
  4. 4.
    J-L. Bouquard. Étude des rapports entre grammaires attribuées et programmation logique: application au test d'occurrence et è l'analyse statique, PhD thesis, University of Tours, 1992.Google Scholar
  5. 5.
    J. Boye. S-SLD-resolution — an operational semantics for logic programs with external procedures. In Programming language implementation and logic programming, pp. 383–393, LNCS 528, Springer-Verlag, 1991.Google Scholar
  6. 6.
    J. Boye, J. Paakki and J. Małuszyński. Dependency-based groundness analysis of functional logic programs. Research report LiTH-IDA-R-93-20, Linköping university, 1993.Google Scholar
  7. 7.
    P. Deransart, G. Ferrand and M. Téguia. NSTO programs. In Proc. of the international symposium on logic programming, pp. 533–547, The MIT Press, 1991.Google Scholar
  8. 8.
    P. Deransart, M. Jourdan and B. Lorho. Attribute grammars — Definitions, systems and bibliography. LNCS 323, Springer-Verlag, 1988.Google Scholar
  9. 9.
    P. Deransart and J. Małuszyński. Relating logic programs and attribute grammars. Journal of logic programming, 2(2), pp. 119–156, 1985.CrossRefGoogle Scholar
  10. 10.
    P. Deransart and J. Małuszyński. A grammatical view on logic programming. The MIT Press. To appear 1993.Google Scholar
  11. 11.
    B. Dumant. Checking the soundness of resolution schemes. In Proc. of the joint international conference and symposium on logic programming, pp. 37–51, The MIT Press, 1992.Google Scholar
  12. 12.
    L. Fribourg. SLOG: A logic programming language interpreter based on clausal superposition and rewriting. In Proc. of the IEEE international symposium on logic programming, pp. 172–184, Boston, 1985.Google Scholar
  13. 13.
    M. Hanus. A functional and logic language with polymorphic types. In Proc. of the international symposium on design and implementation of symbolic computation systems, pp. 215–224, LNCS 429, Springer-Verlag, 1990.Google Scholar
  14. 14.
    M. Hanus. On the completeness of residuation. In Proc. of the joint international conference and symposium on logic programming, pp. 192–206, The MIT Press, 1992.Google Scholar
  15. 15.
    S. Hölldobler. Foundations of equational logic programming. Lecture notes in artificial intelligence 353, Springer-Verlag, 1989.Google Scholar
  16. 16.
    D. Knuth. Semantics of context-free languages. Mathematical systems theory, 2, pp. 127–145, 1968.CrossRefGoogle Scholar
  17. 17.
    A. Kågedal and F. Kluźniak. Enriching Prolog with S-unification. In Darlington and Dietrich, (eds.), PHOENIX Seminar and Workshop on Declarative Programming, Workshops in Computing, Sasbachwalden, Germany. Springer-Verlag, 1991.Google Scholar
  18. 18.
    J. Małuszyński, S. Bonnier, J. Boye, F. Kluźniak, A. Kågedal and U. Nilsson. Logic programs with external procedures. In Apt, de Bakker, Rutten (eds.) Logic programming languages: constraints, functions and objects. The MIT Press, 1993.Google Scholar
  19. 19.
    J. Moreno-Navarro and M. Rodriguez-Artalejo. Logic programming with functions and predicates: the language BABEL. Journal of logic programming (12), pp. 191–223, 1992.Google Scholar
  20. 20.
    L. Naish. Adding equations to NU-Prolog. In Programming language implementation and logic programming, pp. 15–26, LNCS 528, Springer-Verlag, 1991.Google Scholar
  21. 21.
    U. Nilsson and J. Małuszyński. Logic, programming and Prolog. John Wiley and sons, 1990.Google Scholar
  22. 22.
    L. Plümer. Termination proofs for logic programs. Lecture notes in artificial intelligence 446, Springer-Verlag, 1990.Google Scholar
  23. 23.
    P. Sundblad. Transformation of GAPLog programs (preliminary title). Master's thesis, Linköping university, 1993.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1993

Authors and Affiliations

  • Johan Boye
    • 1
  1. 1.Department of Computer and Information ScienceLinköping UniversityLinköpingSweden

Personalised recommendations