home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 100-199 / ff145.lzh / TinyProlog / prolog.doc < prev    next >
Text File  |  1988-05-26  |  3KB  |  72 lines

  1.                       VT-PROLOG - Very Tiny Prolog
  2.  
  3.  
  4. VT-PROLOG  is a simple prolog interpreter provided with full source  code 
  5. to encourage experimentation with PROLOG.
  6.  
  7. Loading a data base
  8. 1. You may enter rules and queries directlty from the keyboard. The        
  9.    syntax of both queries and rules is described below. Be sure to 
  10.    terminate all queries, rules and commands with a period.
  11. 2. Data bases may be stored as ASCII text files. To read a text file type 
  12.    the command:
  13.          @ filename .
  14.    where filename is a legitimate DOS filename, the default extension is 
  15.    'PRO'. If the filename contains a ':', '.' or a '\' then it must be 
  16.    enclosed in single quotes. For example, the following are legitmate 
  17.    file commands:
  18.          @ wine .
  19.          @ 'df0:wine.pro' .
  20.          @ 'df1:prolog/test/wine' .
  21. 3. VTPROLOG will read and compile the text file. Any queries included in 
  22.    the file will be executed just as if they had been typed from the 
  23.    keyboard.
  24. 4. Data base files may contain commands to read to other data base files.
  25.  
  26. Terminating VTPROLOG
  27. 1. To exit VTPROLOG, type :
  28.           EXIT .
  29.    Don't forget the period.
  30.  
  31. VTPROLOG Grammar
  32.    The following BNF describes the syntax of VTPROLOG rules and queries:
  33.  
  34.  
  35.      sentence ::- rule | query | command
  36.      rule ::- head '.' | head ':-' tail '.'
  37.      query ::- '?-' tail '.'
  38.      command ::- '@' file_name '.'
  39.      head ::- goal
  40.      tail ::- goal | goal ',' tail
  41.      goal ::- constant | variable | structure
  42.      constant ::- {quoted string} | {token beginning with 'a' .. 'z'}
  43.      variable ::- {identifier beginning with 'A' .. 'Z' or '_' }
  44.      structure ::- functor '(' component_list ')'
  45.      functor ::- {token beginning with 'a' .. 'z'}
  46.      component_list ::- term | term ',' component_list
  47.      term ::- goal | list
  48.      list ::- '[]' | '[' element_list ']'
  49.      element_list ::- term | term ',' element_list | term | term
  50.      file_name ::- {legitimate DOS file name, must be surrounded with
  51.                     single quotes if it contains a '.',':' or '\'}
  52.  
  53.  
  54.    Constant,  variable  or  functor names may be up to 80  characters  in 
  55.    length.   Constants  beginning  with  capital  letters  or  containing 
  56.    imbedded blanks, commas, paraenthesis or periods must be surrounded by 
  57.    single quote marks. Lists begin with '[' and end with ']'. Components 
  58.    separated by commas and may be constants variables, structures or other 
  59.    lists.
  60.  
  61.    Good  luck  with VTPROLOG.  We would be very interested in hearing  of 
  62.    your experiments,  enhancements or even (gasp) bugs that you may find. 
  63.    Please write to us with your comments or questions.
  64.  
  65.           Bill and Bev Thompson
  66.           C/O AI Expert Magazine
  67.           650 5th St.
  68.           Suite 311
  69.           San Francisco, CA 94107
  70.  
  71.  
  72.