Solution (source code)

= Solution

All requester indices in the following expressions are interpreted <modulo> four. Let $h_{\ell,j}$ mean that requester $j$ is the first asserted request after last recipient $\ell$:
$$
h_{\ell,\ell+d}=r_{\ell+d}\land\bigwedge_{t=1}^{d-1}\neg r_{\ell+t},\qquad d=1,2,3,4.
$$
An empty <logical conjunction> is true. Decode the remembered index and combine the four priority orders:
$$
w_j=\bigvee_{\ell=0}^3([L=\ell]\land h_{\ell,j}),\qquad H=\bigvee_{j=0}^3r_j.
$$
Exactly one $w_j$ is high when any request is high. Write $L$ as bits $L_1L_0$. The <next-state function> and <Moore machine> outputs are
$$
\boxed{\begin{aligned}
V^+&=H,\\
L_1^+&=(\neg H\land L_1)\lor w_2\lor w_3,\\
L_0^+&=(\neg H\land L_0)\lor w_1\lor w_3,\\
g_j&=V\land[L=j].
\end{aligned}}
$$
Thus an idle step preserves the priority memory. The $w_j$ are combinational selection signals, not the current-cycle grants: exposing them directly as outputs would change the design into a <Mealy machine>. If a requester remains continuously asserted, each intervening successful grant advances the circular order, so it receives service after at most four grant decisions.