Skip to main content

An Application of Term Rewriting Systems for Functional Programming

  • Chapter
Distributed Environments

Summary

Term rewriting systems have some excellent properties as a functional computation model. However, their programming is similar to logical programming rather than functional programming. This paper proposes the use of term rewriting systems as a mechanism of execution and verification, and the use of a functional programming language as syntax sugar which hides the underlying layer.

We show how to translate functional programs into term rewriting systems derived from techniques of conditional term rewriting systems. Selectors in programs, which are obstacles at the stage of development of programs, can be eliminated at the same time.

As an example of this concept, we describe a graph rewriting system and its application for functional programming. The graph grammar and its rewriting system are similar to term rewriting systems, except that the graph rewriting system can treat naturally both multiple output functions and call-by-name evaluation. We define properties, termination and confluency, for equational reasoning on this system, and then we show that this system is useful for evaluating and verifying programs which have multiple output functions.

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

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Knuth DE, Bendix PB (1970) Simple word problems in universal algebras. In: Leech J (ed) Computational problems in abstract algebra. Pergamon, Toyohashi, Japan, pp 263–297

    Google Scholar 

  2. Huet G, Hullot JM (1982) Proofs by induction in equational theories with constructors. Comput Syst Sci 25(2): 239–266

    Article  MATH  MathSciNet  Google Scholar 

  3. Hsiang J (1985) Refutational theorem proving using term-rewriting systems. Artif Intell 25: 255–300

    Article  MATH  MathSciNet  Google Scholar 

  4. Comon H (1989) Inductive proofs by specification transformations. In: Dershowitz N (ed) Rewriting techniques and applications. Springer-Verlag, Chapel Hill pp 76–91. Proceedings, 3rd International Conference, RTA-89, Lecture Notes in Computer Science, 355

    Google Scholar 

  5. Shinoda Y. Katayama T (1988) Attribute grammar based programming and its environment. In: Proc 21st Hawaii International Conference on System Sciences, Kona, Hawaii pp 612–620

    Google Scholar 

  6. Knuth DE (1968) Semantics of context-free languages. Math Syst Theory 2(2): 127–145

    Article  MATH  MathSciNet  Google Scholar 

  7. Huet G (1980) Confluent reductions: abstract properties and applications to term rewriting systems. J ACM 27(4): 797–821

    Article  MATH  MathSciNet  Google Scholar 

  8. Dershowitz N (1985) Termination. In: Jouannaud J-P (ed) Rewriting techniques and applications. Springer-Verlag, pp 180–224. Lecture Notes in Computer Science, 202

    Google Scholar 

  9. Klop JW (1990) Term rewriting systems. In: ICALP. Springer-Verlag, pp 350–369. Lecture Notes in Computer Science

    Google Scholar 

  10. Bergstra JA, Klop JW (1986) Conditional rewrite rules: confluence and termination. J Comput Syst Sci 32: 323–362

    Article  MATH  MathSciNet  Google Scholar 

  11. Giovannetti E, Moiso C (1987) Notes on the elimination of conditions. In: Kaplan S, Jouannaud J-P (eds) Conditional term rewriting systems. Springer-Verlag, pp 91–97. Proceedings, 1st International Workshop, Orsay, France, Lecture Notes in Computer Science, 308

    Google Scholar 

  12. Baeten JCM, Bergstra JA, Klop JW, Weijland WP (1989) Term-rewriting systems with rule priorities. Theor Comput Sci 67: 283–301

    Article  MATH  MathSciNet  Google Scholar 

  13. Katayama T (1981) Hfp, a hierarchical and functional programming. In: Proc 5th International Conference on Software Engineering, pp 343–353

    Google Scholar 

  14. Reps T, Teitelbaum T (1985) The Synthesizer Generator reference manual. Department of Computer Science, Cornell University, Ithaca, New York

    Google Scholar 

  15. Reps TW (1984) Generating language-based environments. MIT Press, Massachusetts Institute of Technology, Cambridge, Massachusetts 02142

    MATH  Google Scholar 

  16. Reps T, Alpern B (1984) Interactive proof checking. In: Proc 11th ACM Symp Principles of Programming Languages

    Google Scholar 

  17. Lusk EL, Overbeek RA (1982) An LMA-based theorem prover. Mathematics and Computer Science Division ANL-82–75, Argonne National Laboratory, 9700 South Cass Avenue, Argonne, Illinois 60439

    Google Scholar 

  18. Lusk EL, Mrine WW, Overbeek RA (1982) Logic machine architecture: kernel functions. In: Lecture notes in computer science 138. Springer-Verlag, pp 70–108

    Google Scholar 

  19. Habel A, Kreowski H-J (1986) May we introduce to you: hyperedge replacement. In: Ehrig H, Nagl M, Rozenberg G, Rosenfeld A (eds) Graph-grammars and their application to computer science. Springer-Verlag, pp 15–29. Lecture Notes in Computer Science, 291

    Google Scholar 

  20. Katayama T, Sasaki N (1986) Global storage allocation in attribute evaluation. In: Proc 13th ACM Symp Principles of Programming Languages, pp 26–37

    Google Scholar 

  21. Dershowitz N (1990) Infinite rewriting. In: Proc Toyohashi Symposium on Theoretical Computer Science. Toyohashi, Japan, pp 27–31, August 1990

    Google Scholar 

  22. Sakai M, Sakabe T, Inagaki Y (1987) Direct implementation system of algebraic specifications of abstract data types (in Japanese). Comput Software 4(4): 16–27

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 1991 Springer-Verlag Tokyo

About this chapter

Cite this chapter

Kikuchi, Y., Katayama, T. (1991). An Application of Term Rewriting Systems for Functional Programming. In: Ohno, Y., Matsuda, T. (eds) Distributed Environments. Springer, Tokyo. https://doi.org/10.1007/978-4-431-68144-1_7

Download citation

  • DOI: https://doi.org/10.1007/978-4-431-68144-1_7

  • Publisher Name: Springer, Tokyo

  • Print ISBN: 978-4-431-68146-5

  • Online ISBN: 978-4-431-68144-1

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics