home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / simtel / sigm / vols200 / vol246 / abstract.246 < prev    next >
Text File  |  1986-02-12  |  9KB  |  214 lines

  1.  
  2.     The disk SIG/M 246, in addition to the usual ancillary files, is
  3. entirely devoted to the library TORU.LBR. This is a specialized volume,
  4. which requires familiarity with Conway's game of LIFE and some previous
  5. knowledge of the programming language Convert.
  6.  
  7.  
  8.         - - - -  T O R U . L B R  - - - -
  9.  
  10.  
  11.     The motivation of the disk was to furnish an example of Convert
  12. programming, but the example is interesting in its own right. We have a
  13. typical example of programming in higher level languages, in which the
  14. language is useful for quickly obtaining results, but whose code does not
  15. deliver the speed and economy of which the CPU is capable. Convert can also
  16. be used as a macro generator, to produce efficient machine language code.
  17.  
  18.     Once one has surmounted the novelty of learning the rules of LIFE
  19. and working with some configurations which come readily to mind, it is
  20. found that some systematic investigations have to be made. Both the folklore
  21. and the few published results concerning LIFE show the results of following
  22. the evolution of all the patterns built up from a few live cells - say up
  23. to ten or twenty cells.
  24.  
  25.     Exploring all the configurations possible in a limited region is
  26. one possible investigation, which quickly turns tedious because of the
  27. exponentially large number of possibilities which have to be considered.
  28. Here there are presented three programs,
  29.  
  30.         TOR4.COM
  31.         TOR5.COM
  32.         TORX4.COM
  33.  
  34. which examine all the states possible in tori of small dimensions - namely
  35. 4 and 5. Since TOR5.COM runs for a day and a half on a 5 MHz Intel 8085,
  36. it is readily apparent that it will be hard to make an approach to a 6x6
  37. torus, not to mention any larger ones.
  38.  
  39.     This brute force approach of working systematically through all the
  40. possibilities may be somewhat questionable. When it is possible, it certainly
  41. gives results in a straightforward manner. By analyzing the results which are
  42. accessible in this form, it may be possible to formulate a more subtle approach
  43. or even to refine the crude approach quite considerably.
  44.  
  45.     This refinement is already apparent in the programs here presented.
  46. Rather than work on a complex macro assembler in Convert, results at first
  47. were taken from the programs by executing them in HEX form with NDDT, using
  48. either ^P or NDDT's disk output capabilities to obtain results.
  49.  
  50.     First, it was found that the program had to do its own writing to
  51. disk, so that the results could be saved, edited, and reproduced. It was not
  52. hard to extract this subroutine form another program and incorporate it into
  53. the torus program.
  54.  
  55.     Next, it was found that there were too many repeated solutions,
  56. because of symmetry. The torus not only has the eightfold symmetry of a
  57. square (four rotations, with or without reflection) but the pattern can be
  58. moved around on the torus. Forcing the center state to be a live cell is not
  59. a very adequate solution to the problem. For the 4x4 torus, there are 128
  60. symmerty variants of a given pattern; for a 5x5 torus there are 200 variants.
  61. Not only does this produce a pile of paper, they all have to be sorted out.
  62. So, the assembly language program produced by Convert was modified to reject
  63. redundancies due to symmetry.
  64.  
  65.     Then, it is found that it is hard to keep a computer running for
  66. long hours at a stretch. Power failures are an ever present threat, but
  67. it also happens that other uses for the computer will be found, with a
  68. certain impatience to interrupt the long program to get something else
  69. done. Consequently an interrupt and restart procedure were called for.
  70. At the same time it is nice to have the program give some reassurance
  71. that it is still alive and how far it has progressed, when it is running
  72. for long periods without actually producing output.
  73.  
  74.     Consequently, while one of these programs is running, one may
  75. exercise one of the following options, by typing the corresponding key:
  76.  
  77.         =   Type the current state (console only) as a binary
  78.             number to see how far the program has advanced.
  79.  
  80.         S   Close the output file TORn.DAT, then save a core
  81.             image as RTORn.COM.
  82.  
  83.         ^C  Close the output file and exit.
  84.  
  85. As usual, ^C typed after ^S while console output is in progress will return
  86. to CP/M, and the output file (at least its current extent) will be lost. To
  87. restart a program that was saved, simply execute the saved core image. The
  88. same program may be restarted several times in succession. Since each new
  89. image uses the same output file, the previous TORn.DAT should be renamed
  90. before restarting, supposing that its contents should be preserved.
  91.  
  92.     A word of caution - if TOR4.COM or TORX4.COM (TOR5.COM runs too
  93. long to make its execution within TORU.HLP reasonable) is to be invoked
  94. by HJELP from a menu, be sure that there is a little space on the disk to
  95. hold the .DAT file (10K is sufficient), and that the disk is not write-
  96. protected.
  97.  
  98.     As the results of a program begin to accumulate, additional ideas
  99. begin to form as to what further results could be produced, what shortcuts
  100. could be taken, and so on. Indeed, if the program is interesting at all it
  101. will continue to evolve, and may end up with little resemblance to its
  102. original form.
  103.  
  104.     For example, the results could be presented in a much more visual form,
  105. without having to resort to pen and graph paper to truly appreciate them.
  106.  
  107.     The presence of TORX4.COM in the package is an example of this kind
  108. of reasoning. Since the area that can be examined in a reasonable time is
  109. limited to 25 or 30 cells, quite a few more possibilities in LIFE can be
  110. sampled if they can be spread over different kinds of areas. Thus, some more
  111. insight could be obtained by using a 4x5 rectangle in addition to the 4x4 and
  112. 5x5 squares. A rectangle can be closed up into a torus in several ways - by
  113. giving it a slight twist for example. It could be made into a Moebius strip
  114. or some other topological figure - all these variants imply a periodic pattern
  115. in the ordinary plane which is used for LIFE. None of the variants replaces
  116. analyzing an 8x8 torus; while the latter is beyond our reach, they will still
  117. help in going beyond 4x4.
  118.  
  119.  
  120.         - - - -  H J E L P . C O M  - - - -
  121.  
  122.  
  123.     The entire library TORU.LBR is set up as both a SUBMIT file and as
  124. a HELP file. TORU.SUB can be executed by typing
  125.  
  126.         RUN (TORU)
  127.  
  128. but is probably not too interesting to most people because its only function
  129. is to use LU.COM to gather up TORU.LBR, which should NOT be on the disk prior
  130. to execution.
  131.  
  132.     On the other hand, much of TORU.LBR can be browsed by typing
  133.  
  134.         HJELP (TORU)
  135.  
  136. and then working through the menus as in any other HELP file. HJELP has been
  137. slightly modified for this disk, so that it maintains its own private I-O
  138. area. This is necessary because of the new feature which has been added, that
  139. .COM files can be incorporated in the menus and executed as part of HJELP. If
  140. the file under execution also performs I-O to disk, it is essential that this
  141. not clash with the I-O which HJELP will need to continue offering its menu and
  142. passing to still further selections.
  143.  
  144.     It is still work for the future, to adapt embedded programs to the
  145. format of HJELP. For instance, HJELP works best with 22 line panels, but this
  146. is not the best format for a printed page. Thus if sample program output is
  147. simply incorporated without revision into a HELP library, as is done in TORU,
  148. its display will not be very aesthetic.
  149.  
  150.     Likewise, if a sample program produces copious output which runs off
  151. the screen before it can be analyzed, its value is greatly diminished and the
  152. reader is likely to be greatly annoyed.
  153.  
  154.  
  155.         - - - -  A N C I . L B R  - - - -
  156.  
  157.  
  158.     Since most SIG/M volumes contain a fixed set of ancillary programs,
  159. we have decided to collect them into a library, so that they can be passed
  160. as a group to a new disk which is under preparation. ANCI.LBR contains:
  161.  
  162.         USQ.COM        unsqueeze squeezed files
  163.         REC.COM        recent version of REC80.COM
  164.         CRC.COM        cyclic redundancy check
  165.         LU.COM        pack and unpack libraries
  166.  
  167.     Two further ancillary programs,
  168.  
  169.         CNVSM.REC    Cnvrt compiler
  170.         CNVLIB.REC    Cnvrt runtime library
  171.  
  172. are not included in the library because REC will not run programs from
  173. the inside of a library, and to spare the user the inconvenience of having
  174. to unpack them. Those LIFE enthusiasts who merely want to examine some LIFE
  175. cycles will not need REC or Convert, but those who wish to see how Convert
  176. is used to transform a protocol into an assembly language program may wish
  177. to try out the process or to modify it.
  178.  
  179.     Finally, the programs
  180.  
  181.         RUN.COM        execute submit files & library programs
  182.         HJELP.COM    browse through HELP files
  183.  
  184. were left outside of ANCI.LBR. RUN has to be, of course; HJELP gives the
  185. most direct access to the main content of the disk and there is no need to
  186. have to type RUN ((ANCI) HJELP) (TORU).
  187.  
  188.     For example:
  189.  
  190.         To run the cyclic redundancy check, type
  191.  
  192.             RUN  ((ANCI) CRC)
  193.  
  194.         To extract a library file, type
  195.  
  196.             RUN  ((ANCI) LU)
  197.  
  198.             and follow the normal instructions for LU.
  199.  
  200.         To unsqueeze FILE.EQT, type
  201.  
  202.             RUN  ((ANCI) USQ) FILE.EQT
  203.  
  204.         To see the main feature, type
  205.  
  206.             RUN (TORU)
  207.  
  208.  
  209.  
  210.  
  211.  
  212. [end]
  213. [Harold V. Mcintosh, 9 August 1985]
  214.