Advertisement

Cost-Augmented Partial Evaluation of Functional Logic Programs

  • Germán Vidal
Article

Abstract

We enhance the narrowing-driven partial evaluation scheme for lazy functional logic programs with the computation of symbolic costs. The enhanced scheme allows us to estimate the effects of the program transformer in a precise framework and, moreover, to quantify these effects. The considered costs are “symbolic” in the sense that they measure the number of basic operations performed during a computation rather than actual execution times. Our scheme may serve as a basis to develop speedup analyses and cost-guided transformers. A cost-augmented partial evaluator, which demonstrates the usefulness of our approach, has been implemented in the multi-paradigm language Curry.

partial evaluation computational costs functional logic programming 

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Ager, M.S., Danvy, O., and Rohde, H. On obtaining Knuth, Morris and Pratt's string matcher by partial evaluation. In Proc. of the ASIAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation (ASIA-PEPM'02), ACM Press, 2002, pp. 32-46.Google Scholar
  2. 2.
    Albert, E., Antoy, S., and Vidal, G. Measuring the effectiveness of partial evaluation in functional logic languages. In Proc. of the 10th Int'l Workshop on Logic-Based Program Synthesis and Transformation (LOPSTR 2000), Springer LNCS 2042, 2001, pp. 103-124.Google Scholar
  3. 3.
    Albert, E., Hanus, M., Huch, F., Olvier, J., and Vidal, G. Operational semantics for functional logic languages. In Proc. of the Int'l Workshop on Functional and (Constraint) Logic Programming (WFLP 2002), vol. 76 of Electronic Notes in Theoretical Computer Science, Elsevier Science Publishers, 2002a.Google Scholar
  4. 4.
    Albert, E., Hanus, M., and Vidal, G. Using an abstract representation to specialize functional logic programs. In Proc. of the 7th Int'l Conf. on Logic for Programming and Automated Reasoning (LPAR'00), Springer LNAI 1955, 2000, pp. 381-398.Google Scholar
  5. 5.
    Albert, E., Hanus, M., and Vidal, G. A practical partial evaluation scheme for multi-paradigm declarative languages. Journal of Functional and Logic Programming, 2002(1) (2002b) 1-34.Google Scholar
  6. 6.
    Albert, E., Hanus, M., and Vidal, G. A residualizing semantics for the partial evaluation of functional logic programs. Information Processing Letters, 85(1) (2003) 19-25.Google Scholar
  7. 7.
    Albert, E. and Vidal, G. The narrowing-driven approach to functional logic program specialization. New Generation Computing, 20(1) (2002a) 3-26.Google Scholar
  8. 8.
    Albert, E. and Vidal, G. Symbolic profiling for multi-paradigm declarative languages. In Proc. of the 11th Int'l Workshop on Logic-Based Program Synthesis and Transformation (LOPSTR'01), Springer LNCS 2372, 2002b, pp. 148-167.Google Scholar
  9. 9.
    Alpuente, M., Falaschi, M., Julián, P., and Vidal, G. Specialization of lazy functional logic programs. In Proc. of the ACM SIGPLAN Conf. on Partial Evaluation and Semantics-Based Program Manipulation, PEPM'97, vol. 32, no. 12, of Sigplan Notices, ACM Press, New York, 1997, pp. 151-162.Google Scholar
  10. 10.
    Alpuente, M., Falaschi, M., and Vidal, G. Partial evaluation of functional logic programs. ACM TOPLAS, 20(4) (1998) 768-844.Google Scholar
  11. 11.
    Alpuente, M., Hanus, M., Lucas, S., and Vidal, G. Specialization of inductively sequential functional logic programs. In Proc. of the Fourth ACM SIGPLAN Int'l Conf. on Functional Programming (ICFP'99), vol. 34.9 of ACM Sigplan Notices, ACM Press, 1999, pp. 273-283.Google Scholar
  12. 12.
    Amtoft, T. Properties of unfolding-based meta-level systems. In Proc. of the ACM Symp. on Partial Evaluation and Semantics-Based Program Transformation (PEPM'91), Sigplan Notices, 26(9) (1991) 243-254.Google Scholar
  13. 13.
    Andersen, L. and Gomard, C. Speedup analysis in partial evaluation: Preliminary results. In Proc. of the ACM Workshop on Partial Evaluation and Semantics-based Program Transformation (PEPM'92), Yale University, 1992, pp. 1-7.Google Scholar
  14. 14.
    Antoy, S. Definitional trees. In Proc. of the 3rd Int'l Conference on Algebraic and Logic Programming (ALP'92), Springer LNCS 632, 1992, pp. 143-157.Google Scholar
  15. 15.
    Antoy, S., Echahed, R., and Hanus, M. A needed narrowing strategy. Journal of the ACM, 47(4) (2000) 776-822.Google Scholar
  16. 16.
    Baader, F. and Nipkow, T. Term Rewriting and All That. Cambridge University Press, 1998.Google Scholar
  17. 17.
    Bruynooghe, M., De Schreye, D., and Martens, B. A general criterion for avoiding infinite unfolding. New Generation Computing, 11(1) (1992) 47-79.Google Scholar
  18. 18.
    Burstall, R. and Darlington, J. A transformation system for developing recursive programs. Journal of the ACM, 24(1) (1977) 44-67.Google Scholar
  19. 19.
    Consel, C. and Danvy, O. Partial evaluation of pattern matching in strings. Information Processing Letters, 30 (1989) 79-86.Google Scholar
  20. 20.
    Gallagher, J. Tutorial on specialisation of logic programs. In Proc. of the ACM Symp. on Partial Evaluation and Semantics-Based Program Manipulation (PEPM'93), ACM, New York, 1993, pp. 88-98.Google Scholar
  21. 21.
    Giovannetti, E., Levi, G., Moiso, C., and Palamidessi, C. Kernel leaf: A logic plus functional language. Journal of Computer and System Sciences, 42 (1991) 363-377.Google Scholar
  22. 22.
    Hanus, M. The integration of functions into logic programming: From theory to practice. Journal of Logic Programming, 19/20 (1994) 583-628.Google Scholar
  23. 23.
    Hanus, M. A unified computation model for functional and logic programming. In Proc. of ACM Symp. on Principles of Programming Languages, ACM, New York, 1997, pp. 80-93.Google Scholar
  24. 24.
    Hanus, M. and Prehofer, C. Higher-order narrowing with definitional trees. Journal of Functional Programming, 9(1) (1999) 33-75.Google Scholar
  25. 25.
    Hanus, M. (Ed.). Curry: An integrated functional logic language. Available at http://www.informatik.uni-kiel.de/~mh/curry/.Google Scholar
  26. 26.
    Hanus, M., Antoy, S., Engelke, M., Höppner, K., Koj, J., Niederau, P., Sadre, R., and Steiner, F (Eds.). PAKCS 1.5.0: The Portland Aachen Kiel Curry System User Manual', Technical report, University of Kiel, Germany, 2003.Google Scholar
  27. 27.
    Hortalá-González, T. and Ullán, E. An abstract machine based system for a lazy narrowing calculus. In Proc. of the 5th Int'l Symp. on Functional and Logic Programming (FLOPS 2001), Springer LNCS 2024, 2001, pp. 216-232.Google Scholar
  28. 28.
    Huet, G. and Lévy, J. Computations in orthogonal rewriting systems, Part I + II. In Computational Logic—Essays in Honor of Alan Robinson, J. Lassez and G. Plotkin (Eds.), 1992, pp. 395-443.Google Scholar
  29. 29.
    Jones, N., Gomard, C., and Sestoft, P. Partial Evaluation and Automatic Program Generation. Prentice-Hall, Englewood Cliffs, NJ, 1993.Google Scholar
  30. 30.
    Leuschel, M. On the power of homeomorphic embedding for online termination. In Proc. of the Int'l Static Analysis Symposium (SAS'98), Springer LNCS 1503, 1998, pp. 230-245.Google Scholar
  31. 31.
    Lloyd, J. Combining functional and logic programming languages. In Proc. of the Int'l Logic Programming Symposium (ILPS'94), 1994, pp. 43-57.Google Scholar
  32. 32.
    Lloyd, J. and Shepherdson, J. Partial evaluation in logic programming. Journal of Logic Programming, 11 (1991) 217-242.Google Scholar
  33. 33.
    Loogen, R., López-Fraguas, F., and Rodríguez-Artalejo, M. A demand driven computation strategy for lazy narrowing. In Proc. of PLILP'93, Springer LNCS 714, 1993, pp. 184-200.Google Scholar
  34. 34.
    Lux, W. Münster curry v0.9.1: User's guide. Technical report, University of Münster, Germany, 2003.Google Scholar
  35. 35.
    Moreno-Navarro, J. and Rodríguez-Artalejo, M. Logic programming with functions and predicates: The language babel. Journal of Logic Programming, 12(3) (1992) 191-224.Google Scholar
  36. 36.
    Peyton Jones, S. and Santos, A. A transformation-based optimiser for haskell. Science of Computer Programming, 32(1-3) (1998) 3-47.Google Scholar
  37. 37.
    Reynolds, J. Definitional interpreters for higher-order programming languages. Higher-Order and Symbolic Computation, 11(4) (1998) 363-297. Reprinted from the Proceedings of the 25th ACM National Conference (1972).Google Scholar
  38. 38.
    Sands, D. A naive time analysis and its theory of cost equivalence. Journal of Logic and Computation, 5(4) (1995) 495-541.Google Scholar
  39. 39.
    Sørensen, M. and Glück, R. An algorithm of generalization in positive supercompilation. In Proc. of the Int'l Logic Programming Symposium (ILPS'95), The MIT Press, Cambridge, MA, 1995, pp. 465-479.Google Scholar
  40. 40.
    Sørensen, M., Glück, R., and Jones, N. A positive supercompiler. Journal of Functional Programming, 6(6) (1996) 811-838.Google Scholar
  41. 41.
    Vidal, G. Cost-augmented narrowing-driven specialization. In Proc. of the ACM SIGPLAN Workshop on Partial Evaluation and Semantics-Based Program Manipulation (PEPM'02), ACM Press, 2002, pp. 52-62.Google Scholar
  42. 42.
    Wadler, P. Deforestation: Transforming programs to eliminate trees. Theoretical Computer Science, 73 (1990) 231-248.Google Scholar
  43. 43.
    Warren, D.H.D. Higher-order extensions to prolog—Are they needed?. In Machine Intelligence, M. Hayes-Roth and Pao (Eds.), Ellis Horwood, vol. 10, 1982.Google Scholar

Copyright information

© Kluwer Academic Publishers 2004

Authors and Affiliations

  • Germán Vidal
    • 1
  1. 1.DSIC, Technical University of ValenciaCamino de Vera s/nSpain

Personalised recommendations