Skip to main content

Demand-Driven Indexing of Prolog Clauses

  • Conference paper
Logic Programming (ICLP 2007)

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

Included in the following conference series:

Abstract

As logic programming applications grow in size, Prolog systems need to efficiently access larger and larger data sets and the need for any- and multi-argument indexing becomes more and more profound. Static generation of multi-argument indexing is one alternative, but applications often rely on features that are inherently dynamic which makes static techniques inapplicable or inaccurate. Another alternative is to employ dynamic schemes for flexible demand-driven indexing of Prolog clauses. We propose such schemes and discuss issues that need to be addressed for their efficient implementation in the context of WAM-based Prolog systems. We have implemented demand-driven indexing in two different Prolog systems and have been able to obtain non-negligible performance speedups: from a few percent up to orders of magnitude. Given these results, we see very little reason for Prolog systems not to incorporate some form of dynamic indexing based on actual demand. In fact, we see demand-driven indexing as only the first step towards effective runtime optimization of Prolog programs.

Dedicated to the memory of our friend, colleague and co-author Ricardo Lopes. We miss you!

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. Warren, D.H.D.: An abstract Prolog instruction set. Tech. Note 309, SRI International (1983)

    Google Scholar 

  2. Santos Costa, V., Damas, L., Reis, R., Azevedo, R.: YAP User’s Manual (2002)

    Google Scholar 

  3. Carlsson, M.: On the efficiency of optimising shallow backtracking in compiled Prolog. In: Levi, G., Martelli, M. (eds.) Proceedings of the Sixth ICLP, pp. 3–15. MIT Press, Cambridge (1989)

    Google Scholar 

  4. Demoen, B., Mariën, A., Callebaut, A.: Indexing in Prolog. In: Lusk, E.L., Overbeek, R.A. (eds.) Proceedings of NACLP, pp. 1001–1012. MIT Press, Cambridge (1989)

    Google Scholar 

  5. Wielemaker, J.: SWI-Prolog 5.1: Reference Manual. SWI, University of Amsterdam, Roetersstraat 15, 1018 WB Amsterdam, The Netherlands (1997-2003)

    Google Scholar 

  6. Sagonas, K.F., Swift, T., Warren, D.S., Freire, J., Rao, P.: The XSB Programmer’s Manual. State University of New York at Stony Brook (1997)

    Google Scholar 

  7. Troncon, R., Janssens, G., Demoen, B., Vandecasteele, H.: Fast frequent quering with lazy control flow compilation. Theory and Practice of Logic Programming (2007) (to appear)

    Google Scholar 

  8. Hickey, T., Mudambi, S.: Global compilation of Prolog. JLP 7(3), 193–230 (1989)

    Article  Google Scholar 

  9. Van Roy, P., Demoen, B., Willems, Y.D.: Improving the execution speed of compiled Prolog with modes, clause selection and determinism. In: Ehrig, H., Levi, G., Montanari, U. (eds.) CAAP 1987 and TAPSOFT 1987. LNCS, vol. 249, pp. 111–125. Springer, Heidelberg (1987)

    Chapter  Google Scholar 

  10. Zhou, N.F., Takagi, T., Kazuo, U.: A matching tree oriented abstract machine for Prolog. In: Warren, D.H.D., Szeredi, P. (eds.) ICLP 1990, pp. 158–173. MIT Press, Cambridge (1990)

    Google Scholar 

  11. Dawson, S., Ramakrishnan, C.R., Ramakrishnan, I.V., Sagonas, K., Skiena, S., Swift, T., Warren, D.S.: Unification factoring for the efficient execution of logic programs. In: Conference Record of POPL 1995, pp. 247–258. ACM Press, New York (1995)

    Google Scholar 

  12. Ramakrishnan, I.V., Rao, P., Sagonas, K., Swift, T., Warren, D.S.: Efficient access mechanisms for tabled logic programs. Journal of Logic Programming 38(1), 31–54 (1999)

    Article  MATH  Google Scholar 

  13. Kliger, S., Shapiro, E.: A decision tree compilation algorithm for FCP(|,:?). In: Proceedings of the Fifth ICSLP, pp. 1315–1336. MIT Press, Cambridge (1988)

    Google Scholar 

  14. Somogyi, Z., Henderson, F., Conway, T.: The execution algorithm of Mercury, an efficient purely declarative logic programming language. JLP 26(1-3), 17–64 (1996)

    Article  Google Scholar 

  15. Hermenegildo, M.V., Puebla, G., Bueno, F., LĂ³pez-GarcĂ­a, P.: Integrated program debugging, verification, and optimization using abstract interpretation (and the Ciao system preprocessor). Science of Computer Programming 58(1–2), 115–140 (2005)

    Article  MATH  Google Scholar 

  16. Carlsson, M.: Freeze, indexing, and other implementation issues in the WAM. In: Lassez, J.L. (ed.) Proceedings of the Fourth ICLP, pp. 40–58. MIT Press, Cambridge (1987)

    Google Scholar 

  17. Srinivasan, A.: The Aleph Manual (2001)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Véronica Dahl Ilkka Niemelä

Rights and permissions

Reprints and permissions

Copyright information

© 2007 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Santos Costa, V., Sagonas, K., Lopes, R. (2007). Demand-Driven Indexing of Prolog Clauses. In: Dahl, V., Niemelä, I. (eds) Logic Programming. ICLP 2007. Lecture Notes in Computer Science, vol 4670. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-74610-2_27

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-74610-2_27

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-74608-9

  • Online ISBN: 978-3-540-74610-2

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics