---
title: Reversible 2-Head Finite Automata
url: https://www.emergentmind.com/topics/reversible-2-head-finite-automata
type: topic
---

# Reversible 2-Head Finite Automata

Reversible 2-head finite automata are deterministic two-head finite automata that process an input word from both ends and are constrained to perform reversible computation, meaning that they are also backward deterministic and therefore admit unique forward and backward computation. In the formulation studied in "On some Classes of Reversible 2-head Automata" [2507.15317], these machines define the language family \(2\mathrm{revLIN}\). Their behavior is notably nonclassical: some regular languages are not acceptable by reversible 2-head automata, while some characteristic linear languages, including palindromes, are. Two restricted submodels—1-limited reversible 2-head automata and complete reversible 2-head automata—are strictly weaker, yielding a proper hierarchy inside deterministic two-head linear-language recognition.

## 1. Formal model and reversibility

A deterministic two-head finite automaton is a 5-tuple
\[
A=(Q,q_0,V,\delta,F),
\]
where \(Q\) is a finite set of states, \(q_0\in Q\) is the initial state, \(V\) is the input alphabet, \(F\subseteq Q\) is the set of accepting states, and
\[
\delta:Q\times (V\cup\{\lambda\})\times (V\cup\{\lambda\})\to Q
\]
is a partial transition function. A configuration is a pair \((q,w)\), where \(q\in Q\) and \(w\in V^*\) is the unread portion of the input; one head is positioned at the left end of \(w\), the other at its right end. If \(w=a\,w'\,b\), with \(a,b\in V\cup\{\lambda\}\) and at least one of \(a,b\neq \lambda\), and if \(p=\delta(q,(a,b))\), then
\[
(q,a\,w'\,b)\;\vdash\;(p,w').
\]

Determinism requires that for every configuration there is at most one applicable move. Equivalently, for each \(q\in Q\) and each pair \((a,b)\in (V\cup\{\lambda\})^2\) with \((a,b)\neq (\lambda,\lambda)\), one has \(|\delta(q,(a,b))|\le 1\), and no two transitions from \(q\) move the same head on the same symbol. Backward determinism requires that every configuration have at most one predecessor. A reversible two-head DFA, or rev-2DFA, is precisely a deterministic two-head automaton that is also backward deterministic; the family of languages it accepts is denoted \(2\mathrm{revLIN}\) [2507.15317].

The key structural criterion is an injectivity condition on the transition function. A deterministic two-head automaton is reversible if and only if its transition function is injective in the following sense: whenever
\[
\delta(q_1,(a,b))=\delta(q_1',(c,d))=q_2
\]
with \(|a\,d|+|b\,c|\ge 1\), then
\[
(q_1,(a,b))=(q_1',(c,d)).
\]
In particular, no two distinct transitions may enter the same state \(q_2\) while reading the same nonempty pair. This characterization isolates reversibility as a local syntactic condition on \(\delta\), rather than only a global property of computation histories.

## 2. Restricted reversible subclasses

Two restricted variants are central. A rev-2DFA is **1-limited** if every transition moves exactly one head. Equivalently,
\[
\forall q\in Q,\;\forall a,b\in V:\;\delta(q,(a,b))\text{ is undefined}.
\]
This model is denoted \(R1\text{-}2H\), and its language family is \(2\mathrm{rev1LIN}\). The restriction excludes simultaneous consumption from both ends and forces the machine to alternate, in a state-dependent way, between left-head and right-head actions [2507.15317].

For \(R1\text{-}2H\), the state space admits a sharp structural classification. States can be partitioned according to which head is used to enter the state and which head may be used to leave it:
\[
Q_{\rightarrow,\rightarrow},\;
Q_{\rightarrow,\leftarrow},\;
Q_{\rightarrow,\emptyset},\;
Q_{\leftarrow,\rightarrow},\;
Q_{\leftarrow,\leftarrow},\;
Q_{\leftarrow,\emptyset},\;
Q_{\emptyset,\rightarrow},\;
Q_{\emptyset,\leftarrow}.
\]
Here \(Q_{\rightarrow,\emptyset}\) and \(Q_{\leftarrow,\emptyset}\) are final-only classes, while \(Q_{\emptyset,\rightarrow}\) and \(Q_{\emptyset,\leftarrow}\) are initial-only classes. Initial and accepting states must lie in the corresponding boundary classes. Together with the injectivity and determinism conditions, this partition completely characterizes 1-limited reversible two-head automata.

The second restriction is **completeness**. A deterministic two-head automaton, and in particular a rev-2DFA, is complete if for every nonempty unread input \(w\) and every state \(q\) there is exactly one valid move. The corresponding reversible complete model is denoted \(RC\text{-}2H\), and its accepted language family is \(2\mathrm{CrevLIN}\). Completeness is stronger than mere totality of the transition function in a one-head DFA sense; in this setting it means that any nonempty unread input can be fully read under a unique continuation [2507.15317].

A decisive consequence is that in a complete reversible automaton no transition may move both heads simultaneously. Thus,
\[
\text{completeness}+\text{reversibility}\;\Rightarrow\;\text{1-limitedness}.
\]
Moreover, the transition graph of any complete 1-limited rev-2DFA is strongly connected: from every reachable state \(p\) and every other state \(q\), some input suffix takes \(p\) to \(q\). Completeness therefore imposes a strong global regularity on the control graph while simultaneously reducing expressive power.

## 3. Proper hierarchy of reversible two-head classes

The principal hierarchy theorem is
\[
2\mathrm{CrevLIN}\;\subsetneq\;2\mathrm{rev1LIN}\;\subsetneq\;2\mathrm{revLIN}\;\subsetneq\;2\mathrm{detLIN},
\]
and each inclusion is strict [2507.15317]. Here \(2\mathrm{detLIN}\) denotes the language family accepted by deterministic two-head finite automata, and all four classes lie inside the linear languages.

| Inclusion | Separating language |
|---|---|
| \(2\mathrm{CrevLIN}\subsetneq 2\mathrm{rev1LIN}\) | \(\{b^n a^n,\; b^{n+1}a^n \mid n\ge 0\}\) |
| \(2\mathrm{rev1LIN}\subsetneq 2\mathrm{revLIN}\) | \(\{wcb^n \mid w\in\{a,b\}^*,\; |w|_b=n\}\) |
| \(2\mathrm{revLIN}\subsetneq 2\mathrm{detLIN}\) | \(\{a^n b^m \mid n,m\ge 0\}\) |

The separation \(2\mathrm{revLIN}\subsetneq 2\mathrm{detLIN}\) is especially significant because the witness language \(\{a^n b^m\mid n,m\ge 0\}\) is regular. Reversibility is therefore not a minor implementation constraint layered on top of ordinary deterministic finite-state recognition; it removes some languages already at the regular level.

The separation \(2\mathrm{rev1LIN}\subsetneq 2\mathrm{revLIN}\) shows that simultaneous two-sided consumption genuinely adds power under reversibility. The language
\[
\{wcb^n \mid w\in\{a,b\}^*,\; |w|_b=n\}
\]
is outside \(2\mathrm{rev1LIN}\), but an example construction places it in \(2\mathrm{revLIN}\). Conversely, the separation \(2\mathrm{CrevLIN}\subsetneq 2\mathrm{rev1LIN}\) shows that completeness is not an innocuous strengthening. The language
\[
\{b^n a^n,\; b^{n+1}a^n \mid n\ge 0\}
\]
cannot be accepted by any complete reversible 2-head DFA, although it belongs to \(2\mathrm{rev1LIN}\) via a two-state cycle reading \(b\)'s with head 1 and \(a\)'s with head 2.

A common misconception is that stronger operational discipline should monotonically increase descriptive regularity. The hierarchy shows the opposite: completeness narrows the class, and 1-limitedness narrows it further relative to unrestricted reversible two-head computation.

## 4. Language-theoretic profile and closure behavior

The language families \(2\mathrm{CrevLIN}\), \(2\mathrm{rev1LIN}\), \(2\mathrm{revLIN}\), and \(2\mathrm{detLIN}\) all sit between the regular languages and the full linear languages \(\mathrm{LIN}\). More precisely, every machine of these kinds accepts only a subfamily of \(\mathrm{LIN}\), but the reversible classes are neither coextensive with the regular languages nor with all linear languages [2507.15317].

The most characteristic positive example is the palindrome language
\[
\mathrm{PAL}=\{w\,w^R \mid w\in V^*\}.
\]
It belongs to \(2\mathrm{rev1LIN}\), hence also to \(2\mathrm{revLIN}\). The construction uses a two-state reversible automaton that zig-zags inward, matching symbols from both ends. This sharply contrasts with the negative regular example \(\{a^n b^m\mid n,m\ge 0\}\notin 2\mathrm{revLIN}\). The comparison demonstrates that reversibility aligns well with symmetric end-to-center comparison tasks, but not with all one-sided regular segmentations. This suggests that the geometry of input access—rather than only Chomsky-style language class membership—is decisive for the model’s expressive behavior.

The closure properties are selective. Each of \(2\mathrm{detLIN}\), \(2\mathrm{revLIN}\), \(2\mathrm{rev1LIN}\), and \(2\mathrm{CrevLIN}\) is closed under reversal. In addition, \(2\mathrm{CrevLIN}\) is closed under complementation, because completeness and reversibility are preserved when final and nonfinal states are exchanged. No broader closure list is stated for the reversible two-head families in the supplied results, so the current picture is intentionally partial.

## 5. Grammars and related reversible two-head models

A left-deterministic linear grammar (LDLG) is a linear grammar in which every nonterminal \(A\) has productions of the form
\[
A\to aBu
\quad\text{or}\quad
A\to \lambda,
\]
and if both \(A\to aBu\) and \(A\to aB'v\) occur, then \(B=B'\) and \(u=v\). Its generated language family is denoted \(\mathrm{LDLL}\). Every LDLG can be simulated by a deterministic 2-head automaton that reads one terminal on one strand and communicates through the state which production was used; accordingly,
\[
\mathrm{LDLL}\subset 2\mathrm{detLIN},
\]
and the inclusion is proper. A witness is
\[
L_{1\vee 3}=\{a^n b^n\}\cup \{a^{3n}b^n\},
\]
which belongs to \(2\mathrm{detLIN}\) but not to \(\mathrm{LDLL}\). Since \(2\mathrm{revLIN}\subsetneq 2\mathrm{detLIN}\) and \(\mathrm{LDLL}\subsetneq 2\mathrm{detLIN}\), the reversible classes are, in general, incomparable with \(\mathrm{LDLL}\): some LDLG languages fail to be reversible, while some reversible languages, including palindromes, are not in \(\mathrm{LDLL}\) [2507.15317].

Related literature on reversible Watson–Crick automata situates reversible 2-head automata inside a broader family of two-head reversible devices on double-stranded inputs. In the strongly reversible case, where the complementarity relation is injective, strongly reversible Watson–Crick automata coincide exactly with reversible two-head DFAs [1507.05283]. More general one-way reversible Watson–Crick automata use a potentially non-injective complementarity relation \(\rho\) as an additional information channel. One summary reports that one-way RWKA accept exactly the regular languages, simulate any \(n\)-state one-way NFA with \(n+2\) states, and achieve an exponential-to-linear state-complexity gap on
\[
L_k=\{x^n \mid n\ge 1,\; x\in\{a,b\}^k\}
\}
\]
via \(s_{NFA}(L_k)\ge 2^{k+1}\) and \(s_{RWKA}(L_k)\le 2k+2\) [2005.10126]. Another summary attributes to non-injective complementarity a strict increase in power over deterministic multi-head finite automata and presents the strongly reversible fragment as the exact counterpart of reversible two-head DFAs [1507.05283]. Taken together, these results make complementarity—not reversibility alone—the central extension mechanism in the Watson–Crick line.

## 6. Conceptual significance and open questions

Reversible 2-head finite automata isolate a narrow but nontrivial zone between general deterministic two-head linear-language acceptors and stricter reversible submodels. The hierarchy
\[
2\mathrm{CrevLIN}\subsetneq 2\mathrm{rev1LIN}\subsetneq 2\mathrm{revLIN}\subsetneq 2\mathrm{detLIN}
\]
shows that reversibility, single-head-per-step operation, and completeness are logically distinct constraints with genuinely different language-theoretic consequences [2507.15317].

Two negative facts are particularly instructive. First, reversibility does not preserve all regular languages: \(\{a^n b^m\mid n,m\ge 0\}\) is excluded. Second, completeness does not enlarge the model’s effective control; instead, completeness together with reversibility forces 1-limitedness and yields the weakest class in the hierarchy. These observations undermine any naive expectation that “more disciplined” finite-state dynamics should automatically remain coextensive with standard regular recognition.

The open problems identified for the model are the search for natural complete characterizations of \(2\mathrm{revLIN}\), decidability results, and tighter comparisons with other subclasses of \(\mathrm{LIN}\). A plausible implication is that future progress will depend less on isolated witness languages than on structural invariants analogous to the injectivity criterion and the state-classification theorem. Such invariants would clarify whether the current hierarchy reflects a deeper algebra of reversible end-to-end reading, or only the first layer of a larger taxonomy of reversible linear-language acceptors.

Source: https://www.emergentmind.com/topics/reversible-2-head-finite-automata