Abstract-Mode-directed tabling amounts to using table modes to control what arguments are used in variant checking of subgoals and how answers are tabled. A mode can be min, max, + (input), -(output), or nt (non-tabled). While the traditional table-all approach to tabling is good for finding all answers, mode-directed tabling is well suited to dynamic programming problems that require selective answers. In this paper, we present three application examples of mode-directed tabling, namely, (1) hydraulic system planning, a dynamic programming problem, (2) the Viterbi algorithm in PRISM, a probabilistic logic reasoning and learning system, and (3) constraint checking in evaluating Answer Set Programs (ASP). For the Viterbi application, the feature of enabling a cardinality limit in a table mode declaration plays an important role. For a PRISM program and a set of data, the explanations may be too large to be completely stored and the cardinality limit allows for Viterbi inference based on a subset of explanations. The mode nt, which specifies an argument that can participate in the computation of a tabled predicate but is never tabled either in subgoal or answer tabling, is useful in constraint checking for the Hamilton cycle problem encoded as an ASP. These examples demonstrate the usefulness of modedirected tabling.
B-Prolog also extends the mode-directed tabling declaration to include a cardinality limit that allows to define the maximum number of answers to be stored in the table space REF .
Mode-Directed Tabling for Dynamic Programming, Machine Learning, and Constraint Solving
2010 22nd IEEE International Conference on Tools with Artificial Intelligence
2010 22nd IEEE International Conference on Tools with Artificial Intelligence
Computer Science