Skip to main content

Preserving Sharing in the Partial Evaluation of Lazy Functional Programs

  • Conference paper
Logic-Based Program Synthesis and Transformation (LOPSTR 2007)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 4915))

  • 203 Accesses

Abstract

The goal of partial evaluation is the specialization of programs w.r.t. part of their input data. Although this technique is already well-known in the context of functional languages, current approaches are either overly restrictive or destroy sharing through the specialization process, which is unacceptable from a performance point of view. In this work, we present the basis of a new partial evaluation scheme for first-order lazy functional programs that preserves sharing through the specialization process and still allows the unfolding of arbitrary function calls.

This work has been partially supported by the EU (FEDER) and the Spanish MEC under grants TIN2005-09207-C03-02 and Acción Integrada HA2006-0008.

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

Access this chapter

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Similar content being viewed by others

References

  1. Albert, E., Hanus, M., Huch, F., Oliver, J., Vidal, G.: Operational Semantics for Declarative Multi-Paradigm Languages. Journal of Symbolic Computation 40(1), 795–829 (2005)

    Article  MathSciNet  MATH  Google Scholar 

  2. Albert, E., Hanus, M., Vidal, G.: A Practical Partial Evaluation Scheme for Multi-Paradigm Declarative Languages. Journal of Functional and Logic Programming 2002(1) (2002)

    Google Scholar 

  3. Albert, E., Hanus, M., Vidal, G.: A Residualizing Semantics for the Partial Evaluation of Functional Logic Programs. Information Processing Letters 85(1), 19–25 (2003)

    Article  MathSciNet  MATH  Google Scholar 

  4. Alpuente, M., Falaschi, M., Julián, P., Vidal, G.: Specialization of Lazy Functional Logic Programs. In: Proc. of the ACM SIGPLAN Conf. on Partial Evaluation and Semantics-Based Program Manipulation, PEPM 1997, vol. 32, pp. 151–162. ACM Press, New York (1997)

    Google Scholar 

  5. Andersen, L.O.: Program Analysis and Specialization for the C Programming Language. PhD thesis, DIKU, University of Copenhagen (1994)

    Google Scholar 

  6. Arroyo, G., Ramos, J.G., Silva, J., Vidal, G.: Improving Offline Narrowing-Driven Partial Evaluation using Size-Change Graphs. In: Puebla, G. (ed.) LOPSTR 2006. LNCS, vol. 4407, pp. 60–76. Springer, Heidelberg (2007)

    Google Scholar 

  7. Barendregt, H.P.: The Lambda Calculus—Its Syntax and Semantics. Elsevier, Amsterdam (1984)

    MATH  Google Scholar 

  8. Bondorf, A.: Similix 5.0 Manual (1993)

    Google Scholar 

  9. Bondorf, A., Jørgensen, J.: Efficient Analyses for Realistic Off-Line Partial Evaluation. Journal of Functional Programming 3(3), 315–346 (1993)

    Article  Google Scholar 

  10. Consel, C., Danvy, O.: Tutorial notes on Partial Evaluation. In: Proc. of the ACM Symp. on Principles of Programming Languages, pp. 493–501. ACM, New York (1993)

    Google Scholar 

  11. Glenstrup, A.J., Jones, N.D.: Termination analysis and specialization-point insertion in offline partial evaluation. ACM TOPLAS 27(6), 1147–1215 (2005)

    Article  Google Scholar 

  12. Jones, N.D., Gomard, C.K., Sestoft, P.: Partial Evaluation and Automatic Program Generation. Prentice-Hall, Englewood Cliffs, NJ (1993)

    MATH  Google Scholar 

  13. Launchbury, J.: A Natural Semantics for Lazy Evaluation. In: Proc. of the ACM Symp. on Principles of Programming Languages (POPL 1993), pp. 144–154. ACM Press, New York (1993)

    Google Scholar 

  14. Leuschel, M., Elphick, D., Varea, M., Craig, S., Fontaine, M.: The Ecce and Logen Partial Evaluators and Their Web Interfaces. In: Proc. of PEPM 2006, pp. 88–94. IBM Press (2006)

    Google Scholar 

  15. Peyton-Jones, S. (ed.): Haskell 98 Language and Libraries—The Revised Report. Cambridge University Press, Cambridge (2003)

    MATH  Google Scholar 

  16. Peyton Jones, S.L., Marlow, S.: Secrets of the Glasgow Haskell Compiler Inliner. Journal of Functional Programming 12(4&5), 393–433 (2002)

    MathSciNet  MATH  Google Scholar 

  17. Ramos, J.G., Silva, J., Vidal, G.: Fast Narrowing-Driven Partial Evaluation for Inductively Sequential Systems. In: Proc. of the 10th ACM SIGPLAN Int’l Conf. on Functional Programming (ICFP 2005), pp. 228–239. ACM Press, New York (2005)

    Google Scholar 

  18. Wadler, P.L.: Deforestation: Transforming programs to eliminate trees. Theoretical Computer Science 73, 231–248 (1990)

    Article  MathSciNet  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2008 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Fischer, S., Silva, J., Tamarit, S., Vidal, G. (2008). Preserving Sharing in the Partial Evaluation of Lazy Functional Programs. In: King, A. (eds) Logic-Based Program Synthesis and Transformation. LOPSTR 2007. Lecture Notes in Computer Science, vol 4915. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-78769-3_6

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-78769-3_6

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-78768-6

  • Online ISBN: 978-3-540-78769-3

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics