Skip to main content
Log in

Relating graph and term rewriting via Böhm models

  • Published:
Applicable Algebra in Engineering, Communication and Computing Aims and scope

Abstract

Dealing properly with sharing is important for expressing some of the common compiler optimizations as source-to-source transformations, such as common subexpressions elimination, lifting of free expressions and removal of invariants from a loop. Term graph rewriting is a computational model to accommodate these concerns. In this paper we are interested in defining a term model for term graph rewriting systems, which allows us to prove total correctness of those optimizations. We introduce the notion of Böhm tree, and show that for orthogonal term graph rewriting systems, Böhm tree equivalence defines a congruence. Total correctness then follows in a straightforward way from showing that if a programM contains less sharing than a programN, then bothM andN have the same Böhm tree. Using Böhm trees we also show that orthogonal term graph rewriting systems are a correct implementation of orthogonal term rewriting systems. This boils down to showing that the behavior of a term graph can be deduced from its finite approximations, that is, graph rewriting is a continuous operation. Our approach differs from that of other researchers which is based on infinite rewriting.

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.

Similar content being viewed by others

References

  1. Ariola, Z. M.: An Algebraic Approach to the Compilation and Operational Semantics of Functional Languages with I-structures. PhD thesis, MIT Technical Report TR-544, 1992

  2. Ariola, Z. M., Arvind, P-TAC: A parallel intermediate language. In: Proc. ACM Conference on Functional Programming Languages and Computer Architecture, London, September 1989

  3. Ariola, Z. M., Arvind: Compilation of Id. In: Proc of the Fourth Workshop on Languages and Compilers for Parallel Computing, Santa Clara, California. Lecture Notes in Computer Science vol. 589. Berlin, Heidelberg, New York: Springer August 1991

    Google Scholar 

  4. Ariola, Z. M., Arvind: A syntactic approach to program transformations. In: Proc. ACM SIGPLAN Symposium on Partial Evaluation and Semantics Based Program Manipulation, Yale University, New Haven, CT, June 1991

    Google Scholar 

  5. Ariola, Z. M. Arvind: Graph rewriting systems for efficient compilation. In: Sleep, M. R. Plasmeijer, M. I., van Eekelen, M. C. D. J., (eds) Term Graph Rewriting: Theory and Practice, pp 77–90. New York: John Wiley 1993

    Google Scholar 

  6. Ariola, Z. M. Arvind: Properties of a first-order functional language with sharing. Theoretical Computer Science.146, 69–108 (1995)

    Google Scholar 

  7. Ariola, Z. M., Braun, C., Klop, J. W.: A graph rewriting system to express state and sequentialization in a parallel setting. In: Proc. 5th International Workshop of Graph Grammars and their Application to Computer Science, Williamsburg, Virgina, 1994

  8. Ariola, Z. M., Klop, J. W.: Equational term graph rewriting. To appear in Fundamenta Informaticae. Extended version: CWI Report CS-R9552. 1995

  9. Barendregt, H., Brus, T., van Eekelen, M., Glauert, J., Kennaway, J., van Lee, M., Plasmeijer, M., Sleep, M. R.: Towards an intermediate language based on graph rewriting. In: Proc. Conference on Parallel Architecture and Languages Europe (PARLE '87), Eindhoven, The Netherlands, Lecture Notes in Computer Science vol. 259. Berlin, Heildelberg, New York 1987

  10. Barendreg, H. P.: The Lambda Calculus: Its Syntax and Semantics. North-Holland, Amsterdam, 1984

    Google Scholar 

  11. Barendregt, H. P., van Eekelen, M. C. J. D., Glauert, J. R. W., Kennaway, J. R., Plasmeijer, M. J. Sleep, M. R.: Term graph rewriting. In: de Bakker, J. W., Nijman, A. J., Treleaven, P. C. (eds), Proc. Conference on Parallel Architecture and Languages Europe (PARLE '87), Eindhoven. The Netherlands, Lecture Notes in Computer Science. Berlin, Heildelberg, New York: Springer 1987

    Google Scholar 

  12. Ehrig, H.: Introduction to the algebraic theory of graph grammars. In Proc. 1st International Workshop on Graph Grammars and their Application to Computer Science. Lecture Notes in Computer Science vol. 73, pp 1–69, Berlin, Heidelberg, New York 1989

    Google Scholar 

  13. Ehrig, H., Nagl, M., Rozenberg, G. (eds.): Proc. 2nd International Workshop on Graph Grammars and their Application to Computer Science, Haus Ohrbeck, Germany, Lecture Notes in Computer Science vol. 153. Berlin, Heidelberg, New York: Springer 1983

    Google Scholar 

  14. Ehrig, H., Nagl, M., Rozenberg, G., Rosenfeld, A. (eds.): 3rd International Workshop on Graph Grammers and their Application to Computer Science, Warrenton, Virginia, USA. Lecture Notes in Computer Science vol. 291. Berlin, Heidelberg, New York: Springer 1987

    Google Scholar 

  15. Ehrig, H., Nagl, M., Rozenberg, G., Rosenfeld, A. (eds.): Proc. 4th International Workshop on Graph Grammars and their Application to Computer Science, Bremen, Germany. Lecture Notes in Computer Science vol. 532. Berlin, Heidelberg, New York: Springer 1991

    Google Scholar 

  16. Farmer, W. M.: A correctness proof for combinator reduction with cycles. ACM Transactions on Programming Languages and Systems12(1), 123–134 (1990)

    Google Scholar 

  17. Farmer, W. M., Watro, R. J.: Redex capturing in term graph rewriting. In: Book, R. V. (ed) Proc. 4th International Conference on Rewriting Techniques and Applications (RTA-91), Como, Italy, Lecture Notes in Computer Science vol. 488, pp 13–24. Berlin, Heildelberg, New York: Springer 1991

    Google Scholar 

  18. Glauert, J. R. W., Kennaway, J. R., Sleep, M. R.: Dactl: An experimental graph rewriting language. In: Proc. 4th International Workshop on Graph Grammars and their Application to Computer Science, Bremen, Germany. Lecture Notes in Computer Science vol. 532, pp 378–395. Berlin, Heidelberg, New York: Springer 1990

    Google Scholar 

  19. Hennessy, M.: Algebraic Theory of Processes. MIT Press, 1988

  20. Hudak, P., Peyton Jones, S., Wadler, P., Boutel, B., Fairbairn, J., Fasel, J., Hammond, K., Hughes, J., Johnsson, T., Kieburtz, D., Nikhil, R., Partain, W., Peterson, J.: Report on the programming language Haskell, ACM SIGPLAN Notice,27(5), 1–64 (1992)

    Google Scholar 

  21. Huet, G., Levy, J.-J.: Computations in orthogonal rewriting systems 1 and 2. In: Computa tional logic. Essays in Honor of Alan Robinson. J.-L. Lassez G. D. Plotkin, 1991 (eds.)

  22. Kennaway, J. R.: On graph rewriting. Theoretical Computer Science52, 37–58 (1987)

    Google Scholar 

  23. Kennaway, J. R., Klop, J. W., Sleep, M. R., de Vries, F. J.: The adequacy of term graph re writing for simulating term rewriting. Trans. Programming Languages Sys.16(3), 493–523 (1994)

    Google Scholar 

  24. Kennaway, J. R., Klop, J. W., Sleep, M. R., deVries, F. I.: Transfinite reductions in orthogonal term rewriting systems. Information and Computation119 (1) (1995)

  25. Klop, J. W.: Term rewriting systems. In: Abramsky, S., Gabbay, D., Maibaum, T. (eds.) Handbook of Logic Computer Science, vol. II, pp 1–116, Oxford University Press, 1992

  26. Lévy, J.-J.: Réductions Correctes et Optimales dans le Lambda-Calcul. PhD thesis, Universite Paris VII, October 1978

  27. Löwe, M.: Algebraic approach to single pushout graph transformation. Theoret Comput Sci109, 181–224 (1993)

    Google Scholar 

  28. Nikhil, R. S. Id (Version 90.1) Reference Manual, Technical Report CSG Memo 284-2, MIT Laboratory for Computer Science, 545 Technology Square, Cambridge, MA 02139, USA, July 1991

    Google Scholar 

  29. Plasmeijer, M. J., van Eekelen, M. C. D. J.: Functional Programming and Parallel Graph Rewriting. Addision Wesley 1993

  30. Raoult, J. C.: On graph rewritings. Theoretical Computer Science32, 1–24 (1984)

    Google Scholar 

  31. Sleep, M. R., Plasmeijer, M. J., vanEekelen, M. C. D. J.: Term Graph Rewriting: Theory and Practice. New York: John Wiley 1993

    Google Scholar 

  32. Smetsers, J. E. W.: Graph Rewriting and Functional Languages. PhD thesis, University of Nijmegen 1993

  33. Wadsworth, C.: Semantics and Pragmatics of the Lambda-Calculus. 1971. PhD thesis, University of Oxford

  34. Wadsworth, C.: The relation between computational and denotational properties for scott's d∞-models of the lambda-calculus. Theoretical Computer Science5 (1976)

  35. Wadsworth, C.: Approximate reduction and lambda calculus models. Theoretical Computer Science7 (1978)

  36. Welch, P.: Continuous semantics and inside-out reductions. In λ-Calculus and Computer Science Theory, Italy. Lecture Notes in Computer Science vol. 37. Berlin, Heidelberg, New York: Springer 1975

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

About this article

Cite this article

Ariola, Z.M. Relating graph and term rewriting via Böhm models. AAECC 7, 401–426 (1996). https://doi.org/10.1007/BF01293598

Download citation

  • Received:

  • Revised:

  • Issue Date:

  • DOI: https://doi.org/10.1007/BF01293598

Keywords

Navigation