Hostname: page-component-8448b6f56d-cfpbc Total loading time: 0 Render date: 2024-04-23T16:43:01.349Z Has data issue: false hasContentIssue false

Promoting rewriting to a programming language: a compiler for non-deterministic rewrite programs in associative-commutative theories

Published online by Cambridge University Press:  12 April 2001

HÉLÈNE KIRCHNER
Affiliation:
LORIA-CNRS & INRIA, BP 239 54506 Vandœuvre-lès-Nancy Cedex, France (e-mail: Helene.Kirchner@loria.fr, moreau@loria.fr)
PIERRE-ETIENNE MOREAU
Affiliation:
LORIA-CNRS & INRIA, BP 239 54506 Vandœuvre-lès-Nancy Cedex, France (e-mail: Helene.Kirchner@loria.fr, moreau@loria.fr)
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the ‘Save PDF’ action button.

First-order languages based on rewrite rules share many features with functional languages, but one difference is that matching and rewriting can be made much more expressive and powerful by incorporating some built-in equational theories. To provide reasonable programming environments, compilation techniques for such languages based on rewriting have to be designed. This is the topic addressed in this paper. The proposed techniques are independent from the rewriting language, and may be useful to build a compiler for any system using rewriting modulo Associative and Commutative (AC) theories. An algorithm for many-to-one AC matching is presented, that works efficiently for a restricted class of patterns. Other patterns are transformed to fit into this class. A refined data structure, namely compact bipartite graph, allows encoding of all matching problems relative to a set of rewrite rules. A few optimisations concerning the construction of the substitution and of the reduced term are described. We also address the problem of non-determinism related to AC rewriting, and show how to handle it through the concept of strategies. We explain how an analysis of the determinism can be performed at compile time, and we illustrate the benefits of this analysis for the performance of the compiled evaluation process. Then we briefly introduce the ELAN system and its compiler, in order to give some experimental results and comparisons with other languages or rewrite engines.

Type
Research Article
Copyright
© 2001 Cambridge University Press
Submit a response

Discussions

No Discussions have been published for this article.