Main Page   Files   Productions   Problem Spaces   Operators   Goal Hierarchy   Groups   Prod. By Type   Todo   All  


output.soar

blocks_world/
     elaborations/
         output.soar [src]

Go to the documentation for this file...

00001 
00002 ##!
00003 # @file elaborations/output.soar
00004 # @brief Implement the "rules" of Blocks World (internalised action).
00005 #
00006 # @desc  
00007 #   <p>As we are internalising the blocks world problem space and not implementing
00008 #   it externally (via the input/output structures) we must define the "rules" of
00009 #   the game via three production rules. These implement the operator
00010 #   "move-block" during the apply phase, modifying the internal model of
00011 #   Blocks World appropriately.</p>
00012 #   <p>To do this we remove the previous "on"/"below" attributes and replace them
00013 #   with new attributes, i.e. "on.table" or "below.o" (where "o" denotes being open,
00014 #   or rather clear).</p>
00015 #   <p>These rules are fairly complicated - early versions contained bugs!</p>
00016 
00017 
00018 ##!
00019 # @production apply*move-block*to-table
00020 # @brief 
00021 #
00022 # @desc <blockquote><i>
00023 #   Move a block to the table (when allowed), updating the both the moving block
00024 #   and the (origin) block was sitting on.
00025 #   </i></blockquote> 
00026 # @problem-space any-ps
00027 # @operator move-block
00028 # @type application
00029 
00030 sp {apply*move-block*to-table
00031    (state <s> ^operator <op>
00032               ^block <moving> {<> <moving> <origin>})
00033    (<op> ^name move-block
00034         ^block <m>
00035         ^destination table)
00036    (<moving> ^name <m> ^on <o> ^below o)
00037    (<origin> ^name <o>         ^below <m>)
00038 -->
00039    (<moving> ^on table ^on <o> -)
00040    (<origin> ^below o ^below <m> - )}
00041 
00042 ##!
00043 # @production apply*move-block*from-table*to-block
00044 # @brief 
00045 #
00046 # @desc <blockquote><i>
00047 #   Move a block from the table to another block (when allowed), updating the
00048 #   moving block and destination block.
00049 #   </i></blockquote> 
00050 # @problem-space any-ps
00051 # @operator move-block
00052 # @type application
00053 
00054 sp {apply*move-block*from-table*to-block
00055    (state <s> ^operator <op>
00056               ^block <moving> {<> <moving> <dest>})
00057    (<op> ^name move-block
00058         ^block <m>
00059         ^destination { <> table <d> })
00060    (<moving> ^name <m> ^on table ^below o)
00061    (<dest>   ^name <d>           ^below o)
00062 -->
00063    (<moving> ^on <d>    ^on table -)
00064    (<dest>   ^below <m> ^below o -)}
00065 
00066 ##!
00067 # @production apply*move-block*from-block*to-block
00068 # @brief 
00069 #
00070 # @desc <blockquote><i>
00071 #   Move a block from one block to another block (when allowed), updating the
00072 #   moving block, the (origin) block it was sitting on, and destination block.
00073 #   </i></blockquote> 
00074 # @problem-space any-ps
00075 # @operator move-block
00076 # @type application
00077 
00078 sp {apply*move-block*from-block*to-block
00079    (state <s> ^operator <op>
00080               ^block <moving> {<> <moving> <origin>}
00081                               {<> <moving> <> <origin> <dest>})
00082    (<op> ^name move-block
00083         ^block <m>
00084         ^destination { <> table <d> })
00085    (<moving> ^name <m> ^on { <> table <o> } ^below o)
00086    (<dest>   ^name <d>                      ^below o)
00087    (<origin> ^name <o>                      ^below <m>)
00088 -->
00089    (<moving> ^on <d>    ^on <o> -)
00090    (<dest>   ^below <m> ^below o -)
00091    (<origin> ^below o   ^below <m> -)}
00092    
00093    

Generated with SoarDoc on Mon Jan 24 15:38:26 2005 by richard