Abstract
We study four transformation methodologies which are automatic instances of Burstall and Darlington's fold/unfold framework: partial evaluation, deforestation, supercompilation, and generalized partial computation (GPC). One can classify these and other fold/unfold based transformers by how much information they maintain during transformation.
We introduce the positive supercompiler, a version of deforestation including more information propagation, to study such a classification in detail. Via the study of positive supercompilation we are able to show that partial evaluation and deforestation have simple information propagation, positive supercompilation has more information propagation, and supercompilation and GPC have even more information propagation. The amount of information propagation is significant: positive supercompilation, GPC, and supercompilation can specialize a general pattern matcher to a fixed pattern so as to obtain efficient output similar to that of the Knuth-Morris-Pratt algorithm. In the case of partial evaluation and deforestation, the general matcher must be rewritten to achieve this.
This work was supported by the Austrian Science Foundation (FWF) under grant number 10780 and the Danish Research Council.
Chapter PDF
References
L. Augustsson. Compiling Lazy Pattern-Matching. In Conference on Functional Programming and Computer Architecture. (Ed.) J.-P. Jouannaud pp368–381. LNCS 201, Springer-Verlag 1985.
A. Bondorf. Self-Applicable Partial Evaluation. Ph.D. thesis, DIKU-Rapport 90/17, Department of Computer Science, University of Copenhagen, 1990.
R. M. Burstall & J. Darlington. A Transformation System for Developing Recursive Programs. In Journal of the ACM. Vol. 24, No.1, pp. 44–67, 1977.
W.-N. Chin. Safe Fusion of Functional Expressions II: Further Improvements. In Journal of Functional Programming. 1994, to appear.
C. Consel & O. Danvy. Partial Evaluation of Pattern Matching in Strings. In Information Processing Letters. Vol. 30, No.2, pp. 79–86, 1989.
C. Consel & O. Danvy. Tutorial Notes on Partial Evaluation. In 20th ACM Symposium on Principles of Programming Languages. Charleston, South Carolina, pp. 493–501, ACM Press 1993.
A. B. Ferguson & P. Wadler. When will Deforestation Stop? 1988 Glasgow Workshop on Functional Programming, pp.39–56, 1988.
Y. Futamura & K. Nogi. Generalized Partial Computation. In Partial Evaluation and Mixed Computation. Eds. A. P. Ershov, D. Bjørner & N. D. Jones, pp. 133–151, North-Holland 1988.
R. Glück & V. F. Turchin. Application of Metasystem Transition to Function Inversion and Transformation. In Proceedings of the ISSAC '90. pp.286–287, ACM Press 1990.
R. Glück & And. Klimov. Occam's Razor in Metacomputation: the Notion of a Perfect Process Tree. In Static Analysis, Proceedings. LNCS 724. pp.112–123, Springer-Verlag 1993.
R. Glück & J. Jørgensen. Generating Optimizing Specializers. In IEEE International Conference on Computer Languages. IEEE Computer Science Press, 1994, to appear.
N. D. Jones, C. Gomard & P. Sestoft. Partial Evaluation and Automatic Program Generation. Prentice Hall International. 1993
S. Kleene, Introduction to Metamathematics. Van Nostrand, 1952.
D. E. Knuth, J. H. Morris, V. R. Pratt. Fast Pattern Matching in Strings. In SIAM Journal on Computing. Vol. 6, No.2, pp. 323–350, 1977.
P. Sestoft. Automatic Call Unfolding in a Partial Evaluator. In Partial Evaluation and Mixed Computation. Eds. A.P Ershov, D. Bjørner, N.D. Jones, pp.485–506, North-Holland 1988.
D. A. Smith. Partial Evaluation of Pattern Matching in Constraint Logic Programming Languages. In ACM Symposium on Partial Evaluation and Semantics-Based Program Manipulation. Ed. N. D. Jones & P. Hudak, pp.62–71, ACM Press 1991.
M. H. Sørensen. A New Means of Ensuring Termination of Deforestation with an Application to Logic Programming. In Workshop of the Global Compilation Workshop in conjunction with the International Logic Programming Symposium. Vancouver, Canada, October, 1993.
M. H. Sørensen. A Grammar-based Data-flow Analysis to Stop Deforestation. In Colloqium on Algebra in Trees and Programming. Edinburgh, Scotland, April 1994, to appear.
M. H. Sørensen. Turchin's Supercompiler Revisited. An Operational Theory of Positive Information Propagation. Master's Thesis, Department of Computer Science, University of Copenhagen, 1994.
A. Takano. Generalized Partial Computation for a Lazy Functional Language. In ACM Workshop on Partial Evaluation and Semantics-Based Program Manipulation. Ed. N. D. Jones & P. Hudak, pp.1–11, ACM Press 1991.
V. F. Turchin. The Concept of a Supercompiler. In ACM TOPLAS. Vol. 8, No.3, pp. 292–325, 1986.
D. Turner. An Overview of Miranda. In Research Topics in Functional Programming. Ed. D. Turner, Addison-Wesley, 1990.
P. L. Wadler. Deforestation: Transforming Programs to Eliminate Trees. In European Symposium on Programming. Proceedings. LNCS 300. pp.344–358, Springer-Verlag 1988.
Author information
Authors and Affiliations
Corresponding authors
Editor information
Rights and permissions
Copyright information
© 1994 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Sørensen, M.H., Glück, R., Jones, N.D. (1994). Towards unifying partial evaluation, deforestation, supercompilation, and GPC. In: Sannella, D. (eds) Programming Languages and Systems — ESOP '94. ESOP 1994. Lecture Notes in Computer Science, vol 788. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-57880-3_32
Download citation
DOI: https://doi.org/10.1007/3-540-57880-3_32
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-57880-2
Online ISBN: 978-3-540-48376-2
eBook Packages: Springer Book Archive