Table of Contents
Fetching ...

Logic-Gated Time-Shared Feedforward Networks for Alternating Finite Automata: Exact Simulation and Learnability

Sahil Rajesh Dhayalkar

Abstract

We present a formal and constructive framework for simulating Alternating Finite Automata (AFAs) using Logic-Gated Time-Shared Feedforward Networks (LG-TS-FFNs). Unlike prior neural automata models limited to Nondeterministic Finite Automata (NFAs) and existential reachability, our architecture integrates learnable, state-dependent biases that function as differentiable logic gates, enabling the representation of both Existential \textsc{\textsc{OR}} and Universal \textsc{\textsc{AND}} aggregation within a shared-parameter linear recurrence. We prove that this architectural modification upgrades the network's computational class to be structurally isomorphic to AFAs, thereby inheriting their exponential succinctness: the network can represent regular languages requiring $2^n$ states in an NFA with only $n$ neurons. We rigorously establish that the forward pass of an LG-TS-FFN exactly simulates the reachability dynamics of an AFA, including instantaneous $\varepsilon$-closures. Furthermore, we demonstrate empirical learnability: a continuous relaxation of the logic gates allows the network to simultaneously recover the automaton's topology and logical semantics from binary labels via standard gradient descent. Extensive experiments confirm that our model achieves perfect recovery of ground-truth automata, bridging the gap between statistical learning and succinct, universal logical reasoning.

Logic-Gated Time-Shared Feedforward Networks for Alternating Finite Automata: Exact Simulation and Learnability

Abstract

We present a formal and constructive framework for simulating Alternating Finite Automata (AFAs) using Logic-Gated Time-Shared Feedforward Networks (LG-TS-FFNs). Unlike prior neural automata models limited to Nondeterministic Finite Automata (NFAs) and existential reachability, our architecture integrates learnable, state-dependent biases that function as differentiable logic gates, enabling the representation of both Existential \textsc{\textsc{OR}} and Universal \textsc{\textsc{AND}} aggregation within a shared-parameter linear recurrence. We prove that this architectural modification upgrades the network's computational class to be structurally isomorphic to AFAs, thereby inheriting their exponential succinctness: the network can represent regular languages requiring states in an NFA with only neurons. We rigorously establish that the forward pass of an LG-TS-FFN exactly simulates the reachability dynamics of an AFA, including instantaneous -closures. Furthermore, we demonstrate empirical learnability: a continuous relaxation of the logic gates allows the network to simultaneously recover the automaton's topology and logical semantics from binary labels via standard gradient descent. Extensive experiments confirm that our model achieves perfect recovery of ground-truth automata, bridging the gap between statistical learning and succinct, universal logical reasoning.

Paper Structure

This paper contains 46 sections, 5 theorems, 19 equations, 3 figures, 2 tables.

Key Result

Proposition 4.2

Let $q_i \in Q$ be a state with a set of predecessors $P_i = \{q_j \mid q_i \in \delta(q_j, x)\}$ for input symbol $x \in \Sigma \cup \{\varepsilon\}$. Let $d_i = |P_i|$ denote the in-degree of state $q_i$ for this symbol (the number of incoming connections). Let $v_{prev} \in \{0,1\}^n$ be the bool where $T_{ij}^{(x)} = 1 \iff q_i \in \delta(q_j, x)$ (encoding the transition $q_j \xrightarrow{x}

Figures (3)

  • Figure : Figure 1: High-level Logic-Gated TS-FFN visualization. An Logic-Gated TS-FFN unrolls a shared logic-gated transition rule across depth (one block per symbol position). Each step applies a symbol-specific transition matrix $T^{x_t}$ and bias vector $\beta^{x_t}$ (with parameter pairs $(T^{x_1}, \beta^{x_1}), \dots, (T^{x_L}, \beta^{x_L})$ corresponding to input symbols from $\Sigma$), time-shared across $t$, interleaved with an $\varepsilon$-closure operator $\mathcal{C}_\varepsilon$ (parameterized by $T^\varepsilon, \beta^\varepsilon$). The resulting boolean state vector $s_t$ corresponds to the AFA's active configuration after consuming prefix $x_{1:t}$ and applying $\varepsilon$-closure, effectively implementing both Existential (OR) and Universal (AND) branching logic within the recurrence.
  • Figure : Figure 2: Per-batch training loss across 5 seeds for Configuration 1.
  • Figure : Figure 3: Per-batch training loss across 5 seeds for Configuration 2.

Theorems & Definitions (18)

  • Definition 3.1: Alternating Finite Automaton
  • Definition 3.2: Boolean State Vector
  • Definition 3.3: $\varepsilon$-Closure
  • Definition 3.4: Feedforward Network with Activation
  • Definition 3.5: Time-Shared, Depth-Unrolled Feedforward Network (TS-FFN) dhayalkar2025nfa
  • Definition 4.1: Logic-Gated Time-Shared Feedforward Network
  • Proposition 4.2: Logical Aggregation via Biased Linear Units
  • Theorem 4.3: Simulation of AFAs by Logic-Gated TS-FFNs
  • Proposition 4.4: Succinctness and Parameter Efficiency
  • Remark 4.5: Comparison to NFA Simulation
  • ...and 8 more