Incremental Evaluation of Tabled Prolog: Beyond Pure Logic Programs
Incremental Evaluation of Tabled Prolog: Beyond Pure Logic Programs
复制标题
表式 Prolog 的增量评估:超越纯逻辑程序
DOI:
--
复制
发表时间:
2006
期刊:
影响因子:
--
通讯作者:
C. Ramakrishnan
中科院分区:
文献类型:
--
作者:
Diptikalyan Saha;C. Ramakrishnan
Tabling, or memoization, enables incremental evaluation of logic programs. When the rules or facts of a program change, we need to recompute only those results that are affected by the changes. The current algorithms for incrementally maintaining memo tables treat insertion of facts/rules differently from their deletion. Hence these techniques cannot be directly applied for incremental evaluation of arbitrary tabled programs, especially those involving Prolog builtins such as findall, other aggregation operations, or non-stratified negation. In this paper, we explore a simpler incremental evaluation algorithm that, based on the dynamic call graph, invalidates and re-evaluates entire calls. The algorithm is agnostic to whether a dependency adds or removes answers from tables, and hence can be applied uniformly to programs with negation, even when the negation is implicit (as is the case with certain aggregation operations). We find that the call-based algorithm is very effective in examples where the call dependencies are largely acyclic (e.g. dynamic programming examples) and is moderately effective when the dependencies contain independent cyclic components (e.g. data flow analysis problems). This is the first practical algorithm to handle all legal tabled logic programs for which incremental evaluation is meaningful.