How to characterize the language of ground normal forms
Résumé
Term rewriting systems provide the computer scientists with a language to express functional definitions on complex domains. In such an area, we face the problem to characterize the ground normal forms (without any variables) as they are the results of computations. Doing that allows one to check the completeness of a functional definition (then the ground normal forms are built only with constructors) or to check the equivalence of two different functional definitions (it is possible to establish a one-to-one correspondence between the ground normal forms). We present here a characterization of the ground normal forms in terms of grammar, and an algorithm to derive it from the form of the left-hand sides of the rewrite rules. When the left-hand sides are linear, the form of the grammar is especially simple as it is context-free when we consider the terms as words, written for instance in prefix form. Therefore we get a decision procedure for the finiteness of the set of ground normal forms and we are also able to compute the normal forms which are the instances of a given linear term. The ideas behind the algorithms we present are very simple and we illustrate them by several examples.