\section{\texorpdfstring{Push-$*$S}{Push-*S}} \label{sec:push-storage} We reduce from nondeterministic constraint logic (NCL). Section~\ref{sec:push-walls} first builds the board with walls, which proves Push-$*$FS PSPACE-complete. Each edge is a long vertical line of boxes, a \emph{train}, and at each vertex a few holes are joined to the empty frame of the board only while the constraint of the vertex holds; once cut off, they stay cut off. Section~\ref{sec:push-no-walls} then replaces every wall by a box. These boxes could now be pushed, and most of the work is to show that the exact target keeps those off the tracks in place. \subsection{The source problem} \label{sec:ncl} A \emph{constraint graph}~\cite{hearn2005ncl} has oriented edges and two types of vertices, each with three edges. At an \emph{OR} vertex, at least one of its edges must point in. At an \emph{AND} vertex, its \emph{heavy} edge or both of its two \emph{light} edges must point in. A move reverses one edge so that all constraints stay satisfied. \emph{NCL} asks whether moves lead from a satisfying orientation $\sigma$ to another one,~$\tau$, and it is PSPACE-complete~\cite{hearn2005ncl}. \subsection{The board with walls} \label{sec:push-walls} \subparagraph*{Trains.} The boundary rows and columns of the board form the empty \emph{frame}, and the player starts at a corner $p_0$ of it. A box pushed onto the frame could never leave it, and the target leaves the frame empty, so the frame stays empty. Each edge $e$ is a vertical line of boxes, its \emph{train}, with an end at each endpoint of~$e$. The train has two canonical positions, one cell apart, and it \emph{points into} the end at which it stops one cell short; so $e$ points into $v$ when its train is shifted away from~$v$, which leaves room at~$v$. \emph{Corridors} are empty paths from the frame, and all other cells are walls, except for the boxes and holes described below. \subparagraph*{AND and OR vertices.} Figure~\ref{fig:full-cores} shows, in representative states, our gadget for an AND or OR vertex $v$ on three edges, from left to right $e_i$, $e_{i+1}$, and~$e_{i+2}$. The train of $e_{i+1}$ ends above a gap of holes, the \emph{core}, and the trains of $e_i$ and $e_{i+2}$ pass on whether they point in through a horizontal line of boxes, a \emph{bar}, and a single box, the \emph{short bar}. The core is joined to the corridors exactly when the edges that point in satisfy the constraint of~$v$; otherwise it is cut off, and only a push from inside the core can reopen it. Our AND gadget lets $e_{i+1}$ point in only after $e_i$ does, so we call an orientation \emph{ordered} if every AND vertex on $e_i,e_{i+1},e_{i+2}$ has $e_{i+1}$ pointing in only if $e_i$ points in. \begin{figure}[htbp] \centering \input{figures/core-states} \caption{An OR (top) and an AND with its heavy edge on the right (bottom), labelled by the edges that point in (a copy of Figure~\ref{fig:push-cores}). Trains are blue, bars orange, short bars green, walls gray, holes joined to the frame through the bottom corridors yellow, and other holes white; in~(d) and~(g) the core (red) is cut off, and in~(h), which is not ordered, the left bar meets the short bar and the core has closed.} \label{fig:full-cores} \end{figure} \subparagraph*{Wires.} To route the edges, we subdivide them by \emph{wires}, vertices with two edges that need at least one of them to point in. A wire has a bar between its two trains, with a \emph{pocket} of three holes where a train meets the bar; the extra hole at the end that a train or bar points into leads to a corridor, so a pocket is joined to the frame if its train or its bar points into it (Figure~\ref{fig:push-pockets}). The bar points into one end only, so if neither train points in, one pocket is cut off, and only a push from inside it can reopen it. The bars of an AND or OR vertex have the same pockets at the trains of $e_i$ and~$e_{i+2}$, so a bar that points into the core while its edge points out cuts off its pocket. \begin{figure}[htbp] \centering \input{figures/pocket-states} \caption{One end of a wire in the top half, exact crops, with the train below, the bar on the right, and the pocket outlined. The pocket is joined to the frame through the train corridor on the left when its train points in, and through the bar corridor at the top when its bar points in; in~(d) it is cut off (red).} \label{fig:push-pockets} \end{figure} \subparagraph*{Layout.} The \emph{central row} splits the board into two halves, and every train crosses it (Figure~\ref{fig:full-board}). The upper end of a train belongs to a wire in the top half, and its lower end to a wire in the bottom half or to an AND or OR vertex on three consecutive edges, with the heavy edge of an AND last. Vertices in the same half are nested like parentheses, and each has a \emph{working row} in its half for its bar, closer to the central row than the working rows of the vertices nested inside it, so a bar crosses only trains of vertices nested inside it; both can be pushed through a crossing cell. \begin{figure}[htbp] \centering \input{figures/push-board} \caption{(a)~A graph drawn as in Section~\ref{sec:push-walls}, not to scale: three nested wires in the top half, an OR and an AND in the bottom half; the central row is dashed, and the arrows give an orientation. (b)~The board of~(a) in the canonical configuration of this orientation, compressed: long uniform stretches are drawn as two cells, so local structure is exact and long distances are not to scale; the scales are those of Section~\ref{sec:push-no-walls}. Trains are blue, bars orange, short bars green, crossing cells dark, and holes yellow; gray cells are walls in Section~\ref{sec:push-walls} and boxes in Section~\ref{sec:push-no-walls}, and light blue cells continue the column of a train to the frame (a copy of Figure~\ref{fig:push-layout}).} \label{fig:full-board} \end{figure} Let $n$ be the number of trains; all distances are large compared with~$n$, and Section~\ref{sec:push-no-walls} fixes them. Starting from planar NCL of bounded bandwidth~\cite[Theorem~6]{vanDerZanden2015}, Appendix~\ref{app:push-source} shows that NCL stays PSPACE-hard on such graphs with ordered $\sigma$ and $\tau$, and that restricting moves to ordered orientations does not change the answer. \subparagraph*{Reduction.} For an ordered satisfying orientation $\rho$, the canonical configuration $B_\rho$ places every train as $\rho$ says, every bar of an AND or OR vertex so that it points into the core exactly when its edge points in, the short bar in the cell right of the middle train's column when $e_{i+2}$ points out and four cells further right when it points in, and the bar of a wire so that it points into its left end exactly when the left train does not. No pocket or core of $B_\rho$ is cut off, and all $B_\rho$ have equal size. We map an instance $(G,\sigma,\tau)$ to the board with initial configuration $B_\sigma$ and target set $B_\tau$. \begin{lemma}[completeness] \label{lem:push-complete} If $\tau$ is reachable from $\sigma$ through ordered orientations, then there is a trajectory from $(p_0,B_\sigma)$ to $(p_0,B_\tau)$. \end{lemma} The player reverses an edge~$e$ by one push on its train from the open pocket (or open core, for a middle train) at its new endpoint. Before this push, it moves the bars at the old endpoint so that the pocket of $e$ there stays open, and after it, it moves the bars at the new endpoint into their canonical positions; at an AND or OR vertex, these are the bar at the train of~$e$ and, if $e$ is the right edge, the short bar. Appendix~\ref{app:ps-complete} gives the moves. \subparagraph*{Tracks.} Before reading an orientation off an arbitrary trajectory, we verify that every train and bar stays one run of boxes of its original length and never merges with another run. The \emph{track} of a train is its column up to the walls beyond its ends (for a middle train, down to the cell above its working row), and the track of a bar is its row between its trains. At an AND or OR vertex, the two bars and the short bar share the working row between the trains of $e_i$ and $e_{i+2}$. With walls, every push takes place on the tracks. A push through a crossing cell moves boxes along one of its two tracks and keeps the box counts of both. A box can leave its track in only two ways: a box of a bar can enter the corner of a pocket, or the lowest box of a middle train can drop onto its working row, which belongs to the track of the bars. Reversing either transfer would require the player to stand on a wall. Moreover, every such transfer moves a box strictly forward in the order: wire bars, middle trains, working rows of AND and OR vertices, and other trains. Weighting each track's box count by its position in this order gives a non-decreasing potential that agrees on $B_\sigma$ and $B_\tau$; hence no box ever leaves its track on a trajectory ending with $B_\tau$. Along any track, a push translates a whole maximal run of consecutive boxes and empties the cell at its trailing end. Runs therefore never split, and once two runs meet they can never separate again. Because $B_\tau$ has as many runs on each track as $B_\sigma$, no two runs ever meet. For arbitrary (possibly non-canonical) positions, a train \emph{points into} an endpoint when its gap at that end reaches the train corridor (or, for a middle train at its bottom end, leaves at least two holes above the working row). Consequently, trains and bars keep their lengths, the left bar of an AND or OR vertex never meets its short bar, so every core keeps a hole (unlike Figure~\ref{fig:full-cores}(h)), every train points into a unique endpoint at every moment, and each push reverses at most one edge. \begin{lemma}[soundness] \label{lem:push-sound} If a trajectory from $(p_0,B_\sigma)$ ends with $B_\tau$, then $\tau$ is reachable from $\sigma$. \end{lemma} \begin{proof} Let $\pi$ be such a trajectory. By the paragraph above, the orientations during $\pi$ run from $\sigma$ to $\tau$, and consecutive ones differ in at most one edge, so it suffices to show that all of them are satisfying. Suppose not, and consider the first push after which a vertex $u$ is violated. The constraints are monotone, so this push reversed an edge $e$ away from $u$: it moved the train of $e$ one cell towards~$u$, from the end of $e$ at its other endpoint, where the player now stands. If $u$ is a wire, neither of its trains points in now, and its bar points into one end only, so one of its pockets is cut off (Figure~\ref{fig:push-pockets}(d)). If $u$ is an AND or OR vertex, either one of its bars points into the core while the train at its pocket does not point in, which cuts off that pocket, or the core is cut off (Figure~\ref{fig:full-cores}(d),(g)); Appendix~\ref{app:ps-sound} lists the cases. A cut-off pocket or core can be reopened only by a push from inside it: every run of boxes on a track that borders it, a train, a bar, or any other run, moves away from it only when pushed from its side, so pushes from outside only move such runs further in. The player stands at the far end of~$e$, outside this region, so the region stays cut off to the end of~$\pi$, but $B_\tau$ has no cut-off pocket or core, a contradiction. \end{proof} Since $\tau$ is reachable from $\sigma$ exactly when it is reachable through ordered orientations, Lemmas~\ref{lem:push-complete} and~\ref{lem:push-sound} and Section~\ref{sec:preliminaries} give the following. \begin{theorem} \label{thm:push-walls} Push-$*$FS is PSPACE-complete. \end{theorem} \subsection{The board without walls} \label{sec:push-no-walls} Without walls, we fill every wall cell of Section~\ref{sec:push-walls} with a box. The track of a train now continues through these boxes to the frame (for a middle train, down to the cell above its working row), since the player can push the boxes on the column of a train from the frame and later push them back. The new boxes off the tracks form the \emph{background}. A push of unbounded strength could now shift a long segment of the background along its row and later shift it back, which the exact target cannot detect, and meanwhile the trains would no longer be held in their columns. We use the instance of Section~\ref{sec:push-walls} on the new board, and we choose its distances and add single holes so that this cannot happen. \begin{lemma}[background] \label{lem:push-background} Along every trajectory from $(p_0,B_\sigma)$ that ends with $B_\tau$, no push moves a box off the tracks or fills a hole off the tracks. \end{lemma} \begin{theorem} \label{thm:push-storage} Push-$*$S is PSPACE-complete. \end{theorem} The trajectory of Lemma~\ref{lem:push-complete} pushes only trains and bars, so it still works. Conversely, by Lemma~\ref{lem:push-background}, background boxes never move and every push takes place on the tracks, as with walls, so the paragraph on tracks and the proof of Lemma~\ref{lem:push-sound} apply word for word, with background boxes in place of walls; the only addition is that the boxes continuing a train's column to the frame stay within two cells of their initial position, by the same cut-off argument (Appendix~\ref{app:ps-sound}), so whether a train points into an end still means whether its pocket is joined to a corridor. The rest of this section proves Lemma~\ref{lem:push-background}. Fix a trajectory $\pi$ from $(p_0,B_\sigma)$ that ends with $B_\tau$. \subparagraph*{Holes far from the player.} The background is made of long segments of boxes, and the player can push a whole column of it from the frame into a corridor and later push it back. Without walls, the only obstacles we can add are holes that the player never reaches. The frame stays empty, so the number $b$ of other holes never changes, and with so few holes the player cannot get far from the empty cells it comes from. \begin{lemma}[hole radius] \label{lem:hole-radius} Let a set $A$ stay empty during $\pi$, with $p_0\in A$ if $A\neq\emptyset$, and let $h$ holes lie outside~$A$. After the player leaves $A$ from a cell~$s$, it stays within Manhattan distance $h$ of $s$ until it returns to~$A$; if $A=\emptyset$, the player stays within Manhattan distance $h-1$ of its initial cell $p_0$ throughout~$\pi$. Hence the player never enters a cell farther than $h$ from~$A$ (or farther than $h-1$ from $p_0$ when $A=\emptyset$), and such a cell can only be filled: an occupied cell stays occupied, and a hole there at the start and at the end stays a hole, into which no box is ever pushed; we call such a hole \emph{blocking}. \end{lemma} \begin{proof} Mark $s$ (or $p_0$ when $A=\emptyset$), and mark a hole outside $A$ when the player first stands on it or a push first moves it (Figure~\ref{fig:hole-radius}). We show that once $i$ holes are marked, the player and all marked holes lie within distance $i-1$ of~$s$ (resp.~$p_0$). A newly marked hole lies at the player's new cell, next to its previous cell. A push moves the hole beyond the pushed boxes to the cell that the player enters, which lies on the straight segment between the player and the old place of the hole, and a Manhattan ball contains the straight segment between two of its cells. At most $h+1$ holes get marked when $A\neq\emptyset$ (and at most $h$ when $A=\emptyset$, since $p_0$ is already one of the $h$ holes), which gives the bound. \end{proof} \begin{figure}[htbp] \centering \input{figures/hole-radius} \caption{One push in the proof of Lemma~\ref{lem:hole-radius}. (a)~The player at~$p$, with all marked holes in the shaded ball around~$s$, pushes the boxes from $q$ up to the first hole~$z$, which is not marked yet. (b)~The hole of $z$ has moved to~$q$, the new cell of the player next to~$p$; it is marked now, and the ball with radius one larger still contains the player and every marked hole. Had $z$ been marked, $q$ would lie on the segment from $p$ to~$z$, inside the old ball.} \label{fig:hole-radius} \end{figure} A blocking hole cuts a segment of boxes like a wall. If a straight segment of boxes contains a blocking hole and its side neighbours never move, then its boxes never move: the player could only push them from beyond the ends of the segment, along it, and such a push would fill the hole. The single holes that we add for this purpose are the \emph{separators}; Appendix~\ref{app:ps-coords} lists them all. We start with $A$ the frame, so that $h=b$, and make blocking the separators that are far from the frame or, along their street, from the ends of their segment. Then, one level at a time, we show that the corridors stay empty and add them to~$A$; each time $h$ drops, and the separators at the next, shorter distance become blocking. In the end, every background box on a street lies in a segment that never moves. \subparagraph*{Separators on the central row.} We place a separator on the central row in every corridor column, and also in each AND or OR vertex's private column (the column two cells past its middle train on the short-bar side, holding the \emph{private branch}, the three holes beside the lower end of the middle train in Figure~\ref{fig:full-cores}). Each of these separators lies at distance more than $D/2$ from the frame, where $D$ is the depth of each half. Choosing $D>4b$ makes all of them blocking by Lemma~\ref{lem:hole-radius}, so no push along these columns ever crosses the central row. \subparagraph*{Holes stay on streets.} The exact target already keeps most of the background motionless. The \emph{streets} of a half consist of its boundary row, the left and right boundary columns, all train columns, its working rows, the rows and columns along which its corridors run, and the private AND/OR columns that received a central-row separator above. Each non-train street column counts only within its own half; continuing it into the opposite half would open a path from the far frame into a corridor, so those opposite-half cells stay off the streets. We place all street rows and columns on even coordinates so that no two street rows are adjacent and no two street columns---even from opposite halves---are adjacent. Every hole of $B_\tau$ lies on a street of its half or at a central-row separator. Now run $\pi$ backwards from $B_\tau$. A push in reverse is a \emph{pull}: the player steps from a cell $x$ back to an adjacent hole and pulls boxes from beyond $x$ towards itself. When both holes lie on streets, non-adjacency forces them onto a common street, so the pull takes its boxes from that street. Because every non-train street column ends at its blocking separator on the central row, no pull crosses into the opposite half, and every hole stays on a street. By backward induction from $B_\tau$, no box off the streets ever moves (Figure~\ref{fig:board-streets}). \begin{figure}[htbp] \centering \input{figures/board-streets} \caption{The board of Figure~\ref{fig:full-board}(b) after the street argument, with all streets and separators; the legend below applies to all whole-board freezing figures in this section.} \label{fig:board-streets} \end{figure} \subparagraph*{Long segments.} Between the central row and the deepest street row of its half, a street column crosses no street rows, so its side neighbours on that segment are off the streets and never move. Each separator on the central row therefore fixes the boxes of its column from the central row to the first hole or street row towards the frame: for a column of a level $jb$, the separators are blocking, and the boxes in the gaps never move (Figure~\ref{fig:board-long}(b)). \begin{figure}[htbp] \centering \input{figures/board-long-pair} \caption{Freezing the long segments (same palette as Figure~\ref{fig:board-streets}). (a)~The separators on the central row fix the street-column segments up to the first hole or street row towards the frame. (b)~The separators at the midpoints of the wide horizontal gaps become blocking and fix the long street rows.} \label{fig:board-long} \end{figure} \subparagraph*{Corridors and scales.} What remains are the streets near the trains, between a train and its corridors. There the corridors are the problem: they lead the player deep into the board, and their holes make $b$ large, too large to show that the separators near a train are blocking. We therefore show that the corridors stay empty and add them to $A$, one level at a time, from the central row towards the frame. Each time, $h$ drops enough for the separators at the next, shorter distance to become blocking, so the distances have to shrink by a large factor from level to level. A vertex $u$ lies \emph{inside} a vertex $v$ in the same half if all edges of $u$ lie between the outermost edges of~$v$. The \emph{level} of $v$ is one more than the largest level of a vertex inside it, or $1$ if there is none, and the \emph{nesting depth} $m$ is the largest level; Appendix~\ref{app:push-source} bounds it by a constant~$m_0$. Let $Y_14b$, and we choose $c$ so that in each stage below, $h$ is less than half the next scale. Coordinates are in Appendix~\ref{app:ps-coords}. \emph{Stage of level $j$}, for $j=m,\dots,1$. It starts with $h=O(nL_j)$; for $j=m$, $A$ is the frame and $h=b$. It has three steps; Figures~\ref{fig:board-close}--\ref{fig:board-cores} show them on the board of Figure~\ref{fig:full-board}, whose nesting depth is $m=3$. \emph{Closing the corridors.} Between depths $Y_j+2$ and $Y_{j+1}$ (or between $Y_m+2$ and the central row for $j=m$), each level-$j$ corridor column crosses no street rows and gets a separator halfway between $Y_j$ and $Y_{j+1}$ (for $j=m$, the central-row separator); at level~$1$, so do the private column and the \emph{public columns} of each AND or OR vertex, which carry the corridors from the bottom of the frame to its working row. These separators are blocking by the along-gap argument above, so the column segment that closes each level-$j$ corridor on the side of the central row never moves. On each level-$j$ bar-corridor column, the crossing box at depth $Y_j+2$ is now backed both vertically by this fixed segment and horizontally by the wide gap fixed earlier, so it cannot move either, and neither can the box between it and the train or the box between it and the working row. For $j=m=3$ this already holds from the long-segments step; Figure~\ref{fig:board-close} shows levels~$2$ and~$1$. \begin{figure}[htbp] \centering \input{figures/board-close-pair} \caption{Closing the corridors of levels~$2$ and~$1$ on the side of the central row (level~$3$ is already closed by the central-row separators in Figure~\ref{fig:board-long}(a)).} \label{fig:board-close} \end{figure} \emph{Train corridors.} The train corridors of level $j$ now stay empty (Figure~\ref{fig:push-corridor}(a)). Consider first the horizontal leg of such a corridor. Its top and bottom neighbours are off the streets, so a box could enter it only from one of its two ends. From the corner end, pushing a box in would require standing on or pushing the background on the far side of the vertical leg, which was already fixed in the long-segments step. From the train end, the player would have to stand on or push the cell just beyond the train; that cell has off-street vertical neighbours and is backed on its far side by the box on the bar-corridor column just fixed in the closing step, so it never moves either. Now consider the vertical leg: a box can enter it from a crossing street row, but it can never leave. Pushing towards the frame only moves boxes along the leg, which can never exit onto the empty frame; pushing towards the central row hits the closed background; and pushing sideways requires standing on or pushing the fixed background on the far side. Since $B_\tau$ leaves these corridors empty, no box ever enters them. Adding all level-$j$ train corridors to $A$ reduces the remaining hole count to $h=O(nY_j)$. \emph{Next to the trains.} On each street row up to the working row, the background segment between a level-$j$ train and its train corridor has length $L_j-1$ and carries a midpoint separator. With $h=O(nY_j)$, this separator is now blocking and fixes the entire segment (Figure~\ref{fig:push-corridor}(b)). On each strictly shallower street row, we also leave the single cell between the train and its bar corridor as a hole (Appendix~\ref{app:ps-coords}). No box can then enter a level-$j$ bar corridor: \begin{itemize} \item along a shallower street row, that intervening cell is empty, so pushing a box in from the train side requires standing on or pushing the background just fixed, and pushing from the far side requires standing on or pushing the wide-gap background fixed earlier; \item from the working row, pushing a box of the bar into its corridor would require standing on the cell of the corridor column just beyond the working row, whose box was fixed in the closing step. \end{itemize} Hence every level-$j$ bar corridor stays empty as well. For $j>1$, adding them to $A$ drops the hole count to $h=O(nL_{j-1})$. Figure~\ref{fig:board-cores}(a)--(c) shows this step for levels~$3$, $2$, and~$1$; the corridors of each level turn yellow as they join~$A$. \begin{figure}[htbp] \centering \input{figures/corridor-empty} \caption{Local freezing at the top end of a level-$j$ train, not to scale (same palette as Figure~\ref{fig:board-streets}). (a)~Train corridor: a box may enter the vertical part from a crossing street row~(1), but upward pushes only move boxes along the leg and can never exit onto the empty frame~(2), while pushing down~(3) or sideways~(4) is blocked; no box enters the horizontal part from above~(5) or from the train~(6). (b)~Next to the train: once the train corridor joins~$A$, the midpoint separators on the shallow street rows become blocking and fix the background beside the train (pink), blocking pushes into the bar corridor from the train side~(7) or from below the bar~(8).} \label{fig:push-corridor} \end{figure} \subparagraph*{Cores.} At level~$1$, the public columns of the AND and OR vertices remain outside~$A$, with $O(nY_1)$ holes, far more than $O(n)$. No budget is needed for them: around each core, the boxes just beyond the working row on the public columns and on the street row two cells beyond it form segments that each end next to a box already fixed, so none of them can be the first to move (Appendix~\ref{app:ps-bg}). Hence no box enters a public column, and the public columns join~$A$ at the end of level~$1$, which leaves $O(n)$ holes outside~$A$. Below each AND or OR vertex, the middle train's column and the private column each hold a \emph{half-depth separator}, at depth $Y_1/2$; by the along-gap argument these are now blocking and fix both columns between the frame and the working row. The same first-move arguments keep the private branch empty, and every deep crossing on an inner train or bar and every cell strictly between a shallower column's inter-level separator and the central row lies farther than $h$ from~$A$ and stays occupied throughout~$\pi$ (so bars and trains may shift across deep crossings without emptying them, and the remaining deep background segments are pinned between their blocking separators so their boxes never move; Figure~\ref{fig:board-cores}(d) and Appendix~\ref{app:ps-bg}). Hence no background box ever moves and no hole off the tracks is ever filled, which proves Lemma~\ref{lem:push-background}. \begin{figure}[!p] \centering \input{figures/board-finale-quad} \caption{Completing the freeze from level~$3$ inwards to the cores. (a)--(c)~Next to the trains across levels~$3$, $2$, and~$1$: each level's separators fix the adjacent street rows (pink) and shield its bar corridors, which join~$A$ in turn; at the end of level~$1$, the AND/OR public columns join~$A$ as well. (d)~The cores: the half-depth separators below each AND and OR vertex become blocking and fix their columns, and the remaining deep background segments are pinned; every background box is now fixed.} \label{fig:board-cores} \end{figure} \FloatBarrier