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

Prolog的表示共享

Representation Sharing for Prolog

Phuong-Lan Nguyen, Bart Demoen

摘要:

表示共享可以通过在重复项之间共享一个表示来减少程序的内存占用。函数式编程系统中最常见的表示共享实现称为散列consing。在Prolog的上下文中,表示共享很少受到关注。一些当前的技术,处理表示共享的审查。新的贡献是:(1)用于{ \em findall/3}的{\em输入共享}的简单实现;(2)在运行时引入表示共享的{ \em sharer}模块的描述。它们的实现在由hProlog实现的WAM的上下文中示出。两者都可以适用于任何WAM类Prolog实现。共享器独立于垃圾收集器工作,但可以使其与垃圾收集器协作。基准测试结果表明,共享器的成本与堆垃圾收集器相当,其有效性高度依赖于应用程序,并且其策略必须根据收集器进行调整。逻辑程序设计理论与实践(Theory and Practice of Logic Programming,TPLP)

英文摘要:

Representation sharing can reduce the memory footprint of a program by sharing one representation between duplicate terms. The most common implementation of representation sharing in functional programming systems is known as hash-consing. In the context of Prolog, representation sharing has been given little attention. Some current techniques that deal with representation sharing are reviewed. The new contributions are: (1) an easy implementation of {\em input sharing} for {\em findall/3}; (2) a description of a {\em sharer} module that introduces representation sharing at runtime. Their realization is shown in the context of the WAM as implemented by hProlog. Both can be adapted to any WAM-like Prolog implementation. The sharer works independently of the garbage collector, but it can be made to cooperate with the garbage collector. Benchmark results show that the sharer has a cost comparable to the heap garbage collector, that its effectiveness is highly application dependent, and that its policy must be tuned to the collector. To appear in Theory and Practice of Logic Programming (TPLP)

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

↑