首页    期刊浏览 2024年12月14日 星期六
登录注册

文章基本信息

  • 标题:Fast Partial Evaluation of Pattern Matching in Strings
  • 作者:Mads Sig Ager ; Olivier Danvy ; Henning Korsholm Rohde
  • 期刊名称:BRICS Report Series
  • 印刷版ISSN:0909-0878
  • 出版年度:2003
  • 卷号:10
  • 期号:11
  • 出版社:Aarhus University
  • 摘要:We show how to obtain all of Knuth, Morris, and Pratt's linear-time string matcher by partial evaluation of a quadratic-time string matcher with respect to a pattern string. Although it has been known for 15 years how to obtain this linear matcher by partial evaluation of a quadratic one, how to obtain it in linear time has remained an open problem. Obtaining a linear matcher by partial evaluation of a quadratic one is achieved by performing its backtracking at specialization time and memoizing its results. We show (1) how to rewrite the source matcher such that its static intermediate computations can be shared at specialization time and (2) how to extend the memoization capabilities of a partial evaluator to static functions. Such an extended partial evaluator, if its memoization is implemented efficiently, specializes the rewritten source matcher in linear time. Superseded by (BRICS-RS-03-20 and) BRICS-RS-04-40.
Loading...
联系我们|关于我们|网站声明
国家哲学社会科学文献中心版权所有