Pre-indexed Terms for Prolog

  • J. F. MoralesEmail author
  • M. Hermenegildo
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 8981)


Indexing of terms and clauses is a well-known technique used in Prolog implementations (as well as automated theorem provers) to speed up search. In this paper we show how the same mechanism can be used to implement efficient reversible mappings between different term representations, which we call pre-indexings. Based on user-provided term descriptions, these mappings allow us to use more efficient data encodings internally, such as prefix trees. We show that for some classes of programs, we can drastically improve the efficiency by applying such mappings at selected program points.


Garbage Collection Automate Theorem Prover Hash Code Prolog System Specialized Data Structure 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


  1. 1.
    Ait-Kaci, H.: Warren’s Abstract Machine, A Tutorial Reconstruction. MIT Press, Cambridge (1991) Google Scholar
  2. 2.
    Boyer, R., More, J.: The sharing of structure in theorem-proving programs. Mach. Intell. 7, 101–116 (1972)zbMATHGoogle Scholar
  3. 3.
    Graf, P. (ed.): Term Indexing. LNCS, vol. 1053. Springer, Heidelberg (1996)Google Scholar
  4. 4.
    Hermenegildo, M.V., Bueno, F., Carro, M., López, P., Mera, E., Morales, J., Puebla, G.: An overview of ciao and its design philosophy. Theory Pract. Logic Program. 12(1–2), 219–252 (2012). CrossRefzbMATHGoogle Scholar
  5. 5.
    Johnson, E., Ramakrishnan, C.R., Ramakrishnan, I.V., Rao, P.: A space efficient engine for subsumption-based tabled evaluation of logic programs. In: Middeldorp, A., Sato, T. (eds.) FLOPS 1999. LNCS, vol. 1722, pp. 284–299. Springer, Heidelberg (1999) CrossRefGoogle Scholar
  6. 6.
    Ramakrishnan, I.V., Sekar, R.C., Voronkov, A.: Term indexing. In: Robinson, J.A., Voronkov, A. (eds.) Handbook of Automated Reasoning, pp. 1853–1964 Elsevier and MIT Press (2001)Google Scholar
  7. 7.
    Santos Costa, V., Sagonas, K., Lopes, R.: Demand-driven indexing of prolog clauses. In: Dahl, V., Niemelä, I. (eds.) ICLP 2007. LNCS, vol. 4670, pp. 395–409. Springer, Heidelberg (2007) CrossRefGoogle Scholar
  8. 8.
    Sarna-Starosta, B., Schrijvers, T.: Transformation-based indexing techniques for Constraint Handling Rules. In: CHR, RISC Report Series 08–10, pp.3–18. University of Linz, Austria (2008)Google Scholar
  9. 9.
    Sarna-Starosta, B., Schrijvers, T.: Attributed data for CHR indexing. In: Hill, P.M., Warren, D.S. (eds.) ICLP 2009. LNCS, vol. 5649, pp. 357–371. Springer, Heidelberg (2009) CrossRefGoogle Scholar
  10. 10.
    Schrijvers, T., Santos Costa, V., Wielemaker, J., Demoen, B.: Towards typed prolog. In: de la Banda, M.G., Pontelli, E. (eds.) ICLP 2008. LNCS, vol. 5366, pp. 693–697. Springer, Heidelberg (2008) CrossRefGoogle Scholar
  11. 11.
    Sneyers, J., Schrijvers, T., Demoen, B.: The computational power and complexity of constraint handling rules. ACM Trans. Program. Lang. Syst. 31(2), 8:1–8:42 (2009)Google Scholar
  12. 12.
    Swift, T., Warren, D.S.: Tabling with answer subsumption: implementation, applications and performance. In: Janhunen, T., Niemelä, I. (eds.) JELIA 2010. LNCS, vol. 6341, pp. 300–312. Springer, Heidelberg (2010) CrossRefGoogle Scholar
  13. 13.
    Swift, T., Warren, D.S.: XSB: extending prolog with tabled logic programming. TPLP 12(1–2), 157–187 (2012)zbMATHMathSciNetGoogle Scholar
  14. 14.
    Vaz, D., Costa, V.S., Ferreira, M.: User defined indexing. In: Hill, P.M., Warren, D.S. (eds.) ICLP 2009. LNCS, vol. 5649, pp. 372–386. Springer, Heidelberg (2009) CrossRefGoogle Scholar
  15. 15.
    Warren, D.H.D.: An Abstract Prolog Instruction Set. Technical Report 309, Artificial Intelligence Center, SRI International, 333 Ravenswood Ave, Menlo Park CA 94025 (1983)Google Scholar
  16. 16.
    Welch, T.A.: A technique for high-performance data compression. IEEE Comput. 17(6), 8–19 (1984)CrossRefGoogle Scholar
  17. 17.
    Zhou, N.F., Have, C.T.: Efficient tabling of structured data with enhanced hash-consing. TPLP 12(4–5), 547–563 (2012)zbMATHGoogle Scholar

Copyright information

© Springer International Publishing Switzerland 2015

Authors and Affiliations

  1. 1.IMDEA Software InstituteMadridSpain
  2. 2.School of Computer ScienceTechnical University of MadridMadridSpain

Personalised recommendations