Accurate Step Counting
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.
KeywordsStep Count Recursive Call Abstract Machine Denotational Semantic Continuation Function
Unable to display preview. Download preview PDF.
- 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
- 4.Claessen, K., Hughes, J.: Quickcheck: a lightweight tool for random testing of haskell programs. In: ICFP, pp. 268–279 (2000)Google Scholar
- 5.Danvy, O.: A rational deconstruction of Landin’s SECD machine. Technical Report RS-03-33 (October 2003)Google Scholar
- 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
- 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.Peyton Jones, S.: Haskell 98 language and libraries: The revised report. Technical reportGoogle Scholar
- 10.Plotkin, G.D.: A Structural Approach to Operational Semantics. Technical Report DAIMI FN-19, University of Aarhus (1981)Google Scholar
- 13.Schmidt, D.A.: Denotational semantics: a methodology for language development. William C. Brown Publishers, Dubuque (1986)Google Scholar
- 14.Shaffer, C.A.: A Practical Introduction to Data Structures and Algorithm Analysis. Prentice Hall PTR, Upper Saddle River (2000)Google Scholar
- 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