Automata and formal languages

Access in controlled Dyck languages

The number of bounded residual behaviors and the prefix depth needed to encounter them are different invariants. Arbitrary sparse languages can delay access without changing an initial growth profile; finite Dyck controllers instead impose a linear access bound. Optimizing that bound exposes a second question: which cost belongs to the language, and which belongs only to a particular controller?

FPRD-T49 · theorem

Scalar growth does not determine access

For a strictly increasing functionf:N→Nf:\mathbb N\to\mathbb N, consider

Lf={anbaf(n):n≥0}. L_f=\{a^n b a^{f(n)}:n\ge0\}.

The residuals after the marker are the singleton completionsRr={ar}R_r=\{a^r\}. Putνf(r)=min⁡{n:f(n)≥r}\nu_f(r)=\min\{n:f(n)\ge r\}. The first prefix reaching the row{ar}\{a^r\} has length

cf(r)=νf(r)+1+f(νf(r))−r, c_f(r)=\nu_f(r)+1+f(\nu_f(r))-r,

while the empty horizon-NN row first appears atef(N)=min⁡{νf(N),2}e_f(N)=\min\{\nu_f(N),2\}. Together with the pre-marker arrivals, these give

Gf(M,N)=1[ef(N)≤M]+∑r=0N1[cf(r)≤M]+#{n≤M:f(n)≤N−1}. G_f(M,N)= \mathbf 1[e_f(N)\le M] +\sum_{r=0}^{N}\mathbf 1[c_f(r)\le M] +\#\{n\le M:f(n)\le N-1\}.

The largest singleton arrival controls access:

af(N)=max⁡ ⁣(1+f(0),max⁡1≤n≤νf(N)(n+f(n)−f(n−1))). a_f(N)=\max\!\left( 1+f(0), \max_{1\le n\le\nu_f(N)} \bigl(n+f(n)-f(n-1)\bigr) \right).

Taking fH(0)=0f_H(0)=0 andfH(1)=H≥Nf_H(1)=H\ge N leaves the scalar quotient history through NNunchanged while makingafH(N)=H+1a_{f_H}(N)=H+1 arbitrarily large.

This family is an unrestricted calibration. No finite-presentation or novelty claim is made for an arbitrary schedule.

FPRD-T50 · theorem and algorithm

Finite controllers force linear access

Fix a generalized-Dyck language and a finite total controllerM=(Q,Ω,δ,q0,F)M=(Q,\Omega,\delta,q_0,F). For controller states p,qp,q, let dM(p,q)d_M(p,q) be the shortest length of a balanced word sending ppto qq.

If ρM(s,q)\rho_M(s,q) is the shortest prefix reaching stack/controller coordinate(s,q)(s,q), the final unmatched opener gives the exact recurrence

ρM(so,q)=min⁡p∈Q(ρM(s,p)+1+dM(δ(p,o),q)). \rho_M(so,q)= \min_{p\in Q} \bigl(\rho_M(s,p)+1+d_M(\delta(p,o),q)\bigr).

Raw coordinates may merge into the same bounded language row. The correct order is therefore to minimize arrival within each semantic class and only then take the maximum over classes.

Exact access.

aLM(N)=max⁡K∈SNmin⁡{arrival(c):c∈K}. a_{L_M}(N)=\max_{K\in S_N} \min\{\text{arrival}(c):c\in K\}.

Let BMB_M be the largest finite balanced distance whose source is reachable in the controller's underlying DFA. A height-hh legal prefix hash+1h+1 balanced segments around its hh unmatched openers. Shortening those segments yields

aLM(N)≤max⁡{1,(N+1)BM+N}. a_{L_M}(N)\le\max\{1,(N+1)B_M+N\}.

For every positive horizon there is a finite controller withBM=2B_M=2 and access3N+23N+2, so the class-wide inequality is pointwise sharp. The witnessing controller may depend on NN.

FPRD-T51 · theorem

Depth thresholds have exact profiles

Let Dk,ℓ≥rD_{k,\ell}^{\ge r}contain balanced words whose stack reaches height at leastr≥1r\ge1, and letDk,ℓ<rD_{k,\ell}^{<r} be the branch that stays below it. WritingSk(N)=∑h=0NkhS_k(N)=\sum_{h=0}^{N}k^h,

qk,r≥(N)=1+Sk(N)+∑h=max⁡(0,2r−N)r−1kh,ak,r≥(N)=max⁡(2r,N), q_{k,r}^{\ge}(N)= 1+S_k(N)+ \sum_{h=\max(0,2r-N)}^{r-1}k^h, \qquad a_{k,r}^{\ge}(N)=\max(2r,N), qk,r<(N)=1+Sk(min⁡(N,r−1)),ak,r<(N)=max⁡(1,min⁡(N,r−1)). q_{k,r}^{<}(N)=1+S_k(\min(N,r-1)), \qquad a_{k,r}^{<}(N)=\max(1,\min(N,r-1)).

A pre-threshold stack of heighth<rh<r first becomes visible when a future of length 2r−h2r-hcan reach the threshold and return. Post-threshold rows are distinguished by their typed closing words.

At horizon zero, every at-least-threshold language has exactly two rows, yet access equals 2r2r. Even finite presentations can therefore have a fixed row count and unbounded delay across a family.

FPRD-T52 · theorem

Remove costs created only by the controller

The linear proof does not need every reachable controller state. A balanced segment begins either at the start state or immediately after an opener in a legal Dyck prefix. Let this exact finite set of sources be EME_M, and letBMentB_M^{\mathrm{ent}} be its largest finite balanced distance.

Under a surjective morphism of reachable DFAs, legal-entry states map onto legal-entry states and balanced distances cannot grow. Thus ordinary DFA minimization weakly improves the certificate for one regular controller language.

More generally, two regular languages can differ away from the Dyck envelope while defining the same observed language. For a controlled-Dyck language L⊆DL\subseteq D, define

βD(L)=min⁡R regularD∩R=LBmin⁡(R)ent. \beta_D(L)= \min_{\substack{R\text{ regular}\\D\cap R=L}} B_{\min(R)}^{\mathrm{ent}}.
aL(N)≤max⁡{1,(N+1)βD(L)+N}. a_L(N)\le\max\{1,(N+1)\beta_D(L)+N\}.

The minimum exists because the candidate values are a nonempty set of natural numbers. Enumerating trace-equivalent controllers approximates it from above, but the proof does not supply a general stopping test.

FPRD-T53 · theorem

Semantic observations bound every presentation

Three language-level quantities expose progressively richer behavior. The first acceptance flipτD\tau_D sees only a changed output at an empty-stack boundary. Balanced residual accessγD\gamma_D distinguishes future behavior after balanced histories. Entry-context accessηD\eta_D repeats that experiment inside every legal unfinished stack.

βD(L)≥ηD(L)≥γD(L)≥τD(L). \beta_D(L)\ge\eta_D(L)\ge\gamma_D(L)\ge\tau_D(L).

Although entry contexts are infinite, their relevant completion behavior is finite. In the paired exclusive-or controller, an unfinished stack is summarized by the set of endpoint pairs that some legal completion separates. Finite saturation of controller states and these summaries computesηD(L)\eta_D(L) exactly.

Given any controller, minimize its ordinary DFA and call its entry diameter bMb_M. Then

ηD(L)≤βD(L)≤bM. \eta_D(L)\le\beta_D(L)\le b_M.

If the two computable endpoints agree, that presentation is globally optimal throughout its Dyck-trace class. The remaining differenceσD(L)=βD(L)−ηD(L)\sigma_D(L)=\beta_D(L)-\eta_D(L)is nonnegative and computable in the limit from above; equality to zero is semidecidable by endpoint coincidence.

No positive value of σD\sigma_Dis known here, and no theorem says it always vanishes.

FPRD-T54 · theorem

The modulus-three trace has zero sewing defect

In the one-bracket Dyck language, let

K3={ϵ}∪{w≠ϵ:t(w)≡2(mod3)}, K_3=\{\epsilon\}\cup \{w\ne\epsilon:t(w)\equiv2\pmod3\},

where t(w)t(w) is the length of the terminal run of closing brackets. A three-state controller resets on every opener and counts that final run modulo three. It is state-minimal, but its entry diameter is six.

A nested-context witness forcesηD(K3)≥4\eta_D(K_3)\ge4. An explicit six-state trace-equivalent controller has entry diameter four, closing the sandwich:

ηD(K3)=βD(K3)=4. \eta_D(K_3)=\beta_D(K_3)=4.

The sewing defect is therefore zero, but minimizing state count and minimizing entry access are different optimization problems.

FPRD-T55 · exact finite-state classification

The modulus-three frontier is exact

The natural three-state controller is state-minimal and has entry cost six. The access-optimal six-state controller from the preceding theorem has cost four. Moreover, no controller with at most five states can present the same Dyck trace at cost four. Hence the nondominated state/access pairs are exactly

(3,6)and(6,4). (3,6)\qquad\text{and}\qquad(6,4).

The five-state exclusion is computer-assisted. The encoding is exact—it closes the balanced-word relation under concatenation and matched wrapping rather than checking words only to a cutoff—and permits unused-state padding. It relies on the trusted Z3 4.16 kernel and was independently cross-checked by CEGIS; no proof-assistant certificate is claimed.

FPRD-T56 · theorem

Modulus two has a single frontier point

For every m≥2m\ge2, define

Km={ϵ}∪{w∈D∖{ϵ}:t(w)≡m−1(modm)}. K_m=\{\epsilon\}\cup \{w\in D\setminus\{\epsilon\}:t(w)\equiv m-1\pmod m\}.

At modulus two, epsilon reaches the accepted top-level residual. The balanced word ococ is also accepted, while ooccooccis the first rejected balanced factor. Thus the semantic access is four. The natural two-state controller also has entry cost four, and a one-state controller cannot define this nontrivial trace. Therefore

ηD(K2)=βD(K2)=4,frontier(K2)={(2,4)}. \eta_D(K_2)=\beta_D(K_2)=4, \qquad\text{frontier}(K_2)=\{(2,4)\}.

FPRD-T57 · exact finite-state classification

Modulus four again separates states from access

The semantic entry cost of K4K_4is six. Its natural state-minimal controller has four states and cost eight, while an explicit six-state controller attains cost six. Exact trace comparison excludes fewer than four states, and exact finite-state search excludes cost six through five states. Consequently

ηD(K4)=βD(K4)=6,frontier(K4)={(4,8),(6,6)}. \eta_D(K_4)=\beta_D(K_4)=6, \qquad \text{frontier}(K_4)=\{(4,8),(6,6)\}.

The five-state exclusion is computer-assisted. A generalized closed-relation encoding and an independently implemented one-hot CEGIS encoding both reach unsatisfiable, but both rely on the trusted Z3 kernel rather than a portable formal certificate.

FPRD-T58 · theorem and construction

The access cost is known for every modulus

Fix a legal entry context of positive stack heighthh. A completion either uses the bare terminal descent, which distinguishes one incoming residue, or contains a later opener, which resets the terminal run and erases the incoming residue. The contextual balanced factors therefore form exactly two classes. Their first arrivals give

ηD(K2)=4,ηD(Km)=2(m−1)(m≥3). \eta_D(K_2)=4, \qquad \eta_D(K_m)=2(m-1)\quad(m\ge3).

A uniform controller with states(a,b)∈Zm×{0,1}(a,b)\in\mathbb Z_m\times\{0,1\}records stack height modulo mmand whether the current terminal descent plus height has the accepting residue. Balanced factors preserve the height coordinate and realize precisely the two semantic classes. Its entry cost meets the lower bound, so

βD(K2)=4,βD(Km)=2(m−1)(m≥3). \beta_D(K_2)=4, \qquad \beta_D(K_m)=2(m-1)\quad(m\ge3).

This construction uses 2m2mstates. It proves optimal access, not minimum state count at that access cost.

FPRD-T59 · theorem and construction

Even moduli admit a smaller optimal controller

When mm is even, the accepting terminal positions lie on one parity class. This permits a controller with an mm-cycle and two nonaccepting parity states. On legal prefixes it tracks the cycle position whent+ht+h is odd and the parity of the remaining height otherwise.

The resulting (m+2)(m+2)-state controller has trace KmK_mand entry cost 2(m−1)2(m-1) for even m≥4m\ge4, with cost four at modulus two. At modulus four it is isomorphic to the six-state witness above.

This is a constructive upper bound on state count. Minimum optimal-cost state counts remain open beyond moduli two, three, and four; no even/odd minimum-state law is asserted.

What remains open

  • Whether βD=ηD\beta_D=\eta_D for every controlled-Dyck trace.
  • Whether βD\beta_D has a terminating computation on useful subclasses.
  • How the invariant changes under a different Dyck envelope or recoding.
  • The minimum number of states needed to attain optimal access beyond moduli two, three, and four.
  • No external or specialist review of these FPRD results is recorded.

Sources