---
title: Bi-level Nondeterministic Finite Automata
url: https://www.emergentmind.com/topics/bi-level-non-deterministic-finite-automaton-bi-nfa
type: topic
---

# Bi-level Nondeterministic Finite Automata

A Bi-level Nondeterministic Finite Automaton (Bi-NFA), also known as a dependency automaton, generalizes classical nondeterministic finite automata (NFA) by incorporating two NFAs connected via a dependency relation on their state sets. This framework enables an explicit and canonical interaction between an automaton for a regular language and one for its reversal, formalizing a deep algebraic equivalence with deterministic automata over finite join-semilattices (JSL-dfas). Bi-NFAs support a categorical structure that unifies automata-theoretic dualities, state-minimality for languages and their reverses, and extends foundational minimization algorithms such as Brzozowski’s double-reversal construction. The Bi-NFA formalism also provides a natural setting for defining and characterizing “subatomic” NFAs through the lens of syntactic semirings and Boolean-quotient closures [2007.06031].

## 1. Formal Structure of Bi-level NFAs (Dependency Automata)

A Bi-NFA over alphabet $\Sigma$ is a triple
\[
(N_1, R, N_2) = \left((I_1, Q_1, \delta^1_a, F_1),\; R \subseteq Q_1 \times Q_2,\; (I_2, Q_2, \delta^2_a, F_2)\right)
\]
where:

- $N_1$ and $N_2$ are both NFAs:
  - $Q_1$, $Q_2$ are state sets,
  - $I_1\subseteq Q_1$, $I_2\subseteq Q_2$ initial states,
  - $F_1\subseteq Q_1$, $F_2\subseteq Q_2$ final states,
  - $\delta^1_a\subseteq Q_1\times Q_1$, $\delta^2_a\subseteq Q_2\times Q_2$ transition relations for each $a\in\Sigma$.
- The dependency relation $R\subseteq Q_1 \times Q_2$ satisfies:
  - **Transition-compatibility**: for all $a\in\Sigma$,
    \[
    \delta^1_a\;;\; R = R\;; (\delta^2_a)^{\breve{}}
    \]
    That is, for $q_1 \in Q_1$, $q_2 \in Q_2$,
    $$
    (\exists\,p_1.\;\delta^1_a(q_1,p_1)\land R(p_1,q_2))
    \iff
    (\exists\,p_2.\;R(q_1,p_2)\land\delta^2_a(q_2,p_2))
    $$
  - **Initial–final compatibility:**
    $$
    F_2 = R[I_1],\quad F_1 = R^{\breve{}}[I_2]
    $$
    $R^{\breve{}}$ denotes converse.
- $(N_1, R, N_2)$ accepts $L(N_1)$ and $L(N_2) = L(N_1)^r$.

This explicit relational coupling constrains the joint NFA behavior, enforcing coherent language acceptance between each automaton and its dual for the reversed language.

## 2. Categorical Equivalence: Bi-NFAs and JSL-dfas

Bi-NFAs constitute the objects of the category $\mathbf{Dep}$, with morphisms given by compatible finite relations. This category is equivalent to that of deterministic automata in finite join-semilattices ($\mathbf{JSL\text{-}dfa}$). The equivalence is constructed as follows:

- The functor $\Det : \mathbf{Dep} \to \mathbf{JSL\text{-}dfa}$ assigns to $(N_1, R, N_2)$ the JSL-dfa defined on the semilattice $\Open R$ of $R$-open sets (down-closures $R[X]$):
  - Initial state: $R[I_1]$.
  - Transitions: $\gamma_a(Y) = (N_2)_a^{\breve{}}[Y]$ for each $a\in\Sigma$.
  - Final filter: $\{Y : Y\cap I_2\neq\emptyset\}$.

- The functor $\Airr: \mathbf{JSL\text{-}dfa} \to \mathbf{Dep}$ produces a dependency automaton from a JSL-dfa, where the lower NFA has states the join-irreducibles of the semilattice $S$ (linking transitions to the partial order), and the upper NFA uses the meet-irreducibles.

Natural isomorphisms $\mathrm{rep}$ and $\mathrm{red}$ ensure that $\Det\circ\Airr\cong \mathrm{Id}$ and $\Airr\circ\Det\cong\mathrm{Id}$, providing a categorical equivalence between Bi-NFAs and JSL-dfas. This implies any Bi-NFA arises canonically from a JSL-dfa and vice versa [2007.06031].

## 3. Canonical Bi-NFA Construction for a Regular Language

Given a regular language $L\subseteq\Sigma^*$, the canonical dependency automaton is defined as
\[
\Dep(L) = (\mathit{dfa}(L),\, DR_L,\, \mathit{dfa}(L^r))
\]
where:
- $\mathit{dfa}(L)$ is the state-minimal deterministic automaton on the semilattice of left quotients:
  $$
  LW(L) = \{u^{-1}L : u\in\Sigma^*\}
  $$
  with transition $\delta_a : u^{-1}L \mapsto (ua)^{-1}L$ and final states $\{u^{-1}L : \varepsilon \in u^{-1}L\}$.
- $DR_L \subseteq LW(L)\times LW(L^r)$ is the dependency relation:
  $$
  DR_L(u^{-1}L, v^{-1}L^r) \iff uv^r\in L
  $$
- $\mathit{dfa}(L^r)$ similarly for the reverse language.

$DR_L$ satisfies the Bi-NFA compatibility axioms and yields, up to $\mathbf{Dep}$-isomorphism, the unique minimal Bi-NFA for $L$. This construction intertwines the state-minimal automata for both $L$ and $L^r$ via $DR_L$, encapsulating the duality of forward and reverse recognition in a single object.

## 4. Bi-NFAs and Brzozowski’s Double-Reverse Minimization

Brzozowski’s minimization algorithm for DFAs proceeds by reversing the automaton, applying the subset construction, and reversing again (“reverse–subset–reverse”). In the Bi-NFA context, this process generalizes as follows:

- For any NFA $N$,
  $$
  N \cong \mathrm{reach}(\Det(N, \Delta_N, N)) = \mathrm{reach}(\mathit{subset}(N))
  $$
  so dualizing (reversing) and simplifying twice yields the minimal DFA.

- The workflow can be captured categorically:
  $$
  \delta \xrightarrow{\Affr} (N, \Delta_N, N) \xrightarrow{\Det} sc(N) \xrightarrow{\mathrm{reach}/\mathrm{simple}} \delta_{\min}
  $$
  where $\Affr$ constructs a trivial Bi-NFA, $\Det$ applies the JSL-dfa functor, and reachability plus simplification produce the state-minimal DFA.

The bi-level perspective reveals that Brzozowski's minimization is naturally interpreted within $\mathbf{aut} \simeq \mathbf{dfa}$, making the double-reversal an internal manifestation of equivalence between Bi-NFAs and JSL-dfas [2007.06031].

## 5. Subatomic NFAs and the Syntactic Transition Semiring

A subatomic NFA for regular $L$ is one whose state languages are all in $\mathit{LRP}(L)$, the Boolean closure under left and right quotients:
\[
\mathit{LRP}(L) = \{\text{finite Boolean combinations of } u^{-1}L v^{-1} : u,v\in\Sigma^*\}
\]

The defining theorem establishes:
> $N$ is subatomic $\iff$ the transition semiring of $\mathrm{rsc}(\mathrm{rev}(N))$ is isomorphic to the syntactic semiring of $L^r$.

Here,

- $\mathrm{rsc}(N)$ is the reachable-subset construction viewed as a JSL-dfa.
- **Transition semiring** of a JSL-dfa $(S,\lor,\bot,\delta_a)$ is the idempotent semiring generated by endomorphisms $\{\delta_w: w\in\Sigma^*\}$ ($S\to S$).
- **Syntactic semiring** of $L$ is the quotient of the free idempotent semiring $(\mathcal{P}_f(\Sigma^*),\cup,\emptyset, \cdot, \{\varepsilon\})$ by the congruence induced by $L$:
  $$
  U\sim V \iff \forall x,y.\; xUy\subseteq \overline{L} \iff xVy \subseteq \overline{L}
  $$

If $N$ is subatomic, the reachability-closed subset construction inherits the Boolean-quotient atomic structure, ensuring the transition semiring coincides with the syntactic semiring. Conversely, if the transition semiring is syntactic, all state languages must lie in the Boolean quotient closure, so $N$ is subatomic [2007.06031].

## 6. Summary and Theoretical Context

Dependency automata (Bi-NFAs) provide a categorical and algebraic unification for regular language recognition, capturing both forward and reverse automata in a minimal, relational framework. They form a self-dual category under language reversal and are categorically equivalent to deterministic automata over finite join-semilattices. The canonical Bi-NFA for a language synchronizes the minimal DFAs of a language and its reversal via an explicit dependency relation. This structure subsumes Brzozowski's double-reversal algorithm and yields a precise interpretation of subatomic automata in terms of syntactic transition semirings, characterizing when the atomic structure of an automaton is preserved under Boolean operations and quotients [2007.06031].

Source: https://www.emergentmind.com/topics/bi-level-non-deterministic-finite-automaton-bi-nfa