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)).
Sourceobserve_call(+Index, +Head, :Wrapped)
Wrapper body. The ancestor stack is kept in the backtrackable global variable auto_table_stack as a term s(Depth, Index, HeadCopy, Parent, Frame) or [], where Frame is the frame that runs the ancestor. The learning state is in the global variable auto_table_learn. We must access it using nb_getval/2 such that we can update it destructively.

A loop that passes a barrier for suspending a tabled goal, such as findall/3, cannot be broken by tabling. It is recorded separately (see shift_barrier/2).