Lambda lifting: transforming programs to recursive equations
Proc. of a conference on Functional programming languages and computer architecture
Partial evaluation of pattern matching in strings
Information Processing Letters
Partial evaluation of pattern matching in constraint logic programming languages
PEPM '91 Proceedings of the 1991 ACM SIGPLAN symposium on Partial evaluation and semantics-based program manipulation
Automatic autoprojection of recursive equations with global variable and abstract data types
Science of Computer Programming
Essence of generalized partial computation
Theoretical Computer Science - Images of programming dedicated to the memory of Andrei P. Ershov
Partial evaluation and automatic program generation
Partial evaluation and automatic program generation
Abstract interpretation of partial evaluation algorithms
Abstract interpretation of partial evaluation algorithms
PLDI '96 Proceedings of the ACM SIGPLAN 1996 conference on Programming language design and implementation
A transformation-based optimiser for Haskell
Science of Computer Programming - Special issue on the 6th European symposium on programming
Lambda-dropping: transforming recursive equations into programs with block structure
Theoretical Computer Science - Partial evaluation and semantics-based program manipulation
Glossary for Partial Evaluation and Related Topics
Higher-Order and Symbolic Computation
Program transformation system based on generalized partial computation
New Generation Computing - Partial evaluation and program transformation
Revised Report on the Algorithmic Language Scheme
Higher-Order and Symbolic Computation
Combining Program and Data Specialization
Higher-Order and Symbolic Computation
Occam's Razor in Metacompuation: the Notion of a Perfect Process Tree
WSA '93 Proceedings of the Third International Workshop on Static Analysis
Partial evaluation of pattern matching in strings, revisited
Nordic Journal of Computing
Automatic generation of efficient string matching algorithms by generalized partial computation
ASIA-PEPM '02 Proceedings of the ASIAN symposium on Partial evaluation and semantics-based program manipulation
Fast partial evaluation of pattern matching in strings
Proceedings of the 2003 ACM SIGPLAN workshop on Partial evaluation and semantics-based program manipulation
Cost-Augmented Partial Evaluation of Functional Logic Programs
Higher-Order and Symbolic Computation
Fast partial evaluation of pattern matching in strings
ACM Transactions on Programming Languages and Systems (TOPLAS)
On obtaining the Boyer-Moore string-matching algorithm by partial evaluation
Information Processing Letters
Hi-index | 0.00 |
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 program yields residual programs that do not back up on the text, a la KMP. We are not aware, however, of any formal proof that partial evaluation of a staged string matcher precisely yields the KMP string matcher, or in fact any other specific string matcher.In this article, we present a staged string matcher and we formally prove that it performs the same sequence of comparisons between pattern and text as the KMP string matcher. To this end, we operationally specify each of the programming languages in which the matchers are written, and we formalize each sequence of comparisons with a trace semantics. We also state the (mild) conditions under which specializing the staged string matcher with respect to a pattern string provably yields a specialized string matcher whose size is proportional to the length of this pattern string and whose time complexity is proportional to the length of the text string. Finally, we show how tabulating one of the functions in this staged string matcher gives rise to the 'next' table of the original KMP algorithm.The method scales for obtaining other linear string matchers, be they known or new.