Abstract
A supercompiler is a program transformer of a certain type. It traces the possible generalized histories of computation by the original program, and compiles an equivalent program, reducing in the process the redundancy that could be present in the original program. The nature of the redundancy that can be eliminated by supercompilation may be various, e.g., some variables might have predefined values (as in partial evaluation), or the structure of control transfer could be made more efficient (as in lazy evaluation), or it could simply be the fact that the same variable is used more than once. The general principles of supercompilation are described and compared with the usual approach to program transformation as a stepwise application of a number of equivalence rules. It is argued that the language Refal serves the needs of supercompilation best. Refal is formally defined and compared with Prolog and other languages. Examples are given of the operation of a Refal supercompiler implemented at CCNY on an IBM/370.
- 1 BECKMAN, L., HARALDSON, A., OSKARSON, O., AND SANDEWALL, O. A partial evaluator and its use as a programming tool. Arti{. InteU. 7 (1974), 319-357.Google Scholar
- 2 BURSTALL, R. M., AND DARLINGTON, J. A transformation system for developing recursive programs. J. ACM 24 (1977), 44-67. Google Scholar
- 3 ERSHOV, A.P. On the essence of translation. In Formal Description of Programming Concepts, E. J. Neuhold, Ed., North-Holland, Amsterdam, 1977, 391-418.Google Scholar
- 4 ERSHOV, A. P. Mixed computation: Potential applications and problems for future studies. Theor. Comput. Sci. 18 (1982), 41-67.Google Scholar
- 5 FRIEDMAN, D. P., AND WISE, D.S. CONS should not evaluate its arguments. In Automata, Languages and Programming, Michaelson and Millner, Eds, Edinburgh University Press, 1967, 257-284.Google Scholar
- 6 FUTAMURA, Y. Partial evaluation of computation process--an approach to a compiler-compiler. Syst. Comput. Control 2, 5 (1971), 45-50.Google Scholar
- 7 FUTAMURA, Y. Partial computation of programs. In Proceedings RIMS Symposium on Software Science and Engineering, LNCS 147, Springer-Verlag, New York, 1983, 1-35. Google Scholar
- 8 HENDERSON, P., AND MORRIS, J. H., JR. A lazy evaluator. In Proceedings 3rd Symposium on POPL (1976), 95-103. Google Scholar
- 9 JONES, N., AND SCHMIDT, D. Compiler generation from denotational semantics. In Semantics- Driven Compiler Generation, LNCS 94, Springer-Verlag, New York, 1980, 70-93. Google Scholar
- 10 JONES, N. D., SESTOFT, P., AND S~NDERGAARD, H. An experiment in partial evaluation: The generation of a compiler generator. In International Conference on Rewriting Techniques and Applications (1985), Springer-Verlag, New York, (forthcoming). Google Scholar
- 11 JONES, N., AND TOFTE, M. Some principles and notation for the construction of compiler generators. DIKU, Internal Rep., Univ. of Copenhagen, 1983.Google Scholar
- 12 LOMBARDI, L.A. Incremental computation. In Advances in Computers, 8, Academic Press, New York, 1967.Google Scholar
- 13 NILLSON, N.J. Artificial intelligence prepares for 2001. AI Mag. 4 (1983), 7-14.Google Scholar
- 14 O'SHEA, T., AND EISENSTADT, M. Artificial Intelligence. Harper and Row, New York, 1984.Google Scholar
- 15 PARTSCH, H., AND STEINBRUEGGEN, R. Program transformation systems. ACM Comput. Surv. 15 (1983), 199-236. Google Scholar
- 16 REDDY, U. Narrowing as the operational semantics of functional languages. Submitted to the Symposium on Logic Programming (Boston, 1985).Google Scholar
- 17 Basic Refal and its Implementation on Computers. GOSSTROI SSSR, TsNIPIASS, Moscow, 1977. The authors are not indicated in the book. They are: V. F. Khoroshevski, And. V. Klimov, Ark. V. Klimov, A. G. Krasovski, S. A. Romanenko, I. B. Shchenkov, and V. F. Turchin. (In Russian)Google Scholar
- 18 SOWA, J.F. A prologue to Prolog. Draft, distributed with permission of the author, 1984.Google Scholar
- 19 TURCmN, V.F. Equivalent transformation of recursive functions defined in Refal. In Trudy Vsesoyuzn. Simpos. "Teoria Yazykov i metody progr," Alushta-Kiev, 1972, 31-42. (In Russian)Google Scholar
- 20 TURCHIN, V.F. A supercompiler system based on the language Refal. SIGPLANNot. 14 (1979), 46-54. Google Scholar
- 21 TURCHIN, V. F. The language Refal, the theory of compilation, and metasystem analysis. Courant Institute Rep. 20, 1980.Google Scholar
- 22 TURCH1N, V. F. Semantics definitions in Refal and automatic production of compilers. In Semantics-Driven Compiler Generation, LNCS 94, N. Jones, Ed., Springer-Verlag, New York, 1980, 443-474. Google Scholar
- 23 TURCHIN, V. F., NIRENBERG, R. N., AND TURCHIN, D.V. Experiments with a supercompiler. In ACM Symposium on LISP and Functional Programming (1982), ACM, New York, 47-55. Google Scholar
- 24 VUILLEMIN, J. Correct and optimal implementation of recursion in a simple programming language. J. Comput. Syst. Stud. 9, 3 (Dec. 1974).Google Scholar
Index Terms
- The concept of a supercompiler
Recommendations
Experiments with a supercompiler
LFP '82: Proceedings of the 1982 ACM symposium on LISP and functional programmingIn this paper we present and discuss some examples of the operation of the first experimental model of a supercompiler. We have chosen our examples to serve as “exhibits” which highlight most important features of the supercompiler and intimate its ...
A java supercompiler and its application to verification of cache-coherence protocols
PSI'09: Proceedings of the 7th international Andrei Ershov Memorial conference on Perspectives of Systems InformaticsThe Java Supercompiler (JScp) is a specializer of Java programs based on the Turchin's supercompilation method and extended to support imperative and object-oriented notions absent in functional languages. It has been successfully applied to ...
Concept-based optimization
LCSD '07: Proceedings of the 2007 Symposium on Library-Centric Software DesignProduction compilers' optimizers typically operate at low abstraction levels, transformation rules enacting on operations on built-in types only. Transformations at higher levels of abstraction, on operations of types defined in libraries or by the user,...
Comments