Run-Time Profiling of Functional Logic Programs

  • B. Brassel
  • M. Hanus
  • F. Huch
  • J. Silva
  • G. Vidal
Part of the Lecture Notes in Computer Science book series (LNCS, volume 3573)


In this work, we introduce a profiling scheme for modern functional logic languages covering notions like laziness, sharing, and non-determinism. Firstly, we instrument a natural (big-step) semantics in order to associate a symbolic cost to each basic operation (e.g., variable updates, function unfoldings, case evaluations). While this cost semantics provides a formal basis to analyze the cost of a computation, the implementation of a cost-augmented interpreter based on it would introduce a huge overhead. Therefore, we also introduce a sound transformation that instruments a program such that its execution—under the standard semantics—yields not only the corresponding results but also the associated costs. Finally, we describe a prototype implementation of a profiler based on the developments in this paper.


Function Call Logical Variable Cost Center Program Transformation Execution Cost 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Albert, E., Hanus, M., Huch, F., Oliver, J., Vidal, G.: Operational Semantics for Declarative Multi-Paradigm Languages. Journal of Symbolic Computation (2005)(To appear)Google Scholar
  2. 2.
    Albert, E., Vidal, G.: Symbolic Profiling of Multi-Paradigm Declarative Languages. In: Pettorossi, A. (ed.) LOPSTR 2001. LNCS, vol. 2372, pp. 148–167. Springer, Heidelberg (2002)CrossRefGoogle Scholar
  3. 3.
    Antoy, S., Hanus, M.: Compiling Multi-Paradigm Declarative Programs into Prolog. In: Kirchner, H. (ed.) FroCos 2000. LNCS, vol. 1794, pp. 171–185. Springer, Heidelberg (2000)CrossRefGoogle Scholar
  4. 4.
    Barendregt, H.P.: The Lambda Calculus—Its Syntax and Semantics. Elsevier, Amsterdam (1984)zbMATHGoogle Scholar
  5. 5.
    Braßel, B., Hanus, M., Huch, F., Silva, J., Vidal, G.: Run-Time Profiling of Functional Logic Programs. Technical report, DSIC, Technical University of Valencia (2005), Available at:
  6. 6.
    Hanus, M. (ed.): Curry: An Integrated Functional Logic Language. Available at:
  7. 7.
    Gorlick, M., Kesselman, C.: Timing Prolog Programs without Clock. In: Proc. of the 4th Symposium on Logic Programming (SLP1987), pp. 426–434 (1987)Google Scholar
  8. 8.
    Hanus, M.: A Unified Computation Model for Functional and Logic Programming. In: Proc. of the 24th ACM Symp. on Principles of Programming Languages (POPL1997), pp. 80–93. ACM, New York (1997)Google Scholar
  9. 9.
    Hanus, M., Prehofer, C.: Higher-Order Narrowing with Definitional Trees. Journal of Functional Programming 9(1), 33–75 (1999)zbMATHCrossRefMathSciNetGoogle Scholar
  10. 10.
    Hanus, M., Antoy, S., Engelke, M., Höppner, K., Koj, J., Niederau, P., Sadre, R., Steiner, F. (eds.): PAKCS 1.6.0: The Portland Aachen Kiel Curry System—User Manual. Technical report, University of Kiel, Germany (2004)Google Scholar
  11. 11.
    Jones, N.D., Gomard, C.K., Sestoft, P.: Partial Evaluation and Automatic Program Generation. Prentice-Hall, Englewood Cliffs (1993)zbMATHGoogle Scholar
  12. 12.
    Launchbury, J.: A Natural Semantics for Lazy Evaluation. In: Proc. of the ACM Symp. on Principles of Programming Languages (POPL1993), pp. 144–154. ACM Press, New York (1993)Google Scholar
  13. 13.
    López-Fraguas, F., Sánchez-Hernández, J.: TOY: A Multiparadigm Declarative System. In: Narendran, P., Rusinowitch, M. (eds.) RTA 1999. LNCS, vol. 1631, pp. 244–247. Springer, Heidelberg (1999)CrossRefGoogle Scholar
  14. 14.
    Sansom, P.M., Peyton-Jones, S.L.: Formally Based Profiling for Higher-Order Functional Languages. ACM Transactions on Programming Languages and Systems 19(2), 334–385 (1997)CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2005

Authors and Affiliations

  • B. Brassel
    • 1
  • M. Hanus
    • 1
  • F. Huch
    • 1
  • J. Silva
    • 2
  • G. Vidal
    • 2
  1. 1.Institut für InformatikCAU KielKielGermany
  2. 2.DSICTech. University of ValenciaValenciaSpain

Personalised recommendations