Stony Brook Prolog Translator: User Guide 1. Invoking the Translator: ========================== The translator is invoked via the predicate "compile", whose usage is as follows: ?- compile( Input_File [, Output_File ] [, Options ] ). Input_File is the name of the file containing the Prolog source program to be compiled. It must be a Prolog atom, i.e. if it does not begin with a lower-case letter, or contains special characters, it must be enclosed within quotes. Output_File is the name of the file intended to contain the byte code generated by the translator, and is optional. If specified, it must be a Prolog atom, like Input_File. If omitted, it defaults to the string obtained by appending a ".out" suffix to the input file name. Options is a Prolog list of compiler options. Options currently recognized by the translator are: v : if specified, turns on the verbose mode. In this mode, the translator prints out brief messages describing its progress. Handy if the program to be translated is large or the system is slow. DEFAULT: off. a : If specified, generates a symbolic "assembly" file in addition to the byte code, which may itself be assembled separately. The additional reading/writing involved slows down the translator. The assembly file name is the string obtained by appending ".asl" to the input file name. DEFAULT: off. Example: ?- compile('/users/foo',[v],foo_targ). specifies that the file '/users/foo' is to be translated in verbose mode, and the byte-code is to be generated into file 'foo_targ'. Note that the output-file and options list can be specified in any order. 2. Environment: ============== The translator uses many of the builtins and library routines in the directory "lib" in this package. The environment variable SIMPATH should be set up to include the "lib" and "cmplib" directories. 3. Inline, Built-in and Internal Predicates: =========================================== Built-in predicates are defined in the directory "lib", and may be redefined by the user. They are loaded dynamically according to the search order specified in SIMPATH. Their functionality is essentially that of C-Prolog, and the user is referred to the C-Prolog User Manual for details. A point to note is that the system distinguishes between "inline" predicates and "builtin" predicates. Inline predicates have in-line code generated for them, and cannot be redefined; built-ins are defined out-of-line and loaded dynamically as necessary, and hence may be redefined. Inline predicates include var/1, nonvar/1, is/2, =/2, >/2, >=/2, =