next up previous contents index
Next: 5.2.3 Interaction Between Prolog Up: 5.2 Definite Programs Previous: 5.2.1.0.3 Declarations for Call   Contents   Index


5.2.2 Table Scheduling Strategies

¶ Recall that SLD resolution works by selecting a goal from a list of goals to be proved, and selecting a program clause $C$ to resolve against that goal. During resolution of a top level goal $G$, if the list of unresolved goals becomes empty, $G$ succeeds, while if there is no program clause to resolve against the selected goal from the list resolution against $G$ fails. In Prolog clauses are selected in the order they are asserted, while literals are selected in a left-to-right selection strategy. Other strategies are possible for SLD, and in fact completeness of SLD for definite programs depends on a non-fixed literal selection strategy. This is why Prolog, which has a fixed literal selection strategy is not complete for definite programs, even when they have bounded term-depth.

Because tabling uses program clause resolution, the two parameters of clause selection and literal selection also apply to tabling. Tabling makes use of a dynamic literal selection strategy for certain non-stratified programs (via the delaying mechanism described in Section 5.3.2), but uses the same left-to-right literal selection strategy as Prolog for definite programs. However, in tabling there is also a choice of when to return derived answers to subgoals that consume these answers. While full discussion of scheduling strategies for tabling is not covered here (see [26]) we discuss two scheduling strategies that have been implemented for XSB Version 3.0 5.4.

Both Local and Batched Scheduling have their advantages, and we list points of comparison.

On the whole, advantages of Local Scheduling outweigh the advantages of Batched Scheduling, and for this reason Local Scheduling is the default scheduling strategy for Version 3.0 of XSB. XSB can be configured to use batched scheduling via the configuration option -enable-batched-scheduling and remaking XSB. This will not affect the default version of XSB, which will also remain available.


next up previous contents index
Next: 5.2.3 Interaction Between Prolog Up: 5.2 Definite Programs Previous: 5.2.1.0.3 Declarations for Call   Contents   Index
Terrance Swift 2007-10-05