2002
DOI: 10.7146/brics.v9i32.21747
|View full text |Cite
|
Sign up to set email alerts
|

On Obtaining Knuth, Morris, and Pratt's String Matcher by Partial Evaluation

Abstract: We present the first formal proof that partial evaluation of a quadratic string matcher can yield the precise behaviour of Knuth, Morris, and Pratt's linear string matcher.Obtaining a KMP-like string matcher is a canonical example of partial evaluation: starting from the naive, quadratic program checking whether a pattern occurs in a text, one ensures that backtracking can be performed at partial-evaluation time (a binding-time shift that yields a staged string matcher); specializing the resulting staged progr… Show more

Help me understand this report

Search citation statements

Order By: Relevance

Paper Sections

Select...
2
1
1
1

Citation Types

0
6
0

Year Published

2005
2005
2006
2006

Publication Types

Select...
3

Relationship

3
0

Authors

Journals

citations
Cited by 3 publications
(6 citation statements)
references
References 11 publications
0
6
0
Order By: Relevance
“…As already shown in the literature [Ager et al 2002;Grobauer and Lawall 2002], each specialized version of a staged matcher such as that of Figure 1 has size linear in the length of the pattern. For two reasons, however, specialization does not proceed in time linear in the length of the pattern: -The first reason is that for every position in the pattern, the specializer blindly performs the backtracking steps of the staged quadratic matcher.…”
Section: Linear-time Specializationmentioning
confidence: 67%
See 1 more Smart Citation
“…As already shown in the literature [Ager et al 2002;Grobauer and Lawall 2002], each specialized version of a staged matcher such as that of Figure 1 has size linear in the length of the pattern. For two reasons, however, specialization does not proceed in time linear in the length of the pattern: -The first reason is that for every position in the pattern, the specializer blindly performs the backtracking steps of the staged quadratic matcher.…”
Section: Linear-time Specializationmentioning
confidence: 67%
“…In this article, the starting point is a staged quadratic-time matcher and a simple memoizing partial evaluator such as Similix, where specialization points are dynamic conditional expressions [Bondorf and Danvy 1991]. Figure 1 displays a staged matcher similar to the ones developed in the literature [Ager et al 2002;Amtoft et al 2002;Consel and Danvy 1989;Jones et al 1993] (see Appendix A for a more complete picture). Matching is done naively from left to right.…”
Section: Obtaining a Specialized Matcher That Work In Linear Timementioning
confidence: 99%
“…We would like to thank Mads Sig Ager for our pleasant joint initial study of partial evaluation of string matchers [1,2]. We are also grateful to him, Julia Lawall, and the anonymous referees for their insightful comments.…”
Section: Acknowledgementsmentioning
confidence: 97%
“…As in our earlier work [1], we characterize a string matcher by a notion of trace: the sequence of character comparisons between the pattern and the text in the course of a run. Using a large test suite (several hundreds of runs), we have verified the correctness of each of our programs by automatically comparing its traces and the corresponding traces of a reference implementation [6].…”
Section: Correctness Issuesmentioning
confidence: 99%
See 1 more Smart Citation