Fast partial evaluation of pattern matching in strings

Author:

Ager Mads Sig1,Danvy Olivier1,Rohde Henning Korsholm1

Affiliation:

1. BRICS, University of Aarhus, Aarhus N, Denmark

Abstract

We show how to obtain all of Knuth, Morris, and Pratt's linear-time string matcher by specializing a quadratic-time string matcher with respect to a pattern string. Although it has been known for fifteen 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 the 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. Finally, we show that the method also applies to a variant of Boyer and Moore's string matcher.

Publisher

Association for Computing Machinery (ACM)

Subject

Software

Reference41 articles.

1. On obtaining Knuth, Morris, and Pratt's string matcher by partial evaluation

2. Aho A. V. Hopcroft J. E. and Ullman J. D. 1974. The Design and Analysis of Computer Algorithms. Addison Wesley Reading Mass.]] Aho A. V. Hopcroft J. E. and Ullman J. D. 1974. The Design and Analysis of Computer Algorithms. Addison Wesley Reading Mass.]]

3. Specialization of lazy functional logic programs

4. Amtoft T. 1993. Sharing of computations. Ph.D. thesis DAIMI Department of Computer Science University of Aarhus Aarhus Denmark. Tech. rep. PB-453.]] Amtoft T. 1993. Sharing of computations. Ph.D. thesis DAIMI Department of Computer Science University of Aarhus Aarhus Denmark. Tech. rep. PB-453.]]

5. The abstraction and instantiation of string-matching programs. In The Essence of Computation: Complexity, Analysis, Transformation. Essays Dedicated to Neil D. Jones, T. æ. Mogensen et al., eds;Amtoft T.;LNCS,2002

Cited by 8 articles. 订阅此论文施引文献 订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献

1. String Matching Algorithm Using Multi-Characters Inverted Lists;WSEAS TRANSACTIONS ON COMPUTERS;2023-10-03

2. Maximally-Polyvariant Partial Evaluation in Polynomial Time;Lecture Notes in Computer Science;2016

3. The Essence of Multi-stage Evaluation in LMS;A List of Successes That Can Change the World;2016

4. A Type Theoretic Specification of Partial Evaluation;Proceedings of the 16th International Symposium on Principles and Practice of Declarative Programming - PPDP '14;2014

5. Bibliography;Program Specialization;2013-02-05

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

"同舟云学术"是以全球学者为主线,采集、加工和组织学术论文而形成的新型学术文献查询和分析系统,可以对全球学者进行文献检索和人才价值评估。用户可以通过关注某些学科领域的顶尖人物而持续追踪该领域的学科进展和研究前沿。经过近期的数据扩容,当前同舟云学术共收录了国内外主流学术期刊6万余种,收集的期刊论文及会议论文总量共计约1.5亿篇,并以每天添加12000余篇中外论文的速度递增。我们也可以为用户提供个性化、定制化的学者数据。欢迎来电咨询!咨询电话:010-8811{复制后删除}0370

www.globalauthorid.com

TOP

Copyright © 2019-2024 北京同舟云网络信息技术有限公司
京公网安备11010802033243号  京ICP备18003416号-3