Section: Scientific Foundations
Rewriting calculus
The huge diversity of the rewriting concept is obvious and when one wants to focus on the underlying notions, it becomes quickly clear that several technical points should be settled. For example, what kind of objects are rewritten? Terms, graphs, strings, sets, multisets, others? Once we have established this, what is a rewrite rule? What is a left-hand side, a right-hand side, a condition, a context? And then, what is the effect of a rule application? This leads immediately to defining more technical concepts like variables in bound or free situations, substitutions and substitution application, matching, replacement; all notions being specific to the kind of objects that have to be rewritten. Once this is solved one has to understand the meaning of the application of a set of rules on (classes of) objects. And last but not least, depending on the intended use of rewriting, one would like to define an induced relation, or a logic, or a calculus.
In this very general picture, we have introduced a calculus whose main
design concept is to make all the basic ingredients of rewriting
explicit objects, in particular the notions of rule
application and result . We concentrate on
term rewriting, we introduce a very general notion of rewrite
rule and we make the rule application and result explicit
concepts. These are the basic ingredients of the rewriting-
or - calculus whose originality comes from the fact that terms, rules, rule
application and application strategies are all treated
at the object level (a rule can be applied on a rule for instance).
The -calculus is usually put forward as the abstract
computational model underlying functional programming. However,
modern functional programming languages have pattern-matching features
which cannot be directly expressed in the
-calculus. To
palliate this problem,
pattern-calculiĀ [68] , [60] , [53]
have been introduced.
The rewriting calculus is also a pattern calculus that combines the
expressiveness of pure functional calculi and algebraic term
rewriting. This calculus is designed and used for logical and
semantical purposes. It could be equipped with powerful type systems
and used for expressing the semantics of rule based as well as object
oriented languages. It allows one to naturally express exception
handling mechanisms and elaborated rewriting strategies. It can be
also extended with imperative features and cyclic data structures.
The study of the rewriting calculus turns out to be extremely successful in terms of fundamental results and of applications. Different instances of this calculus together with their corresponding type systems have been proposed and studied. The expressive power of this calculus was illustrated by comparing it with similar formalismsĀ [35] , [45] and in particular by giving a typed encoding of standard strategies used in first-order rewriting and classical rewrite based languages like ELAN and Tom .