home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / OSK / EFFO / pd3.lzh / SBPROLOG2.2 / CMPLIB / Readme < prev   
Text File  |  1991-08-10  |  3KB  |  73 lines

  1. Stony Brook Prolog Translator: User Guide
  2.  
  3. 1. Invoking the Translator:
  4. ==========================
  5.  
  6. The translator is invoked via the predicate "compile", whose usage is as
  7. follows:
  8.  
  9.     ?- compile( Input_File [, Output_File ] [, Options ] ).
  10.  
  11. Input_File is the name of the file containing the Prolog source program to
  12. be compiled.  It must be a Prolog atom, i.e. if it does not begin with a
  13. lower-case letter, or contains special characters, it must be enclosed
  14. within quotes.
  15.  
  16. Output_File is the name of the file intended to contain the byte code
  17. generated by the translator, and is optional.  If specified, it must be a
  18. Prolog atom, like Input_File.  If omitted, it defaults to the string
  19. obtained by appending a ".out" suffix to the input file name.
  20.  
  21. Options is a Prolog list of compiler options.  Options currently recognized
  22. by the translator are:
  23.  
  24.     v    : if specified, turns on the verbose mode.  In this mode,
  25.           the translator prints out brief messages describing its
  26.           progress.  Handy if the program to be translated is
  27.           large or the system is slow.  DEFAULT: off.
  28.  
  29.     a    : If specified, generates a symbolic "assembly" file in
  30.           addition to the byte code, which may itself be assembled
  31.           separately.  The additional reading/writing involved
  32.           slows down the translator.  The assembly file name is
  33.           the string obtained by appending ".asl" to the input
  34.           file name.  DEFAULT: off.
  35.  
  36. Example: 
  37.  
  38.     ?- compile('/users/foo',[v],foo_targ).
  39.  
  40. specifies that the file '/users/foo' is to be translated in verbose mode,
  41. and the byte-code is to be generated into file 'foo_targ'.  Note that the
  42. output-file and options list can be specified in any order.
  43.  
  44. 2. Environment:
  45. ==============
  46.  
  47. The translator uses many of the builtins and library routines in the
  48. directory "lib" in this package.  The environment variable SIMPATH should
  49. be set up to include the "lib" and "cmplib" directories.
  50.  
  51. 3. Inline, Built-in and Internal Predicates:
  52. ===========================================
  53.  
  54. Built-in predicates are defined in the directory "lib", and may be redefined
  55. by the user.  They are loaded dynamically according to the search order
  56. specified in SIMPATH.  Their functionality is essentially that of C-Prolog,
  57. and the user is referred to the C-Prolog User Manual for details.
  58.  
  59. A point to note is that the system distinguishes between "inline" predicates
  60. and "builtin" predicates.  Inline predicates have in-line code generated for
  61. them, and cannot be redefined; built-ins are defined out-of-line and loaded
  62. dynamically as necessary, and hence may be redefined.  Inline predicates
  63. include var/1, nonvar/1, is/2, =/2, >/2, >=/2, =</2, </2, =:=/2, =\=/2,
  64. fail/0, true/0, halt/0, !/0.  Note that is/2, as implemented, DOES NOT HANDLE
  65. the case where a variable gets bound to a structure and is evaluated at
  66. runtime: for this, the user should use the library routine eval/2.
  67.  
  68. There is also a set of internal predicates, whose names all begin with
  69. '_$', which are not visible to users, and which I won't tell you about.
  70. Users who define predicates whose names begin with '_$' do so at their own
  71. risk.
  72.  
  73.