Abstract
We define Lazy Term Rewriting Systems and show that they can be realized by local adaptations of an eager implementation of conventional term rewriting systems. The overhead of lazy evaluation is only incurred when lazy evaluation is actually performed.
Our method is modelled by a transformation of term rewriting systems, which concisely expresses the intricate interaction between pattern matching and lazy evaluation. The method easily extends to term graph rewriting. We consider only left-linear, confluent term rewriting systems, but we do not require orthogonality.
Preview
Unable to display preview. Download preview PDF.
References
Torben Amtoft. Minimal thunkification. In Third International Workshop on Static Analysis, Padova, Italy, volume 724 of Lecture Notes in Computer Science, pages 218–229. Springer-Verlag, 1993.
Henry G. Baker. Cons should not cons its arguments, part II: Cheney on the M.T.A. Draft Memorandum, January 1994.
P.N. Benton. Strictness properties of lazy algebraic datatypes. In Third International Workshop on Static Analysis, Padova, Italy, volume 724 of Lecture Notes in Computer Science, pages 206–217. Springer-Verlag, 1993.
Didier Bert, Rachid Echahed, and Bjarte M. Østvold. Abstract rewriting. In Third International Workshop on Static Analysis, Padova, Italy, volume 724 of Lecture Notes in Computer Science, pages 178–192. Springer-Verlag, 1993.
Geoffrey Burn and Daniel Le Métayer. Cps-translation and the correctness of optimising compilers. Technical Report DoC92/20, Imperial College, Department of Computing, 1992.
Geoffrey Burn. Lazy Functional Languages: Abstract Interpretation and Compilation. Pitman, 1991.
H.P. Barendregt, M.C.J.D. van Eekelen, J.R.W. Glauert, J.R. Kennaway, M.J. Plasmeijer, and M.R. Sleep. Term graph rewriting. In J.W. de Bakker, A.J. Nijman, and vol. II P.C. Treleaven, editors, Proceedings PARLE'87 Conference, volume 259 of Lecture Notes in Computer Science, pages 141–158. Springer Verlag, 1987.
Guy Cousineau and Gérard Huet. The CAML primer. Technical report, Inria, 1990. Version 2.6.1, available by ftp from ftp.inria.fr.
N. Dershowitz and J.-P Jouannaud. Rewrite systems. In J. van Leeuwen, editor, Handbook of Theoretical Computer Science, Vol B., pages 243–320. Elsevier Science Publishers, 1990.
J. Field. On Laziness and Optimality in Lambda Interpreters: Tools for Specification and Analysis. In Proc. ACM Conference on Principles of Programming Languages, San Francisco, 1990.
Jon Fairbairn and Stuart Wray. Tim: A simple, lazy abstract machine to execute supercombinators. In Gilles Kahn, editor, Functional Programming Languages and Computer Architecture, volume 274 of Lecture Notes in Computer Science, pages 34–45. Springer-Verlag, 1987.
J.A. Goguen, T. Winkler, J. Meseguer, K. Futatsugi, and J.P. Jouannaud. Introducing OBJ. In J.A. Goguen, D. Coleman, and R. Gallimore, editors, Applications of Algebraic Specification Using OBJ. Cambridge University Press, 1992.
Thierry Heuillard. Compiling conditional rewriting systems. In S. Kaplan and J.P. Jouannaud, editors, Proceedins of the First International Workshop on Conditional Term Rewriting Systems, volume 308 of Lecture Notes in Computer Science, pages 111–128. Springer-Verlag, 1988.
G. Huet and J.-J. Lévy. Call-by-need computations in non-ambiguous linear term rewriting systems. Technical Report 359, INRIA, 1979. Also appeared as: Computations in Orthogonal Rewriting Systems part I and II, in: ‘Computational Logic; essays in honour of Alan Robinson’ (eds. J.-L. Lassez and G. Plotkin), MIT Press, Cambridge, MA, 1991, 395–443.
P.Z. Ingermann. Thunks — a way of compiling procedure statements with some comments on procedure declarations. Communications of the ACM, 4(1):55–58, 1961.
Simon L Peyton Jones and David Lester. Implementing Functional Languages — A Tutorial. Prentice Hall, 1992.
Simon L Peyton Jones and Jon Salkild. The Spineless Tagless G-machine. In Functional Programming and Computer Architecture, pages 184–201. ACM, 1989.
J.R. Kennaway, J.W. Klop, M.R. Sleep, and F.J. de Vries. The adequacy of term graph rewriting for simulating term rewriting. In Ronan Sleep, Rinus Plasmeijer, and Marko van Eekelen, editors, Term Graph Rewriting: Theory and Practice. John Wiley & Sons Ltd, 1993.
J.W. Klop. Term rewriting systems. In S. Abramsky, D. Gabbay, and T. Maibaum, editors, Handbook of Logic in Computer Science, Volume 2., pages 1–116. Oxford University Press, 1992.
J.F.Th. Kamperman and H.R. Walters. ARM — Abstract Rewriting Machine. In H. A. Wijshoff, editor, Computing Science in the Netherlands, pages 193–204, 1993.
Luc Maranget. La stratégie paresseuse. PhD thesis, L'Université Paris VII, July 1992.
A. Martelli, C. Moiso, and C.F. Rossi. An algorithm for unification in equational theories. In Proceedings of the Symposium on Logic Programming, pages 180–186. IEEE Computer Society, 1986.
Alan Mycroft. The theory and practice of transforming call-by-need into call-by-value. In B. Robinet, editor, International Symposium on Programming, volume 83 of Lecture Notes in Computer Science. Springer-Verlag, 1980.
M.J. O'Donnell. Computing in Systems Described by Equations, volume 58 of Lecture Notes in Computer Science. Springer-Verlag, 1977.
Chris Okasaki, Peter Lee, and David Tarditi. Call-by-need and continuation-passing style. Lisp and Symbolic Computation, 7:57–82, 1994.
G. D. Plotkin. Call-by-name, call-by-value and the λ-calculus. Theoretical Computer Science, 1(1):125–159, 1975.
M J. Plasmeijer and M C J D. van Eekelen. Functional Programming and Parallel Graph Rewriting. Addison Wesley, 1993.
Paul Steckler and Mitchell Wand. Selective thunkification. In First International Static Analysis Symposium, Namur, Belgium, 28–30 September 1994. also available by ftp as sas94.ps.Z from ftp.ccs.neu.edu:/pub/people/steck.
David Tarditi, Anurag Acharya, and Peter Lee. No assembly required: Compiling Standard ML to C. Technical Report CMU-CS-90-187, School of Computer Science, Carnegie Mellon University, november 1990.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1995 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Kamperman, J.F.T., Walters, H.R. (1995). Lazy rewriting and eager machinery. In: Hsiang, J. (eds) Rewriting Techniques and Applications. RTA 1995. Lecture Notes in Computer Science, vol 914. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-59200-8_54
Download citation
DOI: https://doi.org/10.1007/3-540-59200-8_54
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-59200-6
Online ISBN: 978-3-540-49223-8
eBook Packages: Springer Book Archive