首页    期刊浏览 2024年07月05日 星期五
登录注册

文章基本信息

  • 标题:Partial Evaluation of Pattern Matching in Strings, revisited
  • 本地全文:下载
  • 作者:Bernd Grobauer ; Julia L. Lawall
  • 期刊名称:BRICS Report Series
  • 印刷版ISSN:0909-0878
  • 出版年度:2000
  • 卷号:7
  • 期号:31
  • 出版社:Aarhus University
  • 摘要:Specializing string matchers is a canonical example of partial evaluation. A naive implementation of a string matcher repeatedly matches a pattern against every substring of the data string; this operation should intuitively benefit from specializing the matcher with respect to the pattern. In practice, however, producing an efficient implementation by performing this specialization using standard partial-evaluation techniques has been found to require non-trivial binding-time improvements. Starting with a naive matcher, we thus present a derivation of a binding-time improved string matcher. We prove its correctness and show that specialization with respect to a pattern yields a matcher with code size linear in the length of the pattern and running time linear in the length of its input. We then consider several variants of matchers that specialize well, amongst them the first such matcher presented in the literature, and we demonstrate how variants can be derived from each other systematically.
国家哲学社会科学文献中心版权所有