Hostname: page-component-cd9895bd7-lnqnp Total loading time: 0 Render date: 2024-12-21T23:36:41.186Z Has data issue: false hasContentIssue false

Efficient tabling of structured data with enhanced hash-consing

Published online by Cambridge University Press:  05 September 2012

NENG-FA ZHOU
Affiliation:
CUNY Brooklyn College & Graduate Center (e-mail: [email protected])
CHRISTIAN THEIL HAVE
Affiliation:
Roskilde University (e-mail: [email protected])

Abstract

Current tabling systems suffer from an increase in space complexity, time complexity or both when dealing with sequences due to the use of data structures for tabled subgoals and answers and the need to copy terms into and from the table area. This symptom can be seen in not only B-Prolog, which uses hash tables, but also systems that use tries such as XSB and YAP. In this paper, we apply hash-consing to tabling structured data in B-Prolog. While hash-consing can reduce the space consumption when sharing is effective, it does not change the time complexity. We enhance hash-consing with two techniques, called input sharing and hash code memoization, for reducing the time complexity by avoiding computing hash codes for certain terms. The improved system is able to eliminate the extra linear factor in the old system for processing sequences, thus significantly enhancing the scalability of applications such as language parsing and bio-sequence analysis applications. We confirm this improvement with experimental results.

Type
Regular Papers
Copyright
Copyright © Cambridge University Press 2012

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

References

Appel, A. W. and de Rezende Goncalves, M. J. 2003. Hash-Consing Garbage Collection. Technical Report TR 74-03, Princeton University.Google Scholar
Boyer, R. S. and Moore, J. S. 1972. A sharing of structure in theorem proving programs. Machine Intelligence 7, 101116.Google Scholar
Chen, W. and Warren, D. S. 1996. Tabled evaluation with delaying for general logic programs. Journal of the ACM 43, 1, 2074.CrossRefGoogle Scholar
Ershov, A. 1959. On programming of arithmetic operations. Communications of the ACM 1, 8, 36.CrossRefGoogle Scholar
Goto, E. 1974. Monocopy and Associative Algorithms in Extended Lisp. Technical Report TR 74-03, University of Tokyo.Google Scholar
Have, C. T. and Christiansen, H. 2012. Efficient tabling of structured data using indexing and program transformation. In PADL. LNCS 7149, 93107.Google Scholar
Michie, D. 1968. “Memo” functions and machine learning. Nature, 1922.Google Scholar
Neumerkel, U. 1989. Garbage Collection in Prolog Systems (in German). PhD Thesis, Technical University of Vienna.Google Scholar
Nguyen, P.-L. and Demoen, B. 2012. Representation sharing for Prolog. TPLP.Google Scholar
O'Keefe, R. A. 2001. O(1) reversible tree navigation without cycle. TPLP 1, 5, 617630.Google Scholar
Raimundo, J. and Rocha, R. 2011. Global trie for subterms. In CICLOPS.Google Scholar
Ramakrishnan, I., Rao, P., Sagonas, K., Swift, T. and Warren, D. 1998. Efficient access mechanisms for tabled logic programs. Journal of Logic Programming 38, 3154.CrossRefGoogle Scholar
, Rocha, R. and Damas, L. 2012. The YAP Prolog system. TPLP, Special Issue on Prolog Systems 12, 1-2, 534.Google Scholar
Sato, T. and Kameya, Y. 2008. New advances in logic-based probabilistic modeling by PRISM. In Probabilistic Inductive Logic Programming. 118155.CrossRefGoogle Scholar
Sato, T., Zhou, N.-F., Kameya, Y. and Yizumi, Y. 2010. The PRISM user's manual. http://www.mi.cs.titech.ac.jp/prism/.Google Scholar
Somogyi, Z. and Sagonas, K. 2006. Tabling in Mercury: Design and implementation. In PADL. LNCS 3819, 150167.Google Scholar
Swift, T. and Warren, D. S. 2012. XSB: Extending Prolog with tabled logic programming. TPLP, Special issue on Prolog systems 12, 1-2, 157187.Google Scholar
Swift, T. and Warren, D. S. et al. 2009. The XSB Programmer's Manual: vols. 1 and 2. http://xsb.sf.net.Google Scholar
Warren, D. H. D. 1983. An abstract Prolog instruction set. Technical note 309, SRI International.Google Scholar
Zhou, N.-F. 2012. The language features and architecture of B-Prolog. TPLP, Special Issue on Prolog Systems 12, 1-2, 189218.Google Scholar
Zhou, N.-F., Sato, T. and Shen, Y.-D. 2008. Linear tabling strategies and optimizations. TPLP 8, 1, 81109.Google Scholar