Efficient access mechanisms for tabled logic programs

被引:56
作者
Ramakrishnan, IV
Rao, P
Sagonas, K
Swift, T
Warren, DS
机构
[1] Katholieke Univ Leuven, Dept Comp Sci, B-3001 Heverlee, Belgium
[2] SUNY Stony Brook, Dept Comp Sci, Stony Brook, NY 11794 USA
[3] BELLCORE, Morristown, NJ 07960 USA
[4] Univ Maryland, Dept Comp Sci, College Pk, MD 20742 USA
来源
JOURNAL OF LOGIC PROGRAMMING | 1999年 / 38卷 / 01期
基金
美国国家科学基金会;
关键词
tabling; indexing; tries; discrimination nets; SLG-WAM; implementation;
D O I
10.1016/S0743-1066(98)10013-4
中图分类号
TP301 [理论、方法];
学科分类号
081202 ;
摘要
The use of tabling in logic programming allows bottom-up evaluation to be incorporated in a top-down framework, combining advantages of both. At the engine level, tabling also introduces issues not present in pure top-down evaluation, due to the need for subgoals and answers to access tables during resolution. This article describes the design, implementation, and experimental evaluation of data structures and algorithms for high-performance table access. Our approach uses tries as the basis for tables. Tries, a variant of discrimination nets, provide complete discrimination for terms, and permit a lookup and possible insertion to be performed in a single pass through a term. In addition, a novel technique of substitution factoring is proposed. When substitution factoring is used, the access cost for answers is proportional to the size of the answer substitution, rather than to the size of the answer itself. Answer tries can be implemented both as interpreted structures and as compiled WAM-like code. When they are compiled, the speed of computing substitutions through answer tries is competitive with the speed of unit facts compiled or asserted as WAM code. Because answer tries can also be created an order of magnitude more quickly than asserted code, they form a promising alternative for representing certain types of dynamic code, even in Prolog systems without tabling. (C) 1999 Elsevier Science Inc. All rights reserved.
引用
收藏
页码:31 / 54
页数:24
相关论文
共 20 条
[1]  
BACHMAIR L, 1993, LECT NOTES COMPUTER, V668, P61
[2]  
CHEN T, 1994, SOFTWARE PRACT EXPER, V24, P1097, DOI 10.1002/spe.4380241202
[3]   Tabled evaluation with delaying for general logic programs [J].
Chen, WD ;
Warren, DS .
JOURNAL OF THE ACM, 1996, 43 (01) :20-74
[4]   COMPLEXITY OF TRIE INDEX CONSTRUCTION [J].
COMER, D ;
SETHI, R .
JOURNAL OF THE ACM, 1977, 24 (03) :428-440
[5]  
DAWSON S, 1995, POPL 1995, P247
[6]  
DELACLERGERIE EV, 1993, 12 ANN ACM SIGPLAN S, P345
[7]  
GRAF P, 1996, LECT NOTES ARTIFICIA, V1053
[8]  
Knuth Donald E., 1973, ART COMPUTER PROGRAM, V1
[9]  
McCune W., 1992, Journal of Automated Reasoning, V9, P147, DOI 10.1007/BF00245458
[10]   ARGUMENT REDUCTION BY FACTORING [J].
NAUGHTON, JF ;
RAMAKRISHNAN, R ;
SAGIV, Y ;
ULLMAN, JD .
THEORETICAL COMPUTER SCIENCE, 1995, 146 (1-2) :269-310