home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / prolog / brklyprl.lha / Emulator / MANUAL < prev    next >
Encoding:
Text File  |  1989-04-14  |  5.2 KB  |  181 lines

  1. 6/28/88:
  2. This information should be divided into many small files,
  3. put in a separate directory, and called on demand on line.
  4. Good exercise!
  5.  
  6. FORMAT of the online commands:
  7. command_name: arg_type
  8. arg_type can be Int, NoArg, Atom or Const.
  9. An atom is just a string; a Const is either an Atom or an Int.
  10.  
  11. REMINDER: ">" is the pas prompt.
  12.  
  13. xreg: Int
  14. prints the contents of the specified X register.
  15. X1 is xreg 0, X2 xreg 1,...
  16.  
  17. yreg: Int
  18. prints the contents of the specified Y register.
  19. Y1 is yreg 0, Y2 yreg 1,...
  20.  
  21. step: NoArg
  22. executes one byte-code
  23.  
  24. next: NoArg
  25. continues execution up to the next procedure call or the end of the program,
  26. whichever comes first.
  27.  
  28. run: NoArg
  29. run the loaded program.
  30.  
  31. trace: Atom
  32. without argument, gives some help.
  33. Can trace gc activity, instruction executed, only procedure calls,
  34. value of xreg at each instruction traced, the variations of the heap
  35. at each failure, and the max amount of control stack used.
  36. To check what is traced, call status. 
  37. trace [g,i,c,x,h,s]: each one works independently as a flip-flop.
  38. > trace h     % starts to trace heap variations
  39. > trace h    % stops heap variation traces.
  40.  
  41. list: Int
  42. list the code, from the specified argument. Defaults to 0.
  43. The code really starts at -5. The first 5 byte codes are
  44. for the environment. The loaded code starts at 0.
  45.  
  46. load: Atom
  47. load a program. Should be a filename without suffix.
  48. > load qsort
  49. > load dir/tak
  50. Expects that the files qsort.w and dir/tak.w exists.
  51. Complains otherwise.
  52.  
  53. help: NoArg
  54. prints the list of available commands.
  55.  
  56. reg: Atom
  57. prints the contents of WAM system registers.
  58. reg [h,e,b,tr] (see the WAM documentation for H,E,B,TR).
  59. > reg h
  60.  
  61. reset: NoArg
  62. Reinitialize the environment. (reset registers,...)
  63. Automatically called by run.
  64.  
  65. stop: Int
  66. sets a break point at specified line. Works as a flip-flop.
  67. Only one break point is possible at a time. To remove the break point,
  68. just say: stop.
  69. > stop 10     % set a break point at line 10
  70. > stop         % remove the break point
  71. To check whether a break point is set or not, do:
  72. > status
  73.  
  74. cont: Int
  75. Traditional continues (like in dbx) continues execution up to the next 
  76. break point. I think this is rather useless. Much more useful is to
  77. be able to continue up to a specified number of occurrences of the
  78. break point. It is what this cont with one argument does.
  79. > cont 3    % skips three break points and stop to the next one.
  80.  
  81. print: Atom
  82. print [e,b]: prints the contents of the current environment or choice point.
  83. Obsolete.
  84.  
  85. compile: Atom
  86. compile a file and then loads it. 
  87. > compile a    % expects a.pl or a.w to be there. If a.w is there,
  88. loads it. Otherwise compile a.pl and loads the resulting a.w
  89.  
  90. status: NoArg
  91. gives information on what is currently traced, if the break point is set,
  92. whether profiling is under action.
  93.  
  94. breadth: Int
  95. Sets the breadth limit for printing things. Mainly used to print out
  96. results; also used by heap (not very elegant; should be changed).
  97.  
  98. depth: Int
  99. Sets the depth limit for printing recursive objects.
  100. In conjunction with breadth, very useful to debug programs
  101. and to go over circular structures.
  102.  
  103. mem: NoArg
  104. prints the amount of memory used in words.
  105. (currently, 1 word = 32 bits)
  106.  
  107. env: Int
  108. prints the number of environments specified, starting from the top.
  109.  
  110. cp: Int
  111. prints the number of choice points specified, starting from the top.
  112.  
  113. profile: NoArg
  114. starts/stops profiling (flip-flop). status tells you which state is active.
  115. To get the result of the profiling, just list the program using list.
  116.  
  117. argtypes: NoArg
  118. used to record the argument types at each procedure call.
  119. listproc can then be used, after execution of the program,
  120. to see with what argument each procedure was called.
  121.  
  122. listproc: NoArg
  123. (see argtypes)
  124.  
  125. database: Const
  126. allows the user to read the contents of a value stored by
  127. a set (see set & access).
  128. (inside program: set(foo, bar(bar)))
  129. > dababase foo
  130. bar(bar)
  131.  
  132. heap: Int
  133. prints the contents of the heap, starting at the specified location.
  134. The number of entries printed is given by breadth.
  135. If you use the garbage collected version, things 
  136. won't appear first at location 0, rather you should do:
  137. > reg h
  138. to get the first used location.
  139.  
  140. table: Const
  141. similar to database
  142.  
  143. heapusage: NoArg
  144. give the results on the usage of the heap. First should run
  145. the program with trace h on.
  146.  
  147. window: Int
  148. only for the garbage collector. Specifies the size of the gc window.
  149.  
  150. gc_data: NoArg
  151. prints performance data concerning garbage collection. After executing
  152. the program!
  153.  
  154. echo: Atom
  155. Like the shell echo. Just copies its input verbatim. Used in pas scripts.
  156.  
  157. fast: NoArg
  158. like run. But does not support any tracing, break point, etc...
  159. 30% faster than run.
  160.  
  161. strings: NoArg
  162. spits out the string table. Useful only for heavy debugging.
  163.  
  164. gc: Atom
  165. specifies one gc algorithm. 
  166. > gc    % will gives you the current algorithm and window size
  167. > gc h     % will give you a selection of no less than five algorithms!
  168. Don't worry about that very much; the default value is the best choice.
  169.  
  170. gc_verbose: NoArg
  171. flip-flop. When sets, gives info on the gc activity.
  172.  
  173. gc_limit: Int
  174. should not be of any use; only for debugging the garbage collector.
  175. Stops the emulator after that many calls to the garbage
  176. collector.
  177.  
  178. stack_usage: NoArg
  179. to be used only after a program is executed with trace s on.
  180. Gives the max stack usage by the program.
  181.