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.
References
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.
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.
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.
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.
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.
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.
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.
P. Deransart, M. Jourdan and B. Lorho. Attribute grammars — Definitions, systems and bibliography. LNCS 323, Springer-Verlag, 1988.
P. Deransart and J. Małuszyński. Relating logic programs and attribute grammars. Journal of logic programming, 2(2), pp. 119–156, 1985.
P. Deransart and J. Małuszyński. A grammatical view on logic programming. The MIT Press. To appear 1993.
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.
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.
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.
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.
S. Hölldobler. Foundations of equational logic programming. Lecture notes in artificial intelligence 353, Springer-Verlag, 1989.
D. Knuth. Semantics of context-free languages. Mathematical systems theory, 2, pp. 127–145, 1968.
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.
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.
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.
L. Naish. Adding equations to NU-Prolog. In Programming language implementation and logic programming, pp. 15–26, LNCS 528, Springer-Verlag, 1991.
U. Nilsson and J. Małuszyński. Logic, programming and Prolog. John Wiley and sons, 1990.
L. Plümer. Termination proofs for logic programs. Lecture notes in artificial intelligence 446, Springer-Verlag, 1990.
P. Sundblad. Transformation of GAPLog programs (preliminary title). Master's thesis, Linköping university, 1993.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1993 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Boye, J. (1993). Avoiding dynamic delays in functional logic programs. In: Bruynooghe, M., Penjam, J. (eds) Progamming Language Implementation and Logic Programming. PLILP 1993. Lecture Notes in Computer Science, vol 714. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-57186-8_68
Download citation
DOI: https://doi.org/10.1007/3-540-57186-8_68
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-57186-5
Online ISBN: 978-3-540-47945-1
eBook Packages: Springer Book Archive