sp {elaborate*task*tanksoar
   (state <s> ^superstate nil)
   -->
   (<s> ^name tanksoar)}

sp {elaborate*top-state*top-state
  (state <s> ^name tanksoar)
-->
  (<s> ^top-state <s>)}

sp {elaborate*state*energy*low
   (state <s> ^name tanksoar
              ^io.input-link.energy <= 200)
   -->
   (<s> ^missiles-energy low)}

sp {elaborate*state*missiles*low
   (state <s> ^name tanksoar
              ^io.input-link.missiles 0)
   -->
   (<s> ^missiles-energy low)}

## These are used in retreat/move.soar
sp {elaborate*sidestep-directions
   (state <s> ^name tanksoar)
   -->
   (<s> ^side-direction <sd>)
   (<sd> ^forward right left  
         ^backward right left
         ^right forward backward 
         ^left forward backward)}

sp {elaborate*directions
   (state <s> ^name tanksoar)
-->
   (<s> ^direction-map <tns>
        ^radar-map <dirp>
        ^opposite-direction <opp>
        ^maze-size 14)
   (<tns> ^north <north>
          ^south <south>
          ^west <west>
          ^east <east>)
   (<north> ^right east  ^left west  ^backward south ^forward north)
   (<south> ^right west  ^left east  ^backward north ^forward south)
   (<west>  ^right north ^left south ^backward east  ^forward west)
   (<east>  ^right south ^left north ^backward west  ^forward east)
   (<dirp> ^north <northp>
           ^south <southp>
           ^west <westp>
           ^east <eastp>)
   (<northp> ^center <cr> ^right <nr> ^left <nl> ^sx 0 ^sy -1)
   (<southp> ^center <cr> ^right <sr> ^left <sl> ^sx 0 ^sy 1)
   (<westp>  ^center <cr> ^right <wr> ^left <wl> ^sx -1 ^sy 0)
   (<eastp>  ^center <cr> ^right <er> ^left <el> ^sx 1 ^sy 0)
   (<cr>  ^x   0 ^y  0)
   (<nr>  ^x   1 ^y  0)
   (<nl>  ^x  -1 ^y  0)
   (<sr>  ^x  -1 ^y  0)
   (<sl>  ^x   1 ^y  0)
   (<wr>  ^x   0 ^y  -1)
   (<wl>  ^x   0 ^y   1)
   (<er>  ^x   0 ^y   1)
   (<el>  ^x   0 ^y  -1)
   (<opp> ^forward backward
          ^backward forward
          ^left right
          ^right left)
}
