Results 1 
7 of
7
Occam’s Razor in Metacomputation: the Notion of a Perfect Process Tree
 In Proc. of the 3rd Int’l Workshop on Static Analysis (WSA’93). Springer LNCS 724
, 1993
"... Abstract. We introduce the notion of a perfect process tree as a model for the full propagation of information in metacomputation. Starting with constant propagation we construct stepbystep the driving mechanism used in supercompila tion which ensures the perfect propagation of information. The c ..."
Abstract

Cited by 66 (14 self)
 Add to MetaCart
(Show Context)
Abstract. We introduce the notion of a perfect process tree as a model for the full propagation of information in metacomputation. Starting with constant propagation we construct stepbystep the driving mechanism used in supercompila tion which ensures the perfect propagation of information. The concept of a simple supercompiler based on perfect driving coupled with a simple folding strategy is explained. As an example we demonstrate that specializing a naive pattern matcher with respect to a fixed pattern obtains the efficiency of a matcher generated by the Knuth, Morris & Pratt algorithm. 1
Memoization in typedirected partial evaluation
 PROCEEDINGS OF THE 2002 ACM SIGPLAN/SIGSOFT CONFERENCE ON GENERATIVE PROGRAMMING AND COMPONENT ENGINEERING, NUMBER 2487 IN LECTURE NOTES IN COMPUTER SCIENCE
, 2002
"... We use a code generator—typedirected partial evaluation— to verify conversions between isomorphic types, or more precisely to verify that a composite function is the identity function at some complicated type. A typed functional language such as ML provides a natural support to express the function ..."
Abstract

Cited by 14 (6 self)
 Add to MetaCart
(Show Context)
We use a code generator—typedirected partial evaluation— to verify conversions between isomorphic types, or more precisely to verify that a composite function is the identity function at some complicated type. A typed functional language such as ML provides a natural support to express the functions and typedirected partial evaluation provides a convenient setting to obtain the normal form of their composition. However, offtheshelf typedirected partial evaluation turns out to yield gigantic normal forms. We identify that this gigantism is due to redundancies, and that these redundancies originate in the handling of sums, which uses delimited continuations. We successfully eliminate these redundancies by extending typedirected partial evaluation with memoization capabilities. The result only works for pure functional programs, but it provides an unexpected use of code generation and it yields ordersofmagnitude improvements both in time and in space for type isomorphisms.
On Obtaining Knuth, Morris, and Pratt's String Matcher by Partial Evaluation
, 2002
"... 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 KMPlike string matcher is a canonical example of partial evaluation: starting from the naive, quadratic progr ..."
Abstract

Cited by 4 (0 self)
 Add to MetaCart
(Show Context)
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 KMPlike 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 partialevaluation time (a bindingtime 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.
Automatic generation of efficient string matching algorithms by generalized partial computation
 IN CHIN [8
, 2002
"... This paper shows that Generalized Partial Computation (GPC) can automatically generate efficient string matching algorithms. GPC is a program transformation method utilizing partial information about input data and auxiliary functions as well as the logical structure of a source program. GPC uses bo ..."
Abstract

Cited by 3 (0 self)
 Add to MetaCart
This paper shows that Generalized Partial Computation (GPC) can automatically generate efficient string matching algorithms. GPC is a program transformation method utilizing partial information about input data and auxiliary functions as well as the logical structure of a source program. GPC uses both a classical partial evaluator and an inference engine such as a theorem prover to optimize programs. First, we show that a BoyerMoore (BM) type pattern matcher without the badcharacter heuristic can be generated from a simple nonlinear backward matcher by GPC. This sort of problems has already been discussed in the literature using offline partial evaluators. However, there was no proof that every generated matcher runs in the same way as the BM. In this paper we prove that the problem can be solved starting from a simple nonlinear pattern matcher as a source program. We also prove that a KnuthMorrisPratt (KMP) type linear string matcher can be generated from a naive nonlinear forward matcher by GPC.