7 Tabled execution (SLG resolution)
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
      • Tabled execution (SLG resolution)
        • Example 1: using tabling for memoizing
        • Example 2: avoiding non-termination
        • Answer subsumption or mode directed tabling
        • Tabling predicate reference
          • table/1
          • current_table/2
          • abolish_all_tables/0
          • abolish_table_subgoals/1
        • About the tabling implementation
    • Packages

7.4 Tabling predicate reference

:- table(+PredicateIndicators)
Prepare the given PredicateIndicators for tabling. The example below prepares the predicate edge/2 and the non-terminal statement//1 for tabled execution.
:- table edge/2, statement//1.

In addition to using predicate indicators, a predicate can be declared for mode directed tabling using a term where each argument declares the intended mode. For example:

:- table connection(_,_,min).

Mode directed tabling is discussed in the general introduction section of chapter 7.

current_table(:Variant, -Trie)
True when Trie is the answer table for Variant.
abolish_all_tables
Remove all tables. This is normally used to free up the space or recompute the result after predicates on which the result for some tabled predicates depend. Raises a permission_error when tabling is in progress.
abolish_table_subgoals(:Subgoal)
Abolish all tables that unify with SubGoal.