XSB has two ways of evaluating predicates. The default is to use Prolog-style evaluation, but by using various declarations a programmer can also use tabled resolution which allows for a different, more declarative programming style than Prolog. In this section we discuss the various aspects of tabling and how it is implemented in XSB. Our aim in this section is to provide a user with enough information to be able to program productively in XSB. It is best to read this tutorial with a copy of XSB handy, since much of the information is presented through a series of exercises.
For the theoretically inclined, XSB uses SLG resolution which can compute queries to non-floundering normal programs under the well-founded semantics [49], and is guaranteed to terminate when these programs have the bounded term-depth property. This tutorial covers only enough of the theory of tabling to explain how to program in XSB. For those interested, the web site contains papers covering in detail various aspects of tabling (often through the links for individuals involved in XSB). An overview of SLG resolution, and practical evaluation strategies for it, are provided in [12,46,43,23]. The engine of XSB, the SLG-WAM, is an extension of the WAM [52,1], and is described in [40,39,22,42,11,19,26,15,9] as it is implemented in Version 2.5 and its performance analyzed. Examples of large-scale applications that use tabling are overviewed in [30,31,13,17,38,7,14,24].