Deterministic second-order patterns

  • Authors:
  • Tetsuo Yokoyama;Zhenjiang Hu;Masato Takeichi

  • Affiliations:
  • Department of Mathematical Informatics, Graduate School of Information Science aad Technology, University of Tokyo, 7-3-1 Hongo, Bunkyo-ku, Tokyo 113-8656, Japan;Department of Mathematical Informatics, Graduate School of Information Science aad Technology, University of Tokyo, 7-3-1 Hongo, Bunkyo-ku, Tokyo 113-8656, Japan and PRESTO 21, Japan Science and T ...;Department of Mathematical Informatics, Graduate School of Information Science aad Technology, University of Tokyo, 7-3-1 Hongo, Bunkyo-ku, Tokyo 113-8656, Japan

  • Venue:
  • Information Processing Letters
  • Year:
  • 2004

Quantified Score

Hi-index 0.89

Visualization

Abstract

Second-order patterns, together with second-order matching, enable concise specification of program transformation, and have been implemented in several program transformation systems. However, second-order matching in general is nondeterministic, and the matching algorithm is so expensive that the matching is NP-complete. It is orthodox to impose constraints on the form of higher-order patterns so as 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. In this paper, we relax the restriction of his patterns without changing determinism in the context of matching instead of unification. As a consequence, our deterministic second-order patterns cover a wide class of useful patterns for program transformation. The time-complexity of our deterministic matching algorithm is linear in the size of a term for a fixed pattern.