Abstract
The principal technique for enhancing the speed of clause resolution in logic programming languages, such as Prolog, is indexing. Given a goal, the primary objective of indexing is to quickly eliminate clauses whose heads do not unify with the goal. Efforts at maximizing the performance of indexing automata have focused almost exclusively on constructing them with small depth, which in turn translates into making fewer transitions. Performance of an automata also critically depends on its ability to make each transition efficiently. This is a problem that has largely been ignored and constitutes the topic of this paper.
Although jump tables ensure that each transition can be done in constant time they are usually very sparse and hence are seldom used in implementations. We describe a novel method to construct dense jump tables for indexing automata. We present implementation results that show that our construction indeed yields jump tables that are dense enough to be practical. We also show that indexing automata that use jump tables based on our method, improve the overall performance of Prolog programs. We also provide experimental evidence that our method is a general technique for compressing transition tables of other finite state automata such as those used in scanners.
This work was supported in part by NSF grants CCR-9404921, CDA-9303181 and INT-9314412.
Preview
Unable to display preview. Download preview PDF.
References
A.H. Aho and J.D. Ullman. Principles of Compiler Design. Addison-Wesley, Reading, Mass., 1977.
J.R. Bell. A compression method for compiler precedence tables. In Proc. of the IFIP Congress 74, pages 359–362, Stockholm, August 1974.
M. Carlsson. Freeze, indexing and other implementation issues in the WAM. In International Conference on Logic Programming, pages 40–58, 1987.
G.V. Cormack, R.N.S. Horspool, and M. Kaiserswerth. Practical perfect hashing. The Computer Journal, 28(1):54–58, 1985.
J. Christian. Fast Knuth-Bendix completion: Summary. In RTA'89, pages 551–555. Springer-Verlag LNCS 355, 1989.
T. Chen, I. V. Ramakrishnan, and R. Ramesh. Multistage indexing algorithms for speeding Prolog execution. In Joint International Conference/Symposium on Logic Programming, pages 639–653, 1992.
P. Denker, K. Dürre, and J. Heuft. Optimization of parser tables for portable compilers. ACM Transactions on Programming Languages and Systems, 6(4):546–572, October 1984.
S. Dawson, C. R. Ramakrishnan, I.V. Ramakrishnan, K. Sagonas, S. Skiena, T. Swift, and D. S. Warren. Unification factoring for efficient execution of logic programs. In ACM Symposium on Principles of Programming Languages, pages 247–258, January 1995.
L. Fredman, J. Komlós, and E. Szemerédi. Storing a sparse table with O(1) worst case access time. Journal of the ACM, 31(3):538–544, July 84.
M. Garey and D. Johnson. Computers and Intractibility: A Guide to the Theory of NP-Completness. W.H. Freeman and Company, 1979.
T. Hickey and S. Mudambi. Global compilation of Prolog. Journal of Logic Programming, 7:193–230, 1989.
S. Kliger and E. Shapiro. From decision trees to decision graphs. In North American Conference on Logic Programming, pages 97–116, 1991.
W. McCune. Experiments with discrimination-tree indexing and path indexing for term retrieval. Journal of Automated Reasoning, 9:147–167, 1992.
D. Palmer and L. Naish. NUA-Prolog: An extension to the WAM for parallel Andorra. In International Conference on Logic Programming, pages 429–442, 1991.
R. Ramesh, I. V. Ramakrishnan, and D. S. Warren. Automata-driven indexing of Prolog clauses. In ACM Symposium on Principles of Programming Languages, pages 281–290. ACM Press, 1990.
R. C. Sekar, I. V. Ramakrishnan, and R. Ramesh. Adaptive pattern matching. In International Conference on Automata, Languages, and Programming, number 623 in LNCS, pages 247–260. Springer Verlag, 1992. To appear in SIAM J. Comp.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1995 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Dawson, S., Ramakrishnan, C.R., Ramakrishnan, I.V. (1995). Design and implementation of jump tables for fast indexing of logic programs. In: Hermenegildo, M., Swierstra, S.D. (eds) Programming Languages: Implementations, Logics and Programs. PLILP 1995. Lecture Notes in Computer Science, vol 982. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0026818
Download citation
DOI: https://doi.org/10.1007/BFb0026818
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-60359-7
Online ISBN: 978-3-540-45048-1
eBook Packages: Springer Book Archive