Intermediate CLang (ICLang)


The criteria for modifying the Coaching Language are:

   a. If some constructs of CLang are more expressive than needed
      (or used) then introduce restricted constructs and use them
      instead.

      e.g. (arc POINT 0 RADIUS 0 360) -> (circle POINT RADIUS);
           (ppos ...) -> (ppos-none), (ppos-all);
           fixed regions instead of all possible rectangles.

   b. If there are simple concepts in natural language which are
      impossible to express in CLang using the same arguments and
      if there can be intermediate constructs in which they can be
      expressed easily then introduce those constructs.

      e.g. our {1 2 3 4 5 6} -> (player-range our 1 6);
           left and right of regions

   c. There exists a straightforward mapping from the intermediate
      constructs to the CLang.

The proposed modifications are:

1. All expressions that contain references to players will contain
   sub-expressions of type Player.  For example:

     (bowner our {6}) will become (bowner (player our {6}))

     (pass {2}) will become (pass (player our {2}))

   Expressions of type Player are as follows:

   1.1. (player TEAM UNUM_SET)

          Players in UNUM_SET of team TEAM.

   1.2. (player-range TEAM UNUM_1 UNUM_2)

          Players of team TEAM numbered UNUM_1 to UNUM_2 inclusive.

   1.3. (player-except TEAM UNUM_SET)

          All players of team TEAM except for those in UNUM_SET.

2. (ppos TEAM UNUM_SET INT_1 INT_2 REGION) will be replaced with:

     (ppos-all PLAYER REGION) if INT_1 is 1 and INT_2 is not less than
     the size of UNUM_SET.

     (ppos-none TEAM REGION) if UNUM_SET is {0} and both INT_1 and INT_2
     are 0.

3. (POINT_1 + ((pt ball) * POINT_2)) will be replaced with
   (pt-with-ball-attraction POINT_1 POINT_2).

4. (arc POINT 0 RADIUS ANGLE_BEGIN 360) will be replaced with
   (circle POINT RADIUS).

5. New expressions will be used for certain pre-defined regions:

   Rectangles:

     (field)                            entire field
     (half TEAM)                        half of the field
     (penalty-area TEAM)                penalty area
     (goal-area TEAM)                   goal area

     (midfield)                         midfield
     (midfield TEAM)                    half of the midfield
     (near-goal-line TEAM)              near the goal line
     (very-near-goal-line TEAM)         very near the goal line
     (from-goal-line TEAM X_1 X_2)      X_1 to X_2 meters from the
                                        goal line

     (left REGION)                      left half of the region
     (right REGION)                     right half of the region
     (left-quarter REGION)              left quarter of the region
     (right-quarter REGION)             right quarter of the region
     (reg-exclude REGION_1 REGION_2)    REGION_1 excluding REGION_2

  Points:

     (front-of-goal TEAM)               directly in front of the goal
     (from-goal TEAM X)                 X meters from the goal