A simple transformation from Prolog-written metalevel interpreters into compilers and its implementation

  • Gustaf Neumann
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 592)


In this paper we describe a grammar formalism for program transformation and its implementation in Prolog. Whereas Definite Clause Grammars are merely working on a string of tokens the formalism presented here acts on semantic items such as Prolog literals. This grammar will be used to implement a very compact form of a compiler generator that transforms solve-like interpreters into compilers. Finally the compiler generator will be applied on itself to obtain a more efficient version of the compiler generator.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. [Abr84]
    H. Abramson: “Definite Clause Translation Grammars”, in: Proceedings of the 1984 International Symposium on Logic Programming, 1984, pp 233–240.Google Scholar
  2. [FF88]
    H. Fujita, K. Furukawa: “A Self-Applicable Partial Evaluator and its Use in Incremental Compilation”, New Generation Computing, Vol. 6, Nos. 2 and 3, pp. 91–118, 1988.Google Scholar
  3. [Fu71]
    Y. Futamura: “Partial Evaluation of Computation Process — an Approach to a Compiler-Compiler”, Systems, Computers, Controls, Vol. 2, No. 5, 1971, pp. 45–50.Google Scholar
  4. [Gal86]
    J. Gallagher: “Transforming Logic Programs by Specializing Interpreters”, Proceedings of ECAI 86, pp. 109–122, Brighton 1986.Google Scholar
  5. [JSS85]
    N.D. Jones, P. Sestoft, H. Søndergaard: “The Generation of a Compiler Generator”, 1st International Conference on Rewriting Techniques and Applications, Dijon 1985, LNCS 202, pp. 120–140.Google Scholar
  6. [Lak89]
    A. Lakhotia: “Incorporating ‘Programming Techniques’ into Prolog Programs”, in: Proceedings of the North American Logic Programming Conference 1989, MIT Press, Cambridge 1989.Google Scholar
  7. [McC87]
    M. McCord: “Natural Language Processing and Prolog”, in: A. Walker et al.: “Knowledge Systems and Prolog”, Addison Wesley, Reading 1987.Google Scholar
  8. [Neu86]
    G. Neumann: “Meta-Interpreter Directed Compilation of Logic Programs into Prolog”, IBM-Research Report RC 12113 (#54357), Yorktown Heights, New York 1986.Google Scholar
  9. [Neu88]
    G. Neumann: “Metaprogrammierung und Prolog”, Addison-Wesley, Bonn 1988.Google Scholar
  10. [Neu90]
    G. Neumann: “Transforming Interpreters into Compilers by Goal Classification”, in: Proceedings of the Meta90, 4–6 April 1990, Leuven, Belgium 1990.Google Scholar
  11. [Pag88]
    F.G. Pagan: “Converting Interpreters into Compilers”, Software-Practice and Experience, Vol. 18, No. 6, pp. 509–527, June 1988.Google Scholar
  12. [PW80]
    F.C.N. Pereira, D.H.D. Warren: “Definite Clause Grammars for Language Analysis—A Survey of the Formalism and a Comparison with Augmented Transition Networks”, Artificial Intelligence, Vol. 13, Nr. 3, pp. 231–278, May 1980.CrossRefGoogle Scholar
  13. [Per81]
    F.C.N. Pereira: “Extraposition Grammars”, American Journal of Computational Linguistics, 1981, vol. 7, no. 4, pp 243–255.Google Scholar
  14. [TF86]
    A. Takeuchi, K. Furukawa: “Partial Evaluation of Prolog Programs and its Application to Meta Programming”, IFIP 1986.Google Scholar
  15. [vR88]
    P. Van Roy: “A Useful Extension to Prolog's Definite Clause Grammar Notation”, SIGPLAN Notices, Volume 24, Number 11, November 1989.Google Scholar
  16. [Wir84]
    N. Wirth: “Compilerbau”, Teubner Verlag, Stuttart 1984.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1992

Authors and Affiliations

  • Gustaf Neumann
    • 1
  1. 1.Institute of Information ProcessingVienna University of Economics and Business AdministrationViennaAustria

Personalised recommendations