Skip to main content

Using Static Analysis to Compile Non-sequential Functional Logic Programs?

  • Conference paper
  • First Online:
Practical Aspects of Declarative Languages (PADL 2000)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 1753))

Included in the following conference series:

  • 275 Accesses

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.

This research was partly supported by the Spanish CICYT project TIC96.1012-C02-02.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 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.

    Chapter  Google Scholar 

  2. 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.

    Google Scholar 

  3. Sergio Antoy, Rachid Echahed, and Michael Hanus. Parallel evaluation strategies for functional logic languages. In International Conference on Logic Programming, 1997.

    Google Scholar 

  4. Daniela Genius. Sequential implementation of parallel narrowing. In Proc. JIC-SLP’96 Workshop on Multi-Paradigm Logic Programming, pages 95–104, 1996.

    Google Scholar 

  5. Michael Hanus et al. Curry: an integrated functional logic language. http://www-i2.informatik.rwth-aachen.de/~hanus/curry/report.html.

  6. 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.

    Google Scholar 

  7. Luc Maranget. Compiling lazy pattern matching. In Proc. of the 1992 conference on Lisp and Functional Programming. ACM Press, 1992.

    Google Scholar 

  8. 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.

    Article  Google Scholar 

  9. 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.

    Google Scholar 

  10. 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.

    Google Scholar 

  11. Michael O’Donnell. Handbook of Logic in Artificial Intelligence and Logic Programming, chapter Equational Logic Programming. Oxford University Press, 1994.

    Google Scholar 

  12. S. L. Peyton-Jones. The Implementation of Functional Programming Languages. Prentice-Hall, 1987.

    Google Scholar 

  13. 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.

    Google Scholar 

  14. R. C. Sekar and I. V. Ramakrishnan. Programming in equational logic: Beyond strong sequentiality. Information and Computation, 1(104):78–109, 1993.

    Article  MathSciNet  Google Scholar 

  15. S. Thatte. A refinement of strong sequentiality for term rewriting with constructors. Information and Computation, 72:46–65, 1987.

    Article  MathSciNet  Google Scholar 

  16. Philip Wadler. Efficient compilation of pattern matching. In Peyton-Jones, editor, The Implementation of Functional Programming Languages, pages 78–103. Prentice-Hall, 1987.

    Google Scholar 

  17. 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.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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

Publish with us

Policies and ethics