Skip to main content

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

  • Conference paper
  • First Online:
Logic Programming

Part of the book series: Lecture Notes in Computer Science ((LNAI,volume 592))

Abstract

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. H. Abramson: “Definite Clause Translation Grammars”, in: Proceedings of the 1984 International Symposium on Logic Programming, 1984, pp 233–240.

    Google Scholar 

  2. 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. 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. J. Gallagher: “Transforming Logic Programs by Specializing Interpreters”, Proceedings of ECAI 86, pp. 109–122, Brighton 1986.

    Google Scholar 

  5. 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. 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. M. McCord: “Natural Language Processing and Prolog”, in: A. Walker et al.: “Knowledge Systems and Prolog”, Addison Wesley, Reading 1987.

    Google Scholar 

  8. 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. G. Neumann: “Metaprogrammierung und Prolog”, Addison-Wesley, Bonn 1988.

    Google Scholar 

  10. G. Neumann: “Transforming Interpreters into Compilers by Goal Classification”, in: Proceedings of the Meta90, 4–6 April 1990, Leuven, Belgium 1990.

    Google Scholar 

  11. F.G. Pagan: “Converting Interpreters into Compilers”, Software-Practice and Experience, Vol. 18, No. 6, pp. 509–527, June 1988.

    Google Scholar 

  12. 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.

    Article  Google Scholar 

  13. F.C.N. Pereira: “Extraposition Grammars”, American Journal of Computational Linguistics, 1981, vol. 7, no. 4, pp 243–255.

    Google Scholar 

  14. A. Takeuchi, K. Furukawa: “Partial Evaluation of Prolog Programs and its Application to Meta Programming”, IFIP 1986.

    Google Scholar 

  15. P. Van Roy: “A Useful Extension to Prolog's Definite Clause Grammar Notation”, SIGPLAN Notices, Volume 24, Number 11, November 1989.

    Google Scholar 

  16. N. Wirth: “Compilerbau”, Teubner Verlag, Stuttart 1984.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

A. Voronkov

Rights and permissions

Reprints and permissions

Copyright information

© 1992 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Neumann, G. (1992). A simple transformation from Prolog-written metalevel interpreters into compilers and its implementation. In: Voronkov, A. (eds) Logic Programming. Lecture Notes in Computer Science, vol 592. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-55460-2_26

Download citation

  • DOI: https://doi.org/10.1007/3-540-55460-2_26

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-55460-8

  • Online ISBN: 978-3-540-47083-0

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics