home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 9 / 09.iso / e / e050 / 1.ddi / MBP1.OPS < prev    next >
Encoding:
Text File  |  1985-09-17  |  2.6 KB  |  119 lines

  1.  
  2. module mbp1 ()
  3. {
  4.  
  5. use mbdef;
  6.  
  7.  
  8. --
  9. -- RULES
  10. --
  11.  
  12.  
  13. rule mb1
  14.   {
  15.     &1  (goal    status=active;     type=holds);
  16.     &2  (object    name=&1.object;    on=ceiling);
  17.     -->
  18.         make (goal    status=active;    type=move;    object=ladder;
  19.           X=&2.X;    Y=&2.Y);
  20.   };
  21.  
  22.  
  23.  
  24. rule mb2
  25.   {
  26.     &1  (goal    status=active;     type=holds);
  27.     &2  (object    name=&1.object;    on=ceiling);
  28.         (object    name=ladder;    eqloo(@,&2));
  29.      -->
  30.         make (goal    status=active;    type=on;    object=ladder)
  31.   };
  32.  
  33. rule mb3
  34.   {
  35.     &1  (goal    status=active;     type=holds);
  36.     &2  (object    name=&1.object;    on=ceiling);
  37.         (object    name=ladder;    eqloo(@,&2));
  38.         (monkey    on=ladder;    holds<>nil);
  39.      -->
  40.         make (goal    status=active;    type=holds;    object=nil)
  41.   };
  42.  
  43.  
  44. rule mb4
  45.   {
  46.     &1  (goal    status=active;     type=holds);
  47.     &2  (object    name=&1.object;    on=ceiling);
  48.         (object    name=ladder;    eqloo(@,&2));
  49.     &4   (monkey    on=ladder;    holds=nil);
  50.      -->
  51.         write()  |grab |, &2.name, '\n';
  52.         modify &4 (holds=&2.name);
  53.         modify &1 (status=satified)
  54.   };
  55.  
  56.  
  57.  
  58. rule mb5
  59.   {
  60.     &1  (goal     status=active;     type=holds);
  61.     &2  (object     name=&1.object;    on<>ceiling);
  62.      -->
  63.         make (goal    status=active;    type=on;    object=&2.on)
  64.   };
  65.  
  66.  
  67. rule mb6
  68.   {
  69.     &1  (goal     status=active;     type=holds);
  70.     &2  (object     name=&1.object);
  71.         (monkey on=&2.on;    holds<>nil);
  72.      -->
  73.         make (goal    status=active;    type=holds;    object=nil)
  74.   };
  75.  
  76.  
  77. rule mb7
  78.   {
  79.     &1  (goal     status=active;     type=holds);
  80.     &2  (object     name=&1.object);
  81.     &3  (monkey    on=&2.on;    holds=nil;    (~eqlmo(@,&2)));
  82.      -->
  83.         make (goal    status=active;    type=walk;
  84.           X=&2.X;    Y=&2.Y)
  85.   };
  86.  
  87.  
  88. rule mb7b
  89.   {
  90.     &1  (goal     status=active;     type=holds);
  91.     &2  (object     name=&1.object);
  92.     &3  (monkey    on=&2.on;    holds=nil;    eqlmo(@,&2));
  93.      -->
  94.         write()  |grab |, &2.name, '\n';
  95.         modify &3 (holds=&2.name);
  96.         remove &1
  97.   };
  98.  
  99. rule mb8
  100.   {
  101.     &1  (goal    status=active;    type=move);
  102.         (object    name=&1.object;    weight=light;    (~eqlog(@,&1)));
  103.      -->
  104.         make (goal    status=active;    type=holds;    object=&1.object)
  105.   };
  106.  
  107.  
  108. rule mb9
  109.   {
  110.     &1  (goal    status=active;    type=move);
  111.     &2  (object    name=&1.object;    weight=light;    (~eqlog(@,&1)));
  112.         (monkey    holds=&1.object);
  113.      -->
  114.         make (goal  status=active;   type=walk;
  115.           X=&1.X;    Y=&1.Y);
  116.   };
  117.  
  118. };
  119.