Deterministic Higher-Order Patterns for Program Transformation

Tetsuo Yokoyama,Zhenjiang Hu,Masato Takeichi
DOI: https://doi.org/10.1007/978-3-540-25938-1_12
2003-01-01
Abstract:Higher-order patterns, together with higher-order matching, enable concise specification of program transformation, and have been implemented in several program transformation systems. However, higher-order matching in general is nondeterministic, and the matching algorithm is so expensive that even second-order matching is NP-complete. It is orthodox to impose constraint on the form of patterns to obtain the desirable matches satisfying certain properties such as decidability and finiteness. In the context of unification, Miller's higher-order patterns have a single most general unifier. We relax the restrictions in his patterns without changing determinism within the context of matching instead of unification. As a consequence, the new class of patterns covers a wide class of useful patterns for program transformation. The time-complexity of the matching algorithm is linear for the size of a term for a fixed pattern.
What problem does this paper attempt to address?