Skip to main content
Log in

On graph rewriting, reduction, and evaluation in the presence of cycles

  • Published:
Higher-Order and Symbolic Computation

Abstract

We inter-derive two prototypical styles of graph reduction: reduction machines à la Turner and graph rewriting systems à la Barendregt et al. To this end, we adapt Danvy et al.’s mechanical program derivations from the world of terms to the world of cyclic graphs. We also outline how to inter-derive a third style of graph reduction: a graph evaluator.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6

Similar content being viewed by others

Notes

  1. Terms are directed acyclic graphs where a node can have at most one parent.

  2. Graphs are directed cyclic graphs where a node can have more than one parent.

  3. Compared to the previous machine, this placement of rewire can result in an additional but harmless assignment that replaces the contents of a cell by itself, e.g., in the case of .

References

  1. Ager, M.S., Biernacki, D., Danvy, O., Midtgaard, J.: A functional correspondence between evaluators and abstract machines. In: Miller, D. (ed.) Proceedings of the Fifth ACM-SIGPLAN International Conference on Principles and Practice of Declarative Programming (PPDP’03), pp. 8–19. ACM Press, Uppsala (2003)

    Google Scholar 

  2. Ariola, Z.M., Arvind, : Properties of a first-order functional language with sharing. Theor. Comput. Sci. 146(1&2), 69–108 (1995)

    Article  MathSciNet  MATH  Google Scholar 

  3. Barendregt, H.P.: Functional programming and lambda calculus. In: van Leeuwen, J. (ed.) Handbook of Theoretical Computer Science, Volume B: Formal Models and Semantics, vol. B, Chap. 7, pp. 321–364. Elsevier and The MIT Press, Cambridge (1990)

    Google Scholar 

  4. Barendregt, H.P., van Eekelen, M.C. J.D., Glauert, J.R.W., Kennaway, R., Plasmeijer, M.J., Sleep, M.R.: Term graph rewriting. In: de Bakker,J., Nijman, A.J. Treleaven, P.C. (eds) PARLE, Parallel Architectures and Languages Europe, Vol. II: Parallel Languages, Number 259 in Lecture Notes in Computer Science. Springer, Eindhoven, The Netherlands, pp. 141–158 (1987)

  5. Biernacka, M., Danvy, O.: A concrete framework for environment machines. ACM Trans. Comput. Logic 9(1), 1–30 (2007)

    Article  MathSciNet  MATH  Google Scholar 

  6. Biernacka, M., Danvy, O.: Towards compatible and interderivable semantic specifications for the Scheme programming language, Part II: Reduction semantics and abstract machines. In Palsberg [35], pages 186–206.

  7. Bülck, T., Held, A., Kluge, W.E., Pantke, S., Rathsack, C., Scholz, S.-B., Schröder, R.: Experience with the implementation of a concurrent graph reduction system on an nCUBE/2 platform. In: Buchberger, B., Volkert, J. (eds.) Parallel Processing: CONPAR 94—VAPP VI, Number 854 in Lecture Notes in Computer Science, pp. 497–508. Springer, Berlin (1994)

  8. Burn, G., Peyton Jones, S.L., Robson, J.D.: The spineless G-machine. In R.Cartwright, editor, Proceedings of the 1988 ACM Conference on Lisp and Functional Programming pp. 244–258. ACM Press, Snowbird (1988)

  9. Burton, F.W.: A linear space translation of functional programs to Turner combinators. Inf. Process. Lett. 14(5), 201–204 (1982)

    Article  MathSciNet  MATH  Google Scholar 

  10. Curry, H.B., Hindley, J.R., Feys, R.: Combinatory Logic: Volume II. North Holland, Amsterdam (1972)

    Google Scholar 

  11. Danvy, O.: Defunctionalized interpreters for programming languages. In P. Thiemann, (ed.) Proceedings of the 2008 ACM SIGPLAN International Conference on Functional Programming (ICFP’08), SIGPLAN Notices, Victoria, BC, ACM Press. Invited talk, 43(9),131–142 (2008)

  12. Danvy, O.: From reduction-based to reduction-free normalization. In: Koopman, P., Plasmeijer, R., Swierstra, D. (eds.) Advanced Functional Programming, Sixth International School, Number 5382 in Lecture Notes in Computer Science, pp. 66–164. Springer, Nijmegen (2008)

    Google Scholar 

  13. Danvy, O.: Towards compatible and interderivable semantic specifications for the Scheme programming language, Part I: Denotational Semantics, Natural Semantics, and Abstract Machines. In Palsberg [35], pp. 162–185

  14. Danvy, O., Johannsen, J.: Inter-deriving semantic artifacts for object-oriented programming. J. Comput. Syst. Sci. 76, 302–323 (2010)

    Article  MathSciNet  MATH  Google Scholar 

  15. Danvy, O., Johannsen, J., Zerny, I.: A walk in the semantic park. In: Khoo, S.-C., Siek, J. (eds.) Proceedings of the 2011 ACM SIGPLAN Workshop on Partial Evaluation and Semantics-Based Program Manipulation (PEPM 2011). ACM Press, Austin. Invited talk, 1–12 Jan (2011)

  16. Danvy, O., Millikin, K.: On the equivalence between small-step and big-step abstract machines: a simple application of lightweight fusion. Inf. Process. Lett. 106(3), 100–109 (2008)

    Article  MathSciNet  MATH  Google Scholar 

  17. Danvy, O., Millikin, K.: A rational deconstruction of Landin’s SECD machine with the J operator. Log. Methods Comput. Sci. 4(4:12), 1–67 (2008)

    MathSciNet  MATH  Google Scholar 

  18. Danvy, O., Millikin, K.: Refunctionalization at work Science of Computer Programming. Extended Version Available as the Research Report BRICS RS-08-04. 74(8), 534–549 (2009)

  19. Danvy, O., Millikin, K., Munk, J., Zerny, I.: On inter-deriving small-step and big-step semantics: a case study for storeless call-by-need evaluation. Theor. Comput. Sci. 435, 21–42 (2012)

    Article  MathSciNet  MATH  Google Scholar 

  20. Danvy, O., Nielsen, L.R.: Defunctionalization at work. In H. Søndergaard (ed.) Proceedings of the Third International ACM SIGPLAN Conference on Principles and Practice of Declarative Programming (PPDP’01). ACM Press, Firenze. Extended version available as the research report BRICS RS-01-23, pp. 162–174 (2001)

  21. Danvy, O., Nielsen, L.R.: Refocusing in reduction semantics. Research Report BRICS RS-04-26, Department of Computer Science, Aarhus University, Aarhus, Denmark, A Preliminary Version Appeared in the Informal Proceedings of the Second International Workshop on Rule-Based Programming (RULE 2001), Electronic Notes in Theoretical Computer Science, vol. 59.4 (2004)

  22. Danvy, O., Zerny, I.: Three syntactic theories for combinatory graph reduction. In: Alpuente, M. (ed.) Logic Based Program Synthesis and Transformation, 20th International Symposium, LOPSTR 2010, Revised Selected Papers, Number 6564 in Lecture Notes in Computer Science, pp. 1–20. Invited talk, Springer, Hagenberg (2010)

  23. Felleisen, M., Findler, R.B., Flatt, M.: Semantics Engineering with PLT Redex. The MIT Press, Cambridge (2009)

    MATH  Google Scholar 

  24. Glauert, J.R.W., Kennaway, R., Sleep, M.R.: Dactl: An experimental graph rewriting language. In: Ehrig, H., Kreowski, H.-J., Rozenberg, G. (eds.) Graph-Grammars and their Application to Computer Science, 4th International Workshop, Proceedings, Number 532 in Lecture Notes in Computer Science, pp. 378–395. Springer, Bremen (1990)

  25. Huet, G.: The zipper. J. Funct. Progr. 7(5), 549–554 (1997)

    Article  MathSciNet  MATH  Google Scholar 

  26. Hughes, J.: Super combinators: a new implementation method for applicative languages. In: Friedman, D.P., Wise, D.S. (ed.) Conference Record of the 1982 ACM Symposium on Lisp and Functional Programming, pp. 1–10. ACM Press, Pittsburgh (1982)

  27. Hutton, G., Wright, J.: Calculating an Exceptional Machine. In H.-W. Loidl, (ed.) Trends in Functional Programming, vol. 5. Intellect (2006)

  28. Jeffrey, A.: A fully abstract semantics for concurrent graph reduction. In Proceedings of the Ninth Annual IEEE Symposium on Logic in Computer Science, pp. 82–91. IEEE Computer Society Press, Los Alamitos (1994)

  29. Johnsson, T.: Efficient compilation of lazy evaluation. In: Graham, S.L. (ed.) Proceedings of the 1984 Symposium on Compiler Construction, SIGPLAN Notices, vol. 19, no. 6, pp. 58–69. ACM Press, Montréal, Canada (1984)

  30. Koopman, P.W.M.: Functional Programs as Executable Specifications. PhD thesis, University of Nijmegen (1990)

  31. Landin, P.J.: The mechanical evaluation of expressions. Comput. J 6(4), 308–320 (1964)

    Article  MATH  Google Scholar 

  32. Loidl, H.-W., Rubio, F., Scaife, N., Hammond, K., Horiguchi, S., Klusik, U., Loogen, R., Michaelson, G., Pena, R., Priebe, S., Portillo, Á.J.R., Trinder, P.W.: Comparing parallel functional languages: programming and performance. High. Order Symbol. Comput. 16(3), 203–251 (2003)

    Article  MATH  Google Scholar 

  33. Milner, R., Tofte, M., Harper, R., MacQueen, D.: The Definition of Standard ML (Revised). The MIT Press, Cambridge (1997)

    Google Scholar 

  34. Ohori, A., Sasano, I.: Lightweight fusion by fixed point promotion. In: Felleisen, M. (ed.) Proceedings of the Thirty-Fourth Annual ACM Symposium on Principles of Programming Languages, SIGPLAN Notices, vol. 42, No. 1, pp. 143–154. ACM Press, Nice (2007)

  35. Palsberg, J., (ed.) Semantics and Algebraic Specification: Essays dedicated to Peter D. Mosses on the occasion of his 60th birthday, number 5700 in Lecture Notes in Computer Science. Springer, Berlin (2009)

  36. Jones, S.L.P.: The Implementation of Functional Programming Languages. Prentice Hall International Series in Computer Science. Prentice-Hall International, London (1987)

    Google Scholar 

  37. Jones, S.L.P.: Implementing lazy functional languages on stock hardware: the spineless tagless G-machine. J. Funct. Progr. 2(2), 127–202 (1992)

    Article  MATH  Google Scholar 

  38. Pirog, M., Biernacki, D.: A systematic derivation of the STG machine verified in Coq. In: Gibbons, J. (ed.) Haskell ’10: Proceedings of the 2010 ACM SIGPLAN Haskell Symposium, pp. 25–36. ACM Press, Baltimore (2010)

  39. Plasmeijer, M.J., van Eekelen, M.C.J.D.: Functional Programming and Parallel Graph Rewriting. Addison-Wesley, Reading (1993)

    MATH  Google Scholar 

  40. Plotkin, G.D.: Call-by-name, call-by-value and the \(\lambda \)-calculus. Theor. Comput. Sci. 1, 125–159 (1975)

    Article  MathSciNet  MATH  Google Scholar 

  41. Turner, D.A.: A new implementation technique for applicative languages. Softw. Pract. Exp. 9(1), 31–49 (1979)

    Article  MATH  Google Scholar 

  42. van Eekelen, M., Smetsers, S., Plasmeijer, R.: Graph rewriting semantics for functional programming languages. In: Proceedings of the Fifth Annual Conference of the European Association for Computer Science Logic, pp. 106–128. Springer, Berlin (1996)

  43. Wadsworth, C.P.: Semantics and Pragmatics of the Lambda Calculus. PhD thesis, Programming Research Group, Oxford University (1971)

  44. Zerny, I.: On graph rewriting, reduction and evaluation. In: Horváth, Z., Zsók, V., Achten, P., Koopman, P. (eds.) Trends in Functional Programming, vol. 10, pp. 81–112, Komárno, Slovakia, Intellect Books. Best student-paper award of TFP 2009 (2009)

Download references

Acknowledgments

Thanks are due to the anonymous HOSC reviewers and to Dennis Decker Jensen and the anonymous TFP’09 reviewers for their comments on earlier versions of this article. I am also grateful to Olivier Danvy for his supervision and for his course on functional programming at Aarhus University, where this work originates.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Ian Zerny.

Additional information

Ian Zerny is a recipient of the Google Europe Fellowship in Programming Technology, and this research is supported in part by this Google Fellowship.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Zerny, I. On graph rewriting, reduction, and evaluation in the presence of cycles. Higher-Order Symb Comput 26, 63–84 (2013). https://doi.org/10.1007/s10990-014-9103-9

Download citation

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10990-014-9103-9

Keywords

Navigation