[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.
- Introduced in 11.1.1 (👉8ccf411) library(prolog_auto_table): XSB compatible auto_table/0 and auto_table_learn/2,3