home *** CD-ROM | disk | FTP | other *** search
-
- module mbp1 ()
- {
-
- use mbdef;
-
-
- --
- -- RULES
- --
-
-
- rule mb1
- {
- &1 (goal status=active; type=holds);
- &2 (object name=&1.object; on=ceiling);
- -->
- make (goal status=active; type=move; object=ladder;
- X=&2.X; Y=&2.Y);
- };
-
-
-
- rule mb2
- {
- &1 (goal status=active; type=holds);
- &2 (object name=&1.object; on=ceiling);
- (object name=ladder; eqloo(@,&2));
- -->
- make (goal status=active; type=on; object=ladder)
- };
-
- rule mb3
- {
- &1 (goal status=active; type=holds);
- &2 (object name=&1.object; on=ceiling);
- (object name=ladder; eqloo(@,&2));
- (monkey on=ladder; holds<>nil);
- -->
- make (goal status=active; type=holds; object=nil)
- };
-
-
- rule mb4
- {
- &1 (goal status=active; type=holds);
- &2 (object name=&1.object; on=ceiling);
- (object name=ladder; eqloo(@,&2));
- &4 (monkey on=ladder; holds=nil);
- -->
- write() |grab |, &2.name, '\n';
- modify &4 (holds=&2.name);
- modify &1 (status=satified)
- };
-
-
-
- rule mb5
- {
- &1 (goal status=active; type=holds);
- &2 (object name=&1.object; on<>ceiling);
- -->
- make (goal status=active; type=on; object=&2.on)
- };
-
-
- rule mb6
- {
- &1 (goal status=active; type=holds);
- &2 (object name=&1.object);
- (monkey on=&2.on; holds<>nil);
- -->
- make (goal status=active; type=holds; object=nil)
- };
-
-
- rule mb7
- {
- &1 (goal status=active; type=holds);
- &2 (object name=&1.object);
- &3 (monkey on=&2.on; holds=nil; (~eqlmo(@,&2)));
- -->
- make (goal status=active; type=walk;
- X=&2.X; Y=&2.Y)
- };
-
-
- rule mb7b
- {
- &1 (goal status=active; type=holds);
- &2 (object name=&1.object);
- &3 (monkey on=&2.on; holds=nil; eqlmo(@,&2));
- -->
- write() |grab |, &2.name, '\n';
- modify &3 (holds=&2.name);
- remove &1
- };
-
- rule mb8
- {
- &1 (goal status=active; type=move);
- (object name=&1.object; weight=light; (~eqlog(@,&1)));
- -->
- make (goal status=active; type=holds; object=&1.object)
- };
-
-
- rule mb9
- {
- &1 (goal status=active; type=move);
- &2 (object name=&1.object; weight=light; (~eqlog(@,&1)));
- (monkey holds=&1.object);
- -->
- make (goal status=active; type=walk;
- X=&1.X; Y=&1.Y);
- };
-
- };