Automatic generation of efficient string matching algorithms by generalized partial computation

  • Authors:
  • Yoshihiko Futamura;Zenjiro Konishi;Robert Glück

  • Affiliations:
  • Waseda University, Tokyo, Japan;Waseda University, Tokyo, Japan;Waseda University, Tokyo, Japan

  • Venue:
  • ASIA-PEPM '02 Proceedings of the ASIAN symposium on Partial evaluation and semantics-based program manipulation
  • Year:
  • 2002

Quantified Score

Hi-index 0.00

Visualization

Abstract

This paper shows that Generalized Partial Computation (GPC) can automatically generate efficient string matching algorithms. GPC is a program transformation method utilizing partial information about input data and auxiliary functions as well as the logical structure of a source program. GPC uses both a classical partial evaluator and an inference engine such as a theorem prover to optimize programs. First, we show that a Boyer-Moore (BM) type pattern matcher without the bad-character heuristic can be generated from a simple non-linear backward matcher by GPC. This sort of problems has already been discussed in the literature using offline partial evaluators. However, there was no proof that every generated matcher runs in the same way as the BM. In this paper we prove that the problem can be solved starting from a simple non-linear pattern matcher as a source program. We also prove that a Knuth-Morris-Pratt (KMP) type linear string matcher can be generated from a naive non-linear forward matcher by GPC.