next up previous contents index
Next: Tabling in Definite Programs Up: Using Tabling in XSB: Previous: Using Tabling in XSB:   Contents   Index


XSB as a Prolog System

Before describing how to program using tabling it is perhaps worthwhile reviewing some of the goals of XSB

  1. To execute tabled predicates at the speed of compiled Prolog.
  2. To ensure that the speed of compiled Prolog is not slowed significantly by adding the option of tabling.
  3. To execute that the functionality of Prolog is not compromised by support for tabling.
  4. To provide Prolog functionality in tabled predicates whenever it is semantically sensible to do so.
  5. To provide standard predicates to manipulate tables taken as objects in themselves.

Goals 1 and 2 are addressed by XSBs engine, which in Version 2.2 is based on a memory-copying version of a virtual machine called the SLG-WAM. The overhead for SLD resolution using this machine is negligible. Thus when XSB is used simply as a Prolog system (i.e., no tabling is used), it is reasonably competitive with other Prolog implementations based on a WAM emulator written in C or assembly. For example, XSB Version 1.6 is about two to three times slower than Quintus 3.1.1 or emulated SICStus Prolog 3.1.

Goals 3, 4 and 5 have been nearly met, but there are a few instances in which interaction of tabling with a Prolog construct has been accomplished, or is perhaps impossibe. Accordingly we discuss these instances throughout this chapter. XSB is still under development however, so that future versions may support more transparent mixing of Prolog and tabled code (e.g. allowing tabled predicates in the scope of ${\tt '\backslash+'/1}$) or adding Prolog functionality to tabled predicates (e.g. allowing non-ground negation in tnot/1).


next up previous contents index
Next: Tabling in Definite Programs Up: Using Tabling in XSB: Previous: Using Tabling in XSB:   Contents   Index
Baoqiu Cui
2000-04-23