[det]auto_table_learn(:Goals,
+Options)auto_table_learn/2 prints the result. Options:
user.library(time)
is not available, which is the case in single threaded versions and
WASM.infinite.true (default), run the second phase (see below).time (CPU
time), memory (table space) or balanced
(default, the sum of both relative to the initial configuration).[variant,subsumptive].true, leave the program tabled according to the best
configuration. Default false, restoring the original
tabling.
The second phase searches for the best configuration, a mapping from
predicates to variant, subsumptive or not
tabled. It starts with the predicates that were already tabled plus the
selected predicates of the first phase. Each configuration is evaluated
by running Goals with fresh tables, measuring CPU time and
table space. A configuration is rejected if a goal does not complete or
produces different answers than the initial configuration. If the
initial configuration fails, e.g., because a cut prunes a call to an
incomplete table, the search starts from the original tabling. If that
fails too, the best configuration is the original tabling. The search
moves are: untable all tabled predicates that are not involved in any
observed loop (if this fails, try halves), untable a single predicate,
switch between variant and subsumptive tabling, and table a predicate
that is often called with the same arguments.
Result is a dict with the keys below.
Loop-Barrier for the observed loops that pass a
barrier for suspending a tabled goal, such as findall/3
or a predicate defined in C (see shift/1).
Tabling cannot break these loops, so their predicates are not selected.pi, calls, variants,
args (number of distinct values per argument), tabled
(whether the predicate was already tabled) and loops
(number of loop detections).Goal-Status, where Status is the result
of running the goal: true, false, time_limit_exceeded,
inference_limit_exceeded or an error.PI-Mode, where Mode is variant or subsumptive.