NAL-Game-4
==========

1. Overall function

Initial goals:
//Make something that is an enemy gain the struck property!
(&&,<#1() --> [struck]>,<#1() --> enemy>)! 

Given knowledge:
//e001 is an enemy
<{e001} --> enemy>. 
//w002 is a weapon.
<{w002} --> weapon>. %0.93;0.82%
//e001 and gate005 are reachable.
<(*,{e001},{gate005}) --> reachable>. %1.00;0.90%
//If I use the go-to operation for some place, then I will be at the location of this place.
<<(*,#x)--> ^go-to> =/> <(*,Self,#x) --> AtLocation>>.
//If some place and something are both reachable, and I am at this location, and the thing at this location is struck with a weapon, then this thing will gain the struck property.
<(&/,<(*,#1,#3(#1))-->reachable>,<(*,Self,#3(#1))-->AtLocation>,<#1-->(/,^strike,#2(#1),_)>,<#2(#1)-->weapon>)==><#1-->[struck]>>.

Executed operations:
EXECUTE: ^go-to(Self,{gate005})
EXECUTE: ^strike({w002},{e001})

Including everything from the previous version, this set of input also includes the task of going to the enemy's location, which is specified as {gate005}. To do this, the command is added, along with the information of the enemy's current locale and the statement which states "if the enemy is reachable, and I go to the enemy, then I am at the location of the enemy.

2. Step sequence

*1*
IN: (&&,<#1() --> [struck]>,<#1() --> enemy>)! %1.00;0.90% {0 : 1} 
IN: <{e001} --> enemy>. %1.00;0.90% {0 : 2} 
8
OUT: <{e001} --> [struck]>! %1.00;0.81% {8 : 2;1} 

*2*
  IN: <{e001} --> [struck]>! %1.00;0.81% {0 : 1} 
  IN: <(&/,<(*,#1,#2()) --> reachable>,<(*,Self,#2()) --> AtLocation>,<#3() --> weapon>,<(*,#3(),#1) --> ^strike>) ==> <#1 --> [struck]>>. %1.00;0.90% {0 : 2} 
13
 OUT: (&/,<(*,{e001},#1()) --> reachable>,<(*,Self,#1()) --> AtLocation>,<#2() --> weapon>,<(*,#2(),{e001}) --> ^strike>)! %1.00;0.73% {13 : 2;1} 

*3*
  IN: (&/,<(*,{e001},#1()) --> reachable>,<(*,Self,#1()) --> AtLocation>,<#2() --> weapon>,<(*,#2(),{e001}) --> ^strike>)! %1.00;0.73% {0 : 1} 
  IN: <(*,{e001},{gate005}) --> reachable>. %1.00;0.90% {0 : 2} 
10
 OUT: (&/,<(*,Self,{gate005}) --> AtLocation>,<#1() --> weapon>,<(*,#1(),{e001}) --> ^strike>)! %1.00;0.66% {10 : 2;1}

*4*
  IN: (&/,<(*,Self,{gate005}) --> AtLocation>,<#1() --> weapon>,<(*,#1(),{e001}) --> ^strike>)! %1.00;0.66% {0 : 1} 
10
 OUT: <(*,Self,{gate005}) --> AtLocation>! %1.00;0.37% {10 : 1} 

*5*
  IN: <(*,Self,{gate005}) --> AtLocation>! %1.00;0.37% {0 : 1} 
  IN: <<(*,#1) --> ^go-to> =/> <(*,Self,#1) --> AtLocation>>. %1.00;0.90% {0 : 2} 
14
  OUT: (^go-to,{gate005})! %1.00;0.33% {14 : 2;1} 

*6*
  IN: (^go-to,{gate005})! %1.00;0.33% {0 : 1} 
1
 OUT: (^go-to,{gate005}). :|: %1.00;0.90% {1 : 1 : 2} 
[EXECUTE: ^go-to({gate005})]

*7*
  IN: (^go-to,{gate005}). :|: %1.00;0.90% {0 : 0 : 1} 
  IN: <(^go-to,#1)=/><(*,Self,#1) --> AtLocation>>. %1.00;0.90% {0 : 2} 
22
 OUT: <Self --> (/,AtLocation,_,{gate005})>. :\: %1.00;0.81% {22 : 1 : 2;1} 

*8*
  IN: <Self --> (/,AtLocation,_,{gate005})>. :\: %1.00;0.81% {0 : -1 : 1} 
  IN: (&/,<(*,Self,{gate005}) --> AtLocation>,<#1() --> weapon>,<(*,#1(),{e001}) --> ^strike>)! %1.00;0.66% {0 : 2} 
22
 OUT: (&/,<#1() --> weapon>,<(*,#1(),{e001}) --> ^strike>)! %1.00;0.53% {22 : 1;2}

*9*
  IN: (&/,<#1() --> weapon>,<(*,#1(),{e001}) --> ^strike>)! %1.00;0.53% {0 : 1} 
  IN: <{w002} --> weapon>. %0.93;0.82% {0 : 2} 
16
  OUT: (^strike,{w002},{e001})! %0.93;0.40% {16 : 2;1} 

*10*
  IN: <(*,{w002},{e001}) --> ^strike>! %0.93;0.40% {0 : 1} 
1
 OUT: (^strike,{w002},{e001}). :|: %1.00;0.90% {1 : 1 : 2} 
[EXECUTE: ^strike({w002},{e001})]

3.  Description
The difference between these inputs from the previous system is the addition of the requirement of approaching the enemy before he can be struck. To begin this, the command must be declared, along with a sentence stating how it can be executed, as seen in step 4. Using the new command from the output in step 4, along with a sentence informing that the enemy can in fact be reached, this finally produces the command to execute ^go-to on the enemy's location.