A roadmap to metacomputation by supercompilation

  • Robert Glück
  • Morten Heine Sørensen
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 1110)


This paper gives a gentle introduction to Turchin's super-compilation and its applications in metacomputation with an emphasis on recent developments. First, a complete supercompiler, including positive driving and generalization, is defined for a functional language and illustrated with examples. Then a taxonomy of related transformers is given and compared to the supercompiler. Finally, we put supercompilation into the larger perspective of metacomputation and consider three metacomputation tasks: specialization, composition, and inversion.


Program transformation supercompilation driving generalization metacomputation metasystem transition 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    S.M. Abramov. Metavychislenija i logicheskoe programmirovanie (Metacomputation and logic programming). Programmirovanie, 3:31–44, 1991. (In Russian).Google Scholar
  2. 2.
    S.M. Abramov. Metacomputation and program testing. In 1st International Workshop on Automated and Algorithmic Debugging, pp. 121–135, 1993.Google Scholar
  3. 3.
    S.M. Abramov. Metavychislenija i ikh prilozhenija (Metacomputation and its application). Nauka, Moscow, 1995. (In Russian).Google Scholar
  4. 4.
    S.M. Abramov and N.V. Kondratiev. Kompiljator, osnovannyj na metode chastichnykh vychislenij (A compiler based on the method of partial evaluation). In Nekotorye voprosy prikladnojmatematiki i programmnogo obespechenija EhVB, pp. 66–69. Moscow State University, Moscow, 1982. (in Russian).Google Scholar
  5. 5.
    M. Alpuente, M. Falaschi, and G. Vidal. Narrowing-driven partial evaluation of functional logic programs. In European Symposium on Programming-ESOP '96, LNCS. Springer-Verlag, 1996. To appear.Google Scholar
  6. 6.
    L. Beckman, A. Haraldson, ö. Oskarsson, and E. Sandewall. A partial evaluator and its use as a programming tool. Artificial Intelligence, 7:319–357, 1976.Google Scholar
  7. 7.
    R. Bird and P.L Wadler. Introduction to Functional Programming. Prentice-Hall, 1988.Google Scholar
  8. 8.
    D. Bjørner, A.P. Ershov, and N.D. Jones, editors. Partial Evaluation and Mixed Computation. North-Holland, Amsterdam, 1988.Google Scholar
  9. 9.
    R. Bol. Loop checking in partial deduction. Journal of Logic Programming, 16(1&2):25–46, 1993.Google Scholar
  10. 10.
    M.A. Bulyonkov. Polyvariant mixed computation for analyzer programs. Acta Informatica, 21:473–484, 1984.Google Scholar
  11. 11.
    R.M. Burstall and J. Darlington. A transformation system for developing recursive programs. Journal of the Association for Computing Machines, 24(1):44–67, 1977.Google Scholar
  12. 12.
    C.-L. Chang and R.C.-T. Lee. Symbolic Logic and Mechanical Theorem Proving. Computer Science and Applied Mathematics. Academic Press, 1973.Google Scholar
  13. 13.
    C. Consel and O. Danvy. For a better support of static data flow. In J. Hughes, editor, Functional Programming and Computer Architecture, vol. 523 of LNCS, pp. 495–519. Springer-Verlag, 1991.Google Scholar
  14. 14.
    C. Consel and O. Danvy. Tutorial notes on partial evaluation. In ACM Symposium in Principles of Programming Languages, pages 493–501. ACM Press, 1993.Google Scholar
  15. 15.
    C. Consel and S.C. Khoo. Parameterized partial evaluation. ACM TOPLAS, 15(3):463–493, 1993.Google Scholar
  16. 16.
    O. Danvy, R. Glück, and P. Thiemann, editors. Partial Evaluation. Proceedings. LNCS. Springer-Verlag, 1996. To appear.Google Scholar
  17. 17.
    N. Dershowitz and J.-P. Jouannaud. Rewrite systems. In J. van Leeuwen, editor, Handbook of Theoretical Computer Science, pp. 244–320. Elsevier, 1992.Google Scholar
  18. 18.
    J. Dixon. The specializer, a method of automatically writing computer programs. Technical report, Division of Computer Research and Technology, National Institute of Health, Bethesda, Maryland, 1971.Google Scholar
  19. 19.
    A.P. Ershov. On the partial computation principle. Information Processing Letters, 6(2):38–41, 1977.Google Scholar
  20. 20.
    A.P. Ershov. On the essence of compilation. In E.J. Neuhold, editor, Formal Description of Programming Concepts, pp. 391–420. North-Holland, 1978.Google Scholar
  21. 21.
    A. Ferguson and P.L. Wadler. When will deforestation stop? In 1988 Glasgow Workshop on Functional Programming, pages 39–56, 1988.Google Scholar
  22. 22.
    S.N. Florencev, Y.V. Oljunin, and V.F. Turchin. (An efficient interpreter for the language Refal). Preprint, Institute of Applied Mathematics, Academy of Sciences of the USSR, Moscow, 1969. (In Russian).Google Scholar
  23. 23.
    Y. Futamura. Partial evaluation of computing process — an approach to a compiler-compiler. Systems, Computers, Controls, 2(5):45–50, 1971.Google Scholar
  24. 24.
    Y. Futamura. Partial computation of programs. In E. Goto, K. Furukawa, R. Nakajima, I. Nakata, and A. Yonezawa, editors, RIMS Symposia on Software Science and Engineering, vol. 147 of LNCS, pp. 1–35, Kyoto, Japan, 1983. Springer-Verlag.Google Scholar
  25. 25.
    Y. Futamura. Program evaluation and generalized partial computation. In International Conference on Fifth Generation Computer Systems, pp. 1–8, 1988.Google Scholar
  26. 26.
    J. Gallagher. Tutorial in specialisation of logic programs. In Symposium on Partial Evaluation and Semantics-Based Program Manipulation, pp. 88–98. ACM Press, 1993.Google Scholar
  27. 27.
    R. Glück. Towards multiple self-application. In Proceedings of the Symposium on Partial Evaluation and Semantics-Based Program Manipulation, pp. 309–320. ACM Press, 1991.Google Scholar
  28. 28.
    R. Glück. Projections for knowledge based systems. In R. Trappl, editor, Cybernetics and Systems Research'92, volume 1, pp. 535–542. World Scientific, 1992.Google Scholar
  29. 29.
    R. Glück. On the generation of specializers. Journal of Functional Programming, 4(4):499–514, 1994.Google Scholar
  30. 30.
    R. Glück. On the mechanics of metasystem hierarchies in program transformation. In M. Proietti, editor, Logic Program Synthesis and Transformation. Proceedings, vol. 1048 of LNCS, pp. 234–251. Springer-Verlag, 1996.Google Scholar
  31. 31.
    R. Glück and J. Jørgensen. Generating transformers for deforestation and super-compilation. In B. Le Charlier, editor, Static Analysis. Proceedings, volume 864 of LNCS, pp. 432–448, Namur, Belgium, 1994. Springer-Verlag.Google Scholar
  32. 32.
    R. Glück and J. Jørgensen. Efficient multi-level generating extensions for program specialization. In S.D. Swierstra and M. Hermenegildo, editors, Programming Languages, Implementations, Logics and Programs (PLILP'95), vol. 982 of LNCS, pp. 259–278. Springer-Verlag, 1995.Google Scholar
  33. 33.
    R. Glück, J. Jørgensen, B. Martens, and M.H. Sørensen. Controlling conjunctive partial deduction of definite logic programs. Technical Report CW 226, Katholieke Universiteit Leuven, 1996.Google Scholar
  34. 34.
    R. Glück and A.V. Klimov. Occam's razor in metacomputation: the notion of a perfect process tree. In P. Cousot, M. Falaschi, G. Filè, and G. Rauzy, editors, Static Analysis. Proceedings., vol. 724 of LNCS, pp. 112–123. Springer-Verlag, 1993.Google Scholar
  35. 35.
    R. Glück and A.V. Klimov. Metacomputation as a tool for formal linguistic modeling. In R. Trappl, editor, Cybernetics and Systems'94, volume 2, pp. 1563–1570. World Scientific, 1994.Google Scholar
  36. 36.
    R. Glück and A.V. Klimov. Metasystem transition schemes in computer science and mathematics. World Futures, 45:213–243, 1995.Google Scholar
  37. 37.
    R. Glück and A.V. Klimov. Reduction of language hierarchies. In Proceedings of the 14th International Congress on Cybernetics, page To appear, Namur, Belgium, 1995. International Association for Cybernetics.Google Scholar
  38. 38.
    R. Glück and M.H. Sørensen. Partial deduction and driving are equivalent. In M. Hermenegildo and J. Penjam, editors, Programming Language Implementation and Logic Programming. Proceedings, vol. 844 of LNCS, pp. 165–181. Springer-Verlag, 1994.Google Scholar
  39. 39.
    R. Glück and V.F. Turchin. Application of metasystem transition to function inversion and transformation. In Proceedings of the ISSAC'90 (Tokyo, Japan), pp. 286–287. ACM Press, 1990.Google Scholar
  40. 40.
    R. Gurin and S.A. Romanenko. Jazyk programmirovanija Refal Pljus (The Refal Plus programming language). Intertech, Moscow, 1991. (In Russian).Google Scholar
  41. 41.
    P.G. Harrison. Function inversion. In Bjørner et al. [8], pp. 153–166.Google Scholar
  42. 42.
    J. Hatcliff and Robert Glück. Reasoning about hierarchies of online program specialization systems. In Danvy et al. [16]. To appear.Google Scholar
  43. 43.
    N.D. Jones. The essence of program transformation by partial evaluation and driving. In N.D. Jones, M. Hagiya, and M. Sato, editors, Logic, Language, and Computation, vol. 792 of LNCS, pp. 206–224. Springer-Verlag, 1994. Festschrift in honor of S.Takasu.Google Scholar
  44. 44.
    N.D. Jones, C.K. Gomard, and P. Sestoft. Partial Evaluation and Automatic Program Generation. Prentice-Hall, 1993.Google Scholar
  45. 45.
    N.D. Jones, P. Sestoft, and H. Søndergaard. An experiment in partial evaluation: the generation of a compiler generator. In J.-P. Jouannaud, editor, Rewriting Techniques and Applications, Dijon, France., vol. 202 of LNCS, pp. 124–140. Springer-Verlag, 1985.Google Scholar
  46. 46.
    N.D. Jones, P. Sestoft, and H. Søndergaard. Mix: a self-applicable partial evaluator for experiments in compiler generation. Lisp and Symbolic Computation, 2(1):9–50, 1989.Google Scholar
  47. 47.
    S.C. Kleene. Introduction to Metamathematics. Van Nostrand, 1952.Google Scholar
  48. 48.
    Andrei V. Klimov. Dynamic specialization in extended functional language with monotone objects. In Proceedings of the Symposium on Partial Evaluation and Semantics-Based Program Manipulation, pp. 199–210. ACM Press, 1991.Google Scholar
  49. 49.
    A.V. Klimov and S.A. Romanenko. Metavychislitel' dlja jazyka Refal. Osnovnye ponjatija i primery. (A metaevaluator for the language Refal. Basic concepts and examples). Preprint 71, Keldysh Institute of Applied Mathematics, Academy of Sciences of the USSR, Moscow, 1987. (In Russian).Google Scholar
  50. 50.
    A.V. Klimov and S.A. Romanenko. Sistema programmirovanija Refal-2 dlja ES. Opisanie vkhodnogo jazyka (Programming system Refal-2 for ES computers. The source language description). Technical report, Keldysh Institute of Applied Mathematics, Academy of Sciences of the USSR, Moscow, 1987. (In Russian).Google Scholar
  51. 51.
    A.V. Klimov, S.A. Romanenko, and V.F. Turchin. Teoreticheskie osnovy sintaksicheskogo otozhdestvlenija v jazyke Refal (The theory of pattern matching in Refal). Preprint 13, Keldysh Institute of Applied Mathematics, Academy of Sciences of the USSR, Moscow, 1973. (In Russian).Google Scholar
  52. 52.
    J. Komorowski. An introduction to partial deduction. In A. Pettorossi, editor, Meta-Programming in Logic, vol. 649 of LNCS, pp. 49–69, 1992.Google Scholar
  53. 53.
    J. Komorowski. Special issue on partial deduction. Journal of Logic Programming, 16(1&2):1–189, 1993.Google Scholar
  54. 54.
    M. Leuschel, D. De Schreye, and A. de Waal. A conceptual embedding of folding into partial deduction: Towards a maximal integration. Technical Report CW 225, Katholieke Universiteit Leuven, 1995.Google Scholar
  55. 55.
    M. Leuschel and B. Martens. Global control for partial deduction through characteristic atoms and global trees. In Danvy et al. [16]. To appear.Google Scholar
  56. 56.
    J.W. Lloyd and J.C. Shepherdson. Partial evaluation in logic programming. Journal of Logic Programming, 11(3–4):217–242, 1991.Google Scholar
  57. 57.
    L.A. Lombardi. Incremental computation. In F. L. Alt and M. Rubinoff, editors, Advances in Computers, volume 8, pp. 247–333. Academic Press, 1967.Google Scholar
  58. 58.
    L.A. Lombardi and B. Raphael. Lisp as the language for an incremental computer. In E.C. Berkeley and D.G. Bobrow, editors, The Programming Language Lisp: Its Operation and Applications, pp. 204–219, Cambridge, Massachusetts, 1964. MIT Press.Google Scholar
  59. 59.
    B. Martens and J. Gallagher. Ensuring global termination of partial deduction while allowing flexible polyvariance. In L. Stirling, editor, International Conference on Logic Programming, pp. 597–613. MIT Press, 1995.Google Scholar
  60. 60.
    A.P. Nemytykh, V.A. Pinchuk, and V.F. Turchin. A self-applicable supercompiler. In Danvy et al. [16]. To appear.Google Scholar
  61. 61.
    K. Nielsen and M.H. Sørensen. Call-by-name CPS-translation as a binding-time improvement. In A. Mycroft, editor, Static Analysis, vol. 983 of LNCS, pp. 296–313. Springer-Verlag, 1995.Google Scholar
  62. 62.
    R.M. Nirenberg. A practical turing machine representation. SIGACT News, 17(3):35–44, 1986.Google Scholar
  63. 63.
    M. Proietti and A. Pettorossi. Unfolding — definition — folding, in this order for avoiding unnecessary variables in logic programs. In Programming Language Implementation and Logic Programming, vol. 528 of LNCS, pp. 347–358. Springer-Verlag, 1991.Google Scholar
  64. 64.
    G. Puebla and M. Hermenegildo. Implementation of multiple specialization in logic programs. In Proceedings of the Symposium on Partial Evaluation and Semantics-Based Program Manipulation, pp. 77–87. ACM Press, 1995.Google Scholar
  65. 65.
    A.Y. Romanenko. The generation of inverse functions in Refal. In Bjørner et al. [8], pp. 427–444.Google Scholar
  66. 66.
    A.Y. Romanenko. Inversion and metacomputation. In Proceedings of the Symposium on Partial Evaluation and Semantics-Based Program Manipulation. (Yale University, Connecticut), pages 12–22. ACM Press, 1991.Google Scholar
  67. 67.
    S.A. Romanenko. Progonka dlja programm na Refale-4 (Driving for Refal-4 programs). Preprint 211, Keldysh Institute of Applied Mathematics, Academy of Sciences of the USSR, Moscow, 1987. (In Russian).Google Scholar
  68. 68.
    S.A. Romanenko. A compiler generator produced by a self-applicable specializer can have a surprisingly natural and understandable structure. In Bjørner et al. [8], pp. 445–463.Google Scholar
  69. 69.
    S.A. Romanenko. Arity raiser and its use in program specialization. In N.D. Jones, editor, ESOP'90, vol. 432 of LNCS, pages 341–360. Springer-Verlag, 1990.Google Scholar
  70. 70.
    D. Sands. Proving the correctness of recursion-based automatic program transformation. In P. Mosses, M. Nielsen, and M.I. Schwartzbach, editors, Theory and Practice of Software Development, vol. 915 of LNCS, pages 681–695. Springer-Verlag, 1995.Google Scholar
  71. 71.
    D. Sands. Total correctness by local improvement in program transformation. In 22nd Symposium on Principles of Programming Languages, pages 221–232. ACM Press, 1995.Google Scholar
  72. 72.
    D. Smith. Partial evaluation of pattern matching in constraint logic programming. In Symposium on Partial Evaluation and Semantics-Based Program Manipulation, pp. 62–71. ACM Press, 1991.Google Scholar
  73. 73.
    M.H. Sørensen. Turchin's supercompiler revisited. Master's thesis, Department of Computer Science, University of Copenhagen, 1994. DIKU-rapport 94/17.Google Scholar
  74. 74.
    M.H. Sørensen and R. Glück. An algorithm of generalization in positive super-compilation. In J.W. Lloyd, editor, Logic Programming: Proceedings of the 1995 International Symposium, pp. 465–479. MIT Press, 1995.Google Scholar
  75. 75.
    M.H. Sørensen, R. Glück, and N.D. Jones. Towards unifying deforestation, supercompilation, partial evaluation, and generalized partial computation. In D. Sannella, editor, Programming Languages and Systems, vol. 788 of LNCS, pp. 485–500. Springer-Verlag, 1994.Google Scholar
  76. 76.
    M.H. Sørensen, R. Glück, and N.D. Jones. A positive supercompiler. Journal of Functional Programming, 1996. To appear.Google Scholar
  77. 77.
    A. Takano. Generalized partial computation using disunification to solve constraints. In M. Rusinowitch and J.L. Remy, editors, Conditional Term Rewriting Systems. Proceedings, vol. 656 of LNCS, pp. 424–428. Springer-Verlag, 1993.Google Scholar
  78. 78.
    V.F. Turchin. Metajazyk dlja formal'nogo opisanija algoritmicheskikh jazykov (A metalanguage for the formal description of algorithmic languages). In Cifrovaja Vychislitel'naja Tekhnika i Programmirovanie, pp. 116–124. Sovetskoe Radio, Moscow, 1966. (In Russian).Google Scholar
  79. 79.
    V.F. Turchin. Programmirovanie na jazyke Refal. (Programming in the language Refal). Preprint 41, 43, 44, 48, 49, Institute of Applied Mathematics, Academy of Sciences of the USSR, Moscow, 1971. (In Russian).Google Scholar
  80. 80.
    V.F. Turchin. Ehkvivalentnye preobrazovanija rekursivnykh funkcij na Refale (Equivalent transformations of recursive functions defined in Refal). In Teorija Jazykov i Metody Programmirovanija (Proceedings of the Symposium on the Theory of Languages and Programming Methods), pages 31–42, Kiev-Alushta, USSR, 1972. (In Russian).Google Scholar
  81. 81.
    V.F. Turchin. Ehkvivalentnye preobrazovanija programm na Refale (Equivalent transformations of Refal programs). Avtomatizirovannaja Sistema upravlenija stroitel'stvom. Trudy CNIPIASS, 6:36–68, 1974. (In Russian).Google Scholar
  82. 82.
    V.F. Turchin, The Phenomenon of Science. Columbia University Press, New York, 1977.Google Scholar
  83. 83.
    V.F. Turchin. A supercompiler system based on the language Refal. SIGPLAN Notices, 14(2):46–54, 1979.Google Scholar
  84. 84.
    V.F. Turchin. The language Refal, the theory of compilation and metasystem analysis. Courant Computer Science Report 20, Courant Institute of Mathematical Sciences, New York University, 1980.Google Scholar
  85. 85.
    V.F. Turchin. Semantic definitions in Refal and the automatic production of compilers. In N.D. Jones, editor, Workshop on Semantics-Directed Compiler Generation, århus, Denmark, volume 94 of LNCS, pp. 441–474. Springer-Verlag, 1980.Google Scholar
  86. 86.
    V.F. Turchin. The use of metasystem transition in theorem proving and program optimization. In J.W. de Bakker and J. van Leeuwen, editors, Automata, Languages and Programming, volume 85 of LNCS, pp. 645–657, Noordwijkerhout, Netherlands, 1980. Springer-Verlag.Google Scholar
  87. 87.
    V.F. Turchin. The concept of a supercompiler. Transactions on Programming Languages and Systems, 8(3):292–325, 1986.Google Scholar
  88. 88.
    V.F. Turchin. A constructive interpretation of the full set theory. The Journal of Symbolic Logic, 52(1):172–201, 1987.Google Scholar
  89. 89.
    V.F. Turchin. The algorithm of generalization. In Bjørner et al. [8], pp. 531–549.Google Scholar
  90. 90.
    V.F. Turchin. Refal-5, Programming Guide and Reference Manual. New England Publishing Co., Holyoke, Massachusetts, 1989.Google Scholar
  91. 91.
    V.F. Turchin. The cybernetic ontology of action. Kybernetes, 22(2):10–30, 1993.Google Scholar
  92. 92.
    V.F. Turchin. On cybernetic epistemology. Systems Research, 10(1):3–28, 1993.Google Scholar
  93. 93.
    V.F. Turchin. Program transformation with metasystem transitions. Journal of Functional Programming, 3(3):283–313, 1993.Google Scholar
  94. 94.
    V.F. Turchin. On generalization of lists and strings in supercompilation. Technical report, City College of the City University of New York, 1995.Google Scholar
  95. 95.
    V.F. Turchin. Metacomputation: MST plus SCP. In Danvy et al. [16]. To appear.Google Scholar
  96. 96.
    V.F. Turchin, And.V. Klimov, Ark.V. Klimov, V.F. Khoroshevsky, A.G. Krasovsky, S.A. Romanenko, I.B. Shchenkov, and E.V. Travkina. Bazisnyj Refal i ego realizacija na vychislitelnykh mashinakh (Basic Refal and its implementation on computers). GOSSTROJ SSSR, CNIPIASS, Moscow, 1977. (In Russian).Google Scholar
  97. 97.
    V.F. Turchin and A.P. Nemytykh. Metavariables: their implementation and use in program transformation. Technical Report CSc. TR 95-012, City College of the City University of New York, 1995.Google Scholar
  98. 98.
    V.F. Turchin and A.P. Nemytykh. A self-applicable supercompiler. Technical Report CSc. TR 95-010, City College of the City University of New York, 1995.Google Scholar
  99. 99.
    V.F. Turchin, R. Nirenberg, and D. Turchin. Experiments with a supercompiler. In Conference Record of the ACM Symposium on Lisp and Functional Programming, pp. 47–55. ACM Press, 1982.Google Scholar
  100. 100.
    P.L. Wadler. Deforestation: Transforming programs to eliminate intermediate trees. Theoretical Computer Science, 73:231–248, 1990. Preliminary version in ESOP'88 LNCS vol. 300.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1996

Authors and Affiliations

  • Robert Glück
    • 1
  • Morten Heine Sørensen
    • 1
  1. 1.DIKU, Department of Computer ScienceUniversity of CopenhagenCopenhagen øDenmark

Personalised recommendations