Skip to main content

A Generator of Efficient Abstract Machine Implementations and Its Application to Emulator Minimization

  • Conference paper
Logic Programming (ICLP 2005)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 3668))

Included in the following conference series:

Abstract

The implementation of abstract machines involves complex decisions regarding, e.g., data representation, opcodes, or instruction specialization levels, all of which affect the final performance of the emulator and the size of the bytecode programs in ways that are often difficult to foresee. Besides, studying alternatives by implementing abstract machine variants is a time-consuming and error-prone task because of the level of complexity and optimization of competitive implementations, which makes them generally difficult to understand, maintain, and modify. This also makes it hard to generate specific implementations for particular purposes. To ameliorate those problems, we propose a systematic approach to the automatic generation of implementations of abstract machines. Different parts of their definition (e.g., the instruction set or the internal data and bytecode representation) are kept separate and automatically assembled in the generation process. Alternative versions of the abstract machine are therefore easier to produce, and variants of their implementation can be created mechanically, with specific characteristics for a particular application if necessary. We illustrate the practicality of the approach by reporting on an implementation of a generator of production-quality WAMs which are specialized for executing a particular fixed (set of) program(s). The experimental results show that the approach is effective in reducing emulator size.

Work partially funded by the European Commission IST-FET programme, IST- 2001-38059 ASAP project, and by the Spanish Ministry of Science and Education, TIC 2002-0055 CUBICO project. Manuel Hermenegildo is also supported by the Prince of Asturias Chair in Information Science and Technology at UNM. J. Morales is also supported by an MCYT/MEC fellowship co-financed by the European Social Fund.

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

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Diaz, D., Codognet, P.: Design and Implementation of the GNU Prolog System. Journal of Functional and Logic Programming 2001 (2001)

    Google Scholar 

  2. Van Roy, P.: Can Logic Programming Execute as Fast as Imperative Programming? PhD thesis, Univ. of California Berkeley, Report No. UCB/CSD 90/600 (1990)

    Google Scholar 

  3. Santos-Costa, V.: Optimising Bytecode Emulation for Prolog. In: Nadathur, G. (ed.) PPDP 1999. LNCS, vol. 1702, pp. 261–277. Springer, Heidelberg (1999)

    Chapter  Google Scholar 

  4. Demoen, B., Nguyen, P.L.: So Many WAM Variations, So Little Time. In: Palamidessi, C., Moniz Pereira, L., Lloyd, J.W., Dahl, V., Furbach, U., Kerber, M., Lau, K.-K., Sagiv, Y., Stuckey, P.J. (eds.) CL 2000. LNCS (LNAI), vol. 1861, pp. 1240–1254. Springer, Heidelberg (2000)

    Chapter  Google Scholar 

  5. Van Roy, P.: 1983-1993: The Wonder Years of Sequential Prolog Implementation. Journal of Logic Programming 19/20, 385–441 (1994)

    Article  Google Scholar 

  6. Hannan, J.: Staging Transformations for Abstract Machines. In: Partial Evaluation and Semantics-Based Program Manipulation (PEPM). ACM SigPlan Notices (1991)

    Google Scholar 

  7. Jørring, U., Scherlis, W.: Compilers and staging transformations. In: Thirteenth ACM POPL, pp. 86–96 (1986)

    Google Scholar 

  8. Jones, N., Gomard, C., Sestoft, P.: Partial Evaluation and Automatic Program Generation. Prentice Hall, New York (1993)

    MATH  Google Scholar 

  9. Futamura, Y.: Partial evaluation of computation process - an approach to a compiler-compiler. Systems, Computers, Controls 2, 45–50 (1971)

    Google Scholar 

  10. Warren, D.: An Abstract Prolog Instruction Set. Technical Report 309, SRI International (1983)

    Google Scholar 

  11. Ait-Kaci, H.: Warren’s Abstract Machine, A Tutorial Reconstruction. MIT Press, Cambridge (1991)

    Google Scholar 

  12. Ferreira, M., Damas, L.: Multiple Specialization of WAM Code. In: Gupta, G. (ed.) PADL 1999. LNCS, vol. 1551, p. 243. Springer, Heidelberg (1999)

    Chapter  Google Scholar 

  13. Van Roy, P., Despain, A.: High-Performance Logic Programming with the Aquarius Prolog Compiler. IEEE Computer Magazine, 54–68 (1992)

    Google Scholar 

  14. Tip, F.: A Survey of Program Slicing Techniques. Journal of Programming Languages 3, 121–189 (1995)

    Google Scholar 

  15. Reps, T., Turnidge, T.: Program Specialization via Program Slicing. In: Danvy, O., Thiemann, P., Glück, R. (eds.) Dagstuhl Seminar 1996. LNCS, vol. 1110, pp. 409–429. Springer, Heidelberg (1996)

    Google Scholar 

  16. Weiser, M. (ed.): Information and Software Technology: Special Issue on Program Slicing, vol. 40. Elsevier, Amsterdam (1999)

    Google Scholar 

  17. Bueno, F., Cabeza, D., Carro, M., Hermenegildo, M., López-García, P., Puebla, G.: The Ciao Prolog System. Reference Manual (v1.8). Technical Report CLIP4/2002.1, School of Computer Science, UPM (2002), Available at http://clip.dia.fi.upm.es/Software/Ciao/

  18. Puebla, G., Hermenegildo, M.: Abstract Specialization and its Applications. In: Proc. of PEPM 2003, pp. 29–43. ACM Press, New York (2003) (Invited talk)

    Chapter  Google Scholar 

  19. Morales, J., Carro, M., Hermenegildo, M.: Improving the Compilation of Prolog to C Using Moded Types and Determinism Information. In: Intnl. Symposium on Practical Aspects of Declarative Languages. LNCS, vol. 3507, pp. 86–103. Springer, Heidelberg (2004)

    Chapter  Google Scholar 

  20. Nässén, H., Carlsson, M., Sagonas, K.: Instruction Merging and Specialization in the SICStus Prolog Virtual Machine. In: Proceedings of the 3rd ACM SIGPLAN International Conference on Principles and Practice of Declarative Programming, pp. 49–60. ACM Press, New York (2001)

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2005 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Morales, J.F., Carro, M., Puebla, G., Hermenegildo, M.V. (2005). A Generator of Efficient Abstract Machine Implementations and Its Application to Emulator Minimization. In: Gabbrielli, M., Gupta, G. (eds) Logic Programming. ICLP 2005. Lecture Notes in Computer Science, vol 3668. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11562931_5

Download citation

  • DOI: https://doi.org/10.1007/11562931_5

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-29208-1

  • Online ISBN: 978-3-540-31947-4

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics