Starting with an evaluator for a language, an abstract machine for the same language can be mechanically derived using successive program transformations. This has relevance to studying both the time and space properties of programs because these can be estimated by counting transitions of the abstract machine and measuring the size of the additional data structures needed, such as environments and stacks. In this paper we will use this process to derive a function that accurately counts the number of steps required to evaluate expressions in a simple language, and illustrate this function with a range of examples.


Step Count Recursive Call Abstract Machine Denotational Semantic Continuation Function 
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.
    Ager, M.S.: From natural semantics to abstract machines. In: Etalle, S. (ed.) LOPSTR 2004. LNCS, vol. 3573, pp. 245–261. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  2. 2.
    Ager, M.S., Biernacki, D., Danvy, O., Midtgaard, J.: A functional correspondence between evaluators and abstract machines. Technical Report RS-03-13, March 2003, pp. 28 Appears in, pp. 8–19 (2003)Google Scholar
  3. 3.
    Ager, M.S., Danvy, O., Midtgaard, J.: A functional correspondence between call-by-need evaluators and lazy abstract machines. Information Processing Letters 90(5), 223–232 (2004); Extended version available as the technical report BRICS-RS-04-3MATHCrossRefMathSciNetGoogle Scholar
  4. 4.
    Claessen, K., Hughes, J.: Quickcheck: a lightweight tool for random testing of haskell programs. In: ICFP, pp. 268–279 (2000)Google Scholar
  5. 5.
    Danvy, O.: A rational deconstruction of Landin’s SECD machine. Technical Report RS-03-33 (October 2003)Google Scholar
  6. 6.
    Danvy, O.: On evaluation contexts, continuations, and the rest of the computation. Number CSR-04-1, pp. 13–23, Birmingham B15 2TT, United Kingdom, Invited talk (2004)Google Scholar
  7. 7.
    Hutton, G.: A Tutorial on the Universality and Expressiveness of Fold. Journal of Functional Programming 9(4), 355–372 (1999)MATHCrossRefMathSciNetGoogle Scholar
  8. 8.
    Hutton, G., Wright, J.: Calculating an Exceptional Machine. In: The Proceedings of the Fifth Symposium on Trends in Functional Programming (to appear, 2005)Google Scholar
  9. 9.
    Peyton Jones, S.: Haskell 98 language and libraries: The revised report. Technical reportGoogle Scholar
  10. 10.
    Plotkin, G.D.: A Structural Approach to Operational Semantics. Technical Report DAIMI FN-19, University of Aarhus (1981)Google Scholar
  11. 11.
    Reynolds, J.C.: Definitional interpreters for higher-order programming languages. Higher Order Symbol. Comput. 11(4), 363–397 (1998)MATHCrossRefGoogle Scholar
  12. 12.
    Sansom, P.M., Peyton Jones, S.L.: Formally based profiling for higher-order functional languages. ACM Trans. Program. Lang. Syst. 19(2), 334–385 (1997)CrossRefGoogle Scholar
  13. 13.
    Schmidt, D.A.: Denotational semantics: a methodology for language development. William C. Brown Publishers, Dubuque (1986)Google Scholar
  14. 14.
    Shaffer, C.A.: A Practical Introduction to Data Structures and Algorithm Analysis. Prentice Hall PTR, Upper Saddle River (2000)Google Scholar
  15. 15.
    Wadler, P.: Monads for functional programming. In: Broy, M. (ed.) Program Design Calculi: Proceedings of the 1992 Marktoberdorf International Summer School. Springer, Heidelberg (1993)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2006

Authors and Affiliations

  • Catherine Hope
    • 1
  • Graham Hutton
    • 1
  1. 1.School of Computer Science and ITUniversity of NottinghamUK

Personalised recommendations