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.
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Diaz, D., Codognet, P.: Design and Implementation of the GNU Prolog System. Journal of Functional and Logic Programming 2001 (2001)
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)
Santos-Costa, V.: Optimising Bytecode Emulation for Prolog. In: Nadathur, G. (ed.) PPDP 1999. LNCS, vol. 1702, pp. 261–277. Springer, Heidelberg (1999)
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)
Van Roy, P.: 1983-1993: The Wonder Years of Sequential Prolog Implementation. Journal of Logic Programming 19/20, 385–441 (1994)
Hannan, J.: Staging Transformations for Abstract Machines. In: Partial Evaluation and Semantics-Based Program Manipulation (PEPM). ACM SigPlan Notices (1991)
Jørring, U., Scherlis, W.: Compilers and staging transformations. In: Thirteenth ACM POPL, pp. 86–96 (1986)
Jones, N., Gomard, C., Sestoft, P.: Partial Evaluation and Automatic Program Generation. Prentice Hall, New York (1993)
Futamura, Y.: Partial evaluation of computation process - an approach to a compiler-compiler. Systems, Computers, Controls 2, 45–50 (1971)
Warren, D.: An Abstract Prolog Instruction Set. Technical Report 309, SRI International (1983)
Ait-Kaci, H.: Warren’s Abstract Machine, A Tutorial Reconstruction. MIT Press, Cambridge (1991)
Ferreira, M., Damas, L.: Multiple Specialization of WAM Code. In: Gupta, G. (ed.) PADL 1999. LNCS, vol. 1551, p. 243. Springer, Heidelberg (1999)
Van Roy, P., Despain, A.: High-Performance Logic Programming with the Aquarius Prolog Compiler. IEEE Computer Magazine, 54–68 (1992)
Tip, F.: A Survey of Program Slicing Techniques. Journal of Programming Languages 3, 121–189 (1995)
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)
Weiser, M. (ed.): Information and Software Technology: Special Issue on Program Slicing, vol. 40. Elsevier, Amsterdam (1999)
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/
Puebla, G., Hermenegildo, M.: Abstract Specialization and its Applications. In: Proc. of PEPM 2003, pp. 29–43. ACM Press, New York (2003) (Invited talk)
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)
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)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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)