Abstract
The efficient implementation of functional logic languages relies on finding (if it exists) an optimal evaluation order for the arguments of functions. The problems of finding the best evaluation order, and the sequentiality of program rules are both difficult and can benefit from using static analysis techniques. The second problem is of special interest because the parallel evaluation of arguments is out of the question due to the possibility of backtracking and sharing of free logical variables among different arguments. However, the lack of sequentiality is often syntactic rather than semantic. In this paper we show that an adequate use of type information and strictness analysis can help a compiler to (i) derive an efficient evaluation order, and (ii) generate sequential code from most programs. Data structures (new versions of definitional trees) are introduced to take advantage of this kind of information and manage run time tests when the computation cannot be made sequential at compile time.
Keywords
This research was partly supported by the Spanish CICYT project TIC96.1012-C02-02.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Sergio Antoy. Definitional trees. In Proc. of the 4th Intl. Conf. on Algebraic and Logic Programming, number 632 in Springer LNCS, pages 143–157, 1992.
Sergio Antoy, Rachid Echahed, and Michael Hanus. A needed narrowing strategy. In Proc. 21st. ACM Symposium on Principles of Programming Languages, pages 268–279, Portland, 1994.
Sergio Antoy, Rachid Echahed, and Michael Hanus. Parallel evaluation strategies for functional logic languages. In International Conference on Logic Programming, 1997.
Daniela Genius. Sequential implementation of parallel narrowing. In Proc. JIC-SLP’96 Workshop on Multi-Paradigm Logic Programming, pages 95–104, 1996.
Michael Hanus et al. Curry: an integrated functional logic language. http://www-i2.informatik.rwth-aachen.de/~hanus/curry/report.html.
G. Huet and J.J. Lévy. Call by need computations in non-ambiguous linear term rewriting systems. Technical Report Rapport Laboria 359, IRIA, august 1979.
Luc Maranget. Compiling lazy pattern matching. In Proc. of the 1992 conference on Lisp and Functional Programming. ACM Press, 1992.
Kim Marriot, Harald Søndergaard, and Neil Jones. Denotational abstract interpretation of logic programs. ACM Transactions on Programming Languages and Systems, 16(3):607–648, may 1994.
J.J. Moreno-Navarro, H. Kuchen, R. Loogen, and M. Rodríguez-Artalejo. Lazy narrowing in a graph machine. In H. Kirchner and W. Wechler, editors, 2nd International Conference on Algebraic and Logic Programming, Nancy (France), pages 298–317. CRIN (Centre de Recherche en Informatique de Nancy), LNCS, Springer Verlag, October 1990.
A. Mycroft. The theory and practice of transforming call-by-need into call-by-value. In Proc. International Symposium on Programming, pages 269–281. Springer LNCS 83, 1980.
Michael O’Donnell. Handbook of Logic in Artificial Intelligence and Logic Programming, chapter Equational Logic Programming. Oxford University Press, 1994.
S. L. Peyton-Jones. The Implementation of Functional Programming Languages. Prentice-Hall, 1987.
José María Rey and Julio Mariño. Implementación de Curry mediante su traducci ón a Prolog. Master’s thesis, Facultad de Informática, Universidad Politécnica de Madrid, 1997. In Spanish.
R. C. Sekar and I. V. Ramakrishnan. Programming in equational logic: Beyond strong sequentiality. Information and Computation, 1(104):78–109, 1993.
S. Thatte. A refinement of strong sequentiality for term rewriting with constructors. Information and Computation, 72:46–65, 1987.
Philip Wadler. Efficient compilation of pattern matching. In Peyton-Jones, editor, The Implementation of Functional Programming Languages, pages 78–103. Prentice-Hall, 1987.
F. Zartmann. Denotational abstract interpretation of functional logic programs. In P. Van Hentenryck, editor, Static Analysis: Proceedings of the Fourth International Symposium, volume 1302 of Lecture Notes in Computer Science, pages 141–156. Springer, 1997.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 1999 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Mariño, J., José Moreno-Navarro, J. (1999). Using Static Analysis to Compile Non-sequential Functional Logic Programs?. In: Pontelli, E., Santos Costa, V. (eds) Practical Aspects of Declarative Languages. PADL 2000. Lecture Notes in Computer Science, vol 1753. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-46584-7_5
Download citation
DOI: https://doi.org/10.1007/3-540-46584-7_5
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-66992-0
Online ISBN: 978-3-540-46584-3
eBook Packages: Springer Book Archive