Introduction

SB-Prolog is a Prolog system based on an extension of the Warren Abstract Machine2. The WAM simulator is written in C to enhance portability. Prolog source programs can be compiled into byte code files, which contain encodings of WAM instructions and are interpreted by the simulator. Programs can also be interpreted via consult.

SB-Prolog offers several features that are not found on most Prolog systems currently available. These include: compilation to object files; dynamic loading of predicates; provision for generating executable code on the global stack, which can be later be reclaimed; an extension table facility that permits memoization of relations. Other features include full integration between compiled and interpreted code, and a facility for the definition and expansion of macros that is fully compatible with the runtime system.

The system incorporates tail recursion optimization, and performs clause indexing in both compiled and interpreted code. However, there is no garbage collector for the global stack. This may be incorporated into a later version.

One of the few luxuries afforded to a person giving software away for free is the ability to take philosophical stances without hurting his wallet. Based on our faith in the ``declarative ideal'', viz. that pure programs with declarative readings are Good, we have attempted to encourage, where possible, a more declarative style of programming. To this end, we have deliberately chosen to not reward programs containing cuts in some situations where more declarative code is possible (see Appendix [*]). We have also resisted the temptation to make assert less expensive. We hope this will help promote a better programming style.