next up previous contents index
Next: Stratified Normal Programs Up: Tabling in Definite Programs Previous: Potential Pitfalls in Tabling   Contents   Index

Table Directives and Declarations

Often it is tedious to decide which predicates must be tabled. To address this, XSB can automatically table predicates in files. The declaration auto_table chooses predicates to table to assist in termination, while suppl_table chooses predicates to table to optimize data-oriented queries. Both are explained in Section 3.8.4.

Exercise 5.2.7   The reader may have noted that the command table was referred to as a directive, while auto_table and suppl_table were both referred to as declarations. The difference is that the user can execute a directive at the command line but not a compiler declaration. For instance, restart XSB and at the XSB prompt, type the directive

         ?- table(dyn_path/2).
and

         ?- load_dyn(dyn_examples).
Try the queries to path/2 of the previous examples. Note that it is important to dynamically load dyn_examples.P -- otherwise the code in the file will be compiled without knowledge of the tabling declaration.


next up previous contents index
Next: Stratified Normal Programs Up: Tabling in Definite Programs Previous: Potential Pitfalls in Tabling   Contents   Index
Baoqiu Cui
2000-04-23