Preserving Sharing in the Partial Evaluation of Lazy Functional Programs

  • Sebastian Fischer
  • Josep Silva
  • Salvador Tamarit
  • Germán Vidal
Part of the Lecture Notes in Computer Science book series (LNCS, volume 4915)

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.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 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)MathSciNetCrossRefMATHGoogle Scholar
  2. 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. 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)MathSciNetCrossRefMATHGoogle Scholar
  4. 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. 5.
    Andersen, L.O.: Program Analysis and Specialization for the C Programming Language. PhD thesis, DIKU, University of Copenhagen (1994)Google Scholar
  6. 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. 7.
    Barendregt, H.P.: The Lambda Calculus—Its Syntax and Semantics. Elsevier, Amsterdam (1984)MATHGoogle Scholar
  8. 8.
    Bondorf, A.: Similix 5.0 Manual (1993)Google Scholar
  9. 9.
    Bondorf, A., Jørgensen, J.: Efficient Analyses for Realistic Off-Line Partial Evaluation. Journal of Functional Programming 3(3), 315–346 (1993)CrossRefGoogle Scholar
  10. 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. 11.
    Glenstrup, A.J., Jones, N.D.: Termination analysis and specialization-point insertion in offline partial evaluation. ACM TOPLAS 27(6), 1147–1215 (2005)CrossRefGoogle Scholar
  12. 12.
    Jones, N.D., Gomard, C.K., Sestoft, P.: Partial Evaluation and Automatic Program Generation. Prentice-Hall, Englewood Cliffs, NJ (1993)MATHGoogle Scholar
  13. 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. 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. 15.
    Peyton-Jones, S. (ed.): Haskell 98 Language and Libraries—The Revised Report. Cambridge University Press, Cambridge (2003)MATHGoogle Scholar
  16. 16.
    Peyton Jones, S.L., Marlow, S.: Secrets of the Glasgow Haskell Compiler Inliner. Journal of Functional Programming 12(4&5), 393–433 (2002)MathSciNetMATHGoogle Scholar
  17. 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. 18.
    Wadler, P.L.: Deforestation: Transforming programs to eliminate trees. Theoretical Computer Science 73, 231–248 (1990)MathSciNetCrossRefMATHGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2008

Authors and Affiliations

  • Sebastian Fischer
    • 1
  • Josep Silva
    • 2
  • Salvador Tamarit
    • 2
  • Germán Vidal
    • 2
  1. 1.University of KielKielGermany
  2. 2.Technical University of ValenciaValenciaSpain

Personalised recommendations