Skip to main content
QUICK REVIEW

[论文解读] Global Trie for Subterms

João Raimundo, Ricardo Rocha|arXiv (Cornell University)|Dec 16, 2011
Logic, programming, and type systems参考文献 8被引用 4
一句话总结

本文提出全局子项Trie(GT-ST),作为Prolog表格系统中全局Trie(GT)表空间组织的扩展,通过唯一表示跨项中的复合子项来减少内存冗余。在YapTab上的实验表明,GT-ST在不降低执行时间的情况下显著减少了内存使用,尤其对于在参数中重复出现子项的程序,高阶复合子项的内存使用最高可减少51%。

ABSTRACT

A critical component in the implementation of an efficient tabling system is the design of the table space. The most popular and successful data structure for representing tables is based on a two-level trie data structure, where one trie level stores the tabled subgoal calls and the other stores the computed answers. The Global Trie (GT) is an alternative table space organization designed with the intent to reduce the tables's memory usage, namely by storing terms in a global trie, thus preventing repeated representations of the same term in different trie data structures. In this paper, we propose an extension to the GT organization, named Global Trie for Subterms (GT-ST), where compound subterms in term arguments are represented as unique entries in the GT. Experiments results using the YapTab tabling system show that GT-ST support has potential to achieve significant reductions on memory usage, for programs with increasing compound subterms in term arguments, without compromising the execution time for other programs.

研究动机与目标

  • 减少因在项参数中重复表示相同复合子项而导致的Prolog表格系统中的内存膨胀问题。
  • 扩展全局Trie(GT)设计,通过在子项级别而非仅项级别共享子项,优化内存使用。
  • 评估GT-ST中的子项级别共享是否能在不损害执行性能的前提下提升内存效率。
  • 评估不同程序结构下,子项索引的内存节省与开销之间的权衡。

提出的方法

  • 扩展全局Trie(GT)数据结构,将复合子项(如g/1、g/3、g/5)作为全局子项Trie中的共享条目进行索引和唯一表示。
  • 修改YapTab表格系统以集成GT-ST,实现在表插入和查找过程中进行子项级别的规范化。
  • 采用两级Trie架构:一级用于子目标调用,一级用于答案,子项存储于全局子项Trie中以消除冗余。
  • 实现一种规范化表示机制,为所有表格项中结构相同的复合子项分配唯一标识符。
  • 支持编译和非编译Trie,以评估子项索引与查找中的性能权衡。
  • 在具有不同子项复杂度和阶数的多个测试程序上测量内存使用量和执行时间。

实验结果

研究问题

  • RQ1与项级别共享相比,全局Trie中的子项级别共享是否能减少Prolog表格系统的内存使用?
  • RQ2与GT-T相比,GT-ST中索引和解析复合子项的性能开销如何?
  • RQ3GT-ST的内存和时间成本如何随子项阶数和项参数中重复次数的增加而变化?
  • RQ4对于子项冗余极少的程序,GT-ST是否能保持或改善执行时间?
  • RQ5对于子项重复率高的程序,GT-ST在内存效率方面相比GT-T的优越程度如何?

主要发现

  • 对于包含500,000个g/5子项的f/3项,GT-ST相比GT-T将总内存使用量减少了49%(139.24 MB vs. 280.00 MB)。
  • 在f/3情况下包含g/5子项时,GT-ST将仅GT部分的内存使用量减少了53%(129.7 MB vs. 275.5 MB)。
  • 对于包含g/5子项的f/2项,GT-ST将总内存使用量减少了36%(93.46 MB vs. 146.00 MB)。
  • 对于低阶子项(如f/1带g/1),GT-ST的表存储执行时间更高,这是由于索引开销所致,但在高冗余情况下,该开销被内存节省所抵消。
  • 对于高子项冗余的程序(如g/5),GT-ST将内存使用量最高减少了51%,同时保持或改善了表加载和编译的执行时间。
  • 随着子项阶数的增加,GT-ST的性能优势愈发明显,这是由于在更多节点上分摊了索引开销。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。