Fast partial evaluation of pattern matching in strings

Author(s):  
Mads Sig Ager ◽  
Olivier Danvy ◽  
Henning Korsholm Rohde
2003 ◽  
Vol 38 (10) ◽  
pp. 3-9
Author(s):  
Mads Sig Ager ◽  
Olivier Danvy ◽  
Henning Korsholm Rohde

1997 ◽  
Vol 4 (53) ◽  
Author(s):  
Olivier Danvy

In this experimental work, we extend type-directed partial evaluation (a.k.a. "reduction-free normalization" and "normalization by evaluation") to make it online, by enriching it with primitive operations (delta-rules). Each call to a primitive operator is either unfolded or residualized, depending on the operands and either with a default policy or with a user-supplied filter. The user can also specify how to residualize an operation, by pattern-matching over the operands. Operators may be pure or have a computational effect. <br />We report a complete implementation of online type-directed partial evaluation in Scheme, extending our earlier offline implementation.<br />Our partial evaluator is native in that it runs compiled code instead of using the usual meta-level technique of symbolic evaluation.


2003 ◽  
Vol 10 (20) ◽  
Author(s):  
Mads Sig Ager ◽  
Olivier Danvy ◽  
Henning Korsholm Rohde

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 <em>in linear time</em> has remained an open problem.<br /> <br />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.<br /><br />Supersedes BRICS-RS-03-11 and is superseded by BRICS-RS-04-40.


1989 ◽  
Vol 30 (2) ◽  
pp. 79-86 ◽  
Author(s):  
Charles Consel ◽  
Olivier Danvy

2006 ◽  
Vol 28 (4) ◽  
pp. 696-714 ◽  
Author(s):  
Mads Sig Ager ◽  
Olivier Danvy ◽  
Henning Korsholm Rohde

2003 ◽  
Vol 10 (11) ◽  
Author(s):  
Mads Sig Ager ◽  
Olivier Danvy ◽  
Henning Korsholm Rohde

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 <em>in linear time</em> has remained an open problem.<br /> <br />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.<br /><br />Superseded by (BRICS-RS-03-20 and) BRICS-RS-04-40.


2004 ◽  
Vol 11 (40) ◽  
Author(s):  
Mads Sig Ager ◽  
Olivier Danvy ◽  
Henning Korsholm Rohde

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 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. <br /> <br /> 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. <br /> <br />Finally, we show that the method also applies to a variant of Boyer and Moore's string matcher. <br /><br />Supersedes BRICS-RS-03-11 and BRICS-RS-03-20.


Sign in / Sign up

Export Citation Format

Share Document