The second measure determines whether one term subsumes another. A term
t1 subsumes a term t2 if t2 is an instance of t1.
Furthermore, we say that t1 properly subsumes t2 if t2
is not a variant of t1. Under subsumption-based tabling, when a
tabled call C is issued, a search is performed for a table entry
containing a subsuming subgoal S. Notice that, if such an entry
exists, then its answer set logically contains all the solutions
to satisfy C. The subset of answers
which
unify with C are said to be relevant to C. Likewise, upon
the derivation of an answer A for a producing subgoal S, A is
inserted into the answer set
of S if and only if A is not
subsumed by some answer A' already present in
.
Notice that subsumption-based tabling permits greater reuse of computed results, thus avoiding even more program resolution, and thereby can lead to time and space performances superior to variant-based tabling. However, there is a downside to this paradigm. First of all, subsumptively tabled predicates do not interact well with certain Prolog constructs with which variant-tabled predicates can (see Example 5.2.3 below). Further, in the current implementation of subsumption-based tabling, subsumptive predicates may not take part in negative computations which result in the delay of a literal containing a subsumptive subgoal (see Section 10.1). This requires subcomputations in which subsumptive predicates take part to be LRD-stratified.