Description

Conditional rewrite rules are notorious for being difficult to implement in rewrite engines. This is because, like in the case of function calls in programming language implementations, rewrite engines need to "freeze" the current rewriting environment and to create a new one in which the condition is reduced. Stacking these rewriting environments efficiently can easily become a nontrivial task, which can have a direct impact on the efficiency of rewriting. Continuation-passing-style (CPS) transformations are used as a front-end in many programming languages to transform the programs to compile into a convenient and highly optimizable form, in which functions never need to return their values: they just pass their computed values to the current data-context, which "knows" how to continue the computation.We argue that a similar transformation technique can be applied to conditional rewrite systems, to transform them into computationally equivalent unconditional rewrite systems. In this paper we present the first steps towards such a transformation. No special support is needed from the underlying unconditional rewrite engine, so the presented technique can be used as a front-end to any of the current rewrite engines. Since unconditional rewriting is more amenable to parallelization, our transformation is expected to lead to efficient concurrent implementations of rewriting.

You are granted permission for the non-commercial reproduction, distribution, display, and performance of this technical report in any format, BUT this permission is only for a period of 45 (forty-five) days from the most recent time that you verified that this technical report is still available from the University of Illinois at Urbana-Champaign Computer Science Department under terms that include this permission. All other rights are reserved by the author(s).