arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 0705.3468cs.PL
收藏

线性制表策略与优化

Linear Tabling Strategies and Optimizations

Neng-Fa Zhou, Taisuke Sato, Yi-Dong Shen

摘要:

近年来,一种名为线性制表的迭代方法由于其简单、易于实现和良好的空间效率而受到广泛关注。线性制表是一个框架,可以根据处理循环子目标时使用的策略导出不同的方法。一个决定涉及何时消费和返回答案。本文描述了两种策略,即{ \it lazy}和{ \it eager}策略,并对它们进行了定性和定量的比较。结果表明,虽然懒惰的策略有很好的局部性,是非常适合寻找所有的解决方案,渴望的策略是速度与懒惰的策略,是非常适合与削减程序。线性制表依赖于深度优先的迭代深化而不是暂停来计算固定点。由最顶层的循环子目标表示的每个相互依赖的子目标集群被迭代地评估,直到其中没有子目标可以产生任何新的答案。对所有循环子目标进行简单的重新评估,尽管很简单,但在计算上可能是不可接受的。在本文中,我们还介绍了半天真的优化,一种有效的技术,用于自底向上评估的逻辑程序,以避免冗余连接的答案,到线性制表。我们给的技术是安全的(即健全和完整)的条件,并提出了一种优化技术称为{ \it早期答案推广},以提高其有效性。B-Prolog中的基准测试表明,通过这种优化,线性制表在速度上与最先进的SLG实现相比毫不逊色。

英文摘要:

Recently, the iterative approach named linear tabling has received considerable attention because of its simplicity, ease of implementation, and good space efficiency. Linear tabling is a framework from which different methods can be derived based on the strategies used in handling looping subgoals. One decision concerns when answers are consumed and returned. This paper describes two strategies, namely, {\it lazy} and {\it eager} strategies, and compares them both qualitatively and quantitatively. The results indicate that, while the lazy strategy has good locality and is well suited for finding all solutions, the eager strategy is comparable in speed with the lazy strategy and is well suited for programs with cuts. Linear tabling relies on depth-first iterative deepening rather than suspension to compute fixpoints. Each cluster of inter-dependent subgoals as represented by a top-most looping subgoal is iteratively evaluated until no subgoal in it can produce any new answers. Naive re-evaluation of all looping subgoals, albeit simple, may be computationally unacceptable. In this paper, we also introduce semi-naive optimization, an effective technique employed in bottom-up evaluation of logic programs to avoid redundant joins of answers, into linear tabling. We give the conditions for the technique to be safe (i.e. sound and complete) and propose an optimization technique called {\it early answer promotion} to enhance its effectiveness. Benchmarking in B-Prolog demonstrates that with this optimization linear tabling compares favorably well in speed with the state-of-the-art implementation of SLG.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑