I’ve been reading up on the connection between first order logic and small circuit complexity classes, and specifically Barrington, Immerman, and Straubing’s paper “On Uniformity Within $\mathit{NC}^1$”, where they prove $\mathit{DLOGTIME}$-uniform $\mathit{AC}^0$ = $\mathit{FO}[+,\times]$. However, it seems to me that $\mathit{FO}[+,\times]$ is much more powerful than $\mathit{DLOGTIME}$-uniform $\mathit{AC}^0$. For example, the following sentence:
$$ \forall x \,(Qx \lor \exists a \exists b \,(a\times b = x \land a\ne1 \land b\ne1)) $$
can be implemented as a circuit as an $\mathrm{AND}$ gate that is only connected to prime-numbered inputs (including input 1), and so defines the language $\{1, 11, 110, 1100, 11001, 110010\}$. However, $\mathit{DLOGTIME}$ only has time linear in the size of the gate indices to determine whether a connection exists between two gates. It seems to me that to recognize the connectivity language in linear time, one would have to be able to tell whether or not the input gate index was prime, and $\mathrm{PRIMES}$, although in $P$, is not computable in linear time. How can this language be $\mathit{DLOGTIME}$-uniform $\mathit{AC}^0$ then?