Abstract
Functional logic languages amalgamate functional and logic programming paradigms. They can be efficiently implemented by extending techniques known from logic programming. In this paper we show how global information about the call modes of functions can be used to optimize the compilation of functional logic programs. Since mode information has been successfully used to improve the implementation of pure logic programs and these techniques can be applied to implementations of functional logic programs as well, we concentrate on optimizations which are unique to the operational semantics of functional logic programs. We define a suitable notion of modes for functional logic programs and present compile-time techniques to optimize the normalization process during the execution of functional logic programs.
The research described in this paper was supported by the German Ministry for Research and Technology (BMFT) under grant ITS 9103. The responsibility for the contents of this publication lies with the author.
Chapter PDF
Similar content being viewed by others
Keywords
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.
References
D. Bert and R. Echahed. Design and Implementation of a Generic, Logic and Functional Programming Language. In Proc. ESOP'86, pp. 119–132. Springer LNCS 213, 1986.
P.G. Bosco, E. Giovannetti, and C. Moiso. Narrowing vs. SLD-Resolution. Theoretical Computer Science 59, pp. 3–23, 1988.
M. Bruynooghe. A Practical Framework for the Abstract Interpretation of Logic Programs. Journal of Logic Programming (10), pp. 91–124, 1991.
M. Bruynooghe and G. Janssens. An Instance of Abstract Interpretation Integrating Type and Mode Inferencing. In Proc. 5th Conference on Logic Programming & 5th Symposium on Logic Programming (Seattle), pp. 669–683, 1988.
S.K. Debray. Static Inference of Modes and Data Dependencies in Logic Programs. ACM TOPLAS, Vol. 11, No. 3, pp. 418–450, 1989.
S.K. Debray and D.S. Warren. Automatic Mode Inference for Logic Programs. Journal of Logic Programming (5), pp. 207–229, 1988.
D. DeGroot and G. Lindstrom, editors. Logic Programming, Functions, Relations, and Equations. Prentice Hall, 1986.
N. Dershowitz and J.-P. Jouannaud. Rewrite Systems. In J. van Leeuwen, editor, Handbook of Theoretical Computer Science, Vol. B, pp. 243–320. Elsevier, 1990.
M.J. Fay. First-Order Unification in an Equational Theory. In Proc. 4th Workshop on Automated Deduction, pp. 161–167, Austin (Texas), 1979. Academic Press.
L. Fribourg. SLOG: A Logic Programming Language Interpreter Based on Clausal Superposition and Rewriting. In Proc. IEEE Int. Symp. on Logic Programming, pp. 172–184, Boston, 1985.
E. Giovannetti, G. Levi, C. Moiso, and C. Palamidessi. Kernel LEAF: A Logic plus Functional Language. Journal of Computer and System Sciences, Vol. 42, No. 2, pp. 139–185, 1991.
M. Hanus. Compiling Logic Programs with Equality. In Proc. PLILP'90, pp. 387–401. Springer LNCS 456, 1990.
M. Hanus. Efficient Implementation of Narrowing and Rewriting. In Proc. PDK'91, pp. 344–365. Springer LNAI 567, 1991.
M. Hanus. Improving Control of Logic Programs by Using Functional Logic Languages. In Proc. PLILP'92, pp. 1–23. Springer LNCS 631, 1992.
M. Hanus. Incremental Rewriting in Narrowing Derivations. In Proc. ALP'92, pp. 228–243. Springer LNCS 632, 1992.
M. Hanus. On the Completeness of Residuation. In Proc. of the 1992 Joint Int. Conf. and Symp. on Logic Programming, pp. 192–206. MIT Press, 1992.
M. Hanus. The Integration of Functions into Logic Programming: From Theory to Practice. To appear in Journal of Logic Programming, 1994.
M. Hanus and F. Zartmann. Automatic derivation of modes for functional logic programs. Max-Planck-Institut für Informatik, Saarbrücken (in preparation), 1994.
S. Hölldobler. Foundations of Equational Logic Programming. Springer LNCS 353, 1989.
J.-M. Hullot. Canonical Forms and Unification. In Proc. 5th Conference on Automated Deduction, pp. 318–334. Springer LNCS 87, 1980.
H. Kuchen, R. Loogen, J.J. Moreno-Navarro, and M. Rodríguez-Artalejo. Graph-based Implementation of a Functional Logic Language. In Proc. ESOP'90, pp. 271–290. Springer LNCS 432, 1990.
B. Le Charlier, K. Musumbu, and P. Van Hentenryck. A Generic Abstract Interpretation Algorithm and its Complexity Analysis. In Proc. International Conference on Logic Programming, pp. 64–78. MIT Press, 1991.
R. Loogen. Relating the Implementation Techniques of Functional and Functional Logic Languages. New Generation Computing, Vol. 11, pp. 179–215, 1993.
A. Marien, G. Janssens, A. Mulkers, and M. Bruynooghe. The impact of abstract interpretation: an experiment in code generation. In Proc. Sixth International Conference on Logic Programming (Lisboa), pp. 33–47. MIT Press, 1989.
C.S. Mellish. Some Global Optimizations for a Prolog Compiler. Journal of Logic Programming (1), pp. 43–66, 1985.
J.J. Moreno-Navarro and M. Rodríguez-Artalejo. Logic Programming with Functions and Predicates: The Language BABEL. Journal of Logic Programming, Vol. 12, pp. 191–223, 1992.
U. Nilsson. Systematic Semantic Approximations of Logic Programs. In Proc. PLILP'90, pp. 293–306. Springer LNCS 456, 1990.
U.S. Reddy. Narrowing as the Operational Semantics of Functional Languages. In Proc. IEEE Int. Symp. on Logic Programming, pp. 138–151, Boston, 1985.
J.R. Slagle. Automated Theorem-Proving for Theories with Simplifiers, Commutativity, and Associativity. Journal of the ACM, Vol. 21, No. 4, pp. 622–642, 1974.
Z. Somogyi. A system of precise modes for logic programs. In Proc. Fourth Int. Conf. on Logic Programming, pp. 769–787. MIT Press, 1987.
A. Taylor. Removal of Dereferencing and Trailing in Prolog Compilation. In Proc. Sixth Int. Conf. on Logic Programming, pp. 48–60. MIT Press, 1989.
A. Taylor. LIPS on a MIPS: Results form a Prolog Compiler for a RISC. In Proc. Seventh Int. Conf. on Logic Programming, pp. 174–185. MIT Press, 1990.
P. Van Roy. An Intermediate Language to Support Prolog's Unification. In Proc. 1989 North American Conf. on Logic Programming, pp. 1148–1164. MIT Press, 1989.
P.L. Van Roy. Can Logic Programming Execute as Fast as Imperative Programming? PhD thesis, Univ. of California Berkeley, 1990. Report No. UCB/CSD 90/600.
D.H.D. Warren. Implementing PROLOG — Compiling Logic Programs. 1 and 2. D.A.I. Research Report No. 39 and 40, University of Edinburgh, 1977.
D.H.D. Warren. An Abstract Prolog Instruction Set. Technical Note 309, SRI International, Stanford, 1983.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1994 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Hanus, M. (1994). Towards the global optimization of functional logic programs. In: Fritzson, P.A. (eds) Compiler Construction. CC 1994. Lecture Notes in Computer Science, vol 786. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-57877-3_5
Download citation
DOI: https://doi.org/10.1007/3-540-57877-3_5
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-57877-2
Online ISBN: 978-3-540-48371-7
eBook Packages: Springer Book Archive