betaFeedback

WorksComputer Science

Nonstabilization of the Predictive Boolean Lookahead Hierarchy

Abstract

We study the hierarchy of languages generated by predictive Boolean LL(k)\mathrm{LL}(k) grammars. The model uses a deterministic recursive-descent table, strongly non-left-recursive rules, and at least one positive conjunct per rule. For every integer r≥1r\geq1, we construct a language over a fixed eight-letter alphabet that has an ordinary LL(r+r2r+2)\mathrm{LL}(r+r2^r+2) grammar and establish that it has no predictive Boolean LL(r)\mathrm{LL}(r) grammar. The construction asks for a specified token in a uniquely decodable word. The lower bound represents parsing on a long unary prefix by finitely many forward-moving endpoint streams and a finite Boolean recurrence. Random binary blocks followed by homogeneous blocks separate streams with a persistent timing error from streams having an exact finite-state potential. A bounded-lookahead argument hides a token-count change from each remaining stream. An encoding of the resulting independent queries is then shorter than their arbitrary binary payload. This gives nonstabilization under the stated predictive convention. The conclusion is for the stated parser model, including positive-conjunct and strong non-left-recursion requirements. Path-dependent tables satisfying these requirements give the same language families.

Introduction

Boolean grammars extend context-free grammars by allowing conjunction and negation in grammar rules. Their language semantics is independent of any particular parser. Okhotin’s recursive-descent construction identifies a predictive subclass for which a bounded initial segment of the unread input selects the rule to be used [3].

Problem 8 in Okhotin’s list asks whether the corresponding hierarchy eventually stabilizes [1, 4]. The question concerns language families. A language lower bound must exclude every grammar for that language with the smaller lookahead. The lower bound below quantifies over every predictive Boolean grammar with that lookahead and the premises in Section 2.

Let BoolLL(kk) denote the family defined in Section 2, and let LL(kk) denote the ordinary context-free LL(kk) family. Throughout the paper, lookahead counts raw terminal symbols. A short unread suffix is distinguished from a longer suffix with the same initial symbols.

Theorem 1.1. For every integer r≥1r \ge1 there is a language LrL_r over the alphabet {a,b,c,d,e,p,x,y}\{a, b, c, d, e, p, x, y\} such that

Lr∈LL(r+r2r+2)∖BoolLL(r).(1)L_r \in\mathrm{LL}(r + r^{2r} + 2) \setminus\mathrm{BoolLL}(r). \tag*{(1)}

Consequently, there is no integer k0≥1k_0 \ge1 for which BoolLL(k)=BoolLL(k0)\mathrm{BoolLL}(k) = \mathrm{BoolLL}(k_0) for every k≥k0k \ge k_0.

The proof uses the operational structure of the predictive parser. A long unary prefix gives each successful long return a single source endpoint. The other conjuncts test that endpoint, while fixed suffix procedures move it forward. This produces a finite collection of numerical streams. Their number may depend arbitrarily on the hypothetical grammar.

We construct enough independent changes of token count to hide one mode coordinate from each stream. At common query times, the parser would then recover an arbitrary array of binary strings

The authors acknowledge assistance from OpenAI Codex in mathematical exploration, checking, and manuscript preparation. from fewer bits than the array contains. The argument permits the very large input lengths needed for successive calibrations by storing only equality information about remote endpoints.

For linear conjunctive grammars, Olkhovsky and Okhotin proved a collapse to lookahead one [6]. The present witness has a nonlinear production, and its lower bound addresses the full predictive Boolean family. Theorem 1.1 proves eventual nonstabilization for the explicit predictive convention used here. The relation between this convention and the short problem statement is discussed in § 9.

The predictive model

A Boolean grammar is a tuple G=(Σ,V,P,S)G = (\Sigma, V, P, S) with finite terminal alphabet Σ\Sigma, finite nonterminal set VV, start symbol SS, and rules

A⟶α1&⋯&αm&¬β1&⋯&¬βt,m≥1,t≥0.(2)A \longrightarrow\alpha_1 \mathbin{\&} \cdots\mathbin{\&} \alpha_m \mathbin{\&} \neg\beta_1 \mathbin{\&} \cdots\mathbin{\&} \neg\beta_t,\qquad m \ge1,\quad t \ge0. \tag*{(2)}

Every αi\alpha_i and βj\beta_j is a finite word in Σ∪V\Sigma\cup V. The language of a rule is the intersection of its positive-conjunct languages and the complements of its negative-conjunct languages. The language of a nonterminal is the union of its rule languages. We use the strongly unique language-equation semantics. The hypotheses below are the hypotheses of the predictive recursive-descent construction [2, 3].

Write G+G^+ for the positive transform obtained by deleting all negative conjuncts. A signed occurrence of BB in a rule of AA is an occurrence in either a positive or a negative conjunct. If that conjunct has body γBδ\gamma B\delta, its prefix is γ\gamma and its suffix is δ\delta. The zero-consumption graph has an edge A→BA \to B for each such occurrence with ε∈LG+(γ)\varepsilon\in L_{G^+}(\gamma).

Definition 2.1. A grammar is strongly non-left-recursive if its zero-consumption graph is acyclic. A syntactic follower of an occurrence is obtained by concatenating the suffixes on a signed path from the start symbol to that occurrence, in reverse path order.

For a word ww, let First⁡k(w)\operatorname{First}_k(w) be its first kk symbols, or all of ww when ∣w∣<k|w| < k. A predictive table is a partial function

T:V×Σ≤k⟶P.T : V \times\Sigma^{\le k} \longrightarrow P.

It is valid if, for every rule A→φA \to\varphi, every signed occurrence of AA with syntactic follower η\eta, and every u∈LG(φ)LG(η)u \in L_G(\varphi)L_G(\eta), the entry T(A,First⁡k(u))T(A,\operatorname{First}_k(u)) is that rule.

The parser for a nonterminal selects this entry from the unread suffix. An absent entry fails. A selected rule executes its first positive conjunct and records the returned endpoint. Each remaining positive conjunct must return that same endpoint from the same starting position. Each negative conjunct must fail or return a different endpoint. The call succeeds exactly when these tests hold, and then returns the recorded endpoint. A sequence is parsed by executing its factors from left to right. The start call accepts exactly when it succeeds at the end of the input.

Strong non-left-recursion guarantees termination on finite inputs, including inputs outside an occurrence’s syntactic follower domain. A successful operational return consumes a word in the corresponding language of G+G^+. On legal followers, the table construction gives correct recognition of the Boolean language. These facts follow from the recursive-descent soundness and termination argument [2 Sections 4–5]. We will also use their elementary operational content. Any chain of calls whose preceding successful factors consume zero symbols follows the acyclic zero-consumption graph. Every other edge advances the input pointer.

Definition 2.2. The family BoolLL⁡(k)\operatorname{BoolLL}(k) consists of languages of strongly non-left-recursive Boolean grammars of the form (2.1) admitting a valid predictive table with lookahead kk.

The positive-conjunct premise is part of this definition. A purely negative rule has no positive endpoint for the stated parser to return. Appendix A treats the path-dependent version of the table condition in the original problem statement.

The token language

Fix r≥1r \ge1 and put

J=r+r2r,k=J+2.J = r + r2^r,\qquad k = J + 2.

Define

CJ={a,b,e,x,y,bJ+1d} ∪ {abjdve:0≤j≤J, v∈{x,y}∗}.(3)C_J = \{a,b,e,x,y,b^{J+1}d\}\ \cup\ \{ab^jdve:0\le j\le J,\ v\in\{x,y\}^*\}. \tag*{(3)}

Members of CJC_J are called tokens. A token in the second set is a long aa-token. Define

Lr={pncw:n≥1, w∈CJ∗, the nth token of w is a}.(4)L_r=\{p^ncw:n\ge1,\ w\in C_J^*,\ \text{the }n\text{th token of }w\text{ is }a\}. \tag*{(4)}

In particular, the queried token must exist.

Lemma 3.1. Every word in CJ∗C_J^* has a unique tokenization. At the beginning of a token, kk symbols of raw lookahead determine its kind. There is an ordinary LL(k)(k) grammar for LrL_r.

Proof. If the remaining word begins with abjdab^jd for 0≤j≤J0\le j\le J, then the first token must be a long aa-token. A singleton aa would leave at most JJ consecutive bb’s before the first dd, which no subsequent token could absorb. Conversely, a long aa-token has exactly such a prefix. Its {x,y}∗e\{x,y\}^*e tail is deterministic.

At a bb-position, the token bJ+1db^{J+1}d is forced precisely when that prefix is present. Taking an initial singleton bb would again leave too few bb’s to absorb the dd. All other starts use a singleton. Induction over the successive tokens proves uniqueness. Each decision uses at most J+2J+2 raw symbols and remains valid with any follower in CJ∗C_J^*.

More explicitly, let TT generate one token by the rules

T→a∣b∣e∣x∣y∣bJ+1d∣abjdVe(0≤j≤J),T\to a\mid b\mid e\mid x\mid y\mid b^{J+1}d\mid ab^jdVe\quad(0\le j\le J),
V→xV∣yV∣ε.V\to xV\mid yV\mid\varepsilon.

The alternatives of VV are distinguished by the next symbol, since its follower is ee. Let RR be a deterministic right-linear grammar for the regular language CJ∗C_J^*. Use

S→pBaR,B→pBT∣c.(5)S\to pBaR,\qquad B\to pBT\mid c. \tag*{(5)}

The BB-recursion matches the first n−1n-1 tokens after cc, and the literal aa matches the nnth. A literal aa cannot instead be the first symbol of a long token, since its remainder would not belong to CJ∗C_J^*. The alternatives of BB have different first symbols. The described grammar for TT is LL(k)(k) on its followers, and RR is needed only with the end of input as follower. Thus (3.3) has the required predictive grammar. □

We henceforth assume, for a contradiction, that a grammar GG in the model of Section 2 recognizes LrL_r with lookahead rr. All constants may depend on GG. The alphabet, rr, and the language in (3.2) remain fixed.

Endpoint locality and unary-prefix structure

For a nonterminal or fixed sequence α\alpha, write Pα(w)P_\alpha(w) for the length consumed by its actual parser on ww, with value ⊥\perp on failure. A successful length is always nonnegative. A suffix procedure therefore induces a partial extensive map on positions, meaning that an output position is at least the input position.

Lemma 4.1 (Exact endpoint locality). If First⁡ℓ+r(w)=First⁡ℓ+r(w′)\operatorname{First}_{\ell+r}(w)=\operatorname{First}_{\ell+r}(w'), then

Pα(w)=ℓ⟺Pα(w′)=ℓP_\alpha(w)=\ell\quad\Longleftrightarrow\quad P_\alpha(w')=\ell

for every fixed sequence α\alpha and every $\ell\ge 0.

Proof. First treat nonterminals, by induction on ℓ\ell and then by a topological ordering of the zero-consumption graph, with dependencies before dependents. Rule selection uses the same rr-prefix on both inputs. A sequence returns exactly ℓ\ell precisely when its factors return lengths ℓ1,…,ℓs≥0\ell_1,\ldots,\ell_s \ge0 summing to ℓ\ell. For a factor beginning at offset uu, its required prefix has length at most u+ℓi+r≤ℓ+ru+\ell_i+r \le\ell+r.

A child of length less than ℓ\ell is covered by the first induction. A child of length ℓ\ell begins after a zero-length prefix. If that prefix can succeed, it is nullable in G+G^+, so the relevant dependency decreases the topological rank. Otherwise that factorization cannot contribute on either input. This also treats ℓ=0\ell=0.

The selected rule succeeds at length ℓ\ell exactly when all positive sequences succeed at that length and no negative sequence succeeds at that length. These conditions are preserved by the induction. The sequence assertion follows from the same factorization criterion. Equality of truncated prefixes also preserves a short end-of-input window, so the argument includes finite suffixes of length less than ℓ+r\ell+r.

A failing call can inspect an arbitrarily long prefix. In particular, a negative branch may run far beyond the eventual positive endpoint. Returning at a specified endpoint is local in the stated sense.

The fixed positive skeleton

Fix a terminal uu and consider inputs unwu^n w. On the infinite stream uωu^\omega, follow the first positive conjunct at every call and omit all other tests. Each resulting skeleton has one of three types. It returns after a fixed finite length, fails after a finite computation, or continues indefinitely. There is a constant n0n_0 such that every finite skeleton has completed before the last rr symbols of unu^n whenever n≥n0n \ge n_0.

An actual successful call has the same first-positive execution as its skeleton. Consequently, for n≥n0n \ge n_0 a finite returning type can only return its fixed short length. A finite failing type cannot succeed. An indefinitely continuing type can succeed only with an endpoint within the last r−1r-1 symbols of unu^n or within ww.

Measure a long endpoint relative to the beginning of ww. It then lies in

{−r+1,−r+2,…,∣w∣}.(6)\{-r+1,-r+2,\ldots,|w|\}. \tag*{(6)}

For each nonterminal AA, let FA(n;w)F_A(n;w) record failure, a short successful return, or this long endpoint.

Lemma 4.2 (Finite source representation). For the fixed grammar and unary terminal uu, there are integers H≥1H \ge1, P≥0P \ge0, and D≥0D \ge0 with the following properties.

(1) Long successful returns are obtained from PP potential endpoint streams. Each stream, on its residue class of outer indices nn, iterates one fixed suffix procedure Γi\Gamma_i. One iteration increases nn by HH.

(2) Each stream is nondecreasing while it moves. A zero step is stationary thereafter, and failure of the potential procedure is permanent. Actual success agrees with the potential endpoint whenever the relevant guards hold.

(3) All success flags satisfy a deterministic finite Boolean recurrence. At outer index nn, it uses a fixed finite list of suffix procedures evaluated at potential stream positions with indices in a window of width DD about nn.

(4) Apart from these procedure evaluations, the numerical tests are equalities of endpoints and comparison with the final endpoint. The recurrence creates no procedure address by combining two endpoints.

The constants and procedure lists are independent of ww.

Proof. For a signed sequence in a selected rule, traverse the factors until the first indefinitely continuing skeleton. Every earlier successful factor has a fixed short length. Their total is a grammar-bounded delay δ\delta. If there is a finite failure first, the sequence fails. If there is no long factor, its only possible successful length is fixed. Otherwise its endpoint is

h(FB(n−δ;w)),h(F_B(n-\delta;w)),

where BB is the first long factor and hh is the actual parser for the remaining fixed sequence. This is a partial extensive map independent of nn. Earlier short success flags and all signed tests remain as Boolean conditions.

For the first positive sequence of a long nonterminal AA, this gives one designated source B(A)B(A), one delay δA\delta_A, and one suffix map hAh_A. Inaccessible and permanently failing sources can be removed. Every remaining component of this finite functional graph contains a cycle. A cycle of total delay zero would be a cycle in the original zero-consumption graph, so every cycle has positive total delay.

Choose HH to be a common multiple of all cycle delays, taking H=1H = 1 when there are no cycles. Following a cycle until the outer index has decreased by HH expresses its endpoint as one fixed composition of suffix procedures applied to its earlier endpoint. For every cycle node and every outer residue modulo HH, choose a fixed sufficiently large initial index. Seed the potential stream by the actual endpoint there, and iterate that composition in the forward direction. An actual success always agrees with its potential stream. An actual guard failure can suppress a value but cannot change the potential trajectory or introduce a new endpoint source.

Unroll the bounded paths from off-cycle nodes to their cycles. Compose their suffix procedures with the fixed procedures already needed for the signed sequences. This produces a finite list of maps evaluated only at cycle positions at finitely shifted times. The identity map may be included in the list.

Zero-delay conditions are evaluated in the topological order of the zero-consumption graph. All other delays are bounded. Positive conjuncts compare returned endpoints for equality, and negative conjuncts test inequality or failure. Short-long comparisons have a fixed result beyond an enlarged threshold. The resulting finite recurrence has the claimed form. □

Lemma 4.3 (Uniform leading-block periodicity). There are constants dd, d0≥0d_0 \ge0 and q≥1q \ge1 such that the complete operational endpoint vector on umwu^m w is periodic in mm with period qq whenever m≥d∣w∣+d0m \ge d|w| + d_0. Long endpoints are measured relative to ww, and short endpoints by their consumed lengths. The assertion also holds for any fixed finite list of suffix procedures.

Proof. Use Lemma 4.2. On a fixed cycle residue, actual successful long endpoints are nondecreasing in the finite set (6). If an actual cycle value fails, the cycle formula forces every later value on that residue to fail. There are therefore O(∣w∣+1)O(|w| + 1) changes among all cycle residues, including their transitions to failure.

During an interval with no such change, off-cycle potential values are periodic with period HH after a fixed delay margin. They are fixed functions of the cycle values. The remaining state consists of finitely many success bits in a bounded memory window and the current residue. Its number of possibilities is bounded by a grammar-dependent constant M0M_0. An interval without a cycle change longer than the delay margin plus M0+1M_0 + 1 contains two identical full normalized states. The deterministic recurrence then repeats forever. Thus either periodicity has already begun, or another cycle change occurs within a bounded number of steps. Since the number of changes is O(∣w∣+1)O(|w| + 1), the transient is linear in ∣w∣|w|.

The eventual period is at most M0M_0. Taking a common multiple of the integers from 11 to M0M_0 gives a period independent of ww. A fixed suffix procedure is handled by adding a new one-rule wrapper, with no incoming dependencies, or directly by the sequence formula in the preceding proof. A finite list changes only the constants. □

We apply Lemma 4.2 to the unary terminal pp. Positions will be measured from the beginning of the token word after the separator cc. This changes the fixed offsets by one and has no effect on any conclusion. The number of streams is denoted by PP. If P=0P = 0, sufficiently long accepted words would have no long start endpoint, already contradicting (4). Hence $P \ge 1.

Calibration of endpoint streams

A potential stream iterates a fixed actual suffix procedure Γ\Gamma. We now examine its positive steps on an infinite binary input. This examination concerns the potential trajectory. Actual signed guards will be retained separately in the final Boolean simulation.

A finite-state additive process

For a fixed infinite word, a finite return of length ℓ\ell means a return forced by its prefix of length ℓ+r\ell+r. Such a return is well-defined by Lemma 4.1. A zero return is stationary. An input admitting no finite return is sent to a cemetery outcome.

Lemma 5.1. On independent fair binary letters, the successive rr-windows at positive cutoffs, together with the consumed lengths, form a finite-state Markov additive process, with possible absorption at failure or stationarity. Its state space is a subset of {a,b}r\{a,b\}^{r}.

Proof. At a current cutoff jj, the known window is the next rr symbols. The event that the next length is ℓ\ell is determined by the input through position j+ℓ+rj+\ell+r. Consequently the new cutoff plus its window is a stopping boundary for revealing letters. Bits beyond that boundary are fresh and independent. Conditional on the current window, the distribution of the next window and length is therefore independent of the earlier trajectory. Overlapping windows when ℓ<r\ell<r simply retain their already known letters. Zero returns and the absence of any finite return give the stated absorbing outcomes. □

Lemma 5.2 (Drift or an exact potential). Fix the positive integer HH from Lemma 4.2. In a closed irreducible moving class of the process in Lemma 5.1, exactly one of the following applicable descriptions holds.

(1) The mean progress per step is μ≠H\mu\ne H, possibly μ=∞\mu=\infty. If TNT_N is the first step crossing raw position NN, then TN/N→1/μT_N/N\to1/\mu, with 1/∞=01/\infty=0.

(2) The mean is HH, and for every 0<η<1/80<\eta<1/8,

Pr⁡∣HTN−N∣≤N2η⟶0.(7)\Pr\left\lvert HT_N-N\right\rvert\le N^{2\eta}\longrightarrow0. \tag*{(7)}

(3) There is a function ϕ\phi on the class such that every possible step from qq to q′q' has positive finite length

ℓ=H+ϕ(q′)−ϕ(q).(8)\ell=H+\phi(q')-\phi(q). \tag*{(8)}

This formula and positive finite returns hold on every binary continuation from the class. For a fixed procedure, there is at most one class of the third kind, and it contains the window brb^r.

Proof. Successive returns to a fixed state form independent excursions. Their number of steps has finite mean. The strong law for excursion rewards gives a limiting mean raw progress μ\mu per step. Truncating the nonnegative rewards proves divergence of the average when their mean is infinite. Positivity then gives the assertion about crossing times in the first case.

Suppose μ=H\mu=H. Regard different possible lengths on one transition as different edges. If two closed walks have different average lengths, repeat them to obtain two return paths having the same number hh of steps but distinct total raw lengths. Each path has positive probability. Sample in blocks of hh steps in an appropriate residue of the chain’s period. The resulting finite chain is irreducible on its cyclic component. With probability tending to one, a positive fraction of the first tt blocks are one of the two selected return paths.

Condition on the coarser trajectory which identifies the union of those two paths, and on every other block. Their remaining choices are independent Bernoulli variables with a fixed parameter in (0,1)(0,1). They have the same initial state, final state, and duration, so choosing one does not change the distribution of the subsequent coarser path. The raw position is a fixed term plus a nonzero integer multiple of their sum. The largest atom of that sum is O(t−1/2)O(t^{-1/2}), by the binomial coefficient estimate. Thus the position at time tt has vanishing probability of lying in any interval of length o(t)o(\sqrt{t}).

To pass to crossing times, take t=⌊N/H⌋t = \lfloor N/H \rfloor and a window of O(N2η)O(N^{2\eta}) steps about tt. The expected total progress in this window is O(N2η)O(N^{2\eta}), uniformly over its starting state. By Markov’s inequality it exceeds N3ηN^{3\eta} with probability tending to zero. A crossing within the window would therefore place the position at time tt within O(N3η)O(N^{3\eta}) of NN, except on that exceptional event. Since 3η<1/23\eta< 1/2, the preceding anti-concentration bound proves (5.1).

If all closed walks have the same average, their average is μ\mu. The sum of ℓ−μ\ell-\mu on each closed walk is zero. Path integration therefore defines a potential with ℓ=μ+ϕ(q′)−ϕ(q)\ell= \mu+ \phi(q') - \phi(q). For μ=H\mu= H this is (5.2). The finite potential range bounds all step lengths. If some binary continuation had no positive return by this bound, locality would give a positive-probability finite cylinder with the same property, contradicting closed almost-sure survival. Hence the formula is valid on every continuation.

Continuing with bb forever eventually places every positive moving trajectory in state brb^r. Closedness keeps this state in the class. Two different closed classes are disjoint, so there is at most one exact class for the procedure. □

Passing from random input to a homogeneous block

We will use a block XbRXb^R, where XX is binary of length NN and R=N2R = N^2. The next lemma prevents an altered return near the join from having an uncontrolled intermediate length.

Lemma 5.3 (Join bound). Let an actual successful fixed-sequence call start at position j≤Nj \le N of an input whose interval [N,N+R)[N,N+R) consists of bb’s. There is a grammar-dependent constant CC such that its endpoint either lies within rr positions of N+RN+R or later, or lies at most C(N−j+1)C(N-j+1) positions beyond NN.

Proof. Keep the successful first-positive parse forest of the call. At the first logical crossing of NN, its pending stack consists of siblings along an active ancestor path and a fixed number of remaining top-level factors. Every path edge with a positive preceding consumption advances by at least one symbol, so there are at most N−jN-j such edges before the join. Consecutive zero-prefix edges follow the acyclic zero-consumption graph and have bounded length. The pending stack therefore has O(N−j+1)O(N-j+1) entries.

If the endpoint is at most N+R−rN+R-r, each remaining entry of this successful forest finishes on homogeneous input with its full lookahead still in the bb-block. Its first-positive computation on bωb^\omega must then have the same finite length. There are finitely many types of pending factors, and their finite homogeneous return lengths have a fixed maximum. Summing these lengths proves the bound. The fixed number of factors in the original sequence changes only CC. □

For finite mean progress, the last random cutoff before a specified raw position has tight undershoot. Indeed, for A≥1A \ge1 the chance of an undershoot exceeding AA is bounded by

∑h≥Amax⁡qPr⁡q(ℓ>h).(9)\sum_{h \ge A} \max_q \Pr_q(\ell> h). \tag*{(9)}

Every raw cutoff position is visited at most once, and the Markov property applies there. There are finitely many states and their lengths have finite means, so the right side tends to zero.

Lemma 5.4 (Uniform calibration). Fix finitely many stream procedures and finitely many possible finite preludes to a new binary block. Fix an entering clock discrepancy bound BB, a bound LL on all later raw input, and a constant d∗>0d_* > 0. One can choose arbitrarily large NN and a common binary word XX of length NN such that, after XbN2Xb^{N^2}, every stream and prelude has one of the following descriptions, uniformly in the later input.

(1) It is dead or stationary by all relevant final query times.

(2) It has entered its exact class from Lemma 5.2. Its clock discrepancy changes by a bounded amount independent of NN. Its deep homogeneous cutoffs are spaced by HH, and their phase is determined before the later input.

(3) At the final query times it is still deep in this homogeneous block, at an affine position on each outer residue. Its unread homogeneous length exceeds d∗(L+1)d_{*}(L + 1).

The final queries may range over a prescribed interval after the nominal end of the block, provided its total length and its clock offset are bounded by L+BL + B.

Proof. Couple all finite words XbNv2XbN^2_v to the same infinite independent binary reference with prefix XX. Every reference cutoff at most N−rN-r is reproduced on all these words by Lemma 4.1. A first changed successful return must end past N−rN-r. A reference zero step before that position remains stationary. Conditional on eventual absorption, its time and last finite position are tight. Conditional on survival, the entry into one of the finitely many closed moving classes is also tight. Choose fixed bounds for these quantities with an arbitrarily small exceptional probability.

In a finite-mean class, (5.3) places the last cutoff before N−rN-r within a fixed distance of it, outside an arbitrarily small exceptional event. Only finitely many binary fragments can lie between that cutoff and NN. On each fragment followed by bωb^\omega, a finite homogeneous return has a fixed length. Locality and Lemma 5.3 show that the altered trajectory either enters deep homogeneous input at position N+O(1)N+O(1) or jumps near its far end. There are at most r−1r-1 additional positive starts immediately before the join.

In the infinite-mean and absorbed-reference cases, Lemma 5.3 gives entry no farther than O(N+1)O(N+1) into the homogeneous block, or a jump to its far end. The entry clock is o(N)o(N) in the infinite-mean case and bounded on the retained absorbed event. These bounds also apply to an initial seed procedure with a fixed prefix.

On deep bb input, the fixed procedure has one homogeneous skeleton. It either has one finite positive step length hh, returns zero, fails, or can return on a finite word only near the end of the block. A jump near the end occurs at clock O(N)O(N) and is far ahead of the nominal clock N+N2N+N^2. There are at most L+O(1)L+O(1) subsequent strict position increases before failure or stationarity.

For a finite positive homogeneous step, h>Hh>H also makes the stream far ahead, while h<Hh<H leaves a positive fraction of the N2N^2 block unread at the final queries. If h=Hh=H, the discrepancy at the random join persists. Wrong mean creates an order-NN discrepancy. Equation (7) makes a mean-HH nonexact class miss a window of width N2ηN^{2\eta} with probability tending to one. An absorbed or infinite-mean reference is ahead by order NN on the retained event. Choose N2ηN^{2\eta} much larger than any required multiple of L+BL+B.

The remaining case is an exact class. All its binary steps are bounded and obey (5.2), including the continuation into the bb-block. The bounded entrance data and finite potential range bound its discrepancy independently of NN. Its homogeneous phase is known from the common prefix. This gives the second description.

All statements about the finite continuation followed from locality or the early-return versus far-jump dichotomy, and hence are uniform in vv. Choose the exceptional probability smaller than the reciprocal of the finite number of procedure-prelude pairs. A union bound gives one reference prefix XX that works for all pairs. Increasing NN gives the required unread length and query margins. □

A hidden change of token count

We next use the bound on the number of possible lookahead windows. It is independent of the range of the potential in Lemma 5.2.

Lemma 6.1 (A common cutoff). *Suppose a stream is in an exact class. After a fixed common prefix, there are two binary continuations differing at one position ss, one containing a there and

one containing bb, for which the stream reaches the same cutoff j∗j_\ast at the same outer time. Moreover,

1≤j∗−s≤r2r+1.1 \leq j_\ast- s \leq r2^r + 1.

A marker may be placed at position j∗+rj_\ast+ r, followed by any common suffix, without changing this common cutoff.

Proof. Fix the seed and write the cutoff after tt steps as

jt=Ht+c0+ϕ(qt).(10)j_t = Ht + c_0 + \phi(q_t). \tag*{(10)}

Take the continuation after the seed to consist entirely of bb’s, and choose tt large enough that the positions considered below are past the seed. Then qt=brq_t = b^r and j∗=Ht+c0+ϕ(br)j_\ast= Ht + c_0 + \phi(b^r).

For each state qq of the exact class, the candidate endpoint Ht+c0+ϕ(q)Ht+c_0+\phi(q) has an rr-symbol window. There are at most 2r2^r states, so these windows cover at most r2rr2^r raw positions. Among the r2r+1r2^r+1 positions immediately preceding j∗j_\ast, choose ss outside all candidate windows. Change only position ss from bb to aa.

The changed continuation still has positive exact-class steps by Lemma 5.2, and still satisfies (6.1) with the same c0c_0. Every candidate endpoint has unchanged window brb^r. Its state must therefore be brb^r, giving the same endpoint j∗j_\ast at step tt.

All earlier cutoffs are at most j∗j_\ast. Inserting a marker at j∗+rj_\ast+r changes none of their consumed prefixes and following rr-windows. Lemma 4.1, applied successively, preserves every cutoff up to j∗j_\ast. The remaining raw suffix is the same in the two inputs, so the potential trajectories from this cutoff onward are identical.

Lemma 6.2 (Token-count change). In Lemma 6.1, place dd at j∗+rj_\ast+r and then append xvex^v e. By choosing v≥0v\geq0, the bb-signal version can have any prescribed positive number WW more tokens than the aa-signal version. Both versions have the same raw length.

Proof. Put B=j∗−sB=j_\ast-s. The number of bb’s between the signal and dd is

j=B+r−1≤r2r+r=J.j = B+r-1 \leq r2^r+r=J.

Choose the common leading homogeneous segment long enough to contain at least J+1J+1 consecutive bb’s before dd. In the bb-signal version, the last J+1J+1 of these and the marker form the special token bJ+1db^{J+1}d. The following xvex^v e contributes v+1v+1 singleton tokens. In the aa-signal version, the signal and bjdxvebjdx^v e form one long token.

If the common binary segment before dd has length ℓ\ell, these portions contribute respectively

ℓ−J+v+1andℓ−j\ell-J+v+1 \qquad\text{and}\qquad\ell-j

tokens. Their difference is v+1−(J−j)v+1-(J-j). Taking v=W+J−j−1v=W+J-j-1 makes the difference WW and gives v≥0v\geq0.

Simultaneous modes

We construct a finite family of words on which each stream loses one independently chosen coordinate. The family depends on the alleged grammar GG, while its words are all words in the fixed code language (3.1).

Choose a power of two M=2mM=2^m and put

Q=M2,Λ=MPQ,θ=(θ1,…,θP)∈{0,…,M−1}P.(11)Q=M^2,\qquad\Lambda=M^P Q,\qquad\theta=(\theta_1,\ldots,\theta_P)\in\{0,\ldots,M-1\}^P. \tag*{(11)}

The payload z∈{a,b}Λz\in\{a,b\}^{\Lambda} is arbitrary. It is partitioned into MPM^P successive blocks of length QQ. Define

I(θ)=∑i=1PθiMi−1.I(\theta)=\sum_{i=1}^{P}\theta_iM^{i-1}.

Stream ii owns a consecutive group of mm signal positions, one for each binary digit of θi\theta_i. The signal for digit bb, where 0≤b<m0 \le b < m, is given token-count weight

Wi,b=QMi−12b.(12)W_{i,b}=QM^{i-1}2^b. \tag*{(12)}

Signal aa represents a digit one and reduces the token count by Wi,bW_{i,b} relative to signal bb.

Choosing the raw blocks

Before each signal place a calibration block XbN2Xb^{N^2} as in Lemma 5.4. Beyond its nominal end, reserve a homogeneous margin and place the signal and marker from Lemma 6.1. The margin is chosen large enough that all candidate windows lie after the preceding fixed cutoff and that the special token containing dd lies wholly in this margin and its trap. This is possible because GG and its potential ranges are fixed.

For a stream in an exact class, take the first suitable cutoff in the margin. Its position depends on its phase modulo HH and varies by at most HH. Compensating singleton bb’s after ee make the total raw trap length and its all-bb token count independent of that phase. Use a predetermined placement when the stream is already excluded or stationary. Lemma 6.2 assigns the required weight in (12) in either placement.

All trap lengths and margins are fixed before any calibration sizes are chosen. The possible local inputs between a safe cutoff at the end of one calibration and the next binary block form a finite set. Indeed, an exact stream has a cutoff within H+rH+r positions of the nominal homogeneous end, with lookahead entirely before the next signal. The intervening word consists of a bounded margin, one fixed-length trap, and its compensating padding. The initial seed procedures have a fixed pp-prefix and the separator cc, and are included among the finitely many initial cases.

Choose the entrance bounds in Lemma 5.4 jointly over these finite sets. Let B0B_0 bound all accumulated discrepancies of streams that remain exact, all fixed source delays, and all differences between raw length and token count in the traps. The constant B0B_0 may depend on GG and MM but is chosen independently of the later calibration lengths.

Append a final homogeneous padding bSb^S before zz, where SS dominates B0B_0, the last trap length, QQ, and the fixed delay margin. Now choose the calibration sizes from right to left. At each stage choose NN so large that its separation scale N2ηN^{2\eta} dominates B0B_0 and the entire raw length of all later stages, traps, padding, and payload, multiplied by every grammar-dependent constant used in Lemma 4.3. Apply Lemma 5.4 to the already fixed finite prelude set. Fix a common successful binary reference prefix XX for that stage.

These choices have no circular dependence. The finite prelude words use only the bounded pieces after safe cutoffs, so their lengths do not contain earlier or later nominal calibration lengths. The separation estimate is uniform in the remaining suffix. Each stage can therefore be fixed before any payload bits are selected.

Lemma 7.1 (Persistence of exclusion). A stream excluded by a calibration cannot supply a moving endpoint near the payload at the final query times. It is dead or stationary, or it remains deep in the homogeneous block of that calibration. In the last case its position is affine on each outer residue, and its unread homogeneous length is beyond the linear threshold of Lemma 4.3 for every procedure subsequently used.

Proof. An ahead stream has more available outer steps than the number of remaining raw positions, after division by the fixed step spacing HH and allowance for all delay margins. Every positive step advances at least one position. It must therefore fail or become stationary before the queries. Once a fixed procedure returns zero at a fixed position, it returns zero there on every further iteration.

A lagging stream advances by the fixed homogeneous step hh on its outer residue. The discrepancy produced at its excluding stage is larger than all later raw lengths, clock corrections and query widths by the right-to-left choice of scales. Thus its unread homogeneous length stays above any prescribed grammar multiple of the remaining suffix length throughout the expanded query interval.

Choose that multiple to include the constants of Lemma 4.3 for the complete finite procedure list.

The number of layouts

A layout specifies the raw placement of every signal and marker. Signal values are not part of the layout.

Lemma 7.2. The number of possible layouts is at most

K=(H+1)P(13)K = (H+1)^P \tag*{(13)}

The layout of a mode is independent of zz. Moreover, for any stream ii, two modes with equal coordinates other than ii and equal full layout have identical potential trajectories, at the same outer times, after their last ii-owned signal, whenever their informative trajectories reach all those signals.

Proof. At the first signal of group ii, its stream has one of HH incoming homogeneous phases, or it uses the excluded fallback. Fix this choice. The first marker placement is now determined. At the common cutoff from Lemma 6.1, the remaining raw word is identical for the two values of the signal. The local process in the next fixed calibration, its classification, and its next homogeneous phase are consequently independent of the signal just hidden. These are properties of the local suffix and the fixed procedure, independent of the absolute outer time. If the stream becomes excluded, the remaining placements in that group use the fixed fallback. Induction over its mm signals shows that its whole group’s layout is determined by its incoming phase or fallback.

Different earlier groups can change a later group’s incoming phase. There are nevertheless at most H+1H+1 choices per group, giving (7.3). The classification uses the fixed reference prefixes and uniform finite-tail estimates, so it is independent of the arbitrary payload.

For the stronger same-time assertion, fix all other mode coordinates and the complete layout. Before group ii the raw inputs coincide. Endpoint locality gives equal seed positions and equal outer times up to a safe cutoff before its first signal. An informative stream cannot have skipped that cutoff in an earlier ahead jump, by Lemma 7.1. Lemma 6.1 gives equality of position and time through the first signal. Repeat this reasoning through all signals of the group. Thereafter the entire remaining raw suffix is common, since all other digits and placements agree. The potential trajectories are therefore identical at the common query times. Actual success flags can still differ and will be recorded separately.

Let UθU_\theta be the resulting prefix, including the final padding and excluding the payload. Its raw length is independent of θ\theta. Its number of tokens is

#tokens⁡(Uθ)=K0−QI(θ),(14)\#\operatorname{tokens}(U_\theta)=K_0-QI(\theta), \tag*{(14)}

where K0K_0 is the count when every signal is bb. The compensating pads make K0K_0 independent of the layout. Every word UθzU_\theta z belongs to CJ∗C^*_J, and all payload letters are singleton tokens. At the common indices

n=K0+q,1≤q≤Q,(15)n=K_0+q,\qquad1\le q\le Q, \tag*{(15)}

membership of pncUθzp^n cU_\theta z in LrL_r reports exactly whether the (QI(θ)+q)(QI(\theta)+q)th payload symbol is aa.

A finite description of the query interval

The calibration blocks can be far longer than the payload. Encoding an unrestricted raw position would therefore give an inadequate bound. We now describe only the numerical information the Boolean recurrence actually uses.

Include the fixed delay margin of Lemma 4.2 in the query interval. Its width is Q+OG(1)Q+O_G(1). Use the beginning of the payload as the origin for the following coordinates.

Lemma 8.1 (Per-mode summary). For each mode θ\theta and payload zz, the recurrence on the query interval can be simulated from the following data.

  1. A per-mode summary of OG(log⁡Λ)O_G(\log\Lambda) bits.

  2. For each stream that needs near-payload information, a table of OG(Qlog⁡Λ)O_G(Q\log\Lambda) bits containing its finite list of map outputs on the expanded query interval.

A near-payload table for stream ii is identical for two modes with the same other coordinates and the same layout, whenever that table is needed for both modes.

Proof. By the final padding, any informative moving stream that survived all calibrations has passed all its own signal cutoffs before the queries. After its last safe cutoff, only a fixed-length trap lies before that padding. A positive trajectory has at most that many strict advances before entering or passing the padding. A zero step or a failure makes it stationary or dead. The choice of SS allows all fixed source delays as well. Lemma 7.2 therefore gives the final sharing assertion for any near-payload data.

Consider the other data. A lagging stream excluded earlier remains at a position whose unread suffix has form btvb^{t}v, with t>d(∣v∣+1)t > d(|v| + 1) for all needed maps. On each sufficiently refined outer residue, its source position is affine. Lemma 4.3 makes each map output either failure, a fixed short increment from that source, or a fixed endpoint relative to vv. Thus the numerical outputs are constants or affine functions of outer time, with slopes in a finite grammar-dependent set. A stationary source gives fixed outputs or failure. An ahead source is already stationary or dead.

A surviving moving source in the final padding is treated similarly while it is farther than the linear periodicity threshold from the payload. If it approaches that threshold by bounded homogeneous steps during the query interval, its entire relevant bounded-step trajectory lies within CΛC\Lambda positions of the payload for a constant C=C(G)C = C(G). A homogeneous procedure without a finite positive step can make one first jump to that region or later. This needs only one split time and a bounded number of extra descriptors. All later endpoints stay in the region, since the maps are extensive.

Record near-payload map outputs directly in this common interval of length OG(Λ)O_G(\Lambda), using OG(log⁡Λ)O_G(\log\Lambda) bits each. Describe all remaining outputs by a fixed finite family of constants and affine functions on outer residues, possibly before and after a split time. Their absolute intercepts need not be recorded. The decoder needs precisely the following comparisons.

  1. Two near values are compared by their recorded coordinates.

  2. A descriptor that can enter the near interval during the query window has starting value OG(Λ)O_G(\Lambda), because its slope is bounded and the window has width O(Q)O(Q). Record that value and compute its later values. A descriptor that never enters the near interval cannot equal a near value.

  3. For every pair of descriptors, record their equality pattern on the query window, including the finite time shifts used by the recurrence. Equal slopes give equality everywhere or nowhere on their common support. Unequal slopes permit equality at at most one time, which is recorded relative to the window.

Include the final endpoint as a descriptor. There are only grammar-boundedly many maps, residues, time shifts, supports and pairs. The descriptor labels, their equality information, possible split times, and the initial Boolean memory therefore require only OG(log⁡Λ)O_G(\log\Lambda) bits per mode.

Lemma 4.2 uses no arithmetic on remote values other than the stated equality tests, and generates no new query address from them. Its update can consequently be simulated from this data. Guard failures are handled by the mode’s own Boolean flags, so no assumption that different modes have the same actual success flags has been made. □

Proof of Theorem 1.1. The upper bound is Lemma 3.1. For the lower bound, fix the alleged grammar GG and the constants P,H,KP,H,K above. We show that the query answers would give an injective encoding of all Λ\Lambda-bit payloads into fewer than Λ\Lambda bits.

Use every layout in the encoding. For each of the MPM^{P} modes record its summary from Lemma 8.1. For each layout, stream ii, and tuple of the other P−1P-1 mode coordinates, store the near-payload table once whenever one is needed. The sharing assertion makes one table sufficient for all relevant modes in that group. Use a fixed-size placeholder when no table is needed. Category flags in each mode’s summary specify which tables its simulation uses.

There are at most KPMP−1KPM^{P-1} such tables. The total encoded length is therefore

OG(MPlog⁡Λ+KPMP−1Qlog⁡Λ).(16)O_G\left(M^P\log\Lambda+ KPM^{P-1}Q\log\Lambda\right). \tag*{(16)}

The grammar, chosen layouts, and calibration words are fixed for this encoding and do not depend on zz. Hardwire them in the decoder. There is no effectiveness or time requirement on choosing these finite parameters.

The decoder runs the finite recurrence for every mode at the common indices (15). Equations (14) and (15) recover every one of the MPM^P payload blocks. Thus the encoding is injective on all 2Λ2^\Lambda payloads.

Since Q=M2Q=M^2 and log⁡Λ=(P+2)log⁡M\log\Lambda=(P+2)\log M, dividing (16) by Λ=MPQ\Lambda=M^PQ gives

OG(log⁡MM2+KPlog⁡MM)⟶0.O_G\left(\frac{\log M}{M^2}+\frac{KP\log M}{M}\right)\longrightarrow0.

For sufficiently large MM, a fixed-length padded version of the encoding is strictly shorter than Λ\Lambda. The pigeonhole principle gives a contradiction.

Finally, ordinary LL⁡(k)\operatorname{LL}(k) grammars belong to the Boolean family by using only positive single-conjunct rules. If the Boolean families stabilized at k0k_0, the language supplied by the theorem with r=k0r=k_0 would belong to BoolLL⁡(k0)\operatorname{BoolLL}(k_0), contradicting the lower bound. This proves nonstabilization. □

Scope and relation to earlier results

The constructed language uses a fixed alphabet and is ordinary context-free. Its definition depends on rr, while the large input parameters in the lower bound depend on the hypothetical competing grammar. This order of quantifiers is essential. The proof excludes every such grammar for one fixed LrL_r.

Okhotin’s expressive-power work establishes unary regularity and restrictions on long homogeneous suffixes for Boolean predictive languages [5]. The present argument uses operational returns on a homogeneous prefix, followed by several independently controlled changes of token count. The finite Boolean recurrence allows guards to retain arbitrary earlier success information while constraining how new numerical endpoints are obtained.

The linear-conjunctive collapse of Olkhovsky and Okhotin [6] permits at most one nonterminal per conjunct. The production B→pBTB\to pBT in the witness uses two. The higher-level grammar can therefore process a sequence of variable-length tokens without lying in that restricted family.

The short definition accompanying the original problem states a pathwise rule-uniqueness condition. It does not repeat the positivity and non-left-recursion assumptions used by the recursive-descent construction. Our theorem concerns the model in § 2. These premises cannot be discarded from our statement: a purely negative rule has no positive endpoint for the parser to return, and a non-consuming recursion can prevent termination despite rule uniqueness. Thus the theorem does not address arbitrary Boolean grammars satisfying only the short pathwise predicate. Appendix A shows that path-dependent and uniform tables give the same language families when the stated parser premises are retained.

Appendix A. Path-dependent and uniform tables

The original statement permits a rule uniqueness condition at each fixed signed path. For completeness, we give the finite annotation that converts it to one uniform table.

Proposition A.1. *Suppose a strongly non-left-recursive Boolean grammar of the form (2.1) satisfies the kk-lookahead uniqueness condition at each fixed signed path from its start. It has an equivalent

grammar with a uniform predictive kk-table. The construction preserves the number of nonterminals per conjunct.

Proof. For a syntactic word η\eta, put F(η)=First⁡k(LG(η))F(\eta)=\operatorname{First}_{k}(L_{G}(\eta)). For finite sets X,Y⊆Σ≤kX,Y\subseteq\Sigma^{\leq k}, define

X⊙Y={First⁡k(xy):x∈X, y∈Y}.X\odot Y=\{\operatorname{First}_{k}(xy):x\in X,\ y\in Y\}.

Truncation respects concatenation, so this operation gives the truncated follower language of a concatenated tail, including short end-of-input words.

Make a copy AFA_{F} of each old nonterminal for each possible finite set F⊆Σ≤kF\subseteq\Sigma^{\leq k}. The start symbol is S{ϵ}S_{\{\epsilon\}}. Copy every old rule for each AFA_{F}. In a signed occurrence of BB with remaining local suffix δ\delta, replace that occurrence by BF(δ)⊙FB_{F(\delta)\odot F}. Retain terminals and signs.

The candidate languages L(AF)=LG(A)L(A_{F})=L_{G}(A) satisfy all copied equations. Projection of positive derivation trees shows that a nullable prefix in the new positive transform projects to a nullable prefix in the old one. Every new signed zero-consumption cycle would therefore project to an old such cycle. Strong non-left-recursion and the corresponding uniqueness of the equations give the asserted candidate languages as the actual languages of the copies.

Along every new signed path, the truncated language of its right tail is exactly the tag on the current nonterminal. This follows by induction from the start tag and the update F(δ)⊙FF(\delta)\odot F. All occurrences of a fixed AFA_{F} thus have the same relevant follower-key set. If two of its copied rules required the same lookahead entry, their original rules would both require that entry at any one projected occurrence with this tail tag. This contradicts the assumed pathwise uniqueness. Unreachable copies impose no constraint. A uniform deterministic table follows.

The reverse implication is immediate, and each copied conjunct retains the old number of nonterminal occurrences.

Email address: [email protected]

Email address: [email protected]

Email address: [email protected]

Email address: [email protected]

References

  1. [1]A. Okhotin, Nine open problems on conjunctive and Boolean grammars, Bulletin of the European Association for Theoretical Computer Science 91 (2007), 96–119. https://eatcs.org/images/bulletin/beatcs91.pdf.
  2. [2]A. Okhotin, Recursive descent parsing for Boolean grammars, Technical Report 2004–475, School of Computing, Queen’s University, March 2004. https://research.cs.queensu.ca/TechReports/Reports/2004–475.pdf.
  3. [3]A. Okhotin, Recursive descent parsing for Boolean grammars, Acta Informatica 44 (2007), 167–189. doi:10.1007/s00236-007-0045-0.DOI
  4. [4]A. Okhotin, Nine open problems on conjunctive and Boolean grammars: an update, manuscript, March 30, 2010. https://citeseerx.ist.psu.edu/document?doi=0e62d472c289c617866fde28ff6dd32758a73c7&rep=rep1&type=pdf.
  5. [5]A. Okhotin, Expressive power of LL(k) Boolean grammars, Theoretical Computer Science 412 (2011), no. 39, 5132–5155. doi:10.1016/j.tcs.2011.05.013.DOI
  6. [6]I. Okhotin and A. Okhotin, On LL(k) linear conjunctive grammars, 2021, arXiv:2112.08014 [cs.FL]. https://arxiv.org/abs/2112.08014.

Paper details

vlnc:W_bj2wudg5
Version
v1 · latest
Published
Fresh — published within the last 30 days
License
CC BY 4.0
Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

OpenAI Codex

View statement
Looking for related papers…
Contents