在Prolog中使用多提示符分隔的控件进行更多的声明性制表
More declarative tabling in Prolog using multi-prompt delimited control
摘要:
几个Prolog实现包括一个制表设施,一个替代的解决策略,使用memoisation,以避免冗余的重复计算。直到最近,制表还需要底层Prolog引擎中的低级支持,或者广泛的程序transmittance(de Guzman等人,2008年)。另一种方法是增加Prolog与低级别的支持连续捕获控制操作符,特别是定界的延续,这已经在函数编程领域进行了研究,并发现能够支持各种各样的计算效果,否则声明性语言。本技术报告描述了基于Schrijvers等人(2013)最近引入的Prolog分隔控制运算符的SWI Prolog中的制表实现。与之前使用分隔控件的SWI Prolog制表实现(Desouter等人,2015),这种方法基于Johnson(1995)的函数记忆解析器组合子,更接近Prolog的声明性核心,需要更少的代码,并且能够从表格谓词系统中增量地交付解决方案(而不是在将任何解决方案交付给程序的其余部分之前找到所有解决方案)。一组基准测试表明,少量精心针对性的优化产生的性能在Desouter等人的优化版本的约2倍之内。的系统目前包含在SWI Prolog中。
英文摘要:
Several Prolog implementations include a facility for tabling, an alternative resolution strategy which uses memoisation to avoid redundant duplication of computations. Until relatively recently, tabling has required either low-level support in the underlying Prolog engine, or extensive program transormation (de Guzman et al., 2008). An alternative approach is to augment Prolog with low level support for continuation capturing control operators, particularly delimited continuations, which have been investigated in the field of functional programming and found to be capable of supporting a wide variety of computational effects within an otherwise declarative language. This technical report describes an implementation of tabling in SWI Prolog based on delimited control operators for Prolog recently introduced by Schrijvers et al. (2013). In comparison with a previous implementation of tabling for SWI Prolog using delimited control (Desouter et al., 2015), this approach, based on the functional memoising parser combinators of Johnson (1995), stays closer to the declarative core of Prolog, requires less code, and is able to deliver solutions from systems of tabled predicates incrementally (as opposed to finding all solutions before delivering any to the rest of the program). A collection of benchmarks shows that a small number of carefully targeted optimisations yields performance within a factor of about 2 of the optimised version of Desouter et al.'s system currently included in SWI Prolog.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。