A Self-Applicable supercompiler

  • Andrei P. Nemytykh
  • Victoria A. Pinchuk
  • Valentin F. Turchin
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 1110)


A supercompiler is a program which can perform a deep transformation of programs using a principle which is similar to partial evaluation, and can be referred to as metacomputation. Supercompilers that have been in existence up to now (see [12], [13]) were not self-applicable: this is a more difficult problem than self-application of a partial evaluator, because of the more intricate logic of supercompilation. In the present paper we describe the first self-applicable model of a supercompiler and present some tests. Three features distinguish it from the previous models and make self-application possible: (1) The input language is a subset of Refal which we refer to as flat Refal. (2) The process of driving is performed as a transformation of pattern-matching graphs. (3) Metasystem jumps are implemented, which allows the supercompiler to avoid interpretation whenever direct computation is possible.


program transformation supercompilation metacomputation self-application metasystem transition MST-schemes metacode pattern-matching graphs Refal 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. [1]
    Ershov, A.P. On the essence of compilation, In: E.J.Neuhold(ed) Formal Description of Programming Concepts, pp.391–420, North-Holland, 1978.Google Scholar
  2. [2]
    Futamura, Y., Partial evaluation of computation process — an approach to compiler compiler. Systems, Computers, Controls, 2, 5 (1971) pp. 45–50.Google Scholar
  3. [3]
    Jones N., Sestoft P., Sondergaard H., An experiment in partial evaluation: the generation of a compiler generator. In: Jouannaud J.-P. (Ed.) Rewriting Techniques and Applications, Dijon, France, LNCS 202, Springer, 1985.Google Scholar
  4. [4]
    Jones, Neil. The essence of program transformation by partial evaluation and driving. In: Proc. of The Atlantique Worlshop on Semantics Based Program Manipulation, N.Jones and C.Talcott Ed. Copenhagen University, pp.134–147, 1994.Google Scholar
  5. [5]
    Glück, R., Towards multiple self-application, Proceedings of the Symposium on Partial Evaluation and Semantics-Based Program Manipulation (Yale University), ACM Press, 1991, pp.309–320.Google Scholar
  6. [6]
    Glück, R. and Klimov, And., Occam's razor in metacomputation: the notion of a perfect process tree. In: Static Analysis, COusot et.al (Eds), LNCS Vol 724, pp.112–123, Springer-Verlag 1993.Google Scholar
  7. [7]
    Glück R. and Sørensen, M.H. Partial deduction and driving are equivalent. In: Symposium on Programming Language Implementation and Logic Programming (PLILP'94), LNCS, Springer-Verlag, 1994.Google Scholar
  8. [8]
    Glück R. and Turchin V., Experiments with a Self-applicable Supercompiler, CCNY Technical Report, 1989.Google Scholar
  9. [9]
    Turchin, V.F., Equivalent transformations of recursive functions defined in Refal. In: Teoriya Yazykov I Metody Postroeniya Sistem Programmirovaniya (Proceedings of the Symposium), Kiev-Alushta (USSR), pp.31–42, 1972 (in Russian).Google Scholar
  10. [10]
    Turchin V.F., Klimov A.V. et al, Bazisnyi Refal i yego realizatsiya na vychislitel'nykh mashinakh (Basic Refal and its implementation on computers) GOSSTROY SSSR, TsNIPIASS, Moscow, 1977 (in Russian).Google Scholar
  11. [11]
    Turchin, V.F. The Language Refal, the Theory of Compilation and Metasystem Analysis, Courant Computer Science Report #20, New York University, 1980.Google Scholar
  12. [12]
    Turchin, V.F., Nirenberg, R.M., Turchin, D.V. Experiments with a supercompiler. In: ACM Symposium on Lisp and Functional Programming (1982), ACM, New York, pp. 47–55.Google Scholar
  13. [13]
    Turchin, V.F. The concept of a supercompiler, ACM Transactions on Programming Languages and Systems, 8, pp. 292–325, 1986.Google Scholar
  14. [14]
    Turchin V., Refal-5, Programming Guide and Reference Manual, New England Publishing Co., 1989.Google Scholar
  15. [15]
    Turchin V., Nemytykh, A. Metavariables: Their implementation and use in Program Transformation, CCNY Technical Report CSc TR-95-012, 1995.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1996

Authors and Affiliations

  • Andrei P. Nemytykh
    • 1
  • Victoria A. Pinchuk
    • 1
  • Valentin F. Turchin
    • 2
  1. 1.Programming Systems InstitutePereslavl-ZalesskiRussia
  2. 2.The City College of New YorkUSA

Personalised recommendations