home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / s / sd-27.zip / database.doc < prev    next >
Text File  |  1992-11-26  |  69KB  |  1,655 lines

  1. The setups that the program recognizes are as follows
  2. (from database.h, enumeration type "setup_kind"), each is
  3. shown with a map giving the person numbering:
  4.  
  5.              _____
  6.             |     |
  7. 1x1         |  0  |                    (4 way symmetry)
  8.             |_____|
  9.  
  10.  
  11.              _____ _____
  12.             |     |     |
  13. 1x2         |  0  |  1  |
  14.             |_____|_____|
  15.  
  16.  
  17.              _____ _____ _____
  18.             |     |     |     |
  19. 1x3         |  0  |  1  |  2  |
  20.             |_____|_____|_____|
  21.  
  22.  
  23.              _____ _____ _____ _____
  24.             |     |     |     |     |
  25. 1x4         |  0  |  1  |  3  |  2  |
  26.             |_____|_____|_____|_____|
  27.  
  28.  
  29.              _____ _____ _____ _____ _____ _____
  30.             |     |     |     |     |     |     |
  31. 1x6         |  0  |  1  |  2  |  5  |  4  |  3  |
  32.             |_____|_____|_____|_____|_____|_____|
  33.  
  34.  
  35.              _____ _____ _____ _____ _____ _____ _____ _____
  36.             |     |     |     |     |     |     |     |     |
  37. 1x8         |  0  |  1  |  3  |  2  |  6  |  7  |  5  |  4  |
  38.             |_____|_____|_____|_____|_____|_____|_____|_____|
  39.  
  40.  
  41.              _____ _____ _____ _____ _____ _____ _____ ___________ _____
  42.             |     |     |     |     |     |     |     |     |     |     |
  43. 1x10        |  0  |  1  |  2  |  3  |  4  |  9  |  8  |  7  |  6  |  5  |
  44.             |_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|
  45.  
  46.  
  47.              _____ _____ _____ _____ _____ _____ _____ ___________ _____ _____ _____
  48.             |     |     |     |     |     |     |     |     |     |     |     |     |
  49. 1x12        |  0  |  1  |  2  |  3  |  4  |  5  | 11  | 10  |  9  |  8  |  7  |  6  |
  50.             |_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|
  51.  
  52.  
  53.              _____ _____ _____ _____ _____ _____ _____ ___________ _____ _____ _____ _____ _____
  54.             |     |     |     |     |     |     |     |     |     |     |     |     |     |     |
  55. 1x14        |  0  |  1  |  2  |  3  |  4  |  5  |  6  | 13  | 12  | 11  | 10  |  9  |  8  |  7  |
  56.             |_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|
  57.  
  58.  
  59.              _____ _____ _____ _____ _____ _____ _____ ___________ _____ _____ _____ _____ _____ _____ _____
  60.             |     |     |     |     |     |     |     |     |     |     |     |     |     |     |     |     |
  61. 1x16        |  0  |  1  |  2  |  3  |  4  |  5  |  6  |  7  | 15  | 14  | 13  | 12  | 11  | 10  |  9  |  8  |
  62.             |_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|
  63.  
  64.  
  65.              _____ _____
  66.             |     |     |
  67.             |  0  |  1  |
  68. 2x2         |_____|_____|              (4 way symmetry)
  69.             |     |     |
  70.             |  3  |  2  |
  71.             |_____|_____|
  72.  
  73.  
  74.              _____ _____ _____
  75.             |     |     |     |
  76.             |  0  |  1  |  2  |
  77. 2x3         |_____|_____|_____|
  78.             |     |     |     |
  79.             |  5  |  4  |  3  |
  80.             |_____|_____|_____|
  81.  
  82.  
  83.              _____ _____ _____ _____
  84.             |     |     |     |     |
  85.             |  0  |  1  |  2  |  3  |
  86. 2x4         |_____|_____|_____|_____|
  87.             |     |     |     |     |
  88.             |  7  |  6  |  5  |  4  |
  89.             |_____|_____|_____|_____|
  90.  
  91.  
  92.              _____ _____ _____ _____ _____ _____
  93.             |     |     |     |     |     |     |
  94.             |  0  |  1  |  2  |  3  |  4  |  5  |
  95. 2x6         |_____|_____|_____|_____|_____|_____|
  96.             |     |     |     |     |     |     |
  97.             | 11  | 10  |  9  |  8  |  7  |  6  |
  98.             |_____|_____|_____|_____|_____|_____|
  99.  
  100.  
  101.              _____ _____ _____ _____ _____ _____ _____ _____
  102.             |     |     |     |     |     |     |     |     |
  103.             |  0  |  1  |  2  |  3  |  4  |  5  |  6  |  7  |
  104. 2x8         |_____|_____|_____|_____|_____|_____|_____|_____|
  105.             |     |     |     |     |     |     |     |     |
  106.             | 15  | 14  | 13  | 12  | 11  | 10  |  9  |  8  |
  107.             |_____|_____|_____|_____|_____|_____|_____|_____|
  108.  
  109.                    _____
  110.              _____|     |_____
  111.             |     |  1  |     |
  112. dmd         |  0  |_____|  2  |
  113.             |_____|     |_____|
  114.                   |  3  |
  115.                   |_____|
  116.  
  117.  
  118.                    _____
  119.                   |     |
  120.                   |  1  |
  121.              _____|_____|_____
  122.             |     |     |     |
  123. star        |  0  |     |  2  |        (4 way symmetry)
  124.             |_____|_____|_____|
  125.                   |     |
  126.                   |  3  |
  127.                   |_____|
  128.  
  129.  
  130.              _____             _____
  131.             |     |_____ _____|     |
  132.             |  0  |     |     |  1  |
  133. bone6       |_____|  5  |  2  |_____|
  134.             |     |_____|_____|     |
  135.             |  4  |           |  3  |
  136.             |_____|           |_____|
  137.  
  138.  
  139.                 _____
  140.                |     |
  141.                |  1  |
  142.              __|__ __|__
  143.             |     |     |
  144.             |  0  |  2  |
  145. short6      |_____|_____|
  146.             |     |     |
  147.             |  5  |  3  |
  148.             |_____|_____|
  149.                |     |
  150.                |  4  |
  151.                |_____|
  152.  
  153.  
  154.                    _____ _____
  155.                   |     |     |
  156.                   |  0  |  1  |
  157.              _____|_____|_____|_____
  158.             |     |     |     |     |
  159. qtag        |  6  |  7  |  3  |  2  |
  160.             |_____|_____|_____|_____|
  161.                   |     |     |
  162.                   |  5  |  4  |
  163.                   |_____|_____|
  164.  
  165.              _____                         _____
  166.             |     |_____ _____ _____ _____|     |
  167.             |  0  |     |     |     |     |  1  |
  168. bone        |_____|  6  |  7  |  3  |  2  |_____|
  169.             |     |_____|_____|_____|_____|     |
  170.             |  5  |                       |  4  |
  171.             |_____|                       |_____|
  172.  
  173.  
  174.                          _____ _____
  175.              _____ _____|     |     |_____ _____
  176.             |     |     |  0  |  1  |     |     |
  177. rigger      |  6  |  7  |_____|_____|  3  |  2  |
  178.             |_____|_____|     |     |_____|_____|
  179.                         |  5  |  4  |
  180.                         |_____|_____|
  181.  
  182.  
  183.                    _____ _____ _____
  184.              _____|     |     |     |_____
  185.             |     |  0  |  1  |  2  |     |
  186. spindle     |  7  |_____|_____|_____|  3  |
  187.             |_____|     |     |     |_____|
  188.                   |  6  |  5  |  4  |
  189.                   |_____|_____|_____|
  190.  
  191.  
  192.                 _____ _____
  193.                |     |     |
  194.                |  0  |  1  |
  195.                |_____|_____|
  196.              _____|     |_____
  197.             |     |  3  |     |
  198. hrglass     |  6  |_____|  2  |
  199.             |_____|     |_____|
  200.                   |  7  |
  201.                 __|__ __|__
  202.                |     |     |
  203.                |  5  |  4  |
  204.                |_____|_____|
  205.  
  206.  
  207.                               _____
  208.                              |     |
  209.                              |  2  |
  210.                              |_____|
  211.              _____ _____     |     |     _____ _____
  212.             |     |     |    |  3  |    |     |     |
  213. crosswave   |  0  |  1  |    |_____|    |  5  |  4  |
  214.             |_____|_____|    |     |    |_____|_____|
  215.                              |  7  |
  216.                              |_____|
  217.                              |     |
  218.                              |  6  |
  219.                              |_____|
  220.  
  221.              _____ _____ _____ _____
  222.             |     |     |     |     |
  223.             |  0  |  1  |  2  |  3  |
  224.             |_____|_____|_____|_____|
  225.             |     |     |     |     |
  226. 3x4         | 10  | 11  |  5  |  4  |
  227.             |_____|_____|_____|_____|
  228.             |     |     |     |     |
  229.             |  9  |  8  |  7  |  6  |
  230.             |_____|_____|_____|_____|
  231.  
  232.  
  233.              _____ _____ _____ _____
  234.             |     |     |     |     |
  235.             | 12  | 13  | 14  |  0  |
  236.             |_____|_____|_____|_____|
  237.             |     |     |     |     |
  238.             | 10  | 15  |  3  |  1  |
  239. 4x4         |_____|_____|_____|_____|            (4 way symmetry)
  240.             |     |     |     |     |
  241.             |  9  | 11  |  7  |  2  |
  242.             |_____|_____|_____|_____|
  243.             |     |     |     |     |
  244.             |  8  |  6  |  5  |  4  |
  245.             |_____|_____|_____|_____|
  246.  
  247.  
  248.              _____ _____ _____ _____ _____ _____
  249.             |     |     |     |     |     |     |
  250.             |  0  |  1  |  2  |  3  |  4  |  5  |
  251.             |_____|_____|_____|_____|_____|_____|
  252.             |     |     |     |     |     |     |
  253.             | 11  | 10  |  9  |  8  |  7  |  6  |
  254. 4x6         |_____|_____|_____|_____|_____|_____|
  255.             |     |     |     |     |     |     |
  256.             | 18  | 19  | 20  | 21  | 22  | 23  |
  257.             |_____|_____|_____|_____|_____|_____|
  258.             |     |     |     |     |     |     |
  259.             | 17  | 16  | 15  | 14  | 13  | 12  |
  260.             |_____|_____|_____|_____|_____|_____|
  261.  
  262.                    _____             _____
  263.                   |     |           |     |
  264.                   |  1  |           |  4  |
  265.              _____|_____|_____ _____|_____|_____
  266.             |     |     |     |     |     |     |
  267.             |  0  |     |  2  |  7  |     |  5  |
  268.             |_____|_____|_____|_____|_____|_____|
  269.                   |     |           |     |
  270.                   |  3  |           |  6  |
  271. c1phan            |_____|           |_____|         (4 way symmetry)
  272.                   |     |           |     |
  273.                   | 14  |           | 11  |
  274.              _____|_____|___________|_____|_____
  275.             |     |     |     |     |     |     |
  276.             | 13  |     | 15  | 10  |     |  8  |
  277.             |_____|_____|_____|_____|_____|_____|
  278.                   |     |           |     |
  279.                   | 12  |           |  9  |
  280.                   |_____|           |_____|
  281.  
  282.  
  283.                          _____ _____
  284.                         |     |     |
  285.                         |  0  |  1  |
  286.                    _____|_____|_____|_____
  287.                   |     |     |     |     |
  288.                   | 21  | 22  |  2  |  3  |
  289.              _____|_____|_____|_____|_____|_____
  290.             |     |     |     |     |     |     |
  291.             | 19  | 20  | 23  |  5  |  4  |  6  |
  292. bigblob     |_____|_____|_____|_____|_____|_____|      (4 way symmetry)
  293.             |     |     |     |     |     |     |
  294.             | 18  | 16  | 17  | 11  |  8  |  7  |
  295.             |_____|_____|_____|_____|_____|_____|
  296.                   |     |     |     |     |
  297.                   | 15  | 14  | 10  |  9  |
  298.                   |_____|_____|_____|_____|
  299.                         |     |     |
  300.                         | 13  | 12  |
  301.                         |_____|_____|
  302.  
  303.  
  304.                       _____
  305.                      |     |
  306.                      |  2  |
  307.                    __|__ __|__
  308.              _____|     |     |_____
  309.             |     |  1  |  3  |     |
  310. galaxy      |  0  |_____|_____|  4  |     (4 way symmetry)
  311.             |_____|     |     |_____|
  312.                   |  7  |  5  |
  313.                   |_____|_____|
  314.                      |     |
  315.                      |  6  |
  316.                      |_____|
  317.  
  318.                    _____             _____
  319.              _____|     |_____ _____|     |_____
  320.             |     |  1  |     |     |  7  |     |
  321. ptpd        |  0  |_____|  2  |  6  |_____|  4  |
  322.             |_____|     |_____|_____|     |_____|
  323.                   |  3  |           |  5  |
  324.                   |_____|           |_____|
  325.  
  326.  
  327.                             _____
  328.                            |     |
  329.                            |  3  |
  330.              _____ _____ __|__ __|__ _____ _____
  331.             |     |     |     |     |     |     |
  332. 3x1dmd      |  0  |  1  |  2  |  6  |  5  |  4  |
  333.             |_____|_____|_____|_____|_____|_____|
  334.                            |     |
  335.                            |  7  |
  336.                            |_____|
  337.  
  338.  
  339.                 _____       _____       _____
  340.                |     |     |     |     |     |
  341.                |  0  |     |  1  |     |  2  |
  342.              __|__ __|__ __|__ __|__ __|__ __|__
  343.             |     |     |     |     |     |     |
  344. 3dmd        |  9  | 10  | 11  |  5  |  4  |  3  |
  345.             |_____|_____|_____|_____|_____|_____|
  346.                |     |     |     |     |     |
  347.                |  8  |     |  7  |     |  6  |
  348.                |_____|     |_____|     |_____|
  349.  
  350.  
  351.                 _____       _____       _____       _____
  352.                |     |     |     |     |     |     |     |
  353.                |  0  |     |  1  |     |  2  |     |  3  |
  354.              __|__ __|__ __|__ __|__ __|__ __|__ __|__ __|__
  355.             |     |     |     |     |     |     |     |     |
  356. 4dmd        | 12  | 13  | 14  | 15  |  7  |  6  |  5  |  4  |
  357.             |_____|_____|_____|_____|_____|_____|_____|_____|
  358.                |     |     |     |     |     |     |     |
  359.                | 11  |     | 10  |     |  9  |     |  8  |
  360.                |_____|     |_____|     |_____|     |_____|
  361.  
  362.  
  363.  
  364.  
  365.                                _____
  366.                               |     |
  367.                               |  3  |
  368.              _____ _____ _____|_____|_____ _____ _____
  369.             |     |     |     |     |     |     |     |
  370. wingedstar  |  0  |  1  |  2  |     |  6  |  5  |  4  |
  371.             |_____|_____|_____|_____|_____|_____|_____|
  372.                               |     |
  373.                               |  7  |
  374.                               |_____|
  375.  
  376.  
  377.  
  378.                          _____
  379.                _____    |     |    _____
  380.               |     |   |  3  |   |     |
  381.               |  2  |   |_____|   |  5  |
  382.               |_____|   |     |   |_____|
  383.                         |  4  |
  384.              _____ _____|_____|_____ _____
  385.             |     |     |     |     |     |
  386. hyperglass  |  0  |  1  |     |  7  |  6  |      (4 way symmetry)
  387.             |_____|_____|_____|_____|_____|    (internal use only!)
  388.                         |     |
  389.                _____    | 10  |    _____
  390.               |     |   |_____|   |     |
  391.               | 11  |   |     |   |  8  |
  392.               |_____|   |  9  |   |_____|
  393.                         |_____|
  394.  
  395.  
  396.              _____ _____
  397.             |     |     |
  398.             |  1  |  2  |
  399. trngl       |_____|_____|      (1 way symmetry -- leads to strange
  400.                |     |         requirements in call descriptions)
  401.                |  0  |
  402.                |_____|
  403.  
  404.  
  405.  
  406. thar
  407. nothing            ??????
  408. normal_concentric  ??????
  409.  
  410.  
  411. An important property of these setups, used extensively by the program,
  412. is that any person's diagonal opposite can be found by adding half the
  413. setup size modulo the setup size.  Additionally, for setups that have
  414. 4 way symmetry, the person 90 degrees clockwise from a given person can
  415. be found by adding one quarter of the setup size modulo the setup size.
  416.  
  417. Before going further, we must distinguish between
  418. a "beginning setup kind" and an "ending setup kind".
  419. These are described internally by the enumerations "begin_kind" and
  420. "setup_kind", respectively, in the file database.h, by the way.
  421.  
  422. Ending setup kinds correspond to the diagrams shown earlier.  They do
  423. not distinguish between 90 degree rotated versions of the same setup.
  424. Beginning setup kinds are more numerous because they DO distinguish
  425. between the 90 degree rotated versions of those setups that do not
  426. have 4 way symmetry.  That is, they take into account the difference
  427. between lines and columns, so that a call definition can indicate
  428. separate actions for people in lines vs. people in columns in the
  429. same 2x4 setup.
  430.  
  431. The set of beginning setup kinds is just the set of ending setup kinds
  432. (that is, the diagrams above) augmented by 90 degree rotated versions
  433. of those setups that don't have 4 way symmetry.  The names of these
  434. extra setups (called "PU" setups) are typically formed by reversing
  435. the matrix size numbers (1x4 vs. 4x1, for example) or by putting
  436. the letter "p" in front, as in "pqtag".
  437.  
  438. The extra beginning setup kinds are as follows:
  439.  
  440.            normal setup           "PU" setup
  441.  
  442.                 1x2                  2x1
  443.                 dmd                  pmd
  444.                 trngl                ptrngl
  445.                 bone6                pbone6
  446.                 short6               pshort6
  447.                 qtag                 pqtag
  448.                 wing                 pwing
  449.                 spindle              pspindle
  450.                 hrglass              phrglass
  451.                 1x4                  4x1
  452.                 1x8                  8x1
  453.                 1x10                 10x1
  454.                 1x12                 12x1
  455.                 1x14                 14x1
  456.                 1x16                 16x1
  457.                 2x4                  4x2
  458.                 2x3                  3x2
  459.                 1x6                  6x1
  460.                 3x4                  4x3
  461.                 2x6                  6x2
  462.                 2x8                  8x2
  463.                 ptpd                 pptpd
  464.                 3x1dmd               p3x1dmd
  465.                 3dmd                 p3dmd
  466.                 4dmd                 p4dmd
  467.  
  468. This correspondence is embodied in the program by means of the table
  469. "keytab" in the file sdtables.c, by the way.
  470.  
  471. A call definition by array consists of one or more descriptors that look like:
  472.  
  473.          setup <beginning setup kind> <ending setup kind>
  474.             array [<person action> <person action> ...]
  475.  
  476. So, for example, the description of the call "drift apart" looks as follows:
  477.  
  478.    setup 2x4 2x4
  479.       array [M6S M4S M7S M5S L2S L0S R3S R1S]
  480.    setup 4x2 2x4
  481.       array [R6S M4N 3LS M5S M2S R4S M3N L1S]
  482.  
  483. The first descriptor tells people who think they are in lines what to do,
  484. and the second descriptor addresses people in columns.  For calls that start
  485. in a setup with 4 way symmetry, there is only one descriptor as in the
  486. following definition of "reach out":
  487.  
  488.    setup 2x2 1x4
  489.       array [M3S M1S R2S L0S]
  490.  
  491. It is never appropriate for a PU setup, such as "4x2", to
  492. appear as the SECOND token after the word "setup".  Only the FIRST token
  493. may be such a setup.
  494.  
  495. An entry of zero in the array means that the call would be illegal for
  496. anyone in that position, e.g. the leaders in the call "right and left thru".
  497.  
  498. We can now show the interpretation of a call descriptor for a very simple case,
  499. when the beginning and ending formations are both in normal orientation,
  500. as shown in diagrams above.  In this case the beginning setup will have the
  501. same name as an ending setup.  The list in brackets will have as many items
  502. as there are people in the beginning setup.  Each person finds his position
  503. number in that setup, assuming he is facing north.  It is as though everyone
  504. were given the diagrams listed above, and held the diagram in front of him
  505. to determine his position.  Once he determines his position, he looks at that
  506. item in the bracketed array (starting with zero, of course) to determine
  507. what to do.  The number says what position in the ending setup that person
  508. should move to.  The letter (N, E, S, or W) after the number tells what
  509. facing direction to take (north, east, south, or west).  Both of these are
  510. interpreted relative to the diagram that the person is holding in front of him.
  511. So, for example, a direction of north indicates that that person does not
  512. change facing direction, east indicates that that person finishes 90 degrees
  513. clockwise from his starting orientation, and so on.  Note that all directions
  514. are north for the call "walk and dodge", and are south for the call "reach
  515. out".  This is so even if the calls are done from T-boned formations.
  516.  
  517. Finally, the optional letter before the number tells that person's roll
  518. direction.  "L" and "R" indicate that the person will quarter left or
  519. right if told to roll after the call.  "M" ("middle") says that the
  520. person knows that he can't roll, and will stay facing the same direction.
  521. No letter means that the person's roll direction is undefined
  522. (or controversial, or not implemented yet) and an error will be given if
  523. that person is told to roll.  For example, roll is considered illegal
  524. after "wheel fan and cross thru".
  525.  
  526. Example:
  527.      In "reach out", the first array item, which is "M3S", says that any
  528. person in the starting 2x2 box who is a lead beau (position 0 in the
  529. diagram) should think of a 1x4 line elongated laterally relative to himself,
  530. and should go to the second spot from the right end (position 3), turn 180
  531. degrees, and refuse to roll.
  532.  
  533.       This person ---+
  534.                      |
  535.                      |
  536.                    __V__ _____
  537.                   |     |     |
  538.                   |  0  |     |
  539.                   |_____|_____|
  540.                   |     |     |
  541.                   |     |     |
  542.                   |_____|_____|
  543.  
  544.           goes here -------+
  545.                            |
  546.                            |
  547.              _____ _____ __V__ _____
  548.             |     |     |     |     |
  549.             |     |     |  3  |     |
  550.             |_____|_____|_____|_____|
  551.  
  552. If people are T-boned, the application of these rules could result in
  553. people fighting over which way the resulting 1x4 should be oriented.
  554. The program will resolve this by turning the result into a diamond if
  555. it can, or giving an error otherwise.
  556.  
  557. We will now go through all the cases in a somewhat methodical way.
  558.  
  559.             BEGINNING AND ENDING SETUPS DO NOT HAVE 4 WAY SYMMETRY,
  560.                         CALL IS NON-ROTATING
  561.  
  562.    We consider a call to be non-rotating if the starting and ending setups
  563.    have consistent orientation relative to the diagrams above.  That is,
  564.    if the beginning setup is oriented as shown in one of the diagrams,
  565.    the ending setup will also be as shown in one of the diagrams.  Any
  566.    "non-shape-changer" is such a call.  Switch to a diamond is also
  567.    non-rotating.  Reverse flip the diamond is not.
  568.  
  569. In this case, each person holds the diagram in front of him, in normal
  570. orientation if possible, so that he is facing north, and reads his
  571. position number from it.  He then looks that the correspondingly numbered
  572. element of the array describing the call in the database, and goes to
  573. the indicated spot in the result setup, using the same orientation
  574. of the set of diagrams.  For example, on the call "circulate" from a 2x4,
  575. anyone who thinks he is in lines and is the second from the left looking
  576. out, will do this:
  577.  
  578.       This person ---+
  579.                      |
  580.                      |
  581.              _____ __V__ _____ _____
  582.             |     |     |     |     |
  583.             |     |  1  |     |     |
  584.             |_____|_____|_____|_____|
  585.             |     |     |     |     |
  586.             |     |     |     |     |
  587.             |_____|_____|_____|_____|
  588.  
  589.       looks at item number 1 in the call definition array, which is
  590.             setup 2x4 2x4
  591.                array [R3S R2S L1S L0S M3N M2N M1N M0N]
  592.                            ^
  593.                            |
  594.                         item 1
  595.  
  596.       and so goes here ----+
  597.                            |
  598.                            |
  599.              _____ _____ __V__ _____
  600.             |     |     |     |     |
  601.             |     |     |  2  |     |
  602.             |_____|_____|_____|_____|
  603.             |     |     |     |     |
  604.             |     |     |     |     |
  605.             |_____|_____|_____|_____|
  606.  
  607.       and faces south, ready to roll right.
  608.  
  609. The procedure just described only works for people who are facing north
  610. or south in the diagram of the beginning setup.  People facing east
  611. or west do the following:  Change the name of the beginning setup to
  612. its PU name (in this case 4x2) when looking it up in the database
  613. specification, and turn all the diagrams 90 degrees counterclockwise.
  614.  
  615. The PU version of the 2x4 setup looks like this:
  616.              _____ _____
  617.             |     |     |
  618.             |  3  |  4  |
  619.             |_____|_____|
  620.             |     |     |
  621.             |  2  |  5  |
  622. 4x2         |_____|_____|
  623.             |     |     |
  624.             |  1  |  6  |
  625.             |_____|_____|
  626.             |     |     |
  627.             |  0  |  7  |
  628.             |_____|_____|
  629.  
  630. If someone is last in a right-hand column, he will do the following:
  631.  
  632.                          _____ _____
  633.                         |     |     |
  634.                         |     |     |
  635.                         |_____|_____|
  636.                         |     |     |
  637.                         |     |     |
  638.                         |_____|_____|
  639.                         |     |     |
  640.                         |     |     |
  641.                         |_____|_____|
  642.                         |     |     |
  643.       this person ----->|  0  |     |
  644.                         |_____|_____|
  645.  
  646.       looks at item number 0 in the call definition array, which is
  647.             setup 4x2 2x4
  648.                array [M1N M2N M3N R4S L3S M4N M5N M6N]
  649.       (Note that the beginning setup is now 4x2, but the ending setup
  650.          is still 2x4.  PU names are never used in ending setup names.)
  651.  
  652.                             _____ _____
  653.                            |     |     |
  654.                            |     |     |
  655.                            |_____|_____|
  656.                            |     |     |
  657.                            |     |     |
  658.                            |_____|_____|
  659.                            |     |     |
  660.       and so goes here --->|  1  |     |
  661.                            |_____|_____|
  662.                            |     |     |
  663.                            |     |     |
  664.                            |_____|_____|
  665.  
  666.  
  667.       and faces north, ready to refuse to roll.
  668.  
  669.  
  670.  
  671. Calls that can handle arbitrary facing directions from beginning setups that
  672. do not have 4 way symmetry must have 2 entries in the database: a "normal"
  673. one for people who are facing north or south in the diagrams shown above,
  674. and a "PU" one for people who are facing east or west.  The full
  675. definition for circulate from arbitrary 2x4's is
  676.  
  677.    setup 2x4 2x4
  678.       array [R3S R2S L1S L0S M3N M2N M1N M0N]
  679.    setup 4x2 2x4
  680.       array [M1N M2N M3N R4S L3S M4N M5N M6N]
  681.  
  682. When using the PU definition, both the beginning and ending diagrams
  683. are rotated 90 degrees counterclockwise relative to the above diagrams,
  684. whether they are the same setup or different setups.
  685.  
  686. Another example:
  687.  
  688. Diamonds always have people T-boned.  The points use the normal
  689. definitions and the centers use the PU definitions.  The call
  690. "diamond circulate" is defined as
  691.  
  692.    setup dmd dmd
  693.       array [R1E 0 L1W 0]
  694.    setup pmd dmd
  695.       array [0 R2E 0 L2W]
  696.  
  697. The zero entries mean that the call is illegal for people who
  698. are facing directly into or out of the diamond.  The legal starting
  699. positions for the call "diamond single rotate" are the other way around:
  700.  
  701.    setup dmd dmd
  702.       array [0 L0S 0 L2N]
  703.    setup pmd dmd
  704.       array [L3N 0 L1S 0]
  705.  
  706. The diagram that people use for the PU definition is:
  707.                 _____
  708.                |     |
  709.                |  2  |
  710.              __|__ __|__
  711.             |     |     |
  712.             |  1  |  3  |
  713.             |_____|_____|
  714.                |     |
  715.                |  0  |
  716.                |_____|
  717.  
  718.  
  719. Another example:
  720. The call "flip the diamond" is defined as
  721.  
  722.    setup dmd 1x4
  723.       array [R1S 0 L3S 0]
  724.    setup pmd 1x4
  725.       array [0 R2E 0 L2W]
  726.  
  727. The centers of the diamond use the PU definition.  They
  728. rotate the ending diagram 90 degrees counterclockwise also,
  729. so the ending setup is
  730.  
  731.              _____
  732.             |     |
  733.             |  2  |
  734.             |_____|
  735.             |     |
  736.             |  3  |
  737.             |_____|
  738.             |     |
  739.             |  1  |
  740.             |_____|
  741.             |     |
  742.             |  0  |
  743.             |_____|
  744.  
  745.  
  746.             BEGINNING AND ENDING SETUPS DO NOT HAVE 4 WAY SYMMETRY,
  747.                         CALL IS *ROTATING*
  748.  
  749. If the beginning and ending setups do not both appear in the above diagrams
  750. with consistent orientation, do the following:
  751.  
  752.    Invent a new call whose action is the desired call followed by
  753.       a complete rotation of the final poition 90 degrees counterclockwise.
  754.    Enter that new call in the database as described above.
  755.    Put the word "rotate" after the two setup names in each definition
  756.       specification.
  757.  
  758. The word "rotate" tells the program to rotate the setup resulting from the
  759. use of that specification clockwise after completion of the call.  The call
  760. "counter rotate" is an example:
  761.  
  762.    setup 2x4 2x4 rotate
  763.       array [R0N R1N L6S L7S L0S L1S R6N R7N]
  764.    setup 4x2 2x4 rotate
  765.       array [R0N R1N R2N R3N L0S L1S L2S L3S]
  766.  
  767. "Lockit" is another:
  768.  
  769.    setup 1x4 1x4 rotate
  770.       array [R0N R1N L0S L1S]
  771.  
  772. "Single strut right" is another:
  773.  
  774.    setup 4x1 1x4 rotate
  775.       array [3W 2E 0 0]
  776.  
  777. Rotating call definitions are confusing to write!  The facing direction
  778. given in the call specification does NOT include the final clockwise
  779. rotation that the program will perform.  In "lockit" person #0 is shown
  780. not changing his facing direction at all ("N") even though his roll direction
  781. is "R".  This is because his actual 90 degree clockwise turn is entirely
  782. a consequence of the hidden final rotation.  Person #2 is show turning
  783. 180 degrees.  That, plus the final rotation, gives a 90 degree
  784. counterclockwise turn.
  785.  
  786. What happens if one of the specifications has the word "rotate" and the
  787. other does not?  If people are not T-boned, there is no problem.  Only
  788. one of the specifications is used.  In this case, whether the call is a
  789. shape-changer would depend on people's facing direction.  (The call "change
  790. your image" comes to mind.)  If people are T-boned, the call will be illegal
  791. with this definition.  "Change your image" used to be definied this way,
  792. and was illegal from T-boned setups.  It now uses a different trick, to
  793. be described much later.
  794.  
  795.             BEGINNING AND ENDING SETUPS BOTH HAVE 4 WAY SYMMETRY
  796.  
  797. This is straightforward.  The word "rotate" is never used with such
  798. calls, and only one descriptor is required.  If people are T-boned when
  799. the call is executed, the program does what it can.  Here is the definition
  800. of "ripoff":
  801.  
  802.    setup 2x2 2x2
  803.       array [R1S R2N M3N M0N]
  804.  
  805.  
  806.             BEGINNING SETUP HAS 4 WAY SYMMETRY, ENDING SETUP DOES NOT
  807.  
  808. If the ending setup, relative to people who are facing north when the call
  809. begins, is oriented as in one of the diagrams above, the situation is
  810. straightforward, as in "reach out":
  811.  
  812.    setup 2x2 1x4
  813.       array [M3S M1S R2S L0S]
  814.  
  815. Otherwise, we must use a rotating definition.  As above, we define
  816. a new call that has the effect of the desired call followed by a 90
  817. degree counterclockwise rotation, encode that into the database, and put
  818. in the word "rotate".  Here is "pass the ocean":
  819.  
  820.    setup 2x2 1x4 rotate
  821.       array [0 0 L1S R0N]
  822.  
  823.                    _____ _____
  824.                   |     |     |
  825.                   |     |     |
  826.                   |_____|_____|
  827.                   |     |     |
  828.                   |  3  |     |
  829.                   |_____|_____|
  830.                      ^
  831.                      |
  832.       This person ---+
  833.  
  834.  
  835.       goes here --+        and faces north,
  836.                   |
  837.                   |
  838.                 __V__ _____ _____ _____
  839.                |     |     |     |     |
  840.                |  0  |     |     |     |
  841.                |_____|_____|_____|_____|
  842.  
  843. and then the entire setup is rotated clockwise, resulting in this:
  844.  
  845.              _____
  846.             |     |
  847.             |  X  |    facing east
  848.             |_____|
  849.             |     |
  850.             |     |
  851.             |_____|
  852.             |     |
  853.             |     |
  854.             |_____|
  855.             |     |
  856.             |     |
  857.             |_____|
  858.  
  859. which is of course the desired result.
  860.  
  861.             BEGINNING SETUP DOES NOT HAVE 4 WAY SYMMETRY
  862.                      ENDING SETUP DOES
  863.  
  864. If the beginning setup, relative to people who are facing north,
  865. is oriented as in one of the diagrams above, the situation is
  866. straightforward, as in "ah so":
  867.  
  868.    setup 1x4 2x2
  869.       array [R1S L3S L0S R2S]
  870.  
  871. If the PU beginning setup is required, so that we turn all the
  872. diagrams counterclockwise, we turn the ending setup's diagram
  873. counterclockwise also.  This is perhaps not intuitive.
  874. Here is the call "single polly wally":
  875.  
  876.    setup 4x1 2x2
  877.       array [R3S 2N L1S 0S]
  878.  
  879. beginning PU setup:
  880.              _____
  881.             |     |
  882.             |  2  |
  883.             |_____|
  884.             |     |
  885.             |  3  |
  886.             |_____|
  887.             |     |
  888.             |  1  |
  889.             |_____|
  890.             |     |
  891.             |  0  |
  892.             |_____|
  893.  
  894.  
  895. ending setup -- note that it is rotated with respect to the main
  896.    diagram for a 2x2, so that its orientation is consistent with
  897.    the 4x1 starting setup:
  898.  
  899.              _____ _____
  900.             |     |     |
  901.             |  1  |  2  |
  902.             |_____|_____|
  903.             |     |     |
  904.             |  0  |  3  |
  905.             |_____|_____|
  906.  
  907. Viewed in this way, person zero goes to position 3 and faces south.
  908. The word "rotate" is not used with such a specification, since the
  909. orientations of the beginning and ending setups are consistent
  910. WITH EACH OTHER.  (They are both rotated 90 degrees counterclockwise
  911. from the main diagrams.)
  912.  
  913. We can of course mix specifications in which the people begin in the
  914. normal setup and the PU setup.  Consider "drop in":
  915.  
  916.    setup dmd 2x2
  917.       array [R0E 0 L1W 0]
  918.    setup pmd 2x2
  919.       array [0 M1N 0 M2N]
  920.  
  921. For the "normal" people (who are the points):
  922.  
  923.           _____                _____ _____
  924.     _____|     |_____         |     |     |
  925.    |     |  1  |     |        |  0  |  1  |
  926.    |  0  |_____|  2  |  -->   |_____|_____|
  927.    |_____|     |_____|        |     |     |
  928.          |  3  |              |  3  |  2  |
  929.          |_____|              |_____|_____|
  930.  
  931. For the "PU" people (who are the centers):
  932.  
  933.           _____
  934.          |     |
  935.          |  2  |               _____ _____
  936.        __|__ __|__            |     |     |
  937.       |     |     |           |  1  |  2  |
  938.       |  1  |  3  |     -->   |_____|_____|
  939.       |_____|_____|           |     |     |
  940.          |     |              |  0  |  3  |
  941.          |  0  |              |_____|_____|
  942.          |_____|
  943.  
  944. The word "rotate" is not used for either the "dmd" or the "pmd"
  945. specification.
  946.  
  947. General rules of thumb:
  948.  
  949.    (1) Never use the word "rotate" with an ending setup that has
  950.       4-way symmetry.  If you think you need to, you are wrong.
  951.    (2) In general, use the word "rotate" for both specifications of a
  952.       multi-specification call, or for neither.  If it is used for
  953.       one and not the other, that means that, if people are T-boned,
  954.       they will disagree on whether the call is a shape-changer.  The
  955.       only legal case of this is calls with an ending setup which is
  956.       a 2x4.  In that case, if people are T-boned, the call will go
  957.       into a 4x4 final setup.  This is used in "change your image"
  958.       and "single rotate".
  959.    (3) The word "rotate" simply causes all of the people to turn their
  960.       formation 90 degrees clockwise at the conclusion of the call.
  961.       It is independent of everything else.
  962.    (3) Within any one specification, you must either turn ALL of the
  963.       above diagrams counterclockwise, or NONE of them.  In the former
  964.       case, use the "PU" starting setup designation for that
  965.       specification.  If you can't define the call this way, define
  966.       a different call and use "rotate" to get the desired behavior.
  967.  
  968.                 MULTIPLE SPECIFICATIONS
  969.  
  970. In general, a call is defined with one or more specifications, each
  971. giving the rule for one starting setup.  An example of this can be
  972. found in the call "counter rotate", for which a very abbreviated
  973. definition is:
  974.  
  975.    setup 2x4 2x4 rotate
  976.       array [R0N R1N L6S L7S L0S L1S R6N R7N]
  977.    setup 4x2 2x4 rotate
  978.       array [R0N R1N R2N R3N L0S L1S L2S L3S]
  979.    setup 2x2 2x2
  980.       array [R1E L0W L1W R0E]
  981.    setup dmd dmd rotate
  982.       array [R0N 0 L0S 0]
  983.    setup pmd dmd rotate
  984.       array [0 R1N 0 L1S]
  985.  
  986. It actually has a specification for just about every starting setup
  987. that exists.  This is because counter rotate is a rather unusual call.
  988. Many calls have just one definition from one setup.  They are legal
  989. from other setups that are just multiple copies of the given setup.
  990. For example, "circle to a wave" is just defined from a 2x2 box:
  991.  
  992.    setup 2x2 2x2
  993.       array [0 0 0E 1E]
  994.  
  995. No other definitions are given.  When the call is executed from a
  996. larger setup, such as lines facing or an 8-chain, the program breaks
  997. up the larger setup into smaller ones and executes the call separately
  998. in each smaller setup.
  999.  
  1000. The program's general rule is to search through the given call
  1001. definition for a specification matching the given setup.  If no entry
  1002. is found, it attempts to divide the setup into smaller ones.  (If
  1003. people are T-boned and the setup does not have 4-way symmetry, it
  1004. actually requires two specifications, for example, 2x4 and 4x2.
  1005. If it finds either one, it does not consider subdividing.  If only
  1006. one of the two was present, the people whoe require the other will
  1007. lose.  Too bad.)
  1008.  
  1009. When the program decides to subdivide the setup, it is guided by the
  1010. specifications that are present for smaller setups.  It always begins
  1011. with the least radical subdivision.  If the original setup is a 2x4,
  1012. but no 2x4 (or 4x2, as needed) specifications are present, it looks
  1013. for 1x4 (and/or 4x1) specifications.  If found, the setup is divided
  1014. that way.  If a 2x2 specification is found, it divides the setup that
  1015. way.  If both are found, it gives precedence to the 1x4 division.
  1016. If neither a 1x4/4x1 or 2x2 specification is found, it looks for a
  1017. 1x2 and/or 2x1.  If found, it subdivides the setup as appropriate.
  1018. If no 1x2/2x1 is found, it searches for a 1x1.  Similar subdivision
  1019. searches are performed for other initial setups.
  1020.  
  1021. Some of the subdivision rules are actually somewhat tricky.  When
  1022. dividing a 2x2 into 1x2's, it looks at people's facing direction
  1023. and checks for the existence of a 1x2 and/or 2x1 specification.
  1024. It requires an unambiguous decision of which axis to use for the
  1025. subdivision.  Hence "siamese breakdown" is not permitted in a 2x2,
  1026. and subdivision is not possible if people are T-boned (I think.)
  1027. Similar care is exercised in the 2x4 to 1x2/2x1 subdivision.  It
  1028. does the right thing with "heads pass thru; everyone trade".
  1029.  
  1030. The reason that "counter rotate" needs so many specifications is that
  1031. this call's definition does not involve the replication of smaller
  1032. versions in larger setups.  If it were defined on a 1x4 but not on a
  1033. 1x8, then, if called from a grand wave, it would do a lockit on each
  1034. side, rather than a the gigantic concentric counter rotate that is
  1035. required.
  1036.  
  1037. The order in which specifications with different starting setups
  1038. appear is not significant -- the search is always from the largest
  1039. setup to the smallest.  Multiple specifications with the same
  1040. starting setup are only meaningful if qualifiers are used (see below),
  1041. and, in that case, they are searched in the order in which they appear.
  1042.  
  1043.         OVERVIEW OF PREDICATES, RESTRICTIONS, AND QUALIFIERS
  1044.  
  1045. These are conditional things that can be placed in calls to perform
  1046. special functions.  A brief summary of their meanings is this:
  1047.  
  1048.    Predicates are applied separately to each person, and are used
  1049.    to let a person execute a rule that depends on some property of
  1050.    the setup, such as another person's orientation.  Example:
  1051.    Predicates are used in the call "in roll circulate" to tell people
  1052.    who are not inrollers where the inroller is, so they know which way
  1053.    to move.
  1054.  
  1055.    Restrictions are applied to entire setups, and are used to indicate
  1056.    that, while the overall setup shape is acceptable, certain aspects
  1057.    (for example, facing directions) might be unusual.  When a restriction
  1058.    is violated, a warning or error arises.  This is typically the "do
  1059.    your part" warning.  Example:  A restriction is used on "follow your
  1060.    neighbor" to force the "do your part" warning if people are not in
  1061.    a normal box.  The call could be done from a magic box.  [Actually,
  1062.    most restrictions should raise errors instead of warnings, but the
  1063.    ability to do that is a recent feature.]
  1064.  
  1065.    Qualifiers are used to control the search for starting setups.
  1066.    Rather than causing a warning or error to be raised if the setup
  1067.    is inappropriate, a qualifier simply causes that clause to be skipped
  1068.    in the search.  An example of this is in the call "recycle":
  1069.  
  1070.       setup 1x4 2x2 qualifier wave_only
  1071.          .....
  1072.       setup 2x2 1x4
  1073.          .....
  1074.  
  1075.    When done from a 2x4, we want to do the 1x4 version if the people
  1076.    are in waves, and the 2x2 version if they are in lines facing.  The
  1077.    normal preference is for the 1x4 version.  The qualifier causes the
  1078.    program to look at people's facing direction and ignore the 1x4 clause
  1079.    if the people are not in waves.  This will cause the 2x2 clause to be
  1080.    used instead.  If they are neither in waves nor lines facing, the 2x2
  1081.    clause will be used and the call will fail, since the 2x2 definition
  1082.    requires facing couples.
  1083.  
  1084. In using predicates, restrictions, and qualifiers, one must be aware
  1085. of their behavior in the presence of phantoms.  Some of them are
  1086. strict -- they require that all necessary people actually be present
  1087. and make up the indicated formation.  Others are lax -- they simply
  1088. require that the people who are present be oriented in a way that is
  1089. consistent with the indicated formation.  In general, predicates are
  1090. strict (though they typically only look at one other person, not the
  1091. whole setup), and restrictions and qualifiers are lax.
  1092.  
  1093.                   PREDICATES
  1094.  
  1095. Predicates are used to indicate, on a person-by-person basis, how
  1096. the call definition is determined by properties of the setup other
  1097. than that person's position and facing direction.  If a person's
  1098. action is dependent only on his position and facing direction, as
  1099. it is for most calls, the mechanism already described is sufficient.
  1100. For calls like "cycle and wheel" and "in roll circulate", that isn't
  1101. enough.  Some people need guidance from another person.
  1102.  
  1103. Predicates are used by replacing the "array" clause:
  1104.  
  1105.             array [<person action> <person action> ...]
  1106.  
  1107. With a "preds" clause:
  1108.  
  1109.       preds <error message in quotes>
  1110.          if <predicate> [<person action> <person action> ...]
  1111.          if <predicate> [<person action> <person action> ...]
  1112.          ....
  1113.  
  1114. For each person, the predicates are evaluated in sequence until one
  1115. is satisfied.  When that happens, that person's entry in the
  1116. corresponding action list is used.  If no predicate is satisfied for
  1117. some person, the call fails, giving the error message.  (In some
  1118. cases, evaluation of a predicate itself gives rise to an error
  1119. message.)
  1120.  
  1121. For example, the call "cycle and wheel" is defined this way:
  1122.  
  1123.    setup 1x4 2x2
  1124.       preds "Can't do this call."
  1125.          if lines_miniwave [R1S L3N L0S R2N]
  1126.          if lines_couple   [R1S R0S L0S L1S]
  1127.  
  1128. These two predicates are both strict, and both defined for many setups.
  1129. They test the "partner" of the given person, and return true if that
  1130. partner is facing the opposite way or same way, respectively, as the
  1131. given person.  If the partner is a phantom or is T-boned to the given
  1132. person, they return false.  They do not raise any errors in any case.
  1133. If any person's partner is a phantom or is T-boned, both predicates
  1134. will return false, the program will run out of predicates, and the
  1135. error "Can't do this call" will be raised.
  1136.  
  1137. The call could have been defined by:
  1138.  
  1139.    setup 1x4 2x2
  1140.       preds "?"
  1141.          if lines_miniwave [R1S L3N L0S R2N]
  1142.          if lines_couple   [R1S R0S L0S L1S]
  1143.          if always         [R1S  0  L0S  0 ]
  1144.  
  1145. since the ends know what to do anyway.  In this case, if an end were
  1146. a phantom and the adjacent center were not, the call would fail with
  1147. a "so-and-so is not able to execute this call" error.  This is because,
  1148. when testing the center, the first two predicates would both fail, and
  1149. the third would be used, giving zero, which indicates that the person
  1150. can't do the call.
  1151.  
  1152. The definition of "in roll circulate" is:
  1153.  
  1154.    setup 2x4 2x4
  1155.       preds "???"
  1156.          if inroller_is_cw [1S 2S 3S 0  0  6S 7S 0N]
  1157.          if always         [0  0S 1S 2S 3N 4S 5S 0 ]
  1158.  
  1159. The predicate "inroller_is_cw" is unusual.  It is specifically
  1160. designed for this call.  It is defined only for 2x4 lines.
  1161. Some predicates, like "lines_miniwave" and "lines_couple", are
  1162. overloaded -- they have rather general meaning and can be invoked
  1163. from several setups.  This predicate, however, is only appropriate
  1164. from 2x4 lines, so it must only be used with a "setup 2x4 ..."
  1165. specification.  (In fact, it is only used for this call.)
  1166. Always check the applicable setups before using a predicate.
  1167.  
  1168. The predicate "inroller_is_cw" does most of its work when evaluated
  1169. for a center person (spots 1, 2, 5, or 6.)  It examines the people
  1170. at the two ends of that person's line.  There must be exactly one
  1171. live inroller.  An inroller at one end and a phantom at the other
  1172. is legal.  It evaluates to true if the inroller is clockwise (around
  1173. the 2x4) from the person in question, false if not.  In the latter
  1174. case, the program will use the "always" predicate, which is always
  1175. satisfied, so it will never run off the end of the list.  For this
  1176. reason, the error message after the word "preds" is just some question
  1177. marks -- it will never be printed.  If the in-roll direction can not
  1178. be determined, the predicate itself raises the error.
  1179.  
  1180. For the ends, the in-roll status is clear.  Person zero is not an
  1181. inroller.  The predicate checks whether the person at the other end
  1182. of his line is an inroller, raising an error if not, and returns true
  1183. if so, since that inroller is clockwise from person zero.  For person
  1184. three, the inroller must be at the other end of the line, which is
  1185. counterclockwise, so the predicate either raises an error or returns
  1186. false.  Appropriate things are also done with persons four and seven,
  1187. to be sure that the inroller is not ambiguous.
  1188.  
  1189. To summarize some general properties of predicates:
  1190.  
  1191.    (1) Some predicates are "strict" in their examination of other
  1192.        people.  They demand that the person being examined be alive
  1193.        and facing in a certain direction.  A few predicates are "lax" --
  1194.        they only test for the absence of a person facing in the incorrect
  1195.        direction.  Always check the documentation of the spefic predicate
  1196.        being used.
  1197.    (2) Some predicates are applicable on a number of setups, with
  1198.        suitable interpretation of what is meant for each setup.  Others
  1199.        are only applicable to one setup.  Always check the documentation
  1200.        of the spefic predicate being used.
  1201.    (3) Some predicates (the more "generic" ones, in general) do their work
  1202.        only by returning TRUE or FALSE.  They never raise errors, because
  1203.        that would compromise their generality.  Other predicates raise
  1204.        errors when appropriate, in order to simplify the database.  Always
  1205.        check the documentation of the specific predicate being used.
  1206.  
  1207. The existing predicates are listed in the appendix.
  1208.  
  1209.  
  1210.  
  1211.  
  1212.  
  1213.                            APPENDIX A -- PREDICATES
  1214.  
  1215. always
  1216.       applies to any setup.  Returns TRUE in all cases.
  1217.  
  1218. x22_miniwave
  1219.       applies to 2x2 only.  Returns TRUE if the lateral partner of the
  1220.       person under test is alive and facing the opposite direction.
  1221.       Returns FALSE if the lateral partner is a phantom or faces the
  1222.       same way or is T-boned.
  1223.  
  1224. x22_couple
  1225.       applies to 2x2 only.  Returns TRUE if the lateral partner of the
  1226.       person under test is alive and facing the same direction.  Returns
  1227.       FALSE if the lateral partner is a phantom or faces the opposite way
  1228.       or is T-boned.
  1229.  
  1230. x22_facing_someone
  1231.       applies to 2x2 only.  Returns TRUE if the vertical partner of the
  1232.       person under test is alive and facing the opposite direction.
  1233.       Returns FALSE if the vertical partner is a phantom or faces the
  1234.       same way or is T-boned.  The name may be misleading.  It is intended
  1235.       to be used to determine if the person being tested is facing someone
  1236.       else's face, but, if the two people are back-to-back, the predicate
  1237.       will also be satisfied.  To get the desired effect, you must only
  1238.       use it on people who are trailers.
  1239.  
  1240. x14_once_rem_miniwave
  1241.       applies to 1x4 only.  Returns TRUE if the person once-removed
  1242.       from the person under test is alive and facing the opposite direction.
  1243.       Returns FALSE if the once-removed person is a phantom or faces the
  1244.       same way or is T-boned.
  1245.  
  1246. x14_once_rem_couple
  1247.       applies to 1x4 only.  Returns TRUE if the person once-removed
  1248.       from the person under test is alive and facing the same direction.
  1249.       Returns FALSE if the once-removed person is a phantom or faces the
  1250.       opposite way or is T-boned.
  1251.  
  1252. lines_miniwave
  1253.       applies to 1x2, 1x4, 1x6, 2x4, 2x6, or 2x8 lines only.  Returns TRUE if the
  1254.       lateral partner of the person under test is alive and facing the
  1255.       opposite direction.  Returns FALSE if the partner is a phantom or
  1256.       faces the same way or is T-boned.
  1257.  
  1258. lines_couple
  1259.       applies to 1x2, 1x4, 1x6, 2x4, 2x6, or 2x8 lines only.  Returns TRUE if the
  1260.       lateral partner of the person under test is alive and facing the
  1261.       same direction.  Returns FALSE if the partner is a phantom or
  1262.       faces the opposite way or is T-boned.
  1263.  
  1264. lines_magic_miniwave
  1265.       applies to 2x4 lines only.  Returns TRUE if the magic partner
  1266.       of the person under test (the person in the opposite corner of
  1267.       the same box) is alive and facing the opposite direction.
  1268.       Returns FALSE if the magic partner is a phantom or faces the same
  1269.       way or is T-boned.
  1270.  
  1271. lines_magic_couple
  1272.       applies to 2x4 lines only.  Returns TRUE if the magic partner
  1273.       of the person under test (the person in the opposite corner of
  1274.       the same box) is alive and facing the same direction.
  1275.       Returns FALSE if the magic partner is a phantom or faces the
  1276.       opposite way or is T-boned.
  1277.  
  1278. lines_once_rem_miniwave
  1279.       applies to 2x4 lines only.  This is the same as
  1280.       "x14_once_rem_miniwave", but used in a 2x4 setup.
  1281.  
  1282. lines_once_rem_couple
  1283.       applies to 2x4 lines only.  This is the same as
  1284.       "x14_once_rem_couple", but used in a 2x4 setup.
  1285.  
  1286. lines_tandem
  1287.       applies to 2x4 lines only.  Returns TRUE if the vertical partner
  1288.       of the person under test is alive and facing the same direction.
  1289.       Returns FALSE if the vertical partner is a phantom or faces the
  1290.       opposite way or is T-boned.
  1291.  
  1292. lines_antitandem
  1293.       applies to 2x4 lines only.  Returns TRUE if the vertical partner
  1294.       of the person under test is alive and facing the opposite direction.
  1295.       Returns FALSE if the vertical partner is a phantom or faces the
  1296.       same way or is T-boned.
  1297.  
  1298. columns_tandem
  1299.       applies to 2x1, 4x1, 6x1, 4x2, 6x2, or 8x2 columns only.  Returns TRUE if the
  1300.       tandem partner of the person under test is alive and facing the same
  1301.       direction.  Returns FALSE if that person is a phantom or faces the
  1302.       opposite way or is T-boned.
  1303.  
  1304. columns_antitandem
  1305.       applies to 2x1, 4x1, 6x1, 4x2, 6x2, or 8x2 columns only.  Returns TRUE if the
  1306.       tandem partner of the person under test is alive and facing the opposite
  1307.       direction.  Returns FALSE if that person is a phantom or faces the
  1308.       same way or is T-boned.
  1309.  
  1310. columns_magic_tandem
  1311.       applies to 4x2 columns only.  Returns TRUE if the magic tandem
  1312.       partner of the person under test (the person in the opposite
  1313.       corner of the same box) is alive and facing the same direction.
  1314.       Returns FALSE if that person is a phantom or faces the
  1315.       opposite way or is T-boned.
  1316.  
  1317. columns_magic_antitandem
  1318.       applies to 4x2 columns only.  Returns TRUE if the magic tandem
  1319.       partner of the person under test (the person in the opposite
  1320.       corner of the same box) is alive and facing the opposite direction.
  1321.       Returns FALSE if that person is a phantom or faces the same
  1322.       way or is T-boned.
  1323.  
  1324. columns_once_rem_tandem
  1325.       applies to 4x2 columns only.  Returns TRUE if the person
  1326.       once-removed from the person under test is alive and facing
  1327.       the same direction.  Returns FALSE if that person is a phantom
  1328.       or faces the opposite way or is T-boned.
  1329.  
  1330. columns_once_rem_antitandem
  1331.       applies to 4x2 columns only.  Returns TRUE if the person
  1332.       once-removed from the person under test is alive and facing
  1333.       the opposite direction.  Returns FALSE if that person is a
  1334.       phantom or faces the same way or is T-boned.
  1335.  
  1336. columns_couple
  1337.       applies to 4x2 columns only.  Returns TRUE if the lateral partner
  1338.       of the person under test is alive and facing the same direction.
  1339.       Returns FALSE if that person is a phantom or faces the opposite
  1340.       way or is T-boned.
  1341.  
  1342. columns_miniwave
  1343.       applies to 4x2 columns only.  Returns TRUE if the lateral partner
  1344.       of the person under test is alive and facing the opposite direction.
  1345.       Returns FALSE if that person is a phantom or faces the same way
  1346.       or is T-boned.
  1347.  
  1348. 1x2_beau_or_miniwave
  1349.       applies to 1x2 lines only.  Returns TRUE if this person is a beau,
  1350.       or else this belle is in a miniwave with the other person.
  1351.       Returns FALSE if this belle is in a couple with the other person.
  1352.       Raises an error if this belle can't tell.
  1353.  
  1354. 1x4_wheel_and_deal
  1355.       applies to 1x4 lines only.  This implements the decision necessary
  1356.       to do a wheel and deal.  It is only as strict as necessary to resolve
  1357.       ambiguity.  You must use this only when it has already been determined
  1358.       that the live people in each couple are facing consistently -- this
  1359.       predicate will malfunction if presented with people in waves, for
  1360.       example.  Hence, it must only be used in the context
  1361.                setup 1x4 2x2 restriction forbidden couples_only
  1362.       It returns TRUE if this person is on the beau-side couple of the line.
  1363.       If this person is on the belle-side couple, it returns TRUE if the line
  1364.       is two-faced, and FALSE if it is one-faced.  It raises an error if there
  1365.       are no people on the other side and hence it can't tell.
  1366.  
  1367. 1x6_wheel_and_deal
  1368.       applies to 1x6 lines only.  This implements the decision necessary
  1369.       to do a 3X3 wheel and deal.  It is only as strict as necessary to resolve
  1370.       ambiguity.  You must use this only when it has already been determined
  1371.       that the live people in each triad are facing consistently -- this
  1372.       predicate will malfunction if presented with people in waves, for
  1373.       example.  Hence, it must only be used in the context
  1374.                setup 1x6 2x3 restriction forbidden 3x3couples_only
  1375.       It returns TRUE if this person is on the beau-side triad of the line.
  1376.       If this person is on the belle-side triad, it returns TRUE if the line
  1377.       is two-faced, and FALSE if it is one-faced.  It raises an error if there
  1378.       are no people on the other side and hence it can't tell.
  1379.  
  1380. 1x8_wheel_and_deal
  1381.       applies to 1x8 lines only.  This implements the decision necessary
  1382.       to do a 4X4 wheel and deal.  It is only as strict as necessary to resolve
  1383.       ambiguity.  You must use this only when it has already been determined
  1384.       that the live people in each quad are facing consistently -- this
  1385.       predicate will malfunction if presented with people in waves, for
  1386.       example.  Hence, it must only be used in the context
  1387.                setup 1x8 2x4 restriction forbidden 4x4couples_only
  1388.       It returns TRUE if this person is on the beau-side quad of the line.
  1389.       If this person is on the belle-side quad, it returns TRUE if the line
  1390.       is two-faced, and FALSE if it is one-faced.  It raises an error if there
  1391.       are no people on the other side and hence it can't tell.
  1392.  
  1393.  
  1394.  
  1395. Still to do:
  1396.  
  1397. vert1
  1398. vert2
  1399. inner_active_lines
  1400. outer_active_lines
  1401.  
  1402.  
  1403.  
  1404. judge_is_right
  1405.       applies to 1x4 lines only.  Returns TRUE if the person on the end
  1406.       of the line to this person's right is alive and is a "judge" (extreme
  1407.       right end of the line), and it is not the case that the other end
  1408.       of the line is occupied by another live judge.  Returns FALSE otherwise.
  1409.  
  1410. judge_is_left
  1411.       applies to 1x4 lines only.  Returns TRUE if the person on the end
  1412.       of the line to this person's left is alive and is a "judge" (extreme
  1413.       right end of the line), and it is not the case that the other end
  1414.       of the line is occupied by another live judge.  Returns FALSE otherwise.
  1415.  
  1416. socker_is_right
  1417.       applies to 1x4 lines only.  Returns TRUE if the person on the end
  1418.       of the line to this person's right is alive and is a "socker" (extreme
  1419.       left end of the line), and it is not the case that the other end
  1420.       of the line is occupied by another live socker.  Returns FALSE otherwise.
  1421.  
  1422. socker_is_left
  1423.       applies to 1x4 lines only.  Returns TRUE if the person on the end
  1424.       of the line to this person's left is alive and is a "socker" (extreme
  1425.       left end of the line), and it is not the case that the other end
  1426.       of the line is occupied by another live socker.  Returns FALSE otherwise.
  1427.  
  1428. inroller_is_cw
  1429.       applies to 2x4 lines only.  Returns TRUE if the end of the line clockwise
  1430.       from this person is a live inroller (facing in) and the other end of that
  1431.       line is not occupied by another live inroller.  Returns FALSE if the end
  1432.       of the line counterclockwise from this person is a live inroller and the
  1433.       other end of that line is not occupied by another live inroller.
  1434.       Otherwise, raises an error.
  1435.  
  1436. magic_inroller_is_cw
  1437.       applies to 2x4 lines only.  Same as inroller_is_cw, but applies to this
  1438.       person's magic line.
  1439.  
  1440. outroller_is_cw
  1441.       applies to 2x4 lines only.  Same as inroller_is_cw, but checks for live
  1442.       outrollers.
  1443.  
  1444. ******* why is there no magic_outroller_is_cw ??????
  1445.  
  1446. outposter_is_cw
  1447.       applies to 2x4 lines only.  Returns TRUE if the end of the line clockwise
  1448.       from this person is the outposter.  The rules for outposters are different
  1449.       from the rules for outrollers:  if both ends of the line are looking out,
  1450.       the one on the right (the "judge") is the outposter -- there is no conflict.
  1451.       Returns FALSE if the outposter is at the counterclockwise end of the line,
  1452.       or there is no live outposter.
  1453.  
  1454. outposter_is_ccw
  1455.       applies to 2x4 lines only.  Returns TRUE if the end of the line counterclockwise
  1456.       from this person is the outposter.  Returns FALSE if the outposter is at the
  1457.       clockwise end of the line, or there is no live outposter.
  1458.  
  1459. nexttrnglspot_is_tboned
  1460.       applies to triangles only.  This is intended to determine which way a
  1461.       person should face after doing a triangle circulate.  Returns FALSE if
  1462.       this person is a base and will still be a base after circulating,
  1463.       independently of the existence or facing direction of the person already
  1464.       standing on the target spot.  If this person is a base circulating to an
  1465.       apex spot or vice-versa, it demands that there be a person already standing
  1466.       on the target spot.  It returns TRUE if that person is facing perpendicular
  1467.       to the subject person, and FALSE if that person is facing the same way or
  1468.       opposite way.  It returns an error if a triangle circulate is impossible
  1469.       for the subject, or if there is no person on the target spot and such a
  1470.       person is needed.
  1471.  
  1472. next62spot_is_tboned
  1473.       applies to short6 only.  This is intended to determine which way a
  1474.       person should face after doing the outsides part of a 6x2 acey-deucey.
  1475.       Returns FALSE if this person is in the box of 4 (normally, one of the
  1476.       diamond points for 6x2 acey-deucey), whether this person will circulate
  1477.       to an apex (end of the center line for 6x2 acey-deucey) spot or not.
  1478.       If this person is an apex, it demands that there be a person already
  1479.       standing on the target spot.  It returns TRUE if that person is facing
  1480.       perpendicular to the subject person, and FALSE if that person is facing
  1481.       the same way or opposite way.  It returns an error if an outer 6 circulate
  1482.       is impossible for the subject (this can only happen if the subject is an
  1483.       apex), or if there is no person on the target spot and such a person
  1484.       is needed.
  1485.  
  1486. next_magic62spot_is_tboned
  1487.       applies to short6 only.  This is the same as "next62spot_is_tboned",
  1488.       but it uses the "magic 6x2 acey deucey" circulate path in calculating
  1489.       the target spot.
  1490.  
  1491.  
  1492. next_galaxyspot_is_tboned
  1493. column_double_down
  1494.  
  1495.  
  1496.  
  1497. boyp
  1498.       applies to any setup.  Returns TRUE if this person is an unambiguous boy.
  1499.       Returns FALSE if not.  The person's gender is ambiguous if the "as couples"
  1500.       or "tandem" concept has caused people of opposite gender to be paired.
  1501.  
  1502. girlp
  1503.       applies to any setup.  Returns TRUE if this person is an unambiguous girl.
  1504.       Returns FALSE if not.  The person's gender is ambiguous if the "as couples"
  1505.       or "tandem" concept has caused people of opposite gender to be paired.
  1506.  
  1507. roll_is_cw
  1508.       applies to any setup.  Returns TRUE if this person's roll direction, from
  1509.       the preceding call, is clockwise.  Returns if the direction is
  1510.       counterclockwise, or the person can't roll, or roll direction from the
  1511.       preceding call is ill-defined.
  1512.  
  1513. roll_is_ccw
  1514.       applies to any setup.  Returns TRUE if this person's roll direction, from
  1515.       the preceding call, is counterclockwise.  Returns if the direction is
  1516.       clockwise, or the person can't roll, or roll direction from the
  1517.       preceding call is ill-defined.
  1518.  
  1519. x12_boy_facing_girl
  1520.       applies to 2x1 columns only.  Returns TRUE if this person is an
  1521.       unambiguous boy, and the other person in the column is alive and an
  1522.       unambiguous girl.  Facing directions are not checked.
  1523.  
  1524. x12_girl_facing_boy
  1525.       applies to 2x1 columns only.  Returns TRUE if this person is an
  1526.       unambiguous girl, and the other person in the column is alive and an
  1527.       unambiguous boy.  Facing directions are not checked.
  1528.  
  1529. x22_boy_facing_girl
  1530.       applies to 2x2 boxes only.  Returns TRUE if this person is an
  1531.       unambiguous boy, and the person in the box that this person faces
  1532.       is alive and an unambiguous girl.  The facing direction of that other
  1533.       person is not checked.
  1534.  
  1535. x22_girl_facing_boy
  1536.       applies to 2x2 boxes only.  Returns TRUE if this person is an
  1537.       unambiguous girl, and the person in the box that this person faces
  1538.       is alive and an unambiguous boy.  The facing direction of that other
  1539.       person is not checked.
  1540.  
  1541. dmd_ctrs_rh
  1542.       applies to a diamond or single 1/4-tag.  Returns TRUE if the center
  1543.       two people are in a right-handed miniwave.  Returns FALSE if they
  1544.       are in a left-handed miniwave.  One live person in the center is
  1545.       sufficient to make the test.  Raises an error if the centers are
  1546.       both phantoms or they are not in a miniwave.  This predicate is
  1547.       unusual in that it does not look specifically at the person under
  1548.       test.  It evaluates the setup as a whole.
  1549.  
  1550. trngl_pt_rh
  1551.       Applies to a triangle.  This is strict relative to the point.
  1552.       Returns TRUE if the triangle point is as if in a right-handed triangle
  1553.       (independently of the existence or facing direction of the base people).
  1554.       Returns FALSE if the triangle point is as if in a left-handed triangle.
  1555.       Raises an error if the point is a phantom or is facing toward or
  1556.       away from the base.  This predicate is unusual in that it does not
  1557.       look specifically at the person under test.  It evaluates the setup
  1558.       as a whole.
  1559.  
  1560. Still to do:
  1561.  
  1562. q_tag_front
  1563.       Applies only to a qtag in which the center people are in some kind of
  1564.       line.  (Remember that we use the term "qtag" independently of actual
  1565.       facing direction -- hence it applies to 3/4 tags, 1/4-lines, diamonds,
  1566.       etc.  Part of the purpose of this predicate is to distinguish among
  1567.       these cases.)  Hence you must use this only with a starting setup of
  1568.       "qtag", or with a starting setup of "pqtag" as long as it doesn't
  1569.       specify a legal move for persons 2, 3, 6, or 7.
  1570.  
  1571.       This is strict relative to the people it tests.  For a person in the
  1572.       center line, this returns TRUE if the subject's partner is alive and
  1573.       facing in the opposite direction, and FALSE otherwise.  That is, it
  1574.       performs a strict test for the subject being in a miniwave, which
  1575.       presumably means the setup is a 1/4-tag or diamonds as opposed to a
  1576.       1/4-line or interlocked diamonds.  For a person on the outside, this
  1577.       returns TRUE only if the two people in the center line who are closest
  1578.       to the subject (in the subject's single 1/4-tag or diamond) are both
  1579.       alive and in a miniwave with each other, and the end of that line is
  1580.       facing the subject.  It returns FALSE otherwise.  For example, for an
  1581.       outside beau in a 1/4-tag or 1/4-line, it returns TRUE only if the
  1582.       setup is a left-handed 1/4-tag, and FALSE if it is right-handed or is
  1583.       a 1/4-line.  It only examines the two center people close to the
  1584.       subject (the ones in the subject's single 1/4-tag or diamond) in
  1585.       making this determination.  When applying the test to an outside, the
  1586.       subject's own facing direction is not important.  For example, in a
  1587.       right-hand 3/4-tag, this will return TRUE for an outside beau and
  1588.       FALSE for an outside belle.  In diamonds of any consistent handedness,
  1589.       this returns TRUE for a trailing point and FALSE for a leading point.
  1590.       For facing diamonds it does the opposite.
  1591.  
  1592. q_tag_back
  1593.       This is just like "q_tag_front" except that, for the outsides, it
  1594.       returns TRUE only if the two people in the center line who are closest
  1595.       to the subject are both alive and in a miniwave with each other, and
  1596.       the end of that line is facing the away from subject.  It returns
  1597.       FALSE otherwise.  For example, for an outside beau in a 1/4-tag or
  1598.       1/4-line, it returns TRUE only if the setup is a right-handed 1/4-tag,
  1599.       and FALSE if it is left-handed or is a 1/4-line. 
  1600.  
  1601. q_line_front
  1602.       This is just like "q_tag_front" except that it tests for a 1/4-line
  1603.       or interlocked diamonds.  For a person in the center line, this returns
  1604.       TRUE if the subject's partner is alive and facing in the same
  1605.       direction, and FALSE otherwise.  That is, it performs a strict test for
  1606.       the subject being in a couple, which presumably means the setup is a
  1607.       1/4-line or interlocked diamonds as opposed to a 1/4-tag or plain
  1608.       diamonds.  For a person on the outside, this returns TRUE only if the
  1609.       two people in the center line who are closest to the subject (in the
  1610.       subject's single 1/4-tag or diamond) are both alive and in a couple
  1611.       with each other, and the end of that line is facing the subject.  It
  1612.       returns FALSE otherwise.  For example, for an outside beau in a 1/4-tag
  1613.       or 1/4-line, it returns TRUE only if the setup is a left-handed
  1614.       1/4-line, and FALSE if it is right-handed or is a 1/4-tag.  In
  1615.       interlocked diamonds of any consistent handedness, this returns TRUE
  1616.       for a trailing point and FALSE for a leading point.  For facing
  1617.       interlocked diamonds it does the opposite.
  1618.  
  1619. q_line_back
  1620.       This is just like "q_line_front" except that, for the outsides, it
  1621.       returns TRUE only if the two people in the center line who are closest
  1622.       to the subject are both alive and in a couple with each other, and
  1623.       the end of that line is facing the away from subject.  It returns
  1624.       FALSE otherwise.  For example, for an outside beau in a 1/4-tag or
  1625.       1/4-line, it returns TRUE only if the setup is a right-handed 1/4-line,
  1626.       and FALSE if it is left-handed or is a 1/4-tag. 
  1627.  
  1628.                            APPENDIX B -- ESCAPE CODES IN CALL NAMES
  1629.  
  1630.                   These are not in a particularly logical order.
  1631.  
  1632. @0        - for call with mandatory substitution (e.g. "clover and ...") put
  1633.                       subcall here.
  1634. @1        - put optional subcall here.
  1635. @2 ... @3 - text to remove and replace with subcall.  Like @4 ... @5 along with @1.
  1636. @4 ... @5 - text to remove if optional substitution has been made.
  1637. @6        - put selector here.
  1638. @7 ... @8 - text to ADD if optional substitution has been made, as in the "ing"
  1639.                       for "fascinating <anything>".
  1640. @9        - put number here.
  1641. @a        - put number here, expressed as N/4, but say "full" instead of 4/4.
  1642. @b        - put number here, expressed as N/4.
  1643. @c ... @d - text to remove if this call was invoked with a "must_be_tag_call"
  1644.                       substitution.
  1645. @e ... @f - text to change to "left" if this call has "left" modifier.
  1646.                       Must use @g also if this appears.
  1647. @g        - at beginning of call name: an @e...@f sequence will occur.
  1648. @h        - at beginning of call name: if this is invoked with "single"
  1649.                       concept, change to "single file".
  1650. @i        - at beginning of call name: an @j...@l sequence will occur.
  1651. @j ... @l - text to add if this call has "cross" modifier.  Presumably
  1652.                       has the word "cross" in it.
  1653.                       Must use @i also if this appears.
  1654. @k        - put selector here, but use singular name, as in "beau tie".
  1655.