Incremental Evaluation of Tabled Prolog: Beyond Pure Logic Programs

Diptikalyan Saha, C. R. 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 built-ins 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.

Bibtex Entry:

author = {Diptikalyan Saha and  C. R. Ramakrishnan},
title = {Incremental Evaluation of Tabled Prolog: Beyond Pure Logic Programs},
booktitle = {Practical Aspects of Declarative Languages ({PADL})},
address = {Charleston, South Carolina},
month = {Jan},
series = {Lecture Notes in Computer Science},
volume = {3819},
pages = {215--229},
publisher = {Springer},
note = {},
year = {2006}

Full Paper: [pdf]

Home | Papers

C. R. Ramakrishnan