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
[det]auto_table(+Options)
Directive that tables predicates of the current file such that each loop in the static call graph of the file contains at least one tabled predicate. The analysis is performed after the file has been loaded completely. Options:
cycles(+Which)
One of all (default) or left. If left, only left recursive cycles are broken.
structural(+Bool)
If true (default false), assume that directly recursive calls on a proper subterm of an argument of the head terminate. This is true if the argument is sufficiently instantiated when the predicate is called. Without this option, this is only assumed if a mode declaration says the argument is input (+ or ++). Mode declarations are given using mode/1 or using PlDoc structured comments, e.g. ‘%! len(+List, -Len)‘.
verbose(+Bool)
If true (default), print a message for each predicate that is tabled.

When the file is reloaded, the predicates tabled by the previous analysis are untabled before the new analysis is performed.

Compatibility
XSB. XSB only provides auto_table/0. As with XSB, :- mode declarations avoid tabling directly recursive predicates whose recursion decreases an input argument. The XSB dialect maps XSB :- mode declarations to mode/1.