Skip to main content

Fast prolog with a VAM1p based Prolog compiler

  • Conference paper
  • First Online:
Book cover Programming Language Implementation and Logic Programming (PLILP 1992)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 631))

Abstract

The VAM (Vienna Abstract Machine) is a Prolog machine developed at the TU Wien. In contrast to the standard implementation technique (Warren Abstract Machine) an inference in the VAM is performed by unifying the goal and head arguments in a single undivided step. The interpreter based VAM2p implements unification by combining head and goal instructions during run time whereas the compiler based VAM1p combines the instructions during compile time. This enables compilers based on the VAM1p to make extensive optimizations like variable elimination, instruction elimination, extended clause indexing and fast last-call optimizations. This results in fast execution and small stack sizes. Our prototype compiler is implemented in Prolog and emits intermediate VAM1p code. This intermediate code is translated to native code instructions for the MIPS R3000 processor. The native code instructions are reordered using a Prolog based instruction scheduler and assembled using the MIPS assembler. The resulting programs achieve 3.1 MLips on a DecStation 5000/200.

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. J. Beer, Concepts, Design, and Performance Analysis of a Parallel Prolog Machine, Springer, 1989

    Google Scholar 

  2. J.R. Bell, Threaded Code, CACM 16(6), 1973.

    Google Scholar 

  3. T. Berger, Implementierung eines Prologcompilers basierend auf der Vienna Abstract Machine, M. Thesis, TU Wien, 1991.

    Google Scholar 

  4. M. Bruynooghe,’ The Memory Management of PROLOG Implementations', Logic Programming, Clark & Tårnlund (ed.), Academic Press, 1982.

    Google Scholar 

  5. M. Carlsson and J. Widén, SICStus Prolog User's Manual, SICS research report R88007C, 1990.

    Google Scholar 

  6. P. Cousot and R. Cousot,’ Abstract Interpretation: A Unified Lattice Model for Static Analysis of Programs by Construction or Approximation of Fixpoints', Forth Symp, Priciples of Programming Languages, ACM, 1977

    Google Scholar 

  7. A.M. Ertl and A. Krall,’ Instruction Scheduling for Complex Pipelines', Int. Workshop on Compiler Construction, LNCS, 1992

    Google Scholar 

  8. M. Gelbmann, Prolog Interpreter, M. Thesis, TU Wien, 1984

    Google Scholar 

  9. P.B. Gibbons and S.S. Muchnick,’ Efficient Instruction Scheduling for a pipelined architecture', in Proceedings of the SIGPLAN '86 Symposium on Compiler Construction, 1986

    Google Scholar 

  10. G. Kane, MIPS RISC Architecture, Prentice Hall, 1989.

    Google Scholar 

  11. A. Krall, Comparing Implementation Techniques for Prolog, VIP TR 1802/86/7, TU Wien, 1986.

    Google Scholar 

  12. A. Krall,’ Implementation of a High-Speed Prolog Interpreter', ACM SIGPLAN 22(7), Conf. on Interpreters and Interpretative Techniques, 1987.

    Google Scholar 

  13. A. Krall, Analyse und Implementierung von Prologsystemen, Ph.D. Thesis, TU Wien, 1988.

    Google Scholar 

  14. A. Krall,’ An Extended Prolog Instruction Set for RISC Processors', Int. Workshop on VLSI for AI and Neural Networks, Oxford, Plenum, 1991.

    Google Scholar 

  15. A. Krall, E. Kühn and U. Neumerkel,’ Distributed Logic Programming', EUUG Spring '89 Conference, Brussels, 1989.

    Google Scholar 

  16. A. Krall and U. Neumerkel,’ The Vienna Abstract Machine', PULP '90, LNCS, Springer, 1990.

    Google Scholar 

  17. E. Kühn and T. Ludwig,’ VIP-MDBS: A Logic Multidatabase System', Int. Symposium on Databases in Parallel and Distributed Systems, Austin Texas, 1988.

    Google Scholar 

  18. E. Kühn and F. Puntigam, The VPL Vienna Parallel Logic Language, TR 185/91/1, TU Wien, 1991.

    Google Scholar 

  19. A. Marien et al.,’ The impact of abstract interpretation: an experiment in code generation', Sixth Int. Conf. on Logic Programming, Lisbon, 1989.

    Google Scholar 

  20. C.S. Mellish,’ An Alternative to Structure Sharing in the Implementation of a Prolog Interpreter', Logic Programming, Clark & Tårnlund (ed.), Academic Press, 1982.

    Google Scholar 

  21. C.S. Mellish, 'some Global Optimizations for a Prolog Compiler', Journal of Logic Programming 2(1), 1985.

    Google Scholar 

  22. U. Neumerkel,’ Extensible Unification by Metastructures', Meta90, Leuven, 1990.

    Google Scholar 

  23. M. Oppitz et al., VIP — A Prolog Programming Environment, VIP TR 1802/85/1, TU Wien, 1985.

    Google Scholar 

  24. C. Pichler, Prolog übersetzer, M. Thesis, TU Wien, 1984.

    Google Scholar 

  25. H. Pohlai, Implementierung eines Prolog-Zwischcncodeinterpreters basierend auf der Vienna Abstract Machine, M. Thesis, TU Wien, 1991.

    Google Scholar 

  26. P.V. Roy and A.M. Despain,’ High-performance Logic Programming with the Aquarius Prolog Compiler', IEEE Computer, 1992

    Google Scholar 

  27. A. Taylor,’ Removal of Dereferencing and Trailing in Prolog Compilation', Sixth Int. Conf. on Logic Programming, Lisbon, 1989.

    Google Scholar 

  28. A. Taylor,’ LIPS on a MIPS', Seventh Int. Conf. on Logic Programming, Jerusalem, 1990.

    Google Scholar 

  29. D.H.D. Warren, An Abstract Prolog Instruction Set, SRI International, Technical Note 309, 1983.

    Google Scholar 

  30. H.S. Warren,’ Instruction scheduling for the IBM RISC System/6000 processor', IBM Journal of Research and Development, 1(34), 1990

    Google Scholar 

  31. R. Warren, M. Hermenegildo and S. Debray,’ On the Practicality of Global Flow Analysis of Logic Programs', Fifth Int. Conf. and Symposium on Logic Programming, Seattle, 1988.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Maurice Bruynooghe Martin Wirsing

Rights and permissions

Reprints and permissions

Copyright information

© 1992 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Krall, A., Berger, T. (1992). Fast prolog with a VAM1p based Prolog compiler. In: Bruynooghe, M., Wirsing, M. (eds) Programming Language Implementation and Logic Programming. PLILP 1992. Lecture Notes in Computer Science, vol 631. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-55844-6_140

Download citation

  • DOI: https://doi.org/10.1007/3-540-55844-6_140

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-55844-6

  • Online ISBN: 978-3-540-47297-1

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics