Generic Encodings of Constructor Rewriting Systems
This work addresses foundational issues in computer science and logic for researchers and practitioners in functional and rewrite-based languages, though it is incremental as it builds on existing formalisms.
The paper tackles the problem of extending classical term rewriting systems with negation and order by proposing a concise algorithm for computing pattern differences, enabling generic encodings into classical systems. This allows established analysis methods to be applied to extended systems and provides a new method for checking pattern subsumption, completeness, and useless patterns.
Rewriting is a formalism widely used in computer science and mathematical logic. The classical formalism has been extended, in the context of functional languages, with an order over the rules and, in the context of rewrite based languages, with the negation over patterns. We propose in this paper a concise and clear algorithm computing the difference over patterns which can be used to define generic encodings of constructor term rewriting systems with negation and order into classical term rewriting systems. As a direct consequence, established methods used for term rewriting systems can be applied to analyze properties of the extended systems. The approach can also be seen as a generic compiler which targets any language providing basic pattern matching primitives. The formalism provides also a new method for deciding if a set of patterns subsumes a given pattern and thus, for checking the presence of useless patterns or the completeness of a set of patterns.