Partial Evaluation of Pattern Matching in Strings, revisited
DOI:
https://doi.org/10.7146/brics.v7i31.20165Resumé
Specializing string matchers 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
has been found to require non-trivial binding-time improvements. Starting
with a naive matcher, we thus present a derivation of a binding-time
improved string matcher. We prove its correctness and show that specialization
with respect to a pattern yields a matcher with code size linear
in the length of the pattern and running time linear in the length of its
input. 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.
Downloads
Publiceret
2000-06-01
Citation/Eksport
Grobauer, B., & Lawall, J. L. (2000). Partial Evaluation of Pattern Matching in Strings, revisited. BRICS Report Series, 7(31). https://doi.org/10.7146/brics.v7i31.20165
Nummer
Sektion
Artikler
Licens
Authors who publish with this journal agree to the following terms:- Authors retain copyright and grant the journal right of first publication with the work simultaneously licensed under a Creative Commons Attribution License that allows others to share the work with an acknowledgement of the work's authorship and initial publication in this journal.
- Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the journal's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgement of its initial publication in this journal.
- Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work (See The Effect of Open Access).