Partial Evaluation of Pattern Matching in Strings, revisited

Bernd Grobauer, J. Lawall
{"title":"Partial Evaluation of Pattern Matching in Strings, revisited","authors":"Bernd Grobauer, J. Lawall","doi":"10.7146/BRICS.V7I31.20165","DOIUrl":null,"url":null,"abstract":"Specialization of a string matcher 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 requires non-trivial binding-time improvements. Starting with a naive matcher, we thus present a derivation of such a binding-time improved string matcher. We show that specialization with respect to a pattern yields a matcher with code size linear in the length of the pattern and a running time independent of the length of the pattern and linear in the length of the data string. 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.","PeriodicalId":114503,"journal":{"name":"Nord. J. Comput.","volume":"24 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2000-06-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"17","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Nord. J. Comput.","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.7146/BRICS.V7I31.20165","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 17

Abstract

Specialization of a string matcher 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 requires non-trivial binding-time improvements. Starting with a naive matcher, we thus present a derivation of such a binding-time improved string matcher. We show that specialization with respect to a pattern yields a matcher with code size linear in the length of the pattern and a running time independent of the length of the pattern and linear in the length of the data string. 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.
字符串中模式匹配的部分求值,重访
字符串匹配器的专门化是部分求值的典型示例。简单的字符串匹配器实现会针对数据字符串的每个子字符串重复匹配模式;这个操作应该直观地受益于针对模式专门化匹配器。然而,在实践中,通过使用标准的部分求值技术执行这种专门化来产生有效的实现,需要对绑定时间进行重大改进。因此,我们从一个朴素的匹配器开始,给出了这样一个绑定时改进的字符串匹配器的派生。我们表明,对模式进行专门化会产生一个匹配器,其代码大小与模式长度呈线性关系,运行时间与模式长度无关,与数据字符串长度呈线性关系。然后,我们考虑了几个很好的匹配器变体,其中包括文献中提出的第一个这样的匹配器,我们演示了如何系统地从彼此派生出变体。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信