next up previous contents index
Next: Letting XSB Decide What Up: 5.2 Definite Programs Previous: 5.2.0.0.1 Exercises   Contents   Index

Tabling Dynamic Predicates

Dynamic predicates may be tabled just as static predicates, as the following exercise shows.

Exercise 5.2.4   For instance, restart XSB and at the 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.$\Box$

In general, as long as the directive table/1 is executed before asserting (or dynamically loading) the predicates referred to in the directive, any dynamic predicate can be tabled.



Terrance Swift 2007-10-05