(x, y-2) & \text{if } m = up\\
\end{cases}$$
-We define the tile update function $next(i)$ for $i \in F$.
-$$next(i)=\left\{\begin{array}{lll}
- free & \text{if } & i=agent \wedge \delta(i)=free\\
- & \vee & i = agent \wedge \delta(i)=target\\
- target & \text{if } & i=targetagent \wedge \delta(i)=free\\
- & \vee & i = targetagent \wedge \delta(i)=target\\
- agent & \text{if } & i=free \wedge \delta(i)=agent\\
- & \vee & i = free \wedge \delta(i)=targetagent\\
- targetagent & \text{if } & i=target \wedge \delta(i)=agent\\
- & \vee & i = target \wedge \delta(i)=targetagent\\
+We define the tile update function $next(i_1, i_2, i_3)$ where $i_1$ contains
+the agent and $i_2$ and $i_3$ are adjacent to it in some direction.
+$$next(i_1, i_2, i_3)=\left\{\begin{array}{lll}
+% Three state transitions
+ (free, agent, box) & \text{if } &
+ i_1=agent \wedge i_2=box \wedge i_3=free\\
+ (target, agent, box) & \text{if } &
+ i_1=targetagent \wedge i_2=box \wedge i_3=free\\
+ (free, targetagent, box) & \text{if } &
+ i_1=agent \wedge i_2=targetbox \wedge i_3=free\\
+ (free, agent, targetbox) & \text{if } &
+ i_1=agent \wedge i_2=box \wedge i_3=targetbox\\
+ (target, targetagent, box) & \text{if } &
+ i_1=targetagent \wedge i_2=targetbox \wedge i_3=free\\
+ (target, agent, targetbox) & \text{if } &
+ i_1=targetagent \wedge i_2=box \wedge i_3=target\\
+ (free, targetagent, targetbox) & \text{if } &
+ i_1=agent \wedge i_2=targetbox \wedge i_3=target\\
+ (target, targetagent, targetbox) & \text{if } &
+ i_1=targetagent \wedge i_2=targetbox \wedge i_3=target\\
+% Two state transitions
+ (free, agent, i_3) & \text{if } & i_1=agent \wedge i_2=free\\
+ (free, targetagent, i_3) & \text{if } & i_1=agent \wedge i_2=target\\
+ (target, agent, i_3) & \text{if } & i_1=targetagent \wedge i_2=free\\
+ (target, targetagent, i_3) & \text{if } & i_1=targetagent \wedge i_2=target\\
+% One state transitions
+ (agent, i_2, i_3) & \text{if } & i_1=agent\\
+ (targetagent, i_2, i_3) & \text{if } & i_1=targetagent\\
\end{array}\right.$$