A Constructive Framework for Nondeterministic Automata via Time-Shared, Depth-Unrolled Feedforward Networks
Sahil Rajesh Dhayalkar
TL;DR
This paper builds a constructive bridge between NFAs and neural networks by encoding NFA states as binary vectors and representing transitions as shared symbolic matrices within time-shared, depth-unrolled feedforward networks (TS-FFNs). It proves that every regular language recognized by an $n$-state NFA can be exactly recognized by a TS-FFN with $O(k n^2)$ parameters, independent of input length, and that the framework is empirically learnable via gradient descent (Proposition 5.1). The construction also yields a bidirectional equivalence: TS-FFNs can simulate NFAs exactly, and any TS-FFN constructed from this symbolic recipe corresponds to an NFA recognizing the same language. These results unify automata theory and neural computation and are validated by experiments showing precise state propagation, epsilon-closure handling, and language equivalence.
Abstract
We present a formal and constructive simulation framework for nondeterministic finite automata (NFAs) using time-shared, depth-unrolled feedforward networks (TS-FFNs), i.e., acyclic unrolled computations with shared parameters that are functionally equivalent to unrolled recurrent or state-space models. Unlike prior approaches that rely on explicit recurrent architectures or post hoc extraction methods, our formulation symbolically encodes automaton states as binary vectors, transitions as sparse matrix transformations, and nondeterministic branching-including $\varepsilon$-closures-as compositions of shared thresholded updates. We prove that every regular language can be recognized exactly by such a shared-parameter unrolled feedforward network, with parameter count independent of input length. Our construction yields a constructive equivalence between NFAs and neural networks and demonstrates \emph{empirical learnability}: these networks can be trained via gradient descent on supervised acceptance data to recover the target automaton behavior. This learnability, formalized in Proposition 5.1, is the crux of this work. Extensive experiments validate the theoretical results, achieving perfect or near-perfect agreement on acceptance, state propagation, and closure dynamics. This work clarifies the correspondence between automata theory and modern neural architectures, showing that unrolled feedforward networks can perform precise, interpretable, and trainable symbolic computation.
