The Abstraction and Instantiation of String-Matching Programs
DOI:
https://doi.org/10.7146/brics.v8i12.20469Resumé
We consider a naive, quadratic string matcher testing whether a
pattern occurs in a text; we equip it with a cache mediating its access to the
text; and we abstract the traversal policy of the pattern, the cache, and
the text. We then specialize this abstracted program with respect to a
pattern, using the off-the-shelf partial evaluator Similix.
Instantiating the abstracted program with a left-to-right traversal policy
yields the linear-time behavior of Knuth, Morris and Pratt's string
matcher. Instantiating it with a right-to-left policy yields the linear-time
behavior of Boyer and Moore's string matcher.
Downloads
Publiceret
2001-04-12
Citation/Eksport
Amtoft, T., Consel, C., Danvy, O., & Malmkjær, K. (2001). The Abstraction and Instantiation of String-Matching Programs. BRICS Report Series, 8(12). https://doi.org/10.7146/brics.v8i12.20469
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).