§ SUPPLEMENTARY MATERIALS: ASSESSING THE INTERPRETABILITY OF PROGRAMMATIC POLICIES WITH LARGE LANGUAGE MODELS

§ DISCUSSION

The prompts for explanation, reconstruction, and verification of both C Programming Problems and Programmatic Policies are detailed in the subsequent sections. The distinction between the two is based on the language in which they're implemented. For C Programming Problems, there's no need to clarify any domain-specific language since the programs are written in C and the LLM is already acquainted with its terminology. On the other hand, Programmatic Policies utilize a language unique to MicroRTS. As a result, it's necessary to define this language and its components to the LLM. Specifically, for the explanation prompt, we must elucidate the DSL to ensure the LLM comprehends the program it's about to explain. Similarly, the DSL must be defined during reconstruction to ensure the regenerated program follows the MicroRTS programming rules. The same applies to the verifier.

§ MICRORTS PROMPTS

§.§ Explainer Prompt

[breakable, width=+1cm]
MicroRTS (ONTANÓN, 2013) is an implementation of a real-time strategy game, played between two players. Each player controls a set of units of different types.

* Worker units can:

* collect resources

* build structures (Barracks and Bases)

* attack opponent units

* Barracks and Bases:

* Barracks can train combat units. (they can produce Light, Heavy or Ranged units)

* Bases can train the Workers. (they can only produce Workers)

* They can neither attack opponents units nor move.

* Combat units:

* can be of type Light, Heavy, or Ranged.

* These units differ in:

* how long they survive a battle

* how much damage they can inflict to opponent units

* how close they need to be from opponent units to attack them.

* They can attack the oppponent units.

* Resource units:

* The source of resources, doesn't belong to any player.

* These units cannot execute any actions.

* When the number of resources left reaches 0, the unit disappears. (It only has one parameter: resources left.)

Actions are deterministic and there is no hidden information in MicroRTS. A match is played on a map and each map might require a different strategy for defeating the opponent.

This CFG allows nested loops and conditionals. It contains several Boolean functions (B) and command-oriented functions (C) that provide either information about the current state of the game or commands for the ally units. The following describes a scripting language for playing MicroRTS.

The Boolean functions are described below:

* u.hasNumberOfUnits(T, N): Checks if the ally player has N units of type T.

* u.opponentHasNumberOfUnits(T, N): Checks if the opponent player has N units of type T.

* u.hasLessNumberOfUnits(T, N): Checks if the ally player has less than N units of type T.

* u.haveQtdUnitsAttacking(N): Checks if the ally player has N units attacking the opponent.

* u.hasUnitWithinDistanceFromOpponent(N): Checks if the ally player has a unit within a distance N from a opponent’s unit.

* u.hasNumberOfWorkersHarvesting(N): Checks if the ally player has N units of type Worker harvesting resources.

* u.is_Type(T): Checks if a unit is an instance of type T.

* u.isBuilder(): Checks if a unit is of type Worker.

* u.canAttack(): Checks if a unit can attack.

* u.hasUnitThatKillsInOneAttack(): Checks if the ally player has a unit that kills an opponent’s unit with one attack action.

* u.opponentHasUnitThatKillsUnitInOneAttack(): Checks if the opponent player has a unit that kills an ally’s unit with one attack action.
v u.hasUnitInOpponentRange(): Checks if an unit of the ally player is within attack range of an opponent’s unit.

* u.opponentHasUnitInPlayerRange(): Checks if an unit of the opponent player is within attack range of an ally’s unit.

* u.canHarvest(): Checks if a unit can harvest resources.

The Command functions are described below. These functions assign actions to units.

* u.build(T, D, N): Builds N units of type T on a cell located on the D direction of the unit.

* u.train(T, D, N): Trains N units of type T on a cell located on the D direction of the structure responsible for training them.

* u.moveToUnit(T_p, O_p): Commands a unit to move towards the player T_p following a criterion O_p.

* u.attack(O_p): Sends N Worker units to harvest resources.

* u.harvest(N): Sends N Worker units to harvest resources.

* u.idle(): Commands a unit to stay idle and attack if an opponent unit comes within its attack range.

* u.moveAway(): Commands a unit to move in the opposite direction of the player's base.
'T' represents the types a unit can assume. 'N' is a set of integers. 'D' represents the directions available used in action functions.
'O_p' is a set of criteria to select an opponent unit based on their current state. 'T_p' represents the set of target players.
'e' is an empty block which means doing nothing.

The for loops in this scripting language iterate over all units and the instructions inside the for loops attempt to assign actions to each of these units. For example,
for (Unit u)
u.build(Barracks, EnemyDir, 8)

The snippet above will assign a build action to unit u. Note that the only unit that can build is Worker. In the for loop above, if u is Ranged, for example, then the instruction u.build(Barracks,EnemyDir,8) will be ignored.
Once an action is assigned to a unit, it cannot be changed. That is why the for loops offer a priority scheme to the actions. The way that for loop are organized is perhaps the most important feature of this language. The program always has the form:
for (Unit u)
With the possibility of adding nested for-loops that go through all units.
The parameter in each instruction limits the amount of the thing that is trained or build. For example, u.build(Barracks, EnemyDir, 8) limits to at most 8 Barracks. If the player already has 8 barracks, then this instruction will be ignored.
Now, you have the background you need to know!

Now, given the above information, first try to understand the meanings of all the boolean (B) and command (C) functions from above and try to relate them in the context of microRTS playing strategies.

Alright, let's take a look at program P in which I want you to write an explanation for:

Program P

The following 7 are some guidelines for writing an explanation for this strategy:

* Please write a high-level explanation and do not explain the code line by line but try to include numbers and unit names in your natural language explanation.

* Try to understand what is happening in the code and explain it in natural language for someone who wants to know how to play MicroRTS using this strategy.

* Write the explanation inside `$<explanation></explanation>$' tag.

* DON'T USE any quotation marks in writing the explanation.

* At the end of the explanation, write the overall goal of the strategy as well. (include it inside the explanation tag)

* Don't forget to mention the numbers but in a natural language way.

* The for-loops offer a hierarchy that determines the priority of the actions.

The list below specifies the different priorities for actions one can obtain with the for-loops (from highest to lowest priority).

* Actions inserted in nested for-loops at the top of the program receives the highest priority.

* Actions inserted in nested for-loops that appear later in the program have higher priority than actions that appear outside a nested for loop.

* Actions outside the nested for-loops that appear earlier in the program have higher priority than actions outside for-loops that appear later in the program.

The most important part of the explanation is to be clear with respect to the priority of the actions. That is, what is the action with highest priority, which one follows that one, and so on. You MUST NOT talk in terms of for-loops and programming language jargon as people not familiar with programming will not understand the explanation. Also, you MUST not use any `nest' or `nested' words as they are related to programming elements. You should talk in terms of priorities of the actions, as you would explain the strategy to a gamer.

For example, if an action is within a nested for loop, then you need to say that the priority to this action is the highest. If an action isn't within a nested for loop, then you must say that the priority isn't the highest.

So, following the instructions, can you provide a high-level explanation of the provided program that another instance of LLM can rewrite this program from that summary? Remember to verify the priority of the actions, they should be well explained in your text (e.g., this action has the highest priority, this has the second highest and so on).

§.§ Reconstructor Prompt

[breakable, width=+1cm]
MicroRTS (ONTANÓN, 2013) is an implementation of a real-time strategy game, played between two players. Each player controls a set of units of different types.

* Worker units can:

* collect resources

* build structures (Barracks and Bases)

* attack opponent units

* Barracks and Bases:

* Barracks can train combat units. (they can produce Light, Heavy or Ranged units)

* Bases can train the Workers. (they can only produce Workers)

* They can neither attack opponents units nor move.

* Combat units:

* can be of type Light, Heavy, or Ranged.

* These units differ in:

* how long they survive a battle

* how much damage they can inflict to opponent units

* how close they need to be from opponent units to attack them.

* They can attack the oppponent units.

* Resource units:

* The source of resources, doesn't belong to any player.

* These units cannot execute any actions.

* When the number of resources left reaches 0, the unit disappears. (It only has one parameter: resources left.)

Actions are deterministic and there is no hidden information in MicroRTS. A match is played on a map and each map might require a different strategy for defeating the opponent.

Here, I provided a context free grammar (CFG) of microRTS playing strategy inside the $<CFG>$$</CFG>$ tag written bellow:

\begin{align*}
\text{$<CFG>$} \\
S &\to SS \mid \text{for(Unit u) S} \mid \text{if(B) then S} \\
&\quad \mid \text{if(B) then S else S} \mid C \mid \lambda \\
B &\to u.\text{hasNumberOfUnits}(T, N) \\
&\quad \mid u.\text{opponentHasNumberOfUnits}(T, N) \\
&\quad \mid u.\text{hasLessNumberOfUnits}(T, N) \\
&\quad \mid u.\text{haveQtdUnitsAttacking}(N) \\
&\quad \mid u.\text{hasUnitWithinDistanceFromOpponent}(N) \\
&\quad \mid u.\text{hasNumberOfWorkersHarvesting}(N) \\
&\quad \mid u.\text{canAttack()} \\
&\quad \mid u.\text{hasUnitThatKillsInOneAttack()} \\
&\quad \mid u.\text{opponentHasUnitThatKillsUnitInOneAttack()} \\
&\quad \mid u.\text{hasUnitInOpponentRange()} \\
&\quad \mid u.\text{opponentHasUnitInPlayerRange()} \\
&\quad \mid u.\text{canHarvest()}\\
C &\to u.\text{build}(T, D, N) \mid u.\text{train}(T, D, N) \mid u.\text{moveToUnit}(T_p, O_p) \\
&\quad \mid u.\text{attack}(O_p) \mid u.\text{harvest}(N) \\
&\quad \mid u.\text{idle()} \mid u.\text{moveAway()}\\
T &\to \text{Base} \mid \text{Barracks} \mid \text{Ranged} \mid \text{Heavy} \\
&\quad \mid \text{Light} \mid \text{Worker} \\
N &\to 0 \mid 1 \mid 2 \mid 3 \mid 4 \mid 5 \mid 6 \mid 7 \mid 8 \mid 9 \\
&\quad \mid 10 \mid 15 \mid 20 \mid 25 \mid 50 \mid 100\\
D &\to \text{EnemyDir} \mid \text{Up} \mid \text{Down} \mid \text{Right} \mid \text{Left}\\
O_p &\to \text{Strongest} \mid \text{Weakest} \mid \text{Closest} \mid \text{Farthest} \\
&\quad \mid \text{LessHealthy} \mid \text{MostHealthy} \mid \text{Random}\\
T_p &\to \text{Ally} \mid \text{Enemy}\\
\text{$</CFG>$}
\end{align*}

This CFG allows nested loops and conditionals. It contains several Boolean functions (B) and command-oriented functions (C) that provide either information about the current state of the game or commands for the ally units. The following describes a scripting language for playing MicroRTS.

The Boolean functions are described below:

* u.hasNumberOfUnits(T, N): Checks if the ally player has N units of type T.

* u.opponentHasNumberOfUnits(T, N): Checks if the opponent player has N units of type T.

* u.hasLessNumberOfUnits(T, N): Checks if the ally player has less than N units of type T.

* u.haveQtdUnitsAttacking(N): Checks if the ally player has N units attacking the opponent.

* u.hasUnitWithinDistanceFromOpponent(N): Checks if the ally player has a unit within a distance N from a opponent’s unit.

* u.hasNumberOfWorkersHarvesting(N): Checks if the ally player has N units of type Worker harvesting resources.

* u.is_Type(T): Checks if a unit is an instance of type T.

* u.isBuilder(): Checks if a unit is of type Worker.

* u.canAttack(): Checks if a unit can attack.

* u.hasUnitThatKillsInOneAttack(): Checks if the ally player has a unit that kills an opponent’s unit with one attack action.

* u.opponentHasUnitThatKillsUnitInOneAttack(): Checks if the opponent player has a unit that kills an ally’s unit with one attack action.
v u.hasUnitInOpponentRange(): Checks if an unit of the ally player is within attack range of an opponent’s unit.

* u.opponentHasUnitInPlayerRange(): Checks if an unit of the opponent player is within attack range of an ally’s unit.

* u.canHarvest(): Checks if a unit can harvest resources.

The Command functions are described below. These functions assign actions to units.

* u.build(T, D, N): Builds N units of type T on a cell located on the D direction of the unit.

* u.train(T, D, N): Trains N units of type T on a cell located on the D direction of the structure responsible for training them.

* u.moveToUnit(T_p, O_p): Commands a unit to move towards the player T_p following a criterion O_p.

* u.attack(O_p): Sends N Worker units to harvest resources.

* u.harvest(N): Sends N Worker units to harvest resources.

* u.idle(): Commands a unit to stay idle and attack if an opponent unit comes within its attack range.

* u.moveAway(): Commands a unit to move in the opposite direction of the player's base.
`T' represents the types a unit can assume. `N' is a set of integers. `D' represents the directions available used in action functions.
`O_p' is a set of criteria to select an opponent unit based on their current state. `T_p' represents the set of target players.
`e' is an empty block which means doing nothing.

The for loops in this scripting language iterate over all units and the instructions inside the for loops attempt to assign actions to each of these units. For example,
for (Unit u)
u.build(Barracks, EnemyDir, 8)

The snippet above will assign a build action to unit u. Note that the only unit that can build is Worker. In the for loop above, if u is Ranged, for example, then the instruction u.build(Barracks,EnemyDir,8) will be ignored.
Once an action is assigned to a unit, it cannot be changed. That is why the for loops offer a priority scheme to the actions. The way that for loop are organized is perhaps the most important feature of this language. The program always has the form:
for (Unit u)
With the possibility of adding nested for-loops that go through all units.
The parameter in each instruction limits the amount of the thing that is trained or build. For example, u.build(Barracks, EnemyDir, 8) limits to at most 8 Barracks. If the player already has 8 barracks, then this instruction will be ignored.
Now, you have the background you need to know!

Here is a summary of a programmatic strategy generated by a large language model. Let's Call it `LLM-Explanation' which was generated as an explanation of a strategic program for playing MicroRTS.

Explanataion E

The following 7 are some guidelines for writing a program in MicroRTS:

* There is NO NEED TO write classes, initiate objects such as Unit, Worker, etc.

* You should NOT WRITE any comments in the code. (A comment is written in this format //comment, so avoid it!)

* Use curly braces like C/C++/Java while writing any `for' or `if' or `if-else' block. Start the curly braces in the same line of the block.

* Do not write `else if(B) {' block. Write `else { if(B) {...}}' instead.

* The format of the generated code must be the same as the example provided earlier. (not the content, the just the general structure)

* Write only the pseudocode inside `$<strategy></strategy>$' tag.

* The strategy should be written inside one or several `for' blocks.

Your tasks are the following 11:

* Understand the meanings of all the boolean (B) and command (C) functions from above and try to relate them in the context of microRTS playing strategies.

* Given the instructions on how to write a program and the explanation from the large language model('LLM-Explanation') provided earlier, can you write down the strategy encoded in the explanation and reconstruct the program in the MicroRTS scripting language? (Please only use the language provided)

* You must not use any symbols (for example: &&, $||$, etc.) outside this given CFG. You have to strictly follow this CFG while writing the pseudocode.

* Look carefully, the methods of non-terminal symbols B and C have prefixes `u.' in the examples since they are methods of the object `Unit u'. You also need to follow the patterns of the example provided earlier.

* Write only the pseudocode inside `$<strategy></strategy>$' tag.

* Do not write unnecessary symbols of the CFG such as, `$ ->$', `$->$', etc.

* When you encounter parentheses in an expression or code, their opening and closing positions are crucial as they indicate the inclusion of some statements within others. The most important feature of this language is how the nested for-loops work and where they start and finish. The for-loops offer an hierarchy that determines the priority of the actions. The list below specifies the different priorities for actions one can obtain with the for-loops (from highest to lowest priority).

* Actions inserted in nested for-loops at the top of the program receives the highest priority.

* Actions inserted in nested for-loops that appear later in the program have higher priority than actions that appear outside a nested for loop.

* Actions outside the nested for-loops that appear earlier in the program have higher priority than actions outside for-loops that appear later in the program.

* Check the pseudocode and ensure it does not violate the rules of the CFG or the guidelines of writing the strategy.

* Conditional structures such as if-statements are rarely needed. Use an if-statement only if you are sure that you need them to implement the strategy. For example, you should NOT use if-statements to ensure that a number of units is trained as these numbers are already handled by the action functions.

* For efficiency reasons, your program should have at most 2 levels of nested loops.

* Double check whether the priorities of the actions are matching with the nested for-loop structure of your program.

* The instructions with highest priority should be placed in innermost loops. If you aren't sure about an action, then leave it in the main for-loop.

§.§ Verifier Prompt

[breakable, width=+1cm]
MicroRTS (ONTANÓN, 2013) is an implementation of a real-time strategy game, played between two players. Each player controls a set of units of different types.

* Worker units can:

* collect resources

* build structures (Barracks and Bases)

* attack opponent units

* Barracks and Bases:

* Barracks can train combat units. (they can produce Light, Heavy or Ranged units)

* Bases can train the Workers. (they can only produce Workers)

* They can neither attack opponents units nor move.

* Combat units:

* can be of type Light, Heavy, or Ranged.

* These units differ in:

* how long they survive a battle

* how much damage they can inflict to opponent units

* how close they need to be from opponent units to attack them.

* They can attack the oppponent units.

* Resource units:

* The source of resources, doesn't belong to any player.

* These units cannot execute any actions.

* When the number of resources left reaches 0, the unit disappears. (It only has one parameter: resources left.)

Actions are deterministic and there is no hidden information in MicroRTS. A match is played on a map and each map might require a different strategy for defeating the opponent.

Here, I provided a context free grammar (CFG) of microRTS playing strategy inside the $<CFG>$$</CFG>$ tag written bellow:

\begin{align*}
\text{$<CFG>$} \\
S &\to SS \mid \text{for(Unit u) S} \mid \text{if(B) then S} \\
&\quad \mid \text{if(B) then S else S} \mid C \mid \lambda \\
B &\to u.\text{hasNumberOfUnits}(T, N) \\
&\quad \mid u.\text{opponentHasNumberOfUnits}(T, N) \\
&\quad \mid u.\text{hasLessNumberOfUnits}(T, N) \\
&\quad \mid u.\text{haveQtdUnitsAttacking}(N) \\
&\quad \mid u.\text{hasUnitWithinDistanceFromOpponent}(N) \\
&\quad \mid u.\text{hasNumberOfWorkersHarvesting}(N) \\
&\quad \mid u.\text{canAttack()} \\
&\quad \mid u.\text{hasUnitThatKillsInOneAttack()} \\
&\quad \mid u.\text{opponentHasUnitThatKillsUnitInOneAttack()} \\
&\quad \mid u.\text{hasUnitInOpponentRange()} \\
&\quad \mid u.\text{opponentHasUnitInPlayerRange()} \\
&\quad \mid u.\text{canHarvest()}\\
C &\to u.\text{build}(T, D, N) \mid u.\text{train}(T, D, N) \mid u.\text{moveToUnit}(T_p, O_p) \\
&\quad \mid u.\text{attack}(O_p) \mid u.\text{harvest}(N) \\
&\quad \mid u.\text{idle()} \mid u.\text{moveAway()}\\
T &\to \text{Base} \mid \text{Barracks} \mid \text{Ranged} \mid \text{Heavy} \\
&\quad \mid \text{Light} \mid \text{Worker} \\
N &\to 0 \mid 1 \mid 2 \mid 3 \mid 4 \mid 5 \mid 6 \mid 7 \mid 8 \mid 9 \\
&\quad \mid 10 \mid 15 \mid 20 \mid 25 \mid 50 \mid 100\\
D &\to \text{EnemyDir} \mid \text{Up} \mid \text{Down} \mid \text{Right} \mid \text{Left}\\
O_p &\to \text{Strongest} \mid \text{Weakest} \mid \text{Closest} \mid \text{Farthest} \\
&\quad \mid \text{LessHealthy} \mid \text{MostHealthy} \mid \text{Random}\\
T_p &\to \text{Ally} \mid \text{Enemy}\\
\text{$</CFG>$}
\end{align*}

This CFG allows nested loops and conditionals. It contains several Boolean functions (B) and command-oriented functions (C) that provide either information about the current state of the game or commands for the ally units. The following describes a scripting language for playing MicroRTS.

The Boolean functions are described below:

* u.hasNumberOfUnits(T, N): Checks if the ally player has N units of type T.

* u.opponentHasNumberOfUnits(T, N): Checks if the opponent player has N units of type T.

* u.hasLessNumberOfUnits(T, N): Checks if the ally player has less than N units of type T.

* u.haveQtdUnitsAttacking(N): Checks if the ally player has N units attacking the opponent.

* u.hasUnitWithinDistanceFromOpponent(N): Checks if the ally player has a unit within a distance N from a opponent’s unit.

* u.hasNumberOfWorkersHarvesting(N): Checks if the ally player has N units of type Worker harvesting resources.

* u.is_Type(T): Checks if a unit is an instance of type T.

* u.isBuilder(): Checks if a unit is of type Worker.

* u.canAttack(): Checks if a unit can attack.

* u.hasUnitThatKillsInOneAttack(): Checks if the ally player has a unit that kills an opponent’s unit with one attack action.

* u.opponentHasUnitThatKillsUnitInOneAttack(): Checks if the opponent player has a unit that kills an ally’s unit with one attack action.
v u.hasUnitInOpponentRange(): Checks if an unit of the ally player is within attack range of an opponent’s unit.

* u.opponentHasUnitInPlayerRange(): Checks if an unit of the opponent player is within attack range of an ally’s unit.

* u.canHarvest(): Checks if a unit can harvest resources.

The Command functions are described below. These functions assign actions to units.

* u.build(T, D, N): Builds N units of type T on a cell located on the D direction of the unit.

* u.train(T, D, N): Trains N units of type T on a cell located on the D direction of the structure responsible for training them.

* u.moveToUnit(T_p, O_p): Commands a unit to move towards the player T_p following a criterion O_p.

* u.attack(O_p): Sends N Worker units to harvest resources.

* u.harvest(N): Sends N Worker units to harvest resources.

* u.idle(): Commands a unit to stay idle and attack if an opponent unit comes within its attack range.

* u.moveAway(): Commands a unit to move in the opposite direction of the player's base.
`T' represents the types a unit can assume. `N' is a set of integers. `D' represents the directions available used in action functions.
`O_p' is a set of criteria to select an opponent unit based on their current state. `T_p' represents the set of target players.
`e' is an empty block which means doing nothing.

The for loops in this scripting language iterate over all units and the instructions inside the for loops attempt to assign actions to each of these units. For example,
for (Unit u)
u.build(Barracks, EnemyDir, 8)

The snippet above will assign a build action to unit u. Note that the only unit that can build is Worker. In the for loop above, if u is Ranged, for example, then the instruction u.build(Barracks,EnemyDir,8) will be ignored.
Once an action is assigned to a unit, it cannot be changed. That is why the for loops offer a priority scheme to the actions. The way that for loop are organized is perhaps the most important feature of this language. The program always has the form:
for (Unit u)
With the possibility of adding nested for-loops that go through all units.
The parameter in each instruction limits the amount of the thing that is trained or build. For example, u.build(Barracks, EnemyDir, 8) limits to at most 8 Barracks. If the player already has 8 barracks, then this instruction will be ignored.
Now, you have the background you need to know!

I have a program P which is written in MicroRTS language. It provides an strategy for playing the real-time strategy game. Here is the program:

Program P

Then, I’m asking the first instance of an LLM for a high-level explanation without any programming jargon about the program so that another instance of LLM can regenerate the code using that explanation.
The first LLM gave me this:

Explanation E

Now, I want to know if the explanation is using any computer programming jargon or provides step by step or line by line instructions to reconstruct the program? (Answer with yes or no first and then explain why)

§ COMPUTER PROGRAMMING PROMPTS

§.§ Explainer Prompt

[breakable, width=+1cm]
Can you explain in plain English, without programming jargon, and without saying what the algorithm does (that is you cannot just say it does something (e.g. computes the proper subset of a set of arguments), what this program does? It needs to be detailed enough so that another LLM is able to write this program from your description.

Be careful to give me a high-level natural language explanation. I don't want to see any variable names and code elements in the text.

Also, write the explanation inside `$<$explanation$>$$<$/explanation$>$' tag.

REMEMBER, don't use any programming jargon!

§.§ Reconstructor Prompt

[breakable, width=+1cm]
Can you write the encrypted strategy in the explanation below in C?

Explanation E

§.§ Verifier Prompt

[breakable, width=+1cm]
I have a program P which that does something. Here is the program:

Program P

Then, I’m asking an LLM for a high-level explanation of the program without any programming jargon so that another LLM can regenerate the code using that explanation.

The first LLM gave me this:

Explanation E

Now, I want to know if the explanation uses any computer programming jargon or provides step by step or line by line instructions to reconstruct the program? (Answer with yes or no first and then explain why)

§.§.§ Verifier Examples

Here are two explanations for Program 2, produced by the LLM from the pool of C programming problems that received distinct feedback from the Verifier.

[breakable, width=+1cm]

Explanataion 1:
The program consists of two main parts. The first part sets up two long numbers with a value of zero. It then defines a pattern using the two numbers in such a way that their values change according to the defined pattern. The pattern looks like a triangle when visualized, starting with a single instance at the top, expanding in width as it goes down, and then contracting again towards the bottom. The process involves decreasing the first number if certain conditions involving the two numbers are met, while the second number keeps increasing. This operation goes on until the first number reaches a certain condition.

The second part of the program uses the values of the two numbers after the pattern operation and performs a calculation using them. This calculation involves multiplying the negative of the first number by 4 and then dividing by the square of the second number. The result of this calculation is then displayed with three decimal places.

Verfier Response for Explanation 1:

The provided explanation contains programming jargon such as "long numbers," indicating data types, and references conditional and iterative operations through phrases like "certain conditions" and “keeps increasing.” Furthermore, specific mathematical operations are detailed, and the triangular pattern visualization implies a specific code structure. These elements, together, give insights into the logic and operations of the program, potentially aiding in its reconstruction.

[breakable, width=+1cm]
Explanataion 2:
Imagine you have two containers. One container is filled up to a certain level, and the second one is empty. You start a process in which you keep taking a little bit from the filled container and putting it into the empty container. The process has two specific rules:
1. You only stop transferring when the filled container is empty.
2. The rate at which you take from the filled container decreases every time.

After the process is finished, you examine the amount you've moved compared to the original amount in the filled container. Then, using this relationship, you calculate a number and display it.

Verfier Response for Explanation 2:

The explanation does not use computer programming jargon, and it doesn't provide step-by-step instructions to reconstruct the program. The given description uses an analogy of two containers and a transfer process between them, without referencing any specific programming constructs or operations. It describes the behavior of the program at a high level, but it does not give details about how the program implements that behavior.

§ C PROGRAMS POOL

In this section, we present the 10 C programs used in our experiments. The first subsection features the obfuscated programs, accompanied by their explanations and one sample of our $k$ attempts at reconstructing the program. As noted in the paper, none of these attempts successfully reconstructed the program. Following that, the subsequent subsection shows the non-obfuscated implementations alongside one sample from our $k$ successful reconstructions, reaffirming that each was accurately reconstructed as mentioned in the paper.

§.§ Obfuscated C Programs

[breakable, width=+1cm]

P1: This program computes all proper subsets of the set of arguments passed to it.

Imagine you have a collection of phrases. The program performs a unique action on this collection:
Starting from the last phrase and moving towards the first, for each phrase, it:
Repeats the entire routine with the preceding phrases.
Alters the start of the current phrase in a special way.
Goes through the collection from the start. For every phrase that begins in a certain manner, it shows it.
Displays a line of dashes.
Once more, carries out the entire routine with the preceding phrases.
It's like a set of instructions that continuously loops for each phrase, making a specific change and then showcasing certain phrases based on a particular feature of their beginning

Reconstructed Program for P1:

[breakable, width=+1cm]

P2: This program calculates the value of $\pi$.

Imagine a bookkeeper with two tallies, both starting at zero. Now, there's a curious poem-like structure which, when read, provides a series of actions to follow. This poem is a mix of lines, with some lines repeated more times than others.
Every time a certain symbol is encountered in the poem, the bookkeeper has to do two things:

Check if the first tally has reached a certain condition; if not, decrease it.
If the first tally has reached that condition, then check if the second tally meets another condition; if not, decrease it.

After the bookkeeper completes reading through this poem and performs all the actions, there's a simple arithmetic task to be done. Multiply the negative value of the first tally by four, then divide it by the square of the second tally. The result of this arithmetic operation is then shared.

In essence, the poem drives the two tallies towards certain values, and then an arithmetic operation is done using these tallies to give a final result.

Reconstructed Program for P2:

[breakable, width=+1cm]

P3: This program prints the input string sorted alphabetically.

Imagine you have a line of people holding cards with numbers, and next to them is another line of people holding cards with letters. We're focusing on the people holding letters, but they'll sometimes peek at the numbers from the first line.

For every person in the letter line:

Check the position of this person in their line and look at the number they're holding.

If their position in the line is greater than the number on their card:
Take the difference by subtracting the number from their position.
Now, add this difference to the number on their card.
If their position in the line is less than or equal to the number:
Now, take the difference by subtracting their position from the number.
Add this difference to the number on their card.
After doing this, show the letter from that person's card to the audience.

Once every person in the letter line has shown their card after the above adjustments, there's a big applause (or a break).

However, if there's no one in the letter line, just proceed with the applause (or break).

Reconstructed Program for P3:

[breakable, width=+1cm]

P4: This program prints the first 100 prime numbers.

Imagine you have a secret vault with 8 chambers. Initially, each chamber has a unique piece of information. Now, alongside this vault, you also have a special set of 16 cards. Some cards come with information pre-written on them, while others are blank.
Now, you perform a series of operations:

You make a duplicate vault and keep it next to the original one.
Using the original vault's information and the special set of cards, you adjust the information in the duplicate vault. You do this 80 times.
After you're done, you take the adjusted values from the duplicate vault and add them back to the original one.
Next, you modify your set of 16 cards. Some of them are reset to blank, and one specific card is marked with a very large number.

You repeat the same series of operations as before:

Make a duplicate of the original vault.
Use the original vault and the modified set of cards to adjust the duplicate vault.
Merge the adjusted values from the duplicate vault back into the original one.
In the end, you read the information from each chamber of the vault and display it.

Reconstructed Program for P4:

[breakable, width=+1cm]

P5: This program computes the factorial of a number.

This program starts by showing a sequence of symbols on the screen. After that, it waits for you to give it a number.
Using this number, the program goes through a series of steps, repeating them as many times as the number you provided.

It keeps the outcomes of these steps in a series of containers. If one container becomes full, it moves on to fill the next one.

After finishing all the steps, the program shows you the outcomes. It starts by skipping some numbers in the first container that are the same as a certain value. Then, it shows you numbers from each container, grouping them in sets. After showing a certain number of sets, it moves to the next line and keeps showing the numbers. This continues until it has shown you everything.

At the end, it shows a little gap and then stops.

Reconstructed Program for P5:

[breakable, width=+1cm]

P6: This program computes a desired number of digits of $e$ in any desired base.

The program starts by showing you a short message.

If you've told the program one or two numbers when you began, it keeps these numbers in mind. If you told it only one number, it just remembers that one. If you didn't tell it any numbers, it uses some numbers it already knows.

Then, it does a lot of repetitive tasks, like a person moving beans between bowls or sometimes just throwing beans away, following some specific rules.
During these tasks:

1. It occasionally shows you a unique number.

2. At the end, it gives a space.

After all this, the program finishes.

Reconstructed Program for P6:

[breakable, width=+1cm]

P7: This program converts byte to binary.

Imagine you have a machine that takes a number you give it. This machine, using a secret formula and some hidden numbers it already knows, changes your number in various ways. At the end of these changes, the machine sees this result as a word made up of letters and symbols. The machine then shows you only the first part of this word, which is made up of eight characters.

Reconstructed Program for P7:

[breakable, width=+1cm]

P8: This program adds two numbers.

Imagine you have a box of unique toys. This program is like a child playing with these toys, trying out different groups of them. The child takes a few toys out, rearranges them in a specific way, and checks if they fit a special rule. If they do, the child counts how many toys are in that group and shares the number. The child does this for every possible grouping of toys without using the same grouping twice.

Reconstructed Program for P8:

[breakable, width=+1cm]

P9: This program calculates the integer part of square root of the input number.

Imagine you have a sequence of special symbols. Each of these symbols has a hidden number attached to it.

1. The program starts by slightly changing the hidden numbers of these symbols based on a secret rule.
2. For every symbol in the sequence, it does the following:
- It changes the hidden number of the symbol, using a particular method, until a specific situation occurs.
- Once that situation happens, it transforms the hidden number of this symbol into a letter and shows it to you.
3. After revealing the letters for all the symbols in the sequence, it displays one more unique character.

Throughout this process, the program pays attention to the order of the symbols. This is crucial because the middle of the sequence plays a special role. The program uses where a symbol is, compared to the middle, to modify its hidden number in a different way.

Reconstructed Program for P9:

[breakable, width=+1cm]

P10: A program that plays a two-player tic-tac-toe.

Imagine you have a magical typewriter. This typewriter, instead of typing out stories or letters as you'd expect, types out patterns when given certain clues.

We start with a set of clues. These clues are just a mix of numbers and symbols.
The magical typewriter has a special way of reading these clues. It looks at a mix of characters, numbers, and empty spaces, then uses the clues to fill in those empty spaces and decide what to type out.
There are different patterns hidden within the clues. Depending on which clues are used, the typewriter might print a star, a dash, or even a sequence of symbols.
Sometimes, the typewriter changes the clues a bit based on some rules. It's like changing the recipe slightly to get a slightly different cake.
After preparing the clues, the typewriter types out patterns, one after another, creating a series of designs on the paper.
So, the end result is a paper filled with unique patterns, all determined by the initial clues and the magical typewriter's special way of reading them.

Reconstructed Program for P10:

§.§ Non-obfuscated Equivalent Programs

[breakable, width=+1cm]

P1: This program computes all proper subsets of the set of arguments passed to it.

Imagine you have a magical box. You give this box several items, one after the other. Once done, the box has the power to reveal all possible groupings of the items you've given it, without ever showing every single item together at once.
For instance, if you give the box an apple, a banana, and a cherry, the box can reveal groupings like:

Only the apple.
Only the banana.
Only the cherry.
The apple with the banana.
The apple with the cherry.
The banana with the cherry.
But it will never show you the apple, banana, and cherry all together since that's exactly what you gave it to start with.

If you approach the magical box and don't give it any items, it will kindly tell you to provide some items so it can show the groupings.

Reconstructed Program for non-obfuscated P1:

[breakable, width=+1cm]

P2: This program calculates the value of $\pi$.

Imagine you have a square dartboard with a circle perfectly drawn inside it. The circle touches all four sides of the square. Now, you decide to throw darts randomly onto this board 10,000 times.
Each time you throw a dart, you make a note of whether the dart landed inside the circle or outside it but still inside the square. After all your throws, you count how many darts landed inside the circle.

Using this information, you can then figure out a special number by taking the count of darts that landed inside the circle, multiplying it by 4, and then dividing it by the total number of darts you threw. The machine then displays this special number up to three decimal places.

Reconstructed Program for non-obfuscated P2:

[breakable, width=+1cm]

P3: This program prints the input string sorted alphabetically.

Imagine you have a collection of letters, and you'd like to rearrange these letters in a specific order similar to how you would find them in a dictionary.
First, you're asked to provide this collection of letters. After entering them, the program will then work on rearranging them. It will repeatedly compare two adjacent letters and swap them if they are not in the desired order. This process of comparison and swapping is repeated multiple times until all the letters are in their proper positions.

Once the letters are rearranged, the program will show you the new arrangement.

Reconstructed Program for non-obfuscated P3:

[breakable, width=+1cm]

P4: This program prints the first 100 prime numbers.

Imagine you have a machine that is searching for very special numbers. These numbers are unique because they cannot be divided evenly by any number other than 1 and themselves.

When you start the machine, it begins its search with the first whole number after 1. It checks to see if this number is special. If it is, the machine displays it. The machine then continues to the next number and does the same check.

This machine is persistent and continues its search, showing you each special number it finds. It will stop after it has shown you a hundred of these special numbers.

Reconstructed Program for non-obfuscated P4:

[breakable, width=+1cm]

P5: This program computes the factorial of a number.

Imagine a machine that helps you find the product of a series of counting numbers up to a given number. When you approach this machine, it asks you to tell it a specific number. Once you provide the number, the machine starts multiplying all the counting numbers from 1 up to the number you provided.

For example, if you tell the machine the number 4, it will multiply 1 by 2, then multiply the result by 3, and then multiply that result by 4.

After finishing the calculations, the machine displays a message that tells you the result of multiplying all those counting numbers up to the number you provided.

Reconstructed Program for non-obfuscated P5:

[breakable, width=+1cm]

P6: This program computes a desired number of digits of $e$ in any desired base.

Imagine a machine that can tell you about a special number, much like pi, which starts 2.71828... and goes on forever. The unique thing about this machine is that it can show this special number using different number systems, not just the one we usually use with numbers 0 to 9.

When you approach the machine, it asks you two things:
1. How many parts of this special number do you want to know? You tell it a number.
2. In which number system you'd like to see this special number? For this, you can choose any system between the one that uses just 0 and 1 and the usual one (that uses numbers 0 to 9).

Once you provide this information, the machine works its magic. It calculates the value of this special number up to the number of parts you specified, in the number system you chose. Then, it displays that special value for you.

However, if you choose a number system outside the allowed range, the machine will tell you that the choice is not acceptable and stop.

Reconstructed Program for non-obfuscated P6:

[breakable, width=+1cm]

P7: This program converts byte to binary.

Imagine you have a line of 8 light bulbs, all turned off. These light bulbs can either be on (showing a light) or off (no light). Now, imagine you have a number between 0 and 255. Based on this number, some of these light bulbs will turn on, while others will remain off.
This program is like a guidebook. First, it asks you for that number. Once you give the number, the guidebook will show you a line indicating which light bulbs should be turned on and which should remain off, using a sequence of 1s (for the bulbs that are on) and 0s (for the bulbs that are off). By looking at this sequence, you will be able to recreate the exact arrangement of lit and unlit light bulbs for the number you provided.

Reconstructed Program for non-obfuscated P7:

[breakable, width=+1cm]

P8: This program adds two numbers.

Imagine you have a digital assistant with a screen. When you turn it on, it first asks you to type in a number. After you've provided the first number, it asks you for a second one. Once you've entered both numbers, the assistant does a quick mental calculation and shows you the result of adding these two numbers together. It displays a message like "The sum of the first number and the second number is the result." With this message, you immediately know how much the two numbers you provided add up to.

Reconstructed Program for non-obfuscated P8:

[breakable, width=+1cm]

P9: This program calculates the integer part of square root of the input number.

Imagine a digital tool that helps you find the square root of numbers. When you start it, it asks you to type in a special kind of number: one that has an even count of digits. For example, if you have a number like "1234", it's okay because it has 4 digits. But a number like "123" won't work since it has 3 digits.
After you type in this number, the tool checks to make sure it has the right amount of digits. If the number you typed doesn't follow the rule, the tool will tell you that you've made a mistake and need to type in a number with an even count of digits.

However, if the number you typed is correct, the tool will quickly do some calculations and then show you the square root of that number. But, it only shows you the whole part of the square root, without any decimals.

Reconstructed Program for non-obfuscated P9:

[breakable, width=+1cm]

P10: A program that plays a two-player tic-tac-toe.

Imagine a classic game where two players take turns marking spaces on a 3x3 grid. One player uses an 'X' and the other uses an 'O'. The goal of the game is to mark three spaces in a row, either horizontally, vertically, or diagonally before the opponent does.

When the game starts, the grid is empty. The game tool displays the grid to show both players the current state of the game. Each space in the grid can be identified using two numbers: the row number and the column number, both ranging from 0 to 2.

One player goes first, marking a space on the grid with their symbol. The game tool then updates the grid to show this mark. After each turn, the tool checks if there are any three matching symbols in a row. If there is a winning line, it announces which player has won.

If all the spaces on the grid are marked, and no player has three of their symbols in a row, then the game is declared a draw.

The game continues by allowing players to take turns marking spaces until someone wins or all spaces are marked, resulting in a draw.

Reconstructed Program for non-obfuscated P10:

§ USELESS CODE SNIPPETS ADDED FOR OBFUSCATION

[breakable, width=+1cm]

§.§ Level 1

[breakable, width=+1cm]

§.§ Level 2

§ SET OF MICRORTS PROGRAMS

[breakable, width=+1cm]

To get started, the very first action this strategy takes with topmost priority involves sending each of our units to gather resources. Specifically, every individual unit is assigned to harvest a maximum of two resources. After that, these units are instructed to remain idle. The idle instruction is crucial because it ensures that while these units are not engaged in harvesting, they still remain vigilant, ready to attack any opponent unit that comes within their attack range.

After the initial phase of resource harvesting, the next priority of this strategy is to train new units. Initially, we aim to train up to 25 Light units in the upward direction from their respective training structures. Following this, we have a target to train up to 4 Worker units who would be placed on the right side of their training structure.

The next action, which comes after the training of Light and Worker units, is attacking the opponent units. Here, the strategy is to attack the closest opponent unit. Hence, if there are several opponent units within the attack range, the closest one will be targeted first.

Subsequently, we have two priorities that occur concurrently. On one hand, we aim to train a limited number of Heavy units (up to 3 in number). On the other hand, we look to construct Barracks with a maximum limit of 1 Barracks. The placement for both these actions is towards the upward direction from the current position.

In summary, the overall goal of this strategy is to maintain an equilibrium between resource harvesting, unit training, and combating the enemy. By prioritizing resource gathering initially, we ensure that there are enough resources available for training new units and building structures. Following that, we put a focus on training both combatant (Light and Heavy) and resource gathering (Worker) units, thereby maintaining the balance in our forces. Finally, the strategy underscores the importance of continuous attacks on the closest enemy while simultaneously enhancing our forces through the construction of Barracks and training of Heavy units.

Best Reconstructed Program for P1:

[breakable, width=+1cm]

The provided strategy for playing MicroRTS takes a structured approach, prioritizing certain actions over others in an attempt to gain an advantage. It is important to understand the priority of actions to follow and execute this strategy properly.
The initial and highest priority of this strategy is to establish a strong defense by building Barracks towards the enemy's direction. The aim here is to construct 7 Barracks, which would serve as the primary base for training combat units. At the same time, the strategy also assigns priority to resource collection, instructing workers to harvest resources, targeting 9 resource units.

The next action with high priority is to train Heavy units from the units within the Barracks. These units are positioned on the left of the Barracks. The training aims to produce up to 20 Heavy units which would serve as the main force in our offensive and defensive operations.

Subsequently, the strategy focuses on replenishing and expanding the workforce. The Barracks are instructed to train more Workers on the right side, targeting a total of 3 additional Workers. These additional workers would serve to increase the efficiency of resource collection and building processes.

With the fortifications and army in place, the strategy now shifts towards offense. The units are directed to attack the weakest of the opponent's units. This action is aimed at diminishing the opponent's strength and defenses by targeting their vulnerable units first.

After the attack command, the next action with priority is to direct units to remain idle. This action ensures that the units conserve their energy and are prepared for any sudden attacks from the opponent.

The strategy then focuses on ensuring the survival of ally units. Units are instructed to move towards the least healthy ally unit. This action might help in providing reinforcement or drawing away enemy units from the weaker allies.

The final action in this strategy is to train Light units. Light units are quicker to train and would serve as a rapid response force. The strategy aims to train 2 Light units on the left side of the Barracks.

In summary, the overall goal of this strategy is to build a strong defense by quickly constructing Barracks and training Heavy units, maintain a steady flow of resources, selectively target vulnerable enemy units while ensuring the survival of ally units, and lastly, training a rapid response force of Light units.

Best Reconstructed Program for P2:

[breakable, width=+1cm]

The strategic gameplay outlined in program P prioritizes actions to maximize efficiency and tactical advantage in the MicroRTS game. The program begins with the top priority action, instructing every unit in the player's control to stay idle. This implies that unless a unit is immediately threatened, it should initially hold its position and avoid proactive movement or combat.
After this first instruction, the player's units are instructed to relocate towards the nearest enemy unit, in order to prepare for an impending confrontation. This directive stands as the second priority in the strategy.

The third priority is to utilize the player's bases to train two worker units in the direction of the enemy. This is intended to increase the player's resource collection capability while also adding a mild defensive presence against incoming enemy units.

Next, for every unit, it prioritizes training a large army of heavy combat units directed towards the enemy. If this is not feasible (e.g., the unit in question is not a barracks), it then looks to train light combat units to the left. After training these units, the next action prioritized is for them to target and attack the weakest enemy units.

Within this framework, if the player's unit detects an enemy unit within its attack range, the unit will change its course and move towards the less healthy enemy unit. This dynamic movement decision is prioritized after the initial set of actions.

Further, for every unit, there is a subsequent set of priority actions. Here, the units first build up to 20 barracks towards the enemy's direction, if possible. Then, it prioritizes the harvest of resources by sending out six worker units. After resource collection, units then attack the less healthy enemy unit and finally, if no other actions are feasible, the units move towards the weakest ally unit for support or defense.

The overarching goal of this strategy is to bolster the player's resources and army strength before engaging in direct confrontation with the enemy. By keeping units idle initially, then focusing on resource collection and building a large army, the strategy aims to avoid premature engagement and instead build up a strong base and military power. Lastly, with a substantial force, the strategy then aims to engage the enemy by targeting their weakest units first, utilizing the player's strength in numbers and resource advantage.

Best Reconstructed Program for P3:

[breakable, width=+1cm]

The strategy here revolves around specific actions prioritized to execute in order, facilitating effective gameplay in MicroRTS.
To start, the utmost priority is given to the condition where our units are within an opponent's attack range. In this scenario, all units are commanded to move towards the enemy's strongest unit. This move helps to concentrate the attack on the enemy's most powerful unit, potentially destabilizing their strategies.

Subsequently, the strategy allows a couple of units to harvest resources. This step ensures we have a continuous supply of resources necessary for building structures and training units.

Next in the line of action priority, the strategy instructs all units to train a single Light unit upwards. This step is followed by training 50 Ranged units towards the left and then keeping them idle until an opponent comes within attack range. The idea here is to amass a significant number of Ranged units to bolster defenses, while the Light unit acts as a quick response unit to potential threats.

In the following step, the strategy commands to build up to 20 Barracks downwards from our current position. Barracks serve as the crucial point for training combat units. Hence, building Barracks broadens our ability to train more combat units, therefore strengthening our defenses and attack capabilities.

Subsequent to building Barracks, the strategy focuses on strengthening our workforce by training up to 20 Worker units towards the enemy's direction. The workers play a pivotal role in collecting resources and building structures, thus maintaining a strong workforce is vital to support our ongoing efforts in the game.

Finally, with the least priority, all units are directed to attack the closest opponent. This action ensures we maintain some pressure on the opponent even as we build up our forces and defenses.

The overall goal of this strategy is to establish strong defensive structures, maintain a robust workforce for resource collection and structure building, while continually training combat units for offensive and defensive purposes. All this is done while keeping an eye on the opponent's actions, enabling us to react swiftly to any potential threats.

Best Reconstructed Program for P4:

[breakable, width=+1cm]

The strategy provided is meant to be aggressive and prioritizes building a robust workforce first to support rapid unit production and resource gathering.
The first and most crucial aspect of the strategy is to consistently and actively train workers and assign them to idle tasks. The idle state commands the workers to stay put and only attack if an enemy unit comes within their attack range. The strategy primarily focuses on training up to eight workers in the direction of the enemy. This action has the highest priority in our gameplay.

Simultaneously, there is also an emphasis on training up to 20 Light combat units positioned towards the left of the base or barracks. This task is of secondary importance in this strategy. Light units are typically fast and can attack well but may not be as durable. Hence, they can provide a good offensive line against the enemy.

Next, the strategy focuses on gathering resources by having units harvest them. Up to two units are chosen for this task at any given time. Although this action isn't the highest priority, it is crucial to ensure a steady inflow of resources for training more units and building more structures.

After the workforce and resources have been established, the next priority is to build up to six Barracks downwards from the base. Barracks are essential as they are the structures that train combat units, which are vital for both defense and offense in the game.

At the same time, the strategy dictates that our units should engage in battle with the closest enemy unit. This approach can ensure that any nearby threats are dealt with quickly.

The final action of this strategy is to train an additional set of up to 20 workers in the downward direction. While this action has the lowest priority, it ensures that we have enough workers in the late game to maintain production and resource gathering capabilities.

In summary, the overall goal of this strategy is to establish a robust workforce, ensuring a steady flow of resources, and maintaining a steady line of defense and offense against the enemy. The focus is on aggressive expansion and keeping pressure on the enemy while maintaining a robust economy.

Best Reconstructed Program for P5:

[breakable, width=+1cm]

In the context of the MicroRTS game, the strategy implied by this program prioritizes several actions in a specific order to achieve victory over the opponent.
At the very outset, the highest priority is given to maintaining a defensive stance and gathering resources. So, the first thing all units, including Workers, Combat units (Light, Heavy, Ranged) will do is adopt a passive stance and wait for an enemy to approach them. In tandem, they will also focus on collecting resources, but with a limit of collecting from at most 2 resource units.

Once this defensive and resource gathering operation is in place, the game strategy shifts to training new units, with a higher emphasis on Light combat units. Specifically, the next priority is to train as many as 25 Light units that will serve as the primary fighting force of the player's army. This action is followed closely by training of Worker units, with a cap of 2 new Workers to join the existing workforce for more efficient resource collection.

The next action in priority is to bolster the production capabilities by constructing Barracks, aiming to have up to 7 of them. This will allow faster training of new combat units, ensuring a steady stream of reinforcements.

After these initial preparations are complete, the strategy moves to more aggressive actions. Each unit in the player's force will focus on attacking the closest enemy unit. This proactive action is designed to minimize potential damage by eliminating nearby threats.

Following the attack, the next priority action is to maneuver our units strategically towards the healthiest enemy unit. This action can help in weakening the enemy's strong units and balancing the battlefield in favor of our army.

Lastly, and with the lowest priority in this strategy, the aim is to train additional Worker units, up to 9, near the enemy's direction. These Workers can help in speedy resource collection near enemy territory while also potentially serving as distractions for enemy attacks.

The overall goal of this strategy is to create a strong defense by prioritizing idle and resource collection actions, followed by expanding the army through training and construction of barracks. Once a strong defense and robust army are in place, the strategy switches to aggressive tactics by prioritizing attack and movement towards the enemy's healthiest units. The endgame is to have a strong and well-equipped army that can tackle any challenge, supported by an efficient workforce collecting resources close to the enemy base.

Best Reconstructed Program for P6:

[breakable, width=+1cm]

The strategy is organized in a hierarchical way, according to the priority of actions.
The highest priority in this strategy is given to launching an attack on the nearest opponent unit. This action is initiated as soon as the game starts, suggesting an aggressive opening.

The second priority is to train two Worker units in the upward direction. These Workers will play a crucial role in resource management and building of structures.

The third priority is to command all the units to remain idle until an opponent unit comes within their attack range. These idle units, thus, are primarily defensive units.

In addition to this, two Workers are sent to harvest resources. These are likely the same Workers that were trained in the upward direction earlier. Harvesting resources is crucial in maintaining an economy and supporting the build and training of units.

At the next level of priority, a significant part of the strategy is unfolded. Each unit is given a sequence of tasks - building Barracks in the right direction, with a cap of 15, moving towards the healthiest enemy unit, training 8 Light units in the direction of the enemy, and moving again towards the closest enemy unit.

The construction of Barracks ensures a regular supply of combat units. The movement of units towards the healthiest and then the closest enemy units suggests a strategy that focuses on taking down the strongest opponent units first.

The training of Light units specifically points towards a preference for quicker, lighter forces over slow, heavy ones. Light units are often used for quick attacks and to keep the enemy's attention away from the main actions.

The lowest priority action is training 15 additional Workers in the direction of the enemy. This implies that there will be a late-game focus on building and resource collection, possibly in preparation for a final massive assault or to provide an economic edge over the opponent.

The overall goal of this strategy appears to be creating a powerful initial assault with rapid unit training and attack on the enemy, while simultaneously building up a steady resource income for future maneuvers. The later stages of the game will focus on strengthening the economy and mass-producing units for a final assault or a dominant economic victory.

Best Reconstructed Program for P7:

[breakable, width=+1cm]

The strategy is organized in a hierarchical way, according to the priority of actions.
The highest priority in this strategy is given to launching an attack on the nearest opponent unit. This action is initiated as soon as the game starts, suggesting an aggressive opening.

The second priority is to train two Worker units in the upward direction. These Workers will play a crucial role in resource management and building of structures.

The third priority is to command all the units to remain idle until an opponent unit comes within their attack range. These idle units, thus, are primarily defensive units.

In addition to this, two Workers are sent to harvest resources. These are likely the same Workers that were trained in the upward direction earlier. Harvesting resources is crucial in maintaining an economy and supporting the build and training of units.

At the next level of priority, a significant part of the strategy is unfolded. Each unit is given a sequence of tasks - building Barracks in the right direction, with a cap of 15, moving towards the healthiest enemy unit, training 8 Light units in the direction of the enemy, and moving again towards the closest enemy unit.

The construction of Barracks ensures a regular supply of combat units. The movement of units towards the healthiest and then the closest enemy units suggests a strategy that focuses on taking down the strongest opponent units first.

The training of Light units specifically points towards a preference for quicker, lighter forces over slow, heavy ones. Light units are often used for quick attacks and to keep the enemy's attention away from the main actions.

The lowest priority action is training 15 additional Workers in the direction of the enemy. This implies that there will be a late-game focus on building and resource collection, possibly in preparation for a final massive assault or to provide an economic edge over the opponent.

The overall goal of this strategy appears to be creating a powerful initial assault with rapid unit training and attack on the enemy, while simultaneously building up a steady resource income for future maneuvers. The later stages of the game will focus on strengthening the economy and mass-producing units for a final assault or a dominant economic victory.

Best Reconstructed Program for P8:

[breakable, width=+1cm]

This strategy is geared towards aggressive resource gathering and expansion, while maintaining a robust defense.
At the outset, our primary focus is on harvesting resources, with an emphasis on up to nine units engaging in this activity. As our units are engaged in resource gathering, they're also prepared to spring into action and defend our territory if required.

Simultaneously, we strategically move our units closer to the less healthy units of our enemy, targeting the weaker ones first to maximize our offensive capabilities. This isn't the highest priority, but a consistent task that we aim to achieve.

Along with these activities, we look to train six additional worker units, stationed towards the direction of the enemy. This serves dual purposes - enhancing our resource gathering capability and establishing a front line of defense against the enemy.

As we continue to build our resources and defenses, we deploy two units for more focused harvesting. This is more specific compared to the earlier broad directive and enjoys a higher priority.

This is closely followed by an order to have all our units maintain a vigilant stance, staying idle until there's a direct threat. This is a key element of our defense strategy.

A significant part of our strategy is to be proactively defensive. So, if any of our units are within the attacking range of the enemy, we go on the offensive by attacking the weakest units first, while strategically moving our units towards the less healthy enemy units. This has a higher priority and occurs before any other offensive or defensive moves.

The strategy also involves moving our units towards the most robust enemy and ally units. The aim here is to provide support to our strong units while simultaneously challenging the enemy's strong units.

To bolster our offense and defense, we aim to construct up to seven Barracks to the left of our existing base. Along with this, we train a massive force of twenty light combat units stationed towards the enemy. The building of the Barracks and the training of light units are part of our strategic expansion and are given a higher priority, falling just short of the highest priority.

Overall, this strategy is a blend of aggressive resource gathering, strategic defense, and tactical offense. Our goal is to build a strong resource base, maintain a defensive posture to thwart enemy attacks, and go on the offensive when the opportunity arises, aiming for a decisive victory.

Best Reconstructed Program for P9:

[breakable, width=+1cm]

The provided strategy for playing MicroRTS consists of a series of prioritized actions. In this strategy, the most crucial action, with the highest priority, is to train worker units. Each of the controlled units is tasked with this function, effectively expanding the player's workforce as a first step. This action is prioritized by having the units train additional worker units in the upward direction, with the limit being up to 2 workers per unit.
The second priority, which is slightly lower than the first one, is to ensure that the units stay idle when they are not training workers. In other words, until a unit has another specific task, it is required to stay idle, being ready to attack if any opponent comes within its attack range.

Next, there's the task of training heavy units. The units are given this task after they've finished training workers and become idle. Here, the strategy is to train up to 8 heavy units in the direction of the enemy, providing robust resistance against potential attacks.

Further down the priority list is the training of light units. Each unit is instructed to train light units to the left direction with a high limit of up to 100 units. This helps in preparing a strong army capable of handling various combat situations.

Building barracks in the enemy direction is also part of the strategy but with a lower priority than training units. Each unit is tasked to build up to one barracks in the direction of the enemy. This strategic placement could potentially disrupt the enemy's actions or serve as a forward base for our attacks.

Another crucial, yet lower priority task, is resource gathering. The strategy dictates that up to 25 workers are assigned to harvest resources. This provides the necessary resources to support the construction of buildings and training of additional units.

The last priority, with the lowest precedence, is to launch attacks on the enemy. Specifically, the units are ordered to attack the closest enemy unit. This offensive move is set with the lowest priority, implying that it should be executed only after all other tasks have been accomplished.

In summary, the strategy aims to expand and strengthen the player's forces through the training of different unit types, build a strategic forward base by erecting barracks near the enemy, manage resources by dedicating workers to harvesting, and finally, carry out attacks on the closest enemy units.

Best Reconstructed Program for P10:

[breakable, width=+1cm]

The program dictates a strategy for playing MicroRTS that emphasizes unit training and resource gathering. The action priorities are as follows:
The highest priority action is to train Worker units at the top of your base. The game prioritizes the training of up to four Worker units. These units are crucial as they are responsible for gathering resources, building structures and even attacking opponent units.

Next in line, the strategy is to keep all units idle. This means that all units, including the previously trained Workers, will not be carrying out any specific task. They will only attack if an enemy unit comes within their attack range.

The next set of actions revolve around both training more Worker units and collecting resources. With a high priority, every unit in the game will be assigned to harvest resources, but only one resource per unit. Then, up to six additional Worker units will be trained at the bottom of your base.

Following this, the strategy takes a more aggressive turn. The priority then shifts to training up to ten Heavy units on the left of your base. Heavy units, as the name suggests, are crucial in attacking and defending against the opponent units due to their increased survivability and damage. Meanwhile, within this training routine, there is a sub-priority to have each of these units harvest three resources. After training these Heavy units and their brief stint in resource gathering, up to fifteen Barracks will be constructed to the left of your base. Barracks are important as they allow the training of more combat units. This phase concludes with each unit attacking the closest enemy unit, signifying the initiation of an offensive against the opponent.

Lastly, the game ends with training up to a whopping 100 Light units on the left of your base. Light units, while weaker than Heavy units, can still provide a strong force in numbers and this shows the game's shift to a more aggressive approach.

The overall goal of this strategy appears to be a balanced approach of building up the base with Worker units and Barracks, collecting resources, and eventually moving towards an aggressive offense using Heavy and Light units.

Best Reconstructed Program for P11:

[breakable, width=+1cm]

In this MicroRTS strategy, the overall goal is to create a strong and sustainable army while harvesting resources efficiently. This strategy involves training and building activities along with harvesting and movement actions.
In the first stage of this strategy, every unit is given a specific task, which is crucial to the early growth and power of our side. The highest priority is given to training our Heavy units in the direction of the enemy, aiming to produce six of them. After this, the strategy prioritizes training four Light units, again in the direction of the enemy. These units will provide initial offensive capabilities to confront any immediate enemy threat.

The third priority action is to build three Barracks in the downward direction, creating a stronghold to prepare for future engagements. Next, our units are commanded to idle, indicating they should hold their position and attack any opponent units that enter their range. Finally, in the first stage, our strategy ensures sustainability by training three Worker units in the left direction. These workers will be vital for resource collection and base expansion.

In the second stage, the strategy focuses on resource gathering and unit movement. The topmost priority at this stage is for every unit to harvest resources until we have 15 resources. This sustains our army and ensures that we can continue to build and train units.

Subsequently, each unit is instructed to move towards the weakest enemy unit. This targeted approach allows our forces to systematically weaken the enemy's defense line by focusing on their most vulnerable points.

The execution of these tasks in the given order of priority ensures that our army is well-prepared and resourceful, which is crucial for victory in MicroRTS.

Best Reconstructed Program for P12:

[breakable, width=+1cm]

The first priority of the strategy is to check if any of our units are within 5 cells of an enemy unit. If this condition is met, the unit in question will carry out a set of actions. It will first move towards the healthiest enemy unit, indicating that our strategy is to target the strongest of the enemy. Immediately after that, the unit will also move towards our furthest ally unit. It is then commanded to attack the enemy unit with the least health. Following this, if the unit has the capability to train other units, it will train up to 7 workers in the upward direction. In case none of our units are within 5 cells of an enemy unit, the units will target the weakest enemy unit, regardless of its type or location.
The second priority in the strategy is to instruct each unit to perform a number of actions. This starts with each unit being instructed to harvest one resource unit. This may be viewed as a micro-management strategy, to ensure that resources are constantly being gathered. Following this, each unit is instructed to train up to a maximum of 100 light units in the upward direction. Then, they are tasked to build up to 5 Barracks towards the enemy direction. If possible, the units are also instructed to train up to 4 workers towards the left direction. If a unit is unable to perform any of these tasks, it is ordered to remain idle and will only engage in combat if an enemy unit comes within its attack range. In addition to this, each unit is also tasked to harvest up to 25 resource units if possible.

In summary, the strategy seems to prioritize offensive actions towards the enemy's healthiest units while at the same time reinforcing our own position by training new units and building new Barracks. The strategy also emphasizes resource gathering by setting specific harvest actions for each unit. Thus, the overall goal of this strategy is to wear down the enemy's strongest units while simultaneously growing our own forces and resource pool.

Best Reconstructed Program for P13:

[breakable, width=+1cm]

In the strategy described, units initially take on an idle state, poised to attack any opponent unit that comes within range. This marks the first course of action. Following that, a total of four units are then trained for light combat, oriented towards the enemy's direction. This is the second action taken.
After preparing for combat, our focus shifts towards infrastructure development, with the construction of three barracks in the downward direction. This is the third action in line. Post the infrastructure setup, we further train eight ranged combat units, pointing again towards enemy territory, forming the fourth action.

In addition to training combat units, we also train three worker units, placed on the left, which makes up the fifth action. These worker units are immediately assigned to gather resources with a target of harvesting up to fifteen resource units, and this is the sixth action our strategy involves.

The strategy then shifts gears and goes into an aggressive mode. All units, regardless of their type, are assigned to attack the enemy's closest unit. This forms the most crucial and high-priority action in this plan, making it the top priority. This order is repeated for every single one of our units, ensuring a relentless wave of attacks aimed at the nearest enemy units.

Overall, this strategy involves starting with a defensive stance and resource accumulation, followed by a massive, prioritized attack on the closest enemy units, signifying an aggressive playstyle.

Best Reconstructed Program for P14:

[breakable, width=+1cm]

In the strategy we're discussing, there's a clear order of priorities to the actions our units will take.
At the very top of our priority list, the main thing units are encouraged to do is to stand their ground and defend their position. If you see a unit doing nothing, that's because they've been instructed to remain idle as their highest priority.

Following that, units have a higher priority to train Light combat units in the direction of the enemy. This means our main offensive strategy focuses on producing as many as 15 Light units to apply pressure on the opponent.

The next action with a somewhat lower priority than training Light units is resource gathering. Here, the directive is to send units out to harvest resources. The goal is to send up to 2 Workers to gather resources at any given time.

After those high-priority tasks, if none of those directives apply, our units then proceed with the next set of actions. The first among these is to train Workers, with an emphasis on training up to 3 of them in the direction of the enemy. This ensures that our army has a steady supply of units that can gather resources and build structures.

Once we have a sufficient number of Workers, the next objective is to build a Barracks in the upward direction. However, we limit this construction to just 1 Barracks. With a Barracks in place, we can then train combat units to bolster our army's strength.

With training and building out of the way, our units are then focused on movement and engagement strategies. They are instructed to approach the closest enemy unit and engage. Specifically, they will target the healthiest opponent unit, aiming to take down the strongest threats first.

In situations where our units need support, they are encouraged to move towards our most healthy ally unit. This could be a tactical move to bolster defense or provide a more united front in our offensive maneuvers.

Overall, the central aim of this strategy seems to be a balanced approach between defense, resource management, and offensive pressure. By prioritizing idle defense and the training of Light units, it suggests a reactive posture that is ready to quickly switch to offense by amassing Light units when the situation allows. The emphasis on resource gathering and Worker training ensures that the army is well-supported and can sustain prolonged engagements

Best Reconstructed Program for P16:

[breakable, width=+1cm]

In this MicroRTS strategy, our units prioritize their actions based on the following order:

1. First and foremost, they'll start by harvesting resources, but they will only send two units for this task.
2. If they aren't harvesting, they'll stay idle and defend if an opponent comes within their attack range.
3. If they haven't been assigned any of the above tasks, they'll then look to train Light combat units, specifically focusing on producing up to seven of them, directing them towards the enemy.
4. As they look to fortify their position, they'll then consider constructing Barracks. The units will try to build up to three Barracks in the direction of the enemy.
5. If their earlier training and building tasks are satisfied, they'll pivot to training Ranged units, aiming to have eight of these units, and they'll also be sent towards the enemy.
6. To ensure continuous resource collection and building, they'll train up to three Workers who will be positioned on the left side.
7. After all these tasks, if none of them are actionable for a unit, it will look for the healthiest opponent unit and move towards it.
8. Finally, if a unit hasn't been assigned any task till now, it'll choose to move away from the player's base.

Once all units have gone through the above priorities, they'll move to the next set of actions:

1. An intense resource collection activity will ensue, with a large group of 50 units being sent out to harvest.
2. When not busy harvesting, they'll go on the offensive, targeting the strongest opponent units to attack.
3. A special consideration is made for situations where they're close to the enemy. If a unit is within a distance of 3 from an opponent, it'll train up to ten Workers, positioning them on the right side.

The main goal of this strategy seems to be establishing a strong frontline with trained combat units and Barracks, while also ensuring there's a continuous supply of resources by having a large number of Workers. Moreover, it places a strong emphasis on being proactive in engagements by targeting stronger and healthier opponent units.

Best Reconstructed Program for P16:

[breakable, width=+1cm]

The given strategy for playing MicroRTS presents a specific approach to handling the game, primarily focusing on certain aspects of controlling units and managing their actions.

The strategy commences with the highest priority action, where all units are commanded to stay idle and attack if an opponent's unit comes within attack range. This will form the core of the defense and is a priority to ensure that units are initially in a guarded state.

Next, the actions following that are of second-highest priority:
- The player's unit trains up to 5 Worker units in the direction of the enemy.
- 3 Worker units are sent to harvest resources.
- 50 Heavy combat units are trained to the right.
- Units are commanded to move towards the enemy's most healthy unit.
- Units are commanded to move in the opposite direction of the player's base.

These actions create a balance between building resources, strengthening the army, and engaging the enemy strategically.

The third-highest priority action is an immediate response mechanism. If an opponent's unit is within the attack range of an ally's unit, the player's units are commanded to:
- Harvest one resource each.
- Attack the strongest opponent unit.

This section forms a rapid reaction to an immediate threat, emphasizing attack and gaining resources in parallel.

Lastly, the action with the lowest priority is to build a Barracks in the direction of the enemy, limited to just one Barracks. This is the least urgent aspect of the strategy, focusing on long-term building rather than immediate response or unit training.

Overall, the strategy focuses on an immediate defensive stance with a systematic escalation in attacking, resource building, and strategic movement. The ultimate goal is to prepare the units quickly for both defense and attack, with a layered approach to handling threats, building resources, and then extending the infrastructure by constructing a Barracks. The priority is set in such a way that immediate defense and controlled aggression take precedence over the long-term development of structures.

Best Reconstructed Program for P17:

[breakable, width=+1cm]

The given strategy for playing MicroRTS focuses on a balanced approach to both defense and offense, prioritizing certain actions to achieve desired outcomes.
First, the strategy commands all units to stay idle, which is of lower priority. If they are able to, they will then train 10 Light units to the right. The strategy then assesses the battlefield: if an opponent unit is in range of an ally unit, the priority is given to moving units towards the strongest Ally unit; otherwise, the command to train 7 Worker units towards the enemy direction is executed.

After assessing the battlefield, the priority shifts to building. Up to 20 Barracks are built downwards. This is followed by a command to move towards the closest enemy, which is of lower priority compared to previous actions.

Next, the strategy enters a phase where the priority is the highest, focusing on training and preparing for the battles ahead. In this phase, up to 5 Worker units are trained to the right.

Following this, the strategy again checks if the units can attack. If they can, they are commanded to attack the weakest opponent unit. If not, no action is taken.

In the final phase, which has the second-highest priority, the focus is on harvesting resources and further building. If units can harvest, they are instructed to harvest 2 resources. Additionally, up to 8 Barracks are built towards the enemy direction.

Overall, the strategy aims for a balanced approach. It prioritizes training and preparing for battle through building Barracks and training various types of units. It takes into account the positioning of both ally and enemy units, emphasizing moving and attacking based on the enemy's position and strength. It also focuses on resource management by training Workers and commanding them to harvest. The highest priority actions are training Workers, followed by building Barracks, attacking or defending based on the opponent's positioning, and finally, commanding units to move, stay idle, or train additional Light units.

Best Reconstructed Program for P18:

[breakable, width=+1cm]

In this MicroRTS strategy, players will initially prioritize having their units stay idle and thereafter focus on training Light units. This action receives the highest priority. Once that's achieved, the player's next focal point is to ensure that up to 3 Worker units start harvesting resources. During this harvesting phase, there's also an emphasis on training up to 20 Ranged units. This step is of the second highest priority.

As the player progresses further, constructing Barracks in the direction of the enemy becomes a vital move. The game will aim to build up to 50 of these structures, suggesting a major strategic emphasis on increasing military capabilities. Following that, the units are directed to attack the closest enemy units. However, these actions aren't given as high a priority as the initial actions.

Lastly, with a slightly lower priority, the strategy emphasizes training additional Worker units. The player will try to bring about 8 more Workers into the game.

To sum it up, the overall goal of this strategy seems to be a balanced approach between defense (having units stay idle initially) and offense (training Light and Ranged units). Furthermore, there's a strong emphasis on resource gathering and expanding the military capacity by building Barracks near the enemy. The balanced focus between offense, defense, and resource gathering suggests a comprehensive approach to the game.

Best Reconstructed Program for P19:

[breakable, width=+1cm]

In this MicroRTS strategy, we initiate by placing the utmost importance on training Heavy units. The prime focus is to create three Heavy units positioned towards the enemy direction. This is the most crucial step of the strategy and receives the highest priority.

Following this, the units are instructed to maintain a stance of inaction, standing their ground. This takes precedence right after training the Heavy units.

As we move further down the list of priorities, the next action involves sending three Worker units to gather resources. Then, there's a directive to construct a Base, positioning it towards the enemy's direction. Only one Base will be built under this directive.

Subsequent to these actions, the strategy emphasizes creating a considerable force of Light units, specifically eight of them, positioned to the left. This is then followed by the establishment of a Barracks to the right, but only one will be erected.

The next phase of the strategy is to be more aggressive. Units are ordered to target and attack the weakest of the opponent's forces. This aggressive stance is vital before moving on to the subsequent steps.

Delving deeper, there's a strong inclination to further enhance our Heavy unit troops. This time, the strategy pushes for the creation of ten Heavy units, with their position being upwards.

Lastly, the strategy rounds off by emphasizing the training of four Worker units, positioning them towards the enemy's direction.

Overall, this strategy can be viewed as a balanced approach between fortifying defenses, resource management, and mounting an offensive. The primary goal is to strengthen the army by training a significant number of Heavy and Light units while ensuring resource accumulation and strategic positioning of bases and barracks.

Best Reconstructed Program for P20: