.\" ------------------------------ sec1.t ------------------------------ .nr % 1 .lp .bp .lp .sh 1 "Introduction" .pp SB-Prolog is a public domain Prolog system based on an extension of the Warren Abstract Machine\**. .(f \** D. H. D. Warren, ``An Abstract Prolog Instruction Set'', Tech. Note 309, SRI International, 1983. .)f The WAM simulator is written in C to enhance portability. Prolog source programs can be compiled into \fIbyte code\fR files, which contain encodings of WAM instructions and are interpreted by the simulator. Programs can also be interpreted via \fIconsult\fR. .pp 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 \fIextension table\fR 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. .pp The following features are absent: we expect to incorporate them in future versions. .ip \(de A ``listing'' feature, which produces a listing of clauses in the system database. .ip \(de A garbage collector for the global stack. .ip \(de The \fIrecord\fR/\fIrecorded\fR/\fIerase\fR, \fIclause\fR and \fIcurrent_\|atom\fR/\fIcurrent_\|functor\fR/\fIcurrent_\|predicate\fR facilities of C-Prolog. .pp In addition, it should be mentioned that while interpreted and compiled code behave similarly in almost all cases, there are a few cases that we are aware of where they behave differently: .np In cuts buried within \fIif-then-else\fRs (\->): such cuts are treated as ``hard'' cuts in interpreted code (i.e. cuts away alternative clauses as well), but as ``soft'' cuts in compiled code (i.e. cuts as far back as the head of the clause, but does not cut away alternative clauses). .np In the evaluation of arithmetic expressions involving compound subexpressions created dynamically: in compiled code, this cannot be handled using \fBis\fR/2, and must be handled using \fBeval\fR/2 (see the section on Arithmetic predicates), while in interpreted code either \fBis\fR/2 or \fBeval\fR/2 is acceptable. .bp .\" ------------------------- end of section sec1.t ------------------------- .