Partial Evaluation of Pattern Matching in StringsCharles
نویسندگان
چکیده
This article describes how automatically specializing a fairly naive pattern matcher by partial evaluation leads to the Knuth, Morris & Pratt algorithm. Interestingly enough, no theorem proving is needed to achieve the partial evaluation, as was previously argued, and it is suucient to identify a static component in the computation to get the result { a deterministic nite automaton. This experiment illustrates how a small insight and partial evaluation can achieve a non-trivial result.
منابع مشابه
Evaluation of Similarity Measures for Template Matching
Image matching is a critical process in various photogrammetry, computer vision and remote sensing applications such as image registration, 3D model reconstruction, change detection, image fusion, pattern recognition, autonomous navigation, and digital elevation model (DEM) generation and orientation. The primary goal of the image matching process is to establish the correspondence between two ...
متن کاملGenerating a Pattern Matching Compiler by Partial Evaluation
Partial evaluation can be used for automatic generation of compilers and was first implemented in [10]. Since partial evaluation was extended to higher order functional languages [9] [2] it has become possible to write denotational semantics definitions of languages and implement these with very few changes in the language treated by partial evaluators. In this paper we use this technique to ge...
متن کاملMapping Software Architectures to Efficient Implementations via Partial Evaluation
Flexibility is recognized as a key feature in structuring software, and many architectures have been designed to that effect. However, they often come with performance and code size overhead, resulting in a flexibility vs. efficiency dilemma. The source of inefficiency in software architectures can be identified in the data and control integration of components, because flexibility is present n...
متن کاملMK Pattern Match Compilation and Partial Evaluation
We derive a compiler for ML-style pattern matches. It is conceptually simple and produces reasonably good compiled matches. The derivation is inspired by the instrumentation and partial evaluation of na ve string match-ers. Following that paradigm, we rst present a general and na ve ML pattern matcher, instrument it to collect and exploit extra information, and show that partial evaluation of t...
متن کاملPartial Evaluation of Pattern Matching in Strings, revisited
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 stand...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 1989