Abstract
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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Ager, M.S.: From natural semantics to abstract machines. In: Etalle, S. (ed.) LOPSTR 2004. LNCS, vol. 3573, pp. 245–261. Springer, Heidelberg (2005)
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)
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-3
Claessen, K., Hughes, J.: Quickcheck: a lightweight tool for random testing of haskell programs. In: ICFP, pp. 268–279 (2000)
Danvy, O.: A rational deconstruction of Landin’s SECD machine. Technical Report RS-03-33 (October 2003)
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)
Hutton, G.: A Tutorial on the Universality and Expressiveness of Fold. Journal of Functional Programming 9(4), 355–372 (1999)
Hutton, G., Wright, J.: Calculating an Exceptional Machine. In: The Proceedings of the Fifth Symposium on Trends in Functional Programming (to appear, 2005)
Peyton Jones, S.: Haskell 98 language and libraries: The revised report. Technical report
Plotkin, G.D.: A Structural Approach to Operational Semantics. Technical Report DAIMI FN-19, University of Aarhus (1981)
Reynolds, J.C.: Definitional interpreters for higher-order programming languages. Higher Order Symbol. Comput. 11(4), 363–397 (1998)
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)
Schmidt, D.A.: Denotational semantics: a methodology for language development. William C. Brown Publishers, Dubuque (1986)
Shaffer, C.A.: A Practical Introduction to Data Structures and Algorithm Analysis. Prentice Hall PTR, Upper Saddle River (2000)
Wadler, P.: Monads for functional programming. In: Broy, M. (ed.) Program Design Calculi: Proceedings of the 1992 Marktoberdorf International Summer School. Springer, Heidelberg (1993)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2006 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Hope, C., Hutton, G. (2006). Accurate Step Counting. In: Butterfield, A., Grelck, C., Huch, F. (eds) Implementation and Application of Functional Languages. IFL 2005. Lecture Notes in Computer Science, vol 4015. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11964681_6
Download citation
DOI: https://doi.org/10.1007/11964681_6
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-69174-7
Online ISBN: 978-3-540-69175-4
eBook Packages: Computer ScienceComputer Science (R0)