A.40 library(prolog_auto_table): Automatic tabling
All Application Manual Name SummaryHelp

  • Documentation
    • Reference manual
      • The SWI-Prolog library
        • library(prolog_auto_table): Automatic tabling
          • auto_table/0
          • auto_table/1
          • auto_table_analysis/3
          • auto_table_learn/2
          • auto_table_learn/3
          • observe_call/3
    • Packages
Availability::- use_module(library(prolog_auto_table)).(can be autoloaded)
Source[det]auto_table_analysis(:Spec, -Analysis:dict, +Options)
Determine the predicates to table for Spec, which is one of file(File), module(Module) or goal(Goal). The latter analyses the predicates reachable from Goal. The options files(FileOrFiles) and module(ModuleOrModules) restrict these to the predicates defined in the given files or modules (see call_graph/2). Analysis is a dict with the keys below. Options are those of auto_table/1 plus the options of call_graph/2.
selected
List of PI-Reason for each predicate that must be tabled, where Reason is one of tnot or cycle.
sccs
List of dicts describing each strongly connected component, holding the keys members, tabled (predicates in the SCC that were already tabled), selected (predicates selected for tabling), cost (estimated cost of the selection), left_recursion (list of left recursion dicts, see left_recursion/3), terminating (directly recursive predicates that are not tabled because their recursion is known to terminate), barriers (edges through a barrier for suspending a tabled goal that are not known to terminate; if this is not empty, nothing is selected) and cuts (if the SCC contains tabled predicates, the edges of the SCC whose call can be pruned by a cut, which raises an error if the call is to an incomplete table; see the pruned key of call_graph_sccs/2).