Abstract
This paper reports two experiments with implementations of constructions from theoretical computer science. The first one deals with Kleene's and Rogers' second recursion theorems and the second is an implementation of Cook's linear time simulation of two way deterministic pushdown automata (2DPDAs). Both experiments involve the treatment of programs as data objects and their execution by means of interpreters.
For our implementations we have been using a small LISP-like language called Mixwell, originally devised for the partial evaluator MIX used in the second experiment. LISP-like languages are especially suitable since programs are data (S-expressions) so the tedious coding of programs as Gödel numbers so familiar from recursive function theory is completely avoided.
We programmed the constructions in the standard proofs of Kleene's and Rogers' recursion theorems and found (as expected) the programs so constructed to be far too inefficient for practical use. We then designed and implemented a new programming language called Reflect in which Kleene and Rogers “fixed-point” programs can be expressed elegantly and much more efficiently. We have programmed some examples in Reflect in an as yet incomplete attempt to find out for which sort of problems the second recursion theorems are useful program generating tools.
The second experiment concerns an automaton that can solve many non-trivial pattern matching problems. Cook [4] has shown that any 2DPDA can be simulated in linear time by a clever memoization technique. We wrote a simple interpreter to execute 2DPDA programs and an interpreter using Cook's algorithm, and we observed that the latter was indeed much faster on certain language recognition problems. Both have, however, a high computational overhead, since they in effect work by interpretation rather than compilation. In order to alleviate this we applied the principle of partial evaluation, see [5], to specialize each of the two interpreters to fixed 2DPDAs. The result was a substantial speedup.
Preview
Unable to display preview. Download preview PDF.
References
Alfred Aho, John Hopcroft, Jeffrey Ullman: The Design and Analysis of Computer Algorithms. Addison-Wesley, 1974.
Torben Amtoft, Thomas Nikolajsen, Jesper Larsson Träff: Implementation of some Theoretical Constructs. DIKU, University of Copenhagen, student project report 1988.
Manuel Blum: A Machine-Independent Theory of the Complexity of Recursive Functions. Journal of the Association for Computing Machinery, vol. 14, no. 2, April 1967, pp. 322–336.
Stephen A. Cook: Linear Time Simulation of Deterministic Two-Way Pushdown Automata. Information Processing 71, pp. 75–80, North-Holland Publishing Company, 1972.
A. P. Ershov: Mixed Computation: Potential applications and problems for study. Theoretical Computer Science 18, pp. 41–67, 1982.
Neil D. Jones: A Note on Linear Time Simulation of Deterministic Two-Way Pushdown Automata. Information Processing Letters, vol. 6 no. 4, 1977.
Neil D. Jones, Peter Sestoft, Harald Søndergaard: MIX: A Self-applicable partial Evaluator for Experiments in Compiler Generation (Revised Version). Lisp and Symbolic Computation, issue 2, fall 1988.
Akira Kanda: Theory of Computation. Lecture notes, DIKU, University of Copenhagen, 1985.
Stephen Cole Kleene: Introduction to Metamathematics. North-Holland, 1952.
A. I. Mal'cev: Algorithms and recursive functions. Wolters-Noordhoff Publishing, 1970.
Hartley Rogers: Theory of Recursive Functions and Effective Computability. McGraw-Hill, 1967.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1989 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Hansen, T.A., Nikolajsen, T., Träff, J.L., Jones, N.D. (1989). Experiments with implementations of two theoretical constructions. In: Meyer, A.R., Taitslin, M.A. (eds) Logic at Botik '89. Logic at Botik 1989. Lecture Notes in Computer Science, vol 363. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-51237-3_11
Download citation
DOI: https://doi.org/10.1007/3-540-51237-3_11
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-51237-0
Online ISBN: 978-3-540-46180-7
eBook Packages: Springer Book Archive