Persistent Receipts and Simultaneous Records:
A Direct Scaffold for Even Palindromes

Joshua Gay
FPRD Lab, Insight Forge

Draft 5 · 21 September 2026

We construct an online palindrome recognizer from persistent records. Typed receipts identify the historical palindrome records needed by each update; a shared-tail identity permits their sequences to be reused. A simultaneous-record compiler packs each bounded batch, including cycles among fresh records, into one scaffold node. The direct recognition theorem uses the strict, opaque sequence interface stated in Section 11 and symbolic finite resource bounds.

Contents

I The construction

1 The question and the direct route

1.1 The language and the conjecture

Write wRw^R for the word ww read backwards and EPAL2\mathsf{EPAL}_2 for the set of binary words of the form wwRww^R: the even-length palindromes ϵ\epsilon, 0000, 1111, 01100110, 10011001, 001100001100, and so on. As a generative object the language is as simple as they come: three rewriting rules produce it (Section 2.2). Loff, Moreira, and Reis (hereafter LMR) studied how much computational power the recognition-based grammars called parsing expression grammars have, and found both surprising positive examples and a natural negative conjecture [7, Conjecture 7, p. 10]:

The language of even-length palindromes has no PEG, i.e. P={wwr∣w∈{0,1}∗}∉PEGP=\{ww^r\mid w\in\{0,1\}^*\}\notin\mathsf{PEG}.

An earlier paper [5] derives palindrome membership in PEG from a real-time multitape recognizer and a machine-to-scaffold compiler. Here we develop the persistent-record construction directly.

1.2 What this paper does

The recognizer stores the longest even-palindromic suffix and the context to its left. Its receipts make the next update accessible through a bounded number of record operations. The sequence interface and its source-level implementation evidence are treated separately in Section 11 and Appendix D.

The real-time multitape transfer and the persistent-receipt construction, which uses the opaque sequence contract and simultaneous compiler.
Figure 1. The transfer route and the receipt route. The latter uses the sequence contract of Section 11; both use the Loff–Moreira–Reis correspondence.

The construction has two main ingredients:

  • Receipt closure. Each input letter updates the longest suffix and its context using a fixed number of persistent sequence operations (Theorem 8.9).
  • Simultaneous compilation. A bounded graph of fresh records, including fresh cycles, can be encoded in one scaffold node (Theorem 10.2).

1.3 How to read this paper

Sections 2–4 define the machine, distinguish words from their stored records, and give a running example. Sections 5–8 prove the receipt recurrence. Sections 9–12 compile and assemble the recognizer. The theorem numbers are retained from the previous edition.

2 Background: words, grammars, parsing expression grammars, and scaffolds

2.1 Words, languages, palindromes

An alphabet Σ\Sigma is a finite set of letters; in this paper Σ={0,1}\Sigma=\{0,1\} unless stated otherwise. A word is a finite sequence of letters, ϵ\epsilon is the empty word, Σ∗\Sigma^* is the set of all words, and ∣w∣|w| is the length of ww. Juxtaposition uvuv is concatenation. A language is any subset of Σ∗\Sigma^*. The reversal of w=c1c2⋯cnw=c_1c_2\cdots c_n is wR=cn⋯c2c1w^R=c_n\cdots c_2c_1; reversal of a language is LR={wR:w∈L}L^R=\{w^R:w\in L\}.

A word uu is a suffix of ww if w=xuw=xu for some xx, and a proper suffix if moreover u≠wu\ne w; prefixes are defined symmetrically. The empty word is a proper suffix of every nonempty word. A palindrome is a word ww with w=wRw=w^R; an even palindrome is a palindrome of even length, equivalently a word of the form wwRww^R. The empty word is an even palindrome. Thus EPAL2={wwR:w∈{0,1}∗}={even palindromes over {0,1}},\mathsf{EPAL}_2=\{ww^R:w\in\{0,1\}^*\}=\{\text{even palindromes over }\{0,1\}\}, and EPAL2R=EPAL2\mathsf{EPAL}_2^R=\mathsf{EPAL}_2 because reversing wwRww^R gives wwRww^R again.

When a palindrome PP occurs as a suffix of a word S=CPS=CP, the letter of CC immediately to the left of that occurrence will matter constantly; we say the occurrence is preceded by that letter. The empty suffix of a nonempty word is preceded by the word's last letter; the empty suffix of ϵ\epsilon is preceded by no letter.

2.2 Context-free grammars: the generative reading

A context-free grammar has terminal and nonterminal symbols, a start symbol, and rules that replace one nonterminal by a finite string of symbols [2, pp. 120–122]. It generates the terminal words reachable from its start symbol.

Example 2.1 (even palindromes are context-free). With start symbol SS and rules S→0S0,S→1S1,S→ϵ,S\to 0S0,\qquad S\to 1S1,\qquad S\to\epsilon, the derivation S⇒0S0⇒01S10⇒0110S\Rightarrow 0S0\Rightarrow 01S10\Rightarrow 0110 produces 01100110, and in general the generated language is exactly EPAL2\mathsf{EPAL}_2: each rule adds one matching letter at each end, and every wwRww^R arises by choosing the letters of ww in order. The reading is existential: a word belongs to the language if some sequence of choices produces it. Nothing in the definition says how a machine would discover those choices.

2.3 Parsing expression grammars: the recognition reading

Parsing expression grammars, introduced by Ford [3, §3], use rule shapes that look like context-free rules but give them an operational meaning. We follow the formalization of LMR [7, Definitions 1–4], which is the one their theorem is stated for.

Definition 2.2 (parsing expressions and grammars). Fix disjoint finite sets Σ\Sigma of terminals and NT\mathit{NT} of non-terminals. Parsing expressions are built from the atoms a∈Σa\in\Sigma, A∈NTA\in\mathit{NT}, ε\varepsilon (accept the empty word) and FAIL\mathsf{FAIL} by three constructions: sequence e1e2e_1e_2, ordered choice e1/e2e_1/e_2, and the predicates !e!e and &e\&e. A parsing expression grammar GG assigns to each non-terminal AA one expression R(A)R(A), written A←R(A)A\leftarrow R(A), and names a start non-terminal SS.

The meaning of an expression is a recognition procedure Rec⁡G(e,x)\operatorname{Rec}_G(e,x) that reads an input word xx from the left and either fails or succeeds consuming a prefix x′x' of xx [7, Definition 3 and Algorithm 1]:

  • ε\varepsilon succeeds consuming nothing; FAIL\mathsf{FAIL} fails; the terminal aa succeeds consuming aa if xx begins with aa, and fails otherwise.

  • Sequence e1e2e_1e_2: run e1e_1 on xx; if it succeeds consuming y1y_1, run e2e_2 on the remainder; succeed consuming y1y2y_1y_2 if both succeed, otherwise fail.

  • Ordered choice e1/e2e_1/e_2: run e1e_1; if it succeeds, that is the answer; only if it fails is e2e_2 run on the same input.

  • Predicates: !e!e succeeds consuming nothing if ee fails, and fails if ee succeeds; &e\&e succeeds consuming nothing if ee succeeds.

  • A non-terminal AA runs R(A)R(A).

A grammar is total when recognition terminates on every input. We use complete-match recognition: a word is accepted only when the start expression consumes the entire input. Let PEG\mathsf{PEG} denote the languages of total PEGs [7, Definition 4].

Example 2.3 (order is semantic). Take S←a/abS\leftarrow a/ab and the input abab. The first alternative aa succeeds consuming aa, so the choice commits to it: Rec⁡(S,ab)=a≠ab\operatorname{Rec}(S,ab)=a\ne ab, and ab∉L(G)ab\notin L(G) although the second alternative would have consumed it. As a context-free grammar, S→a∣abS\to a\mid ab generates {a,ab}\{a,ab\}. Ordered choice is not a parsing strategy for a context-free grammar; it changes the language. (Ford proves the corresponding algebraic fact: sequence distributes over ordered choice on one side only [3, p. 7].)

Example 2.4 (predicates see ahead without consuming). The expression !(0/1)!(0/1) succeeds exactly at the end of the input, consuming nothing, because it succeeds only where no letter can be read. Predicates let a PEG test a property of the remaining input and then parse it again. It is known that the non-context-free language {anbncn}\{a^nb^nc^n\} has a PEG [7, p. 3, citing Aho and Ullman], and LMR use predicates to recognize the palindromes of power-of-two length [7, Theorem 8, p. 10].

2.4 Why comparing the two classes is not a syntactic matter

The context-free alternatives in Example 2.1 cannot simply be read as ordered PEG choices: a successful alternative commits before a later failure can reconsider it. We instead use LMR's machine characterization below.

2.5 Scaffolding automata

A scaffolding automaton reads one letter and appends one immutable graph node per step. It chooses the new label and outgoing edges from a fixed-radius labelled unfolding of the previous top. Edges may point to boundedly accessible old nodes, the new node itself, or nowhere.

Definition 2.5 (scaffold). Let d≥1d\ge1 and let Γ\Gamma be a finite alphabet. A (d,Γ)(d,\Gamma)-scaffold with top tt has nodes 0,1,…,t0,1,\ldots,t, a label L(v)∈Γ∪{∅}L(v)\in\Gamma\cup\{\varnothing\} for each node (L(0)=∅L(0)=\varnothing: the base is unlabelled), and for each node vv and each port i∈{0,…,d−1}i\in\{0,\ldots,d-1\} a target ev(i)∈{0,…,v}∪{∅}e_v(i)\in\{0,\ldots,v\}\cup\{\varnothing\} (edges point backwards or to the node itself; ∅\varnothing means the port is missing). A port word p=p1⋯pmp=p_1\cdots p_m over {0,…,d−1}\{0,\ldots,d-1\} is followed from a node by taking port p1p_1, then port p2p_2 of the node reached, and so on; it is valid from vv if no missing port is met, and then it has an endpoint. The kk-neighbourhood Nk(v)N_k(v) of a node is the labelled tree of depth kk obtained by unfolding ports from vv: it records the label of every node reached by a port word of length at most kk, and where a port is missing. The tree records labels, not node numbers, so it does not reveal whether two port words reach the same node.

Definition 2.6 (scaffolding automaton). A scaffolding automaton is a tuple A=⟨Σ,d,Γ,k,Q,δ,q0,F⟩A=\langle\Sigma,d,\Gamma,k,Q,\delta,q_0,F\rangle: an input alphabet Σ\Sigma, a degree d≥1d\ge1, a working alphabet Γ\Gamma, a distance k≥0k\ge0, a finite set of control states QQ with initial state q0q_0 and accepting states F⊆QF\subseteq Q, and a transition function δ: Q×Σ×Nk(d,Γ)⟶Q×Γ×({0,…,d−1}≤k∪{SELF,∅})d,\delta:\ Q\times\Sigma\times N_k(d,\Gamma)\longrightarrow Q\times\Gamma\times\bigl(\{0,\ldots,d-1\}^{\le k}\cup\{\mathsf{SELF},\varnothing\}\bigr)^d , where Nk(d,Γ)N_k(d,\Gamma) is the set of possible kk-neighbourhoods. The computation on x=σ1⋯σnx=\sigma_1\cdots\sigma_n starts from the scaffold consisting of the base node alone and the state q0q_0. At step jj the machine computes (q′,γ,p0,…,pd−1)=δ(q,σj,Nk(t))(q',\gamma,p_0,\ldots,p_{d-1})=\delta(q,\sigma_j,N_k(t)), where tt is the current top, and appends node t+1t+1 with label γ\gamma and ports et+1(i)={the endpoint of pi followed from t,pi a valid port word,∅,pi=∅ or pi invalid,t+1,pi=SELF.e_{t+1}(i)=\begin{cases} \text{the endpoint of }p_i\text{ followed from }t,&p_i\text{ a valid port word},\\ \varnothing,&p_i=\varnothing\text{ or }p_i\text{ invalid},\\ t+1,&p_i=\mathsf{SELF}. \end{cases} The new state is q′q'. The word is accepted if the state after the last letter lies in FF; L(A)L(A) is the set of accepted words, and we write L∈SAL\in\mathsf{SA} when some scaffolding automaton decides LL.

Three points deserve emphasis. The descriptor ϵ\epsilon (the empty port word) names the old top itself. The descriptor SELF\mathsf{SELF} lets a new node point to itself; it is part of LMR’s model, not an extension. And the machine cannot test whether two observed nodes are the same node: it sees a tree.

Figure 2. A scaffold of degree 22 after three letters. Node 11 was created with descriptors (ϵ,∅)(\epsilon,\varnothing) from top 00; node 22 with (ϵ,0)(\epsilon,0) from top 11 (port 11 follows port word 00 from node 11 and reaches node 00); node 33 with (SELF,0)(\mathsf{SELF},0) from top 22. The depth-22 neighbourhood of node 33 is the tree on the right: it does not record that port 00 returns to node 33 itself.

2.6 The exact correspondence with PEGs, and why reversal appears

Theorem 2.7 (Loff–Moreira–Reis [7, Theorem 16, p. 21]). A language L⊆Σ∗L\subseteq\Sigma^* is in PEG\mathsf{PEG} if and only if its reversal LRL^R is decided by some scaffolding automaton. In particular, if a finite scaffolding automaton decides LL, then LRL^R is recognized by a total complete-match PEG.

We use the scaffold-to-PEG direction. The reversal causes no difficulty because EPAL2R=EPAL2\mathsf{EPAL}_2^R=\mathsf{EPAL}_2.

2.7 Persistent data structures

A persistent data structure retains old versions after an update. Here records are immutable: updates create new records and may share old ones, but cannot change their fields.

The key consequence is structural sharing. If a list is represented as a chain of pairs, then cons(x,ℓ)\mathsf{cons}(x,\ell) creates one new pair pointing at the old chain ℓ\ell; the old list and the new list share everything but that pair, and neither can tell (Figure 3). A structure that needs to "copy" an unbounded old part can instead point to it.

Figure 3. Structural sharing. Both lists exist; the new one reuses the old chain.

A steque supports insertion at either end and removal at the front. A catenable steque also joins two sequences. We require worst-case bounds for every operation, independent of sequence length; Section 11 states the exact interface.

2.8 The mutable palindrome index, and why a scaffold cannot have it

Algorithms that maintain all palindromes of a growing word use a palindromic tree (the eertree of Rubinchik and Shur [8, §2.2]): one node per distinct palindrome, a suffix link from each node to its longest proper palindromic suffix, and, added whenever it is first discovered, an edge labelled cc from the node of PP to the node of cPccPc. Discovering that edge means walking suffix links from the current node until a node is found whose occurrence is preceded by cc; the walk can be long, but its cost is amortized and the edge is then stored at the old node, so it is never needed again.

A scaffold can do neither thing. It cannot walk an unbounded chain within one step (it sees distance kk), and it cannot add an edge to an old node. The present paper shows what must be stored instead: not a pointer from a palindrome type to a type, but a pointer carried by each occurrence to the particular historical record that the next step will need. Section 7 records, with small counterexamples, why each cheaper idea fails.

3 Words, records, and scaffold nodes

For the prefix SS already read, we factor S=CPS=CP where PP is its longest even-palindromic suffix and retain ℓ=CR\ell=C^R. This level contains ordinary words and exact identities.

Palindrome occurrences, typed suffix-link receipts, and receipt ropes expose exactly the historical objects needed by the next transition. Sharing occurs here; a stored receipt is a pointer to a particular record, not merely the name of a palindrome string.

A single physical node tuple-packs all logical records born at one input time. A logical pointer is decoded as a physical historical node plus a finite slot tag.

A palindrome type is a word; an occurrence is a particular interval of the input. The record's semantic fields depend on its type, but its physical address belongs to its occurrence. Receipts preserve access to a suitable historical record without modifying a type-global table.

Figure 4. The proof dependency ladder. The upper row is word combinatorics; the lower row is representation and compilation. Executable checks in the public package test individual arrows but are not used as proofs of them.

4 A running palindrome trace

For each prefix SS, let P=P(S)P=P(S) be its longest even-palindromic suffix and write S=CP, ℓ=CRS=CP,\ \ell=C^R. The recognizer accepts exactly when ℓ=ϵ\ell=\epsilon. Table 1 follows the input 00011001.

Figure 5. The occurrence-context factorization. The context is reversed so that the letter immediately preceding the current occurrence of PP is at the front of ℓ\ell.

An external update matches the first context letter; an internal update selects a suffix inside the current palindrome; a reset leaves the empty palindrome.

Table 1. Exact occurrence-context trace for 0001100100011001. The accompanying checker computes the same eight case labels from the definitions. The table illustrates the recurrence; it is not evidence in place of its proof.
ii old SS aa old PP old ℓ\ell case new PP new ℓ\ell
1 ϵ\epsilon 0 ϵ\epsilon ϵ\epsilon reset ϵ\epsilon 0
2 0 0 ϵ\epsilon 0 external 00 ϵ\epsilon
3 00 0 00 ϵ\epsilon internal 00 0
4 000 1 00 0 reset ϵ\epsilon 1000
5 0001 1 ϵ\epsilon 1000 external 11 000
6 00011 0 11 000 external 0110 00
7 000110 0 0110 00 external 001100 0
8 0001100 1 001100 0 internal 1001 1000

After the second letter, P=00,ℓ=ϵP=00,\ell=\epsilon. The third letter gives an internal update to another occurrence of 00. Row 8 will illustrate the receipt and scaffold representations in Examples 8.10 and 12.1.

II Persistent palindrome state

5 The occurrence-context recurrence

The state tracks the longest even-palindromic suffix and its left context. The recurrence below avoids searching an unbounded suffix-link chain.

5.1 Definitions

Let SS be the input prefix read so far. Let P(S)P(S) be its longest even-palindromic suffix and write S=CP,ℓ=CR.S=CP,\qquad \ell=C^R. The word ℓ\ell is the left-context stack of the current occurrence; its first letter lies immediately to the left of PP.

Definition 5.1 (selected suffix and displaced chunk). For an even palindrome PP and a letter aa, let Da(P)D_a(P) be the longest proper even-palindromic suffix QQ of PP for which P=ZaQP=ZaQ for some word ZZ (that is, the longest proper even-palindromic suffix preceded by aa inside PP), and put ωa(P)=ZR\omega_a(P)=Z^R. Both are undefined when no such factorization exists.

When defined, Da(P)D_a(P) is the suffix that can be extended by the next letter aa; ωa(P)\omega_a(P) is the displaced context.

Example 5.3. For P=001100P=001100: λ(P)=00\lambda(P)=00, the bridge is b=1b=1 (the letter before the suffix occurrence of 0000), R=001R=001, and BP=100B_P=100; indeed P=001⋅1⋅00=00⋅1⋅100P=001\cdot1\cdot00=00\cdot1\cdot100. For P=0110P=0110: λ(P)=ϵ\lambda(P)=\epsilon, b=0b=0 (the last letter), R=011R=011, BP=110B_P=110. For P=00P=00: λ(P)=ϵ\lambda(P)=\epsilon, b=0b=0, BP=0B_P=0.

5.2 The three-case update

Figure 6. The exhaustive three-case update at the word level. The external case consumes one context letter; the internal case prepends a selected chunk; the reset case moves the entire failed candidate into the context.

Theorem 5.4 (Occurrence-context factorization). After reading aa, the new longest even suffix P′P' and reversed context ℓ′\ell' are exactly (P′,ℓ′)={(aPa,ℓ0),ℓ=aℓ0,(aDa(P)a,ωa(P)ℓ),ℓ∉aΣ∗, Da(P) defined,(ϵ,aPℓ),ℓ∉aΣ∗, Da(P) undefined.(P',\ell')= \begin{cases} (aPa,\ell_0), &\ell=a\ell_0,\\[1mm] (aD_a(P)a,\omega_a(P)\ell), &\ell\notin a\Sigma^*,\ D_a(P)\text{ defined},\\[1mm] (\epsilon,aP\ell), &\ell\notin a\Sigma^*,\ D_a(P)\text{ undefined}. \end{cases} Moreover, S∈EPAL2⟺ℓ=ϵ.S\in\mathsf{EPAL}_2\quad\Longleftrightarrow\quad \ell=\epsilon.

Proof. Every nonempty even-palindromic suffix of SaSa has the form aQaaQa, where QQ is an even-palindromic suffix of SS immediately preceded by aa.

If the current longest suffix PP is externally preceded by aa, then Q=PQ=P is maximal. Removing that external letter removes the first symbol of ℓ\ell. Otherwise every eligible QQ is a proper suffix of PP, so maximality selects Da(P)D_a(P). Writing P=ZaDa(P)P=ZaD_a(P) shows that the new context is CZCZ and hence has reversal ZRCR=ωa(P)ℓZ^RC^R=\omega_a(P)\ell. If no eligible proper suffix exists, the longest even suffix is empty and the reversed full prefix is aPℓaP\ell.

Finally ℓ\ell is empty exactly when CC is empty, which is exactly when the whole prefix equals its longest even-palindromic suffix. ◻

In Table 1, rows 2, 5, 6, and 7 are external matches; rows 3 and 8 are internal-direct updates; rows 1 and 4 are resets. The final equivalence in the theorem explains why row 2 is accepting and the final row is not. The theorem also shows why keeping only the length of PP would be insufficient: the internal case must identify a particular suffix and the chunk that precedes it.

Example 5.5 (the two internal rows). At row 3 the old palindrome is P=00P=00 and the context is empty. For the arriving 00, the only eligible proper even suffix is D0(P)=ϵD_0(P)=\epsilon. Writing P=Z0D0(P)P=Z0D_0(P) gives Z=0Z=0 and ω0(P)=0\omega_0(P)=0. Hence P′=0ϵ0=00P'=0\epsilon 0=00 and ℓ′=0ϵ=0\ell'=0\epsilon=0. The palindrome type has not changed, but its occurrence has: it now occupies the last two positions of 000000 rather than all of the preceding prefix. This is a small example of why occurrence context cannot be discarded.

At row 8 the old state is S=0001100=0⋅001100S=0001100=0\cdot001100, P=001100P=001100, ℓ=0\ell=0. The arriving letter is 11, so the external case fails. The factorization P=001⋅1⋅00P=001\cdot1\cdot00 shows D1(P)=00D_1(P)=00 and ω1(P)=100\omega_1(P)=100. The recurrence gives P′=1⋅00⋅1=1001P'=1\cdot00\cdot1=1001 and ℓ′=100⋅0=1000\ell'=100\cdot0=1000. The extra 11 in Z=001Z=001 is easy to omit when the factorization is read by eye; reversal then makes that omission visible at the front of the new context.

5.3 The transition table has fixed width

Lemma 5.6 (chunk recursion). Let PP be a nonempty even palindrome with suffix link L=λ(P)L=\lambda(P), bridge bb, and bridge block BPB_P. Then Db(P)=L,ωb(P)=BP,D_b(P)=L,\qquad \omega_b(P)=B_P, and for every letter a≠ba\ne b, Da(P)=Da(L),ωa(P)=ωa(L) b BP,D_a(P)=D_a(L),\qquad \omega_a(P)=\omega_a(L)\,b\,B_P, with the same definedness on both sides (for L=ϵL=\epsilon the right-hand sides are undefined).

Proof. Every proper even-palindromic suffix of PP is a suffix of LL, since LL is the longest one. The suffix LL itself is preceded by bb, so Db(P)=LD_b(P)=L and the displaced chunk is RR=BPR^R=B_P. For a≠ba\ne b, the suffix LL is not eligible, so every eligible suffix is a proper suffix of LL preceded by aa inside LL, which is the definition of Da(L)D_a(L); writing L=Z′aDa(L)L=Z'aD_a(L) gives P=RbZ′aDa(L)P=RbZ'aD_a(L), so ωa(P)=(RbZ′)R=Z′R b RR=ωa(L) b BP\omega_a(P)=(RbZ')^R=Z'^R\,b\,R^R=\omega_a(L)\,b\,B_P. ◻

Example 5.7. For P=001100P=001100 (L=00L=00, b=1b=1, BP=100B_P=100): D1(P)=00D_1(P)=00, ω1(P)=100\omega_1(P)=100; and D0(P)=D0(00)=ϵD_0(P)=D_0(00)=\epsilon, ω0(P)=ω0(00)⋅1⋅100=0⋅1⋅100=01100\omega_0(P)=\omega_0(00)\cdot1\cdot100=0\cdot1\cdot100=01100. Directly, P=00110⋅0⋅ϵP=00110\cdot0\cdot\epsilon and (00110)R=01100(00110)^R=01100.

For the bridge letter, the suffix link supplies the transition. Every other letter reuses the suffix-link record's stored transition. The alphabet is fixed, so the table has fixed width.

6 Typed mirror receipts

Theorem 5.4 reduces online recognition to catenating type-indexed chunks. It does not yet say how a fresh occurrence obtains its suffix-link record without a search. The needed object is a typed receipt.

The word 001100 is a type; each interval spelling it is an occurrence. A receipt points to an old record of the required type.

Here "typed" specifies the palindrome represented by the target record.

Theorem 6.1 (Typed mirror receipt). Suppose an update selects a longest suffix occurrence QQ of the old input that is immediately preceded by aa, and creates Y=aQaY=aQa. Then λ(Y)={aDa(Q)a,Da(Q) defined,ϵ,Da(Q) undefined.\lambda(Y)= \begin{cases} aD_a(Q)a,&D_a(Q)\text{ defined},\\ \epsilon,&D_a(Q)\text{ undefined}. \end{cases} The palindrome λ(Y)\lambda(Y) has a complete occurrence in the old input and a pre-existing birth record. One old typed pointer can therefore install the suffix-link field of YY.

Proof. Every proper nonempty even-palindromic suffix of Y=aQaY=aQa is aRaaRa, where RR is a proper even-palindromic suffix of QQ immediately preceded in QQ by aa. Maximizing RR gives the displayed formula. Since YY is a palindrome, λ(Y)\lambda(Y) is also a proper prefix of YY; that prefix ends before the newly appended final aa, so the complete occurrence lies in the old input.

At the first occurrence of any nonempty even palindrome HH, it is the longest even-palindromic suffix of the prefix ending there. Otherwise a longer even-palindromic suffix would contain HH as a proper prefix as well as a suffix, giving an earlier occurrence of HH. The online construction creates a record for the longest even-palindromic suffix at every step, so it has already made a birth record for λ(Y)\lambda(Y). The empty case uses the distinguished empty record. ◻

The mirror theorem establishes that the required record occurs in the old history. The receipt construction must additionally expose a pointer to it at bounded depth.

The word "typed" is essential. A raw endpoint does not identify the needed record at bounded depth. Proposition 6.2 makes this precise for the following endpoint-only discipline: store, instead of a typed pointer, the time at which the mirror copy of the required palindrome ends, and recover the record by starting from the longest even-palindromic suffix of the prefix ending there and following suffix links downward.

Figure 7. Endpoint information and typed information are different. The endpoint identifies a historical prefix, but its longest-palindrome record may be arbitrarily high above the required type.

Proposition 6.2 (Endpoint-only escape). For m≥2m\ge2, let Sm=02m1100S_m=0^{2m}1100. Its longest even-palindromic suffix is 001100001100 and the suffix link is 0000. The mirror occurrence of 0000 ends at the historical prefix 02m0^{2m}, whose longest suffix-link chain is 02m,02m−2,…,00,ϵ.0^{2m},0^{2m-2},\ldots,00,\epsilon. Recovering 0000 from that untyped endpoint takes exactly m−1m-1 suffix-link steps.

Proof. The suffix 001100001100 is an even palindrome, and no longer suffix of SmS_m can be a palindrome because any such suffix begins inside the initial zero block but contains its unmatched 1111 asymmetrically. Its longest proper even suffix is 0000. The prefix copy of that 0000 selected by the mirror argument ends at time 2m2m. At that time the input is 02m0^{2m}, whose longest even suffix is the whole prefix and whose proper even suffixes decrease by two zeros at each link. Starting at 02m0^{2m} reaches 0000 after m−1m-1 links. ◻

This rules out the endpoint-only representation; it is not a lower bound against all scaffolding automata.

7 Why simpler representations fail

The following counterexamples explain why the representation needs occurrence receipts, anchor information, and stored direct transitions.

7.1 Why an immutable type table is not enough

If one record is created at the first birth of each palindrome type, it is tempting to copy a fixed-alphabet transition table from the suffix-link record, as the mutable palindromic tree would do: an entry for letter aa pointing to the record of the target type aDa(P)aaD_a(P)a. The target of a later transition, however, need not exist when the source type is born.

Proposition 7.1 (Future transition after type birth). For r≥1r\geq1, put Ar=02rA_r=0^{2r}, Pr=Ar11Ar,Tr=1Ar1.P_r=A_r11A_r, \qquad T_r=1A_r1. Then D1(Pr)=ArD_1(P_r)=A_r, so the transition selected by 11 has target Tr=1D1(Pr)1T_r=1D_1(P_r)1. The type PrP_r is born by the end of the prefix PrP_r, but TrT_r is not a factor of that prefix. It becomes available only in a later history such as Pr1PrP_r1P_r. Thus the immutable first-birth record of PrP_r cannot already point to every future transition out of PrP_r.

Proof. The word ArA_r is the longest proper even-palindromic suffix of PrP_r that is immediately preceded by 11, giving D1(Pr)=ArD_1(P_r)=A_r. Any occurrence of Tr=1Ar1T_r=1A_r1 contains two 11 symbols separated by 2r2r zeros. In PrP_r the only adjacent 11 symbols lie at its center, so no such factor occurs. In Pr1PrP_r1P_r, the separator 11 together with the initial block Ar1A_r1 of the second copy gives an occurrence of TrT_r. This event is strictly later than the birth record of PrP_r. ◻

A table fixed at a type's first appearance cannot include this later transition. The construction therefore transports receipts with occurrences.

7.2 Why raw persistent words are not enough

A persistent rope can share the letters of a context perfectly. Receipts, however, depend on the palindrome around which those letters are interpreted.

Proposition 7.2 (Anchor dependence). For the fixed one-letter block w=0w=0 and anchors Ar=02rA_r=0^{2r}, λ(0Ar0)=Ar.\lambda(0A_r0)=A_r. Consequently the same raw rope cell 00 requires infinitely many distinct typed receipt targets as its anchor varies.

Proof. The word 0Ar0=02r+20A_r0=0^{2r+2} is an even palindrome. Its longest proper even palindromic suffix is 02r=Ar0^{2r}=A_r. These target types are distinct as rr varies. Hence a receipt attached only to the raw letter block cannot be correct for all anchors. ◻

This proposition does not forbid structural sharing of the underlying word. It says that the positive object must be an anchored receipt path, and that later reuse must justify why the receipt shadow survives a legal change of physical anchor. Lemma 8.3 supplies exactly that justification.

7.3 Why bounded bridge chasing is not enough

One might defer the missing transition and repeatedly follow the suffix link, testing the bridge letter at each record. The following family makes the number of failed tests arbitrary.

Proposition 7.3 (Bridge-chasing escape). For r≥1r\geq1 and d≥0d\geq0, let Pr,d=Ar(11Ar)d,Ar=02r.P_{r,d}=A_r(11A_r)^d, \qquad A_r=0^{2r}. These are even palindromes. For d>0d>0, λ(Pr,d)=Pr,d−1andbPr,d=1,\lambda(P_{r,d})=P_{r,d-1} \quad\text{and}\quad b_{P_{r,d}}=1, whereas the bridge of ArA_r is 00. The search for the 00-transition from Pr,dP_{r,d} therefore makes exactly dd failed bridge tests before reaching the variable target ArA_r.

Proof. The word Pr,d=Ar11Ar11⋯11ArP_{r,d}=A_r11A_r11\cdots11A_r is unchanged by reversal, so it is an even palindrome. The suffix beginning after the first block Ar11A_r11 is Pr,d−1P_{r,d-1} and is palindromic. No longer proper suffix is palindromic: a suffix beginning inside the first ArA_r has fewer initial zeros than terminal zeros and meets a 11 while its reversal is still inside the terminal zero block; a suffix beginning in the following 1111 starts with 11 and ends with 00. Hence Pr,d−1P_{r,d-1} is the longest proper even-palindromic suffix. The letter immediately before it is the second 11 of the removed 1111 block.

Thus each of the first dd records rejects the requested bridge letter 00 and delegates to its suffix link. At Pr,0=ArP_{r,0}=A_r, the bridge letter before its longest proper even suffix is 00 (for r=1r=1, λ(00)=ϵ\lambda(00)=\epsilon is preceded by the last letter 00), so the recursion stops. There are exactly dd failures, and dd is unbounded. ◻

The proposition refutes bounded bridge chasing for this representation. It does not refute recursively stored direct transitions: the final construction materializes the same recursion persistently, so the transition selected in a later step is already at bounded depth.

Table 2. Representation lessons. Each escape concerns the interface in the first column, not the expressive power of the target automaton model.
Attempt What it preserves Escape family Information retained finally
Historical endpoint where the mirror copy ends 02m11000^{2m}1100: target 0000 lies m−1m-1 links below the historical maximum direct typed pointer to the required record
Immutable type-birth table canonical suffix-link type Pr=02r1102rP_r=0^{2r}11 0^{2r}: a needed target is born later occurrence-indexed transition receipt
Anchor-free word rope persistent raw context letters the block 00 over anchors 02r0^{2r} needs different receipts headered anchored receipt path
Bounded bridge chase correct recursive selector equation Pr,dP_{r,d} forces exactly dd failures persistently materialized direct/reset rope

We now construct anchored receipt ropes whose shared tails retain their required receipts.

8 Receipt ropes and shadow transport

8.1 What a receipt rope represents

A rope for context ℓ=c1⋯ck\ell=c_1\cdots c_k stores each letter together with the receipt needed if that letter extends the current palindrome. Its header is the receipt for the current anchor.

8.2 Definitions

Definition 8.1 (anchored path, receipt trace, headered rope). For an even palindrome AA and a word w=c1⋯ckw=c_1\cdots c_k, define the anchored path Π(A,w)\Pi(A,w) by A0=A,Ai=ciAi−1ci,A_0=A,\qquad A_i=c_iA_{i-1}c_i , and write wrap⁡w(A)=Ak\operatorname{wrap}_w(A)=A_k for its final palindrome. Cell ii of the path stores (ci,λ(Ai))(c_i,\lambda(A_i)). Its receipt trace is Λ(A,w)=(λ(A1),…,λ(Ak)),\Lambda(A,w)=(\lambda(A_1),\ldots,\lambda(A_k)), and its headered form is Π^(A,w)=(λ(A);(c1,λ(A1)),…,(ck,λ(Ak))),\widehat\Pi(A,w)= \bigl(\lambda(A);(c_1,\lambda(A_1)),\ldots,(c_k,\lambda(A_k))\bigr), whose first component is the header and whose sequence of cells is the body. Palindrome words in a receipt position denote typed pointers to the particular occurrence records supplied by the construction, not mere type tags. In particular, the displayed header λ(ϵ)=ϵ\lambda(\epsilon)=\epsilon of a rope anchored at ϵ\epsilon is physically represented by ⊥\bot.

Taking a tail promotes the first cell's receipt to the new header. Sharing a tail is valid only when its receipt trace, as well as its letters, agrees.

Example 8.2. The live context at row 7 of Table 1 is Π^(001100,0)=(00; (0,00))\widehat\Pi(001100,0)=(00;\,(0,00)): the header is λ(001100)=00\lambda(001100)=00, and the one cell records that after an external match by 00 the palindrome 0001100000011000 would have suffix link 0000.

Figure 8. A headered receipt rope. Tail removes the first cell and promotes its stored receipt; the persistent remainder is shared. The positive proof must show that legal online reanchoring leaves the receipts in that shared remainder unchanged.

8.3 The bridge-shadow identity

The physical palindrome states in a retained context tail can change after a prepend or reset. The next lemma shows that the typed receipt trace does not. Its two anchors HH and PP are different words; the claim is that wrapping them through the same context produces the same sequence of suffix links.

Lemma 8.3 (Bridge-shadow identity). Suppose H=RbPH=RbP, λ(H)=P\lambda(H)=P, and PP is the longest even-palindromic suffix of wRPw^RP. If w=ϵw=\epsilon, or if the first letter of ww differs from bb, then Λ(H,w)=Λ(P,w).\Lambda(H,w)=\Lambda(P,w).

(The statement allows P=ϵP=\epsilon: then H=RbH=Rb is any nonempty even palindrome with λ(H)=ϵ\lambda(H)=\epsilon, and the hypothesis on wRP=wRw^RP=w^R says wRw^R has no nonempty even-palindromic suffix.)

Example 8.4. H=0000H=0000, P=λ(H)=00P=\lambda(H)=00, b=0b=0, w=1w=1: the hypotheses hold (1≠01\ne0; wRP=100w^RP=100 has longest even-palindromic suffix 0000), and indeed λ(1 0000 1)=ϵ=λ(1 00 1)\lambda(1\,0000\,1)=\epsilon=\lambda(1\,00\,1).

Proof. For a letter cc and even palindrome XX, put Gc(X)=λ(cXc)G_c(X)=\lambda(cXc). Every proper even-palindromic suffix of XX is a suffix of λ(X)\lambda(X). Hence Gc(X)={cλ(X)c,c is the bridge before λ(X),Gc(λ(X)),otherwise.(1)G_c(X)= \begin{cases} c\lambda(X)c,&c\text{ is the bridge before }\lambda(X),\\ G_c(\lambda(X)),&\text{otherwise}. \end{cases} \tag{1}

Write w=c1⋯ckw=c_1\cdots c_k, put ui=c1⋯ciu_i=c_1\cdots c_i, and define Xi=uiRHui,Yi=uiRPui,Ni=∣P∣+i.X_i=u_i^RHu_i,\qquad Y_i=u_i^RPu_i,\qquad N_i=|P|+i. Both XiX_i and YiY_i end in the same word Ti=PuiT_i=Pu_i, of length NiN_i. We prove for every i≥1i\geq1 that λ(Xi)=λ(Yi)=Kiand∣Ki∣<Ni.(2)\lambda(X_i)=\lambda(Y_i)=K_i \quad\hbox{and}\quad |K_i|<N_i. \tag{2}

For i=1i=1, the hypothesis c1≠bc_1\ne b and (1) give Gc1(H)=Gc1(P)G_{c_1}(H)=G_{c_1}(P). This common palindrome is a proper suffix of c1Pc1c_1Pc_1, so its length is at most ∣P∣<N1|P|<N_1.

Assume (2) at i<ki<k. Since KiK_i is shorter than the common suffix TiT_i, the letter immediately before its terminal occurrence lies inside TiT_i. It is therefore the same bridge letter in XiX_i and YiY_i. Equation (1), with c=ci+1c=c_{i+1}, now gives the same next receipt on both sides: it is either cKiccK_ic when cc is that common bridge, or Gc(Ki)G_c(K_i) otherwise.

It remains to retain the strict length bound. In the second case ∣Gc(Ki)∣≤∣Ki∣<Ni<Ni+1|G_c(K_i)|\leq |K_i|<N_i<N_{i+1}. In the first case the only way ∣cKic∣|cK_ic| could reach Ni+1N_{i+1} is, by parity, that NiN_i is odd and ∣Ki∣=Ni−1|K_i|=N_i-1. Then the common suffix has the form Ti=cKiT_i=cK_i. Because KiK_i is a palindrome, (uic)RP=c uiRP=cTiR=cKic(u_ic)^RP=c\,u_i^RP=cT_i^R=cK_ic is an even-palindromic suffix of wRPw^RP strictly longer than PP: the word uicu_ic is a prefix of ww. This contradicts the maximality hypothesis. Thus (2) follows by induction, and its receipt equalities are precisely Λ(H,w)=Λ(P,w)\Lambda(H,w)=\Lambda(P,w). ◻

The length inequality keeps the next inspected bridge inside the proper suffix and allows the induction to continue.

8.4 Direct and reset ropes, and the mirror-prefix lemma

For nonempty YY with suffix link LL, bridge bb, and bridge block BB, write Y=RbL=LbB.Y=RbL=LbB. When Dc(Y)D_c(Y) is defined, define the direct headered rope Ωc(Y)=Π^(cDc(Y)c,ωc(Y)).\Omega_c(Y)= \widehat\Pi\bigl(cD_c(Y)c,\omega_c(Y)\bigr). When it is undefined, define the reset rope Zc(Y)=Π^(ϵ,cY).Z_c(Y)=\widehat\Pi(\epsilon,cY). The direct rope is the context rope that the internal case of Theorem 5.4 will need: it is anchored at the palindrome cDc(Y)ccD_c(Y)c that the letter cc creates, and its cells carry the receipts for the displaced chunk ωc(Y)\omega_c(Y) that becomes the front of the new context. The reset rope is the analogue when nothing can be wrapped: anchored at ϵ\epsilon, its cells carry the receipts for the whole failed candidate cYcY.

The next lemma identifies the final receipt used in Theorems 8.7 and 8.9.

Lemma 8.5 (Mirror-prefix lemma). Let YY be a nonempty even palindrome and cc a letter.

  1. If Dc(Y)D_c(Y) is defined, the final palindrome of Π(cDc(Y)c,ωc(Y))\Pi(cD_c(Y)c,\omega_c(Y)) is F=Yc ωc(Y)F=Yc\,\omega_c(Y), and λ(F)=Y\lambda(F)=Y.

  2. If Dc(Y)D_c(Y) is undefined, the final palindrome of Π(ϵ,cY)\Pi(\epsilon,cY) is F=YccYF=YccY, and λ(F)=Y\lambda(F)=Y.

In both cases the last receipt of the rope is the anchor's source YY itself.

Proof. (1) Write Y=ZcDY=ZcD with D=Dc(Y)D=D_c(Y) and ω=ωc(Y)=ZR\omega=\omega_c(Y)=Z^R. Wrapping cDccDc through ω\omega gives F=ωR cDc ω=ZcDcZR=YcZRF=\omega^R\,cDc\,\omega=ZcDcZ^R=YcZ^R. Since FF is a palindrome with prefix YY, the word Y=YRY=Y^R is also a suffix of FF, and it is a proper even-palindromic suffix. Suppose a longer proper even-palindromic suffix V=yYV=yY existed, with yy a nonempty suffix of ZcZc, ∣y∣|y| even. Palindromicity of VV gives yY=YyRyY=Yy^R, so YY has period ∣y∣|y|: its suffix Y′′Y'' of length ∣Y∣−∣y∣|Y|-|y| equals its prefix of that length, and since YY is a palindrome that prefix is the reversal of Y′′Y''; hence Y′′Y'' is an even palindrome. The same equality identifies yy with the prefix of YY of length ∣y∣|y|, so the terminal occurrence of Y′′Y'' in YY is preceded by the last letter of yy, which is cc because yy is a suffix of ZcZc. By maximality of D=Dc(Y)D=D_c(Y), ∣Y′′∣≤∣D∣|Y''|\le|D|, i.e. ∣y∣≥∣Y∣−∣D∣=∣Z∣+1|y|\ge|Y|-|D|=|Z|+1; so y=Zcy=Zc and V=FV=F is not proper, a contradiction.

(2) Wrapping ϵ\epsilon through cYcY gives F=(cY)Rϵ (cY)=YccYF=(cY)^R\epsilon\,(cY)=YccY, a palindrome with prefix YY, so YY is a proper even-palindromic suffix. If a longer proper one V=yYV=yY existed, with yy a nonempty suffix of YccYcc of even length, the same periodicity argument shows that the suffix Y′′Y'' of YY of length ∣Y∣−∣y∣|Y|-|y| is an even palindrome. When ∣y∣≤∣Y∣|y|\le|Y|, the equality yY=YyRyY=Yy^R identifies yy with the corresponding prefix of YY; because yy ends in cc, the terminal occurrence of Y′′Y'' is preceded by cc, which would make Dc(Y)D_c(Y) defined. And ∣y∣>∣Y∣|y|>|Y| forces ∣y∣=∣Y∣+2|y|=|Y|+2, i.e. V=FV=F, not proper. ◻

Proof. By Lemma 5.6, Dc(Y)D_c(Y) is defined iff Dc(L)D_c(L) is (for L=ϵL=\epsilon both are undefined). Apply Lemma 8.5 to LL in place of YY: the final palindrome of Π(cDc(L)c,ωc(L))\Pi(cD_c(L)c,\omega_c(L)) is ZcLZcL, and that of Π(ϵ,cL)\Pi(\epsilon,cL) is LccLLccL. (For L=ϵL=\epsilon the second case reads λ(cc)=ϵ\lambda(cc)=\epsilon.) ◻

8.5 The receipt-rope recurrence

Theorem 8.7 (Receipt-rope recurrence). Let ρb\rho_b be the header receipt of Ωb(Y)\Omega_b(Y). For c≠bc\ne b, Ωc(Y)={undefined,Ωc(L) undefined,Ωc(L)⋅(b,ρb)⋅body⁡Ωb(Y),otherwise,\Omega_c(Y)= \begin{cases} \text{undefined},&\Omega_c(L)\text{ undefined},\\ \Omega_c(L)\cdot(b,\rho_b)\cdot\operatorname{body}\Omega_b(Y),&\text{otherwise}, \end{cases} and, whenever Zc(Y)Z_c(Y) is defined, Zc(Y)=Zc(L)⋅(b,ρb)⋅body⁡Ωb(Y).Z_c(Y)=Z_c(L)\cdot(b,\rho_b)\cdot\operatorname{body}\Omega_b(Y).

The off-bridge rope is the old corresponding rope, one new bridge cell, and the shared tail of the bridge rope. The proof must establish equality of their receipts as well as their words.

Proof. Raw words. Let c≠bc\ne b. By Lemma 5.6, Dc(Y)=Dc(L)D_c(Y)=D_c(L) with the same definedness, and ωc(Y)=ωc(L) b B\omega_c(Y)=\omega_c(L)\,b\,B. Hence, when defined, Ωc(Y)\Omega_c(Y) is anchored at the same palindrome cDc(L)ccD_c(L)c as Ωc(L)\Omega_c(L) and wraps through ωc(L)\omega_c(L), then bb, then BB; by the catenation law its first ∣ωc(L)∣|\omega_c(L)| cells are literally those of Ωc(L)\Omega_c(L), its next cell has letter bb, and its remaining cells are Π(H′,B)\Pi(H',B) where H′=b wrap⁡ωc(L)(cDc(L)c) b=b(ZcL)bH'=b\,\operatorname{wrap}_{\omega_c(L)}(cD_c(L)c)\,b=b(ZcL)b with L=ZcDc(L)L=ZcD_c(L). In the reset case, Zc(Y)=Π^(ϵ,cLbB)Z_c(Y)=\widehat\Pi(\epsilon,cLbB) similarly begins with the cells of Zc(L)=Π^(ϵ,cL)Z_c(L)=\widehat\Pi(\epsilon,cL), continues with a bb cell, and ends with Π(H′,B)\Pi(H',B) where H′=b(LccL)bH'=b(LccL)b. On the other side, body⁡Ωb(Y)=Π(bLb,B)\operatorname{body}\Omega_b(Y)=\Pi(bLb,B) since Db(Y)=LD_b(Y)=L and ωb(Y)=B\omega_b(Y)=B.

Receipts. Put H=ZcLH=ZcL (direct case) or H=LccLH=LccL (reset case), so that H′=bHbH'=bHb, and write B=B′xB=B'x with xx its last letter (BB is nonempty because ∣Y∣−∣L∣−1≥1|Y|-|L|-1\ge1). We claim Λ(H,bB)=Λ(L,bB)\Lambda(H,bB)=\Lambda(L,bB); the first entry of this identity is the statement that the bb cell of Ωc(Y)\Omega_c(Y) (resp. Zc(Y)Z_c(Y)) carries λ(bLb)=ρb\lambda(bLb)=\rho_b, and the remaining entries identify Π(H′,B)\Pi(H',B) with Π(bLb,B)\Pi(bLb,B) receipt by receipt.

Apply Lemma 8.3 with HH, P:=LP:=L, and w:=bB′w:=bB'. Its hypotheses hold: H=R′cLH=R'cL has bridge c≠bc\ne b and λ(H)=L\lambda(H)=L by Corollary 8.6; and wRL=B′RbLw^RL=B'^RbL is YY with its first letter removed, whose even-palindromic suffixes are exactly the proper even-palindromic suffixes of YY, the longest being LL. The lemma gives agreement of the receipts on all cells except the last. For the last cell, the final palindromes are Yc ωc(Y)Yc\,\omega_c(Y) (resp. YccYYccY) on the left and YbBYbB on the right; both have suffix link YY by Lemma 8.5. Hence Λ(H,bB)=Λ(L,bB)\Lambda(H,bB)=\Lambda(L,bB), which is the displayed identity.

Definedness. Ωc(Y)\Omega_c(Y) is defined iff Ωc(L)\Omega_c(L) is, by Lemma 5.6; and Zc(Y)Z_c(Y) is defined (i.e. Dc(Y)D_c(Y) undefined) iff Zc(L)Z_c(L) is. ◻

Example 8.8 (the recurrence on Y=001100Y=001100). Here L=00L=00, b=1b=1, B=100B=100. For c=0c=0: Ω0(L)=Π^(00,0)=(ϵ;(0,00))\Omega_0(L)=\widehat\Pi(00,0)=(\epsilon;(0,00)), Ω1(Y)=Π^(1001,100)=(ϵ;(1,11),(0,0110),(0,001100))\Omega_1(Y)=\widehat\Pi(1001,100)=(\epsilon;(1,11),(0,0110),(0,001100)), so ρ1=ϵ\rho_1=\epsilon and the recurrence predicts Ω0(Y)=(ϵ;(0,00),(1,ϵ),(1,11),(0,0110),(0,001100))\Omega_0(Y)=(\epsilon;(0,00),(1,\epsilon),(1,11),(0,0110),(0,001100)). Direct computation of Π^(00,01100)\widehat\Pi(00,01100) gives the same five cells. The shared tail is anchored at 1 0000 11\,0000\,1 on the left and at 1 00 11\,00\,1 on the right; the two anchors differ, and their receipts agree.

8.6 Full receipt closure

Theorem 8.9 (Full abstract receipt closure). Over a fixed alphabet, every nonreset update obtains a fresh occurrence record, its complete direct/reset rope table, and the updated live context from old receipts by a fixed number of head, tail, singleton, inject, and catenation operations. On reset, only the live rope is updated and the occurrence root becomes the fixed empty record.

This is closure under sequence operations. Section 11 supplies the interface needed to implement those operations with bounded records.

Proof. Suppose the update creates P=aQaP=aQa, where QQ is the old longest suffix (external case) or Q=Da(Pold)Q=D_a(P_{\mathrm{old}}) (internal case), and let L=λ(P)L=\lambda(P) as given by Theorem 6.1. Select the old rope Ωa(Q)\Omega_a(Q) when Da(Q)D_a(Q) is defined and the old reset rope Za(Q)Z_a(Q) otherwise; call it the source rope. Its body is nonempty (its word is ωa(Q)\omega_a(Q), resp. aQaQ, and both are nonempty); write the body (b,H)T(b,H)\mathcal T.

  1. The bridge of PP is bb. If Da(Q)D_a(Q) is defined, write Q=Z′aDa(Q)Q=Z'aD_a(Q); then P=aZ′ aDa(Q)a=(aZ′)LP=aZ'\,aD_a(Q)a=(aZ')L, so the bridge of PP is the last letter of Z′Z', which is the first letter of ωa(Q)=Z′R\omega_a(Q)=Z'^R, i.e. bb. If Da(Q)D_a(Q) is undefined, L=ϵL=\epsilon, the bridge of PP is its last letter aa, and the first letter of the reset rope’s word aQaQ is a=ba=b.

  2. The header of Ωb(P)\Omega_b(P) is HH. The header of Ωb(P)=Π^(bLb,ωb(P))\Omega_b(P)=\widehat\Pi(bLb,\omega_b(P)) is λ(bLb)\lambda(bLb). The first cell of the source rope is obtained by wrapping its anchor (aDa(Q)a=LaD_a(Q)a=L, resp. ϵ=L\epsilon=L) by bb, so its receipt is H=λ(bLb)H=\lambda(bLb).

  3. The body of Ωb(P)\Omega_b(P) is T\mathcal T followed by (a,P)(a,P). By (i), P=(aZ′′b)LP=(aZ''b)L with Z′=Z′′bZ'=Z''b, so ωb(P)=Z′′Ra\omega_b(P)=Z''^Ra, while the source rope’s word is ωa(Q)=Z′R=bZ′′R\omega_a(Q)=Z'^R=bZ''^R (in the reset case ωa(P)=Qa\omega_a(P)=Qa and the source word is aQaQ). So Ωb(P)\Omega_b(P) wraps bLbbLb through the same letters as the source rope after its first cell, followed by one final letter aa. By the catenation law the cells coincide with T\mathcal T, and the final cell has letter aa and receipt λ(wrap⁡ωb(P)(bLb))=P\lambda(\operatorname{wrap}_{\omega_b(P)}(bLb))=P by Lemma 8.5. In symbols, bP=b,Ωb(P)=(H;T(a,P)).(2)b_P=b,\qquad \Omega_b(P)=\bigl(H;\mathcal T(a,P)\bigr). \tag{2} Operationally: pop the source body, inject the terminal cell (a,P)(a,P), and reuse the old header HH.

  4. The suffix-link pointer of PP. In the external case Q=PoldQ=P_{\mathrm{old}} and L=λ(aPolda)L=\lambda(aP_{\mathrm{old}}a) is the receipt stored in the first cell of the live rope K(Pold,ℓ)\mathcal K(P_{\mathrm{old}},\ell), which the pop of (3) below promotes to the new header. In the internal case L=λ(aDa(Pold)a)L=\lambda(aD_a(P_{\mathrm{old}})a) is the header of the old entry Ωa(Pold)\Omega_a(P_{\mathrm{old}}), whose anchor is aDa(Pold)a=PaD_a(P_{\mathrm{old}})a=P. In both cases one old receipt names a record of type LL.

Every other entry of the fresh record follows from (2), Theorem 8.7, and the finite alphabet: for c≠bc\ne b, the rope Ωc(P)\Omega_c(P) or Zc(P)Z_c(P) is Ωc(L)\Omega_c(L) (resp. Zc(L)Z_c(L)) catenated with the singleton (b,H)(b,H) and with body⁡Ωb(P)\operatorname{body}\Omega_b(P)—two catenations on ropes read from the record of LL, which is reached by the pointer of (iv). The bridge transition receipt is the suffix-link receipt LL; every off-bridge direct transition receipt is copied from the corresponding entry of the record for LL.

Let K(P,ℓ)=Π^(P,ℓ)\mathcal K(P,\ell)=\widehat\Pi(P,\ell) be the live context rope. The three cases of Theorem 5.4 give K′={tail⁡K(P,ℓ),ℓ=aℓ0,Ωa(P)⋅body⁡K(P,ℓ),Da(P) defined,Za(P)⋅body⁡K(P,ℓ),Da(P) undefined,(3)\mathcal K'= \begin{cases} \operatorname{tail}\mathcal K(P,\ell),&\ell=a\ell_0,\\ \Omega_a(P)\cdot\operatorname{body}\mathcal K(P,\ell), &D_a(P)\text{ defined},\\ Z_a(P)\cdot\operatorname{body}\mathcal K(P,\ell), &D_a(P)\text{ undefined}, \end{cases} \tag{3} where PP denotes the old palindrome. The first case is the catenation law read backwards. In the second case the new live rope is Π^(aDa(P)a,ωa(P)ℓ)=Ωa(P)⋅Π(wrap⁡ωa(P)(aDa(P)a),ℓ)\widehat\Pi(aD_a(P)a,\omega_a(P)\ell)=\Omega_a(P)\cdot\Pi(\operatorname{wrap}_{\omega_a(P)}(aD_a(P)a),\ell), and the tail is anchored at H:=ZaPH:=ZaP where P=ZaDa(P)P=ZaD_a(P); in the third case the tail is anchored at H:=PaaPH:=PaaP. Lemma 8.3 applies to HH, PP, and w:=ℓw:=\ell: λ(H)=P\lambda(H)=P by Lemma 8.5 (applied to PP and aa), the bridge of HH is aa, either ℓ=ϵ\ell=\epsilon or its first letter differs from aa, and wRP=ℓRP=CP=Sw^RP=\ell^RP=CP=S, of which PP is the longest even-palindromic suffix by definition. So the old body is literally reusable even though its concrete anchor changes. Equations (2)–(3) use a fixed number of rope primitives and old fields. ◻

Example 8.10 (row 8 at the rope layer). Before row 8 the state is P=001100P=001100, ℓ=0\ell=0, with live rope K=(00;(0,00))\mathcal K=(00;(0,00)). The letter is a=1a=1, the internal case with Q=D1(001100)=00Q=D_1(001100)=00, and the fresh palindrome is P′=1001P'=1001. The source rope is Z1(00)=(⊥;(1,ϵ),(0,ϵ),(0,00))Z_1(00)=(\bot;(1,\epsilon),(0,\epsilon),(0,00)) since D1(00)D_1(00) is undefined; so b=1b=1, H=ϵH=\epsilon, T=((0,ϵ),(0,00))\mathcal T=((0,\epsilon),(0,00)), and (2) gives Ω1(1001)=(ϵ; (0,ϵ),(0,00),(1,1001)),\Omega_1(1001)=\bigl(\epsilon;\ (0,\epsilon),(0,00),(1,1001)\bigr), which agrees with the direct definition Π^(11,001)\widehat\Pi(11,001). The suffix-link pointer of the fresh record is the header of Ω1(001100)=(ϵ;(1,11),(0,0110),(0,001100))\Omega_1(001100)=(\epsilon;(1,11),(0,0110),(0,001100)), namely ϵ\epsilon, the empty record. The new live rope by (3) is K′=Ω1(001100)⋅body⁡K=(ϵ; (1,11),(0,0110),(0,001100),(0,00)),\mathcal K'=\Omega_1(001100)\cdot\operatorname{body}\mathcal K =\bigl(\epsilon;\ (1,11),(0,0110),(0,001100),(0,00)\bigr), which is Π^(1001,1000)\widehat\Pi(1001,1000) computed directly. The last cell (0,00)(0,00) was created at row 7 around the anchor 001100001100 and is now read around the anchor 10011001; its receipt is unchanged. The terminal cell (1,1001)(1,1001) of the fresh bridge rope points at the fresh record itself: this is the cycle of Part III. What generalizes: every nonreset update has exactly this shape. What is incidental: the particular lengths.

III Turning bounded records into a scaffold

9 The cyclic allocation obstacle

9.1 Records, fields, and batches

From here on a record is a finite tuple with a finite tag, a finite payload (such as a letter), and a fixed number qq of pointer fields, each of which is missing or points to a record. A persistent program holds a fixed number ss of roots (pointers kept in finite control) and, at each step, reads old records by following fields from the roots and creates a finite batch of fresh records. The fresh batch is a finite labelled directed graph: its vertices are the fresh records (slots 0,…,A−10,\ldots,A-1 for some bound AA), and each field of each slot is missing, points to an old record, or points to a slot.

Strict sequential allocation permits references only to old records or previously allocated records. A simultaneous batch instead specifies a finite adjacency table whose edges may target any fresh slot.

9.2 The cycle the palindrome construction forces

The obstruction is already visible in equation (2) of the closure proof. A fresh palindrome occurrence record PP stores the root of its bridge rope Ωb(P)\Omega_b(P). The final fresh cell of that rope stores the typed receipt PP. Thus P⟶Ωb(P)⟶terminal receipt P.P\longrightarrow\Omega_b(P) \longrightarrow\text{terminal receipt }P. Both edges are semantic requirements of the same input transition. Neither endpoint can be replaced by an old record, and neither ordering of the two fresh objects makes all pointers backward. Example 8.10 exhibits the cycle concretely: the record for 10011001 and the cell (1,1001)(1,1001) are both created at row 8 and point at each other.

Figure 9. The owner/rope same-step cycle. The steque's structural records are acyclic when the payload PP is treated as an opaque atom. Substitution of the fresh owner pointer creates the cycle only at the batch boundary.

The batch is a finite labelled graph. Its specification requires no recursive evaluation of the owner/rope cycle.

10 Bounded simultaneous record transducers

We now define the source machine precisely and compile it into the scaffold model of Definition 2.6. This section is independent of palindromes: a reader may regard its input as an arbitrary bounded persistent-record update.

10.1 The source model

Definition 10.1 (Bounded simultaneous record transducer). Fix constants s,A,q,rs,A,q,r. A bounded simultaneous record transducer has ss current roots, allocates at most AA active slots per input symbol, gives each record qq pointer fields, and follows at most rr old-record fields from its current roots in one step. Its control states, record tags, and nonpointer payloads are finite.

After its bounded old observation, one transition chooses a finite labelled batch graph. Every new root and field targets one of: ∅,an old address of at most r dereferences,any active slot of the fresh batch.\varnothing,\qquad \text{an old address of at most $r$ dereferences},\qquad \text{any active slot of the fresh batch}. The last case includes self-loops, forward references, and mutual cycles. The whole finite adjacency table is specified simultaneously. No fresh record is inspected while the plan is chosen, and control does not branch on whether two old addresses name the same record.

An old address is a root together with a sequence of at most rr field names; it is dereferenced by starting at the root and following the named fields. “Simultaneous” constrains dependencies rather than prescribing a physical allocation primitive. The plan may depend on finite control and bounded old structure, but it may not branch on a fresh record as though that record had already been evaluated. The adjacency table is output data of the transition. The initial roots may be missing or point into a fixed finite, immutable, pointer-closed initial record graph. The compiled decoder stores that graph and its initial roots as finite table data; those virtual records are present from time zero and are never charged to a fresh batch.

10.2 Tuple packing

Pack the at most AA logical records into finite slots of one physical node. The node label records the active slots, their tags, and the target-slot component of each pointer.

Figure 10. Tuple packing. Several logical fresh records occupy finite slots of one physical scaffold node. Every intra-batch edge has the same physical target SELF\mathsf{SELF}; its finite tag selects the logical slot.

Theorem 10.2 (Simultaneous batch compiler). Every transducer of Definition 10.1 whose initial record graph is fixed, finite, immutable, and pointer-closed compiles exactly and letter-synchronously into a finite scaffolding automaton of degree d=max⁡{1,s+Aq}d=\max\{1,s+Aq\} and observation/update distance at most r+1r+1. The source transition uses only bounded labelled rooted unfoldings and does not branch on pointer identity; acceptance is in finite control.

Proof. Name the fixed initial records v0,…,vH−1v_0,\ldots,v_{H-1}. Store their labels, fields, and initial roots in a finite decoder table. A logical pointer is missing, virtual (an index in this table), or dynamic (a physical node and slot). Virtual pointers need no scaffold edge.

At time zero an initialization flag selects the fixed initial roots and acceptance value. The first transition reads the table, creates only its at-most-AA dynamic records, and clears the flag. At later times a dynamic pointer uses the root or field port below. A virtual pointer is followed entirely inside the table: pointer-closure prevents a path entering it from returning to later dynamic records.

One physical scaffold node represents the complete logical batch at one input time. Its finite label records the active mask, every tag and payload, and for each of its dd ports the finite target-slot tag of the record that port stands for (when the target is present).

Ports 0,…,s−10,\ldots,s-1 represent the next roots. Port s+iq+js+iq+j represents field j<qj<q of slot i<Ai<A. Thus a decoded logical pointer is a pair (v,i)(v,i) of a physical scaffold node and a finite slot number.

A path that stays dynamic uses one root edge and one edge per field dereference. If it enters the virtual table, its remaining suffix is computed there; the physical descriptor is ignored for a virtual target.

Consider an old logical address that starts at root uu and follows fields j1,…,jmj_1,\ldots,j_m, with m≤rm\le r. The current labelled unfolding reveals the slot reached after every prefix, because each slot tag is stored in the label of the node whose port is being followed, and that node lies within distance m≤rm\le r of the old top. Compile the address to the raw port word u, s+i0q+j1, …, s+im−1q+jm,u,\ s+i_0q+j_1,\ \ldots,\ s+i_{m-1}q+j_m, where ihi_h is the slot tag at the preceding logical pointer. This word has length at most r+1r+1 and reaches exactly the old target. The extra one in the distance bound is the initial root port; each logical dereference contributes one field port thereafter. LMR’s transition sees the labels of all nodes within distance kk (Definition 2.5), so k=r+1k=r+1 suffices both to compute the word and to read the tags along it.

Use a missing descriptor for ∅\varnothing and the compiled word for an old target. For every fresh target use physical SELF\mathsf{SELF} and record the intended logical slot in the new finite label. This rule makes no distinction between an earlier target, a later target, a self-loop, or one edge of a mutual cycle.

Assume that the old top decodes to the source roots and old heap. Induction on the length of an old logical address proves that its raw word decodes correctly: the base root port reaches the physical node named by that root and supplies its slot; each subsequent field port is selected using the current slot and supplies the next slot. Missing decodes to missing. A fresh descriptor reaches the new physical node by SELF\mathsf{SELF} and then its target-slot tag selects exactly the requested fresh logical record.

Applying these facts independently to every root and field makes the decoded finite labelled adjacency table identical to the source batch. Notice that the induction is on an old address, never on the unfolding of a fresh cycle. Comparing two finite adjacency tables requires no fixed point. Tags, payloads, control, and acceptance are copied directly.

The virtual-initial-record base case and this one-step commuting square give the full run invariant by induction on input length. All parameter ranges, masks, labels, and plans are finite, so the compiled automaton is finite. ◻

A self-loop, forward reference, or mutual cycle in the fresh batch uses the same physical SELF\mathsf{SELF} target with different finite slot tags.

Remark 32 (Where the cycle lives). The physical scaffold still has only backward edges and self-loops, exactly as LMR's definition requires. A logical record pointer is the larger coordinate (v,i)(v,i), not the physical node vv alone. Following a physical SELF\mathsf{SELF} edge keeps vv fixed while its finite edge tag changes the logical slot from ii to i′i'. An arbitrary finite cycle in the decoded fresh batch is therefore represented by one physical self-loop together with finite slot dynamics. The encoding has moved cyclicity from physical time into the finite decoder state.

11 Opaque-atom staging

The receipt update needs persistent sequences with the following list semantics and source-record properties.

11.1 The sequence interface

Let seq⁡(q)\operatorname{seq}(q) denote the sequence of token occurrences stored by a root qq. The operations satisfy:

seq⁡(empty)=[];seq⁡(single(x))=[x];seq⁡(cat(q,t))=seq⁡(q) seq⁡(t).\operatorname{seq}(\mathrm{empty})=[];\quad\operatorname{seq}(\mathrm{single}(x))=[x];\quad\operatorname{seq}(\mathrm{cat}(q,t))=\operatorname{seq}(q)\,\operatorname{seq}(t).

The operation uncons(q) returns None exactly on the empty sequence; otherwise it returns its exact first token and a root for the remaining sequence. All operations preserve every old version, including when their inputs share structure.

In addition, the implementation is strict and immutable, uses a finite record signature and finite inspected data, and has a uniform bound on primitive evaluation steps. It copies and returns base tokens without inspecting them or testing pointer identity. Each old pointer comes from an input root by field selection or is copied from known fresh structure. Temporary control values do not escape. These properties are the sequence contract used in Theorem 12.2.

11.2 The inherited theorem and its model

Kaplan and Tarjan's theorem motivates this interface. Applying it here also requires the source-record properties just stated.

Theorem 11.1 (Kaplan–Tarjan [6, Theorem 5.1, p. 592]; source scope). On regular steques, push, pop, inject, and catenation have worst-case constant cost and return regular steques; catenation assumes two regular inputs.

Regularity is the invariant of their steque representation. Their purely functional model uses pair construction and projection, without memoization [6, p. 578].

Recursive pairs and buffers are structural data that an operation may inspect. Base tokens are opaque. In this application a token is the complete receipt cell, whose receipt field may eventually point to the fresh owner.

Theorem 11.2 (Opaque-atom staging). Let a strict purely functional sequence operation, parameterized by a base element type AA, use finite constructor tests and a worst-case bounded number of car\mathsf{car}, cons\mathsf{cons}, and cdr\mathsf{cdr} operations. It may inspect the representation’s own pairs, buffers, and recursive child structures, but it may not inspect, compare, hash, traverse, or identity-test values of the base type AA. With new elements replaced by symbolic atoms, its branch and fresh structural allocation graph are determined by old structure alone. The graph is finite, acyclic, and uniformly bounded.

A symbolic element may denote a designated fresh payload record, and a fresh owner may store a fixed tuple of resulting roots. Adding those payload and owner slots to the structural skeleton forms one bounded simultaneous batch. Substitution is sound even when a payload field points back to the owner and creates a cycle.

Proof. Fix the old structural roots. A worst-case constant bound gives a uniform number KK of primitive evaluation steps. Replace each new element by a distinct symbol and follow the evaluation.

A constructor test, car\mathsf{car}, or cdr\mathsf{cdr} reads an old structural record or a structural record allocated at an earlier step. By hypothesis it never follows an element field. Its result and next branch are therefore independent of the symbols. A cons\mathsf{cons} allocates one fixed-arity record whose fields are old pointers, earlier fresh structural pointers, or symbolic elements. Induction over the at most KK steps yields a bounded acyclic structural allocation graph independent of the symbolic values.

Now add the bounded fresh payload slots and the owner slot, replace each designated symbol by its payload slot, and fill the payload's receipt field with the owner slot where required. The owner stores its fixed tuple of result roots. The resulting cycle crosses from the owner to a structural root, then to an opaque payload cell, and returns to the owner. Structural evaluation never follows the payload field, so neither the sequence denotation nor the resource bound changes. Theorem 10.2 compiles the whole simultaneous batch, including that feedback edge, with SELF\mathsf{SELF}. ◻

Implementation. Appendix D identifies the length-free four-operation source variant and the semantic and resource arguments used for it. The normalization theorem below states the source-record assumptions independently of that implementation.

Theorem 11.3 (Whole-client bounded symbolic normalization). Fix a finite immutable record signature. Let one deterministic strict client transition have a uniform bound on calls, constructor tests, loops, recursion, and retained fresh records. Suppose it observes only finite tags, finite nonpointer data, old records reached by bounded rooted addresses, and constructors of ordinary fresh structural records already known to its symbolic evaluation. It neither observes pointer identity or allocation state nor inspects an unresolved opaque atom, designated fresh payload, or designated fresh owner. Suppose also that every old pointer later read or retained has a bounded rooted provenance, temporary control packages do not escape, and unreachable failure leaves are completed by a fixed finite plan. Then the whole client normalizes to one bounded simultaneous record-transducer plan determined only by finite control, the input letter, and a bounded labelled unfolding of the old roots.

Proof. Represent every pointer during the step as missing, virtual, an old root followed by a field word, a fresh structural slot, or an opaque atom. Symbolically execute the bounded client. Inspecting an old pointer reads the corresponding node of the bounded old unfolding. Inspecting a fresh structural pointer reads the constructor and finite fields already stored for that symbolic slot, so every apparent same-step structural test is partially evaluated while the finite transition table is defined. Inspecting an unresolved atom or a designated fresh payload or owner is excluded. Because the program does not test identity, two old addresses may alias without changing a branch.

Strict structural allocation adds fixed-arity symbolic records. Transition-local options, bounded vectors, products, GADT witnesses, and result packages are eliminated by substituting their pointer expressions at their uses; they need no persistent slot because they do not escape. After structural evaluation, add the designated payload and owner slots and perform the opaque-atom substitution. This constructs a finite adjacency table rather than running more client code, so it may introduce self-loops, forward references, or mutual cycles without creating a new observation.

The old-provenance hypothesis translates every old target into a permitted bounded address. The allocation and width hypotheses bound the fresh table. There are finitely many control states, input letters, and labelled old unfoldings of the fixed depth, so the symbolic results form a finite transition table. Unreachable assertion and partial-result leaves receive the fixed rejecting plan and do not affect the run from the valid initial state. Thus the sequential client and simultaneous plan have the same retained roots, record graph, control, and acceptance bit, up to fresh-slot renaming. ◻

Finite-access lemma. Suppose a client executes at most KK primitive steps. Pointers start at old roots or fixed virtual records; primitives copy pointers, select fields, and construct fixed-arity records. Then every old pointer inspected or retained has a bounded address from an original root.

Proof. Give an old root level zero. Copying preserves its level; selecting a field of an old record increases it by one. Selecting a field of a known fresh record substitutes the pointer expression stored there, introducing no old edge. If a primitive performs several selections, expand it into individual selections. Induction over the at most KK steps bounds every old expression by KK. Virtual records are resolved in their fixed table. Retaining an old subtree needs only its root expression, not a traversal of all its descendants. The argument therefore bounds both reads and exposed old pointers, including those passed between calls. ∎

For a concrete program, a finite acyclic call graph with bounded vector folds supplies such a KK after each called primitive is expanded. A finite source file alone would not: recursive calls, unbounded loops, or unbounded primitives must be excluded.

Pointer-identity tests, inspection of unresolved payload atoms, and unbounded traversal are excluded by the hypotheses. Each would invalidate the symbolic evaluation argument.

In the palindrome client, the external acceptance test inspects the structural tail returned by the first uncons; later catenations also consume earlier results. These are known fresh structural values during symbolic evaluation. The newly designated receipt cells and owner are not inspected. The external and internal branches use at most eight sequence calls each; reset uses two (Appendix B). The sequence contract and the finite-access lemma thus give a uniform bound for the complete client.

12 A direct palindrome scaffold

12.1 The record layout

We assemble the construction. The persistent program keeps s=2s=2 roots: the current occurrence record and the live context rope. Finite control remembers whether the current palindrome is empty and the acceptance bit determined by whether the live rope has empty body.

An occurrence record for a nonempty palindrome PP has the following fields.

  1. A suffix-link field: a typed pointer to a record of type λ(P)\lambda(P), or the empty record ⊥\bot if λ(P)=ϵ\lambda(P)=\epsilon.

  2. A bridge payload: the letter bPb_P.

  3. For each letter c∈{0,1}c\in\{0,1\}, a table entry, which is either direct; a tag, a typed pointer to a record of type Dc(P)D_c(P) (the transition receipt), and the rope root of Ωc(P)\Omega_c(P)—or reset; a tag and the rope root of Zc(P)Z_c(P).

The empty record ⊥\bot has no suffix link and no bridge, and its two entries are the reset ropes Zc(ϵ)=Π^(ϵ,c)=(⊥;(c,ϵ))Z_c(\epsilon)=\widehat\Pi(\epsilon,c)=(\bot;(c,\epsilon)); it belongs to the fixed virtual initial graph and is decoded from time zero. A rope value is a header receipt together with a steque root whose elements are cells (c,receipt)(c,\text{receipt}).

For the explicit source-resource certificate, this logical layout has three physical record shapes. An occurrence owner has seven direct pointer fields: suffix; transition, header, and body for entry 00; and transition, header, and body for entry 11. Its bridge and two direct/reset tags are finite payloads; a reset tag guards a missing transition pointer. A live-rope record has header and body fields. A cell record has a finite letter and one receipt pointer, and its pointer is the opaque element stored by the sequence. Table entries and their rope pairs are therefore flattened into the owner rather than separately boxed. The two roots remain the owner and live-rope records.

The transition receipts materialize the chunk recursion of Lemma 5.6 persistently: for the bridge letter the transition receipt is the suffix link (Db(P)=λ(P)D_b(P)=\lambda(P)), and for the other letter it is copied from the corresponding entry of the suffix-link record (Dc(P)=Dc(λ(P))D_c(P)=D_c(\lambda(P))), one old pointer read at creation time. This is what Proposition 7.3 demanded: the selector that a later step needs is already at depth one, not at the end of a chain.

12.2 One step

On input aa, inspect the live rope’s first cell and the aa-entry of the current record. The old live-rope header is not read. Theorem 5.4 selects the case: external if the first cell's letter is aa; internal if the aa-entry is direct; reset otherwise. Then:

Source rope: the aa-entry rope of the current record (Ωa(P)\Omega_a(P) or Za(P)Z_a(P)). Suffix link of P′P': the receipt in the first cell of the live rope. Live rope: pop.

Source rope: the aa-entry rope of the record of QQ, reached through the aa-entry’s transition receipt of the current record. Suffix link of P′P': the header of the current record’s aa-entry rope Ωa(P)\Omega_a(P). Live rope: catenate Ωa(P)\Omega_a(P) with the body of the old live rope.

No fresh occurrence record; the root becomes ⊥\bot. Live rope: catenate Za(P)Z_a(P) with the body of the old live rope.

In the two nonreset cases the fresh record is filled by Theorem 8.9: bridge bb and bridge rope from the source rope by one pop and one inject (equation (2)); transition receipt for bb equal to the suffix link; for the other letter cc, transition receipt copied from the cc-entry of the suffix-link record and rope built by Theorem 8.7 with two catenations. Theorem 11.2 stages each opaque sequence operation, and Theorem 11.3 symbolically composes the complete eight/eight/two client into one old-dependent simultaneous plan. Theorem 10.2 appends that batch as the one scaffold node required for the arriving letter. Acceptance is the finite empty-body test on the live rope (Theorem 5.4).

Example 12.1 (row 8 at the scaffold layer). After 00011001, the new owner represents 1001. Its suffix receipt points to the virtual empty record. The owner stores the header and body pointers of its two table ropes directly; the live rope has a separate root record. A fresh terminal receipt cell in the bridge rope points back to this owner.

Assign the owner, live-rope record, new cells, and sequence records distinct slots of the same new scaffold node. Each reference between them becomes a SELF edge with its target-slot tag. References to existing receipts and shared sequence tails keep their old targets. This realizes the owner/rope cycle while leaving every older scaffold node unchanged.

12.3 Uniform constants

Fix a sequence implementation satisfying Section 11.1. The client schedules are finite, so the finite-access lemma and Theorem 11.3 give constants A∗,q,R∗A_*,q,R_* for allocation, record width, and old-address access, independent of input length. The initial empty owner and ropes are virtual records.

With two current roots, the compiler gives d=max⁡{1,2+A∗q},k=R∗+1.d=\max\{1,2+A_*q\},\qquad k=R_*+1. The argument uses existence of these constants. Appendix B records the implementation's allocation inventory; no numerical radius is used in the theorem.

12.4 The run invariant and the theorem

After reading a prefix S=CPS=CP:

  1. the decoded occurrence root names a record for the current occurrence of the longest even-palindromic suffix PP (the empty record if P=ϵP=\epsilon);

  2. the decoded live-rope root denotes Π^(P,CR)\widehat\Pi(P,C^R);

  3. every table entry in every reachable occurrence record has the word and receipt semantics of Section 8 (its rope is Ωc\Omega_c or ZcZ_c of its record’s type, and its transition receipt, when present, names a record of type DcD_c of that type); and

  4. finite control marks acceptance exactly when the live rope has empty body.

The empty initial prefix satisfies the invariant using the distinguished empty record and empty rope. One application of the word recurrence chooses the right abstract update; receipt closure proves the new decoded objects have the required semantics; opaque staging and the compiler prove that the single new physical node decodes to those objects. This is the induction performed in the final theorem.

Theorem 12.2 (Direct palindrome construction). For a persistent sequence implementation satisfying the contract of Section 11.1, the receipt construction recognizes the binary even-palindrome language with a finite scaffolding automaton. If the complete client has source-record bounds (A∗,q,R∗)(A_*,q,R_*), it has degree max⁡{1,2+A∗q}\max\{1,2+A_*q\} and distance at most R∗+1R_*+1.

Proof. The fixed virtual empty-owner graph satisfies the run invariant. On each input letter, Theorem 5.4 selects the exact word update and Theorem 8.9 supplies its occurrence record, table entries, and receipt rope. The sequence laws preserve those denotations. Opacity permits the fresh receipt cells to remain symbolic under Theorem 11.2. The finite client schedule and finite-access lemma meet Theorem 11.3, including the external tail-emptiness test, and produce one bounded simultaneous plan. Theorem 10.2 encodes it in one scaffold node. The context is empty exactly for an even palindrome, which is the acceptance bit in finite control. Induction on input length proves the claim. ∎

Corollary 12.3 (Direct PEG route). Under the sequence contract in Theorem 12.2, the construction yields a PEG for EPAL2\mathsf{EPAL}_2.

Proof. Loff–Moreira–Reis Theorem 2.7 sends the scaffold language of Theorem 12.2 to a complete-match PEG for its reversal. The reversal of wwRww^R is again of the form uuRuu^R, so EPAL2R=EPAL2\mathsf{EPAL}_2^R=\mathsf{EPAL}_2. ◻

13 Relation to the transfer construction

The earlier transfer paper [5] obtains palindrome membership from a classical real-time recognizer. The present construction exposes the stored state: occurrence receipts, anchored ropes, and a finite simultaneous batch. Its representation counterexamples concern only the specific interfaces in Section 7.

The compiler applies to any bounded simultaneous record update. The palindrome application additionally uses receipt closure and the sequence contract. Both routes use the Loff–Moreira–Reis correspondence to obtain a PEG.

14 Supporting evidence

The receipt, compiler, and normalization arguments are written proofs. Bounded word and graph checks test the recurrence, shadow transport, receipt closure, and batch decoding. Source audits address the separate sequence contract and resource accounting. The proof and evidence index links those records.

This work was developed with AI assistance. The recorded AI reviews share model dependencies; no external specialist review is recorded.

A Notation

Table 3 collects the symbols whose meanings cross more than one proof layer. A symbol naming a word is not silently identified with the record that represents an occurrence of that word.

Table 3. Notation crossing the word, record, and scaffold layers.
Symbol Meaning
S=CPS=CP input prefix, factored at its longest even-palindromic suffix PP
ℓ=CR\ell=C^R reversed occurrence context; its head is immediately left of PP
λ(P)\lambda(P) suffix-link word: longest proper even-palindromic suffix of nonempty PP; λ(ϵ)=ϵ\lambda(\epsilon)=\epsilon by convention
bPb_P, BPB_P bridge letter and bridge block: P=λ(P) bP BPP=\lambda(P)\,b_P\,B_P
Da(P)D_a(P) longest proper even suffix of PP immediately preceded by aa
ωa(P)\omega_a(P) reversed word displaced into context when Da(P)D_a(P) is wrapped
Π(A,w)\Pi(A,w), wrap⁡w(A)\operatorname{wrap}_w(A) anchored palindrome path obtained by wrapping AA through ww, and its final palindrome
Λ(A,w)\Lambda(A,w), Π^(A,w)\widehat\Pi(A,w) its receipt trace; its headered rope
Ωa(P)\Omega_a(P) direct receipt rope when Da(P)D_a(P) exists
Za(P)Z_a(P) reset receipt rope when Da(P)D_a(P) does not exist
K(P,ℓ)\mathcal K(P,\ell) the live context rope Π^(P,ℓ)\widehat\Pi(P,\ell)
⊥\bot the distinguished record representing a typed receipt to the empty palindrome
SELF\mathsf{SELF}, ∅\varnothing scaffold descriptors: the node being appended; no edge
(v,i)(v,i) decoded logical record: physical node vv and finite slot ii
s,A,q,rs,A,q,r roots, slots per step, fields per record, old dereference radius

B Client operation inventory

The complete schedules include observations used for branching and acceptance:

BranchSequence callsAllocation expression
External3 uncons, 2 single, 3 cat3AU+2AS+3AC+ΛE3A_U+2A_S+3A_C+\Lambda_E
Internal2 uncons, 2 single, 4 cat2AU+2AS+4AC+ΛI2A_U+2A_S+4A_C+\Lambda_I
Reset1 uncons, 1 catAU+AC+ΛRA_U+A_C+\Lambda_R

Here AU,AS,ACA_U,A_S,A_C bound the respective operations; the Λ\Lambda terms count client records in the chosen layout. The flattened layout has a seven-pointer owner, a two-pointer live-rope wrapper, and one-pointer cells. The archived fixed-client allocation audit reports A∗=8838, q=7A_*=8838,\ q=7. These implementation-specific ceilings are not needed for the qualitative theorem.

C Supporting files

The evidence index separates the word recurrence, receipts, compiler, sequence implementation, and assembled client. The typed-call inventory checks source bindings and bounded call recurrences. The constructor-flow analysis records progress toward an automated pointer-provenance proof.

D Sequence implementation

The length-free four-operation variant adapts the handwritten OCaml implementation of Viennot, Wendling, Guéneau, and Pottier [10], at upstream commit 444358e963db89b7d90a5065c4680ddd70248f82. It removes cached-length observations from the relevant interface and uses bounded endpoint probes. The facade exposes empty, single, uncons, and cat.

The supporting source arguments cover the deque list equations, the Buffer lower-bound invariant and assertion safety, allocation, and bounded calls. The relevant vector folds have at most six elements. Recursive sequence-wide folds elsewhere in the module are outside this facade's operation paths. The finite-access lemma applies to the bounded primitive evaluation, irrespective of the depth of recursively paired data.

These are informal source-level arguments for the contract in Section 11.1. The automated analysis does not yet establish complete old/fresh pointer provenance or a numerical access radius. The separate Rocq development proves properties of its own implementation; no checked correspondence to this handwritten source is used here. The implementation evidence and the generic conditional construction should therefore be read as distinct parts of the argument.

Acknowledgment of inherited work

Loff, Moreira, and Reis supply the scaffold/PEG correspondence; Kaplan and Tarjan supply the real-time catenable-sequence result; Viennot and coauthors supply the modern implementations. The receipt construction, simultaneous-record compiler, and normalization argument are the contributions developed here.

References

Source[1] Noam Chomsky and Marcel-Paul Schützenberger. The algebraic theory of context-free languages. In P. Braffort and D. Hirschberg, editors, Computer Programming and Formal Systems, Studies in Logic and the Foundations of Mathematics, pages 118–161. North-Holland, Amsterdam, 1963.

[2] James R. Driscoll, Neil Sarnak, Daniel D. Sleator, and Robert E. Tarjan. Making data structures persistent. Journal of Computer and System Sciences, 38(1):86–124, 1989. https://doi.org/10.1016/0022-0000(89)90034-2.

[3] Bryan Ford. Parsing expression grammars: A recognition-based syntactic foundation. In Proceedings of POPL 2004, pages 111–122. ACM, 2004. https://doi.org/10.1145/964001.964011.

[4] Zvi Galil. Palindrome recognition in real time by a multitape Turing machine. Journal of Computer and System Sciences, 16(2):140–157, 1978. https://doi.org/10.1016/0022-0000(78)90042-9.

[5] Joshua Gay. Real-time multitape languages transfer to parsing expression grammars. FPRD Lab review paper, released 5 August 2026. FPRD reading edition.

[6] Haim Kaplan and Robert E. Tarjan. Purely functional, real-time deques with catenation. Journal of the ACM, 46(5):577–603, 1999. https://doi.org/10.1145/324133.324139.

[7] Bruno Loff, Nelma Moreira, and Rogério Reis. The computational power of parsing expression grammars. Journal of Computer and System Sciences, 111:1–21, 2020. https://doi.org/10.1016/j.jcss.2020.01.001. Expanded preprint arXiv:1902.08272v2 (2020); definition and theorem numbers in this paper follow the preprint.

[8] Mikhail Rubinchik and Arseny M. Shur. EERTREE: An efficient data structure for processing palindromes in strings. European Journal of Combinatorics, 68:249–265, 2018. https://doi.org/10.1016/j.ejc.2017.07.021. Preprint arXiv:1506.04862.

[9] A. O. Slisenko. A simplified proof of the real-time recognizability of palindromes on Turing machines. Zapiski Nauchnykh Seminarov LOMI, 68:123–139, 1977. English translation in Journal of Soviet Mathematics, 15:68–77, 1981, https://doi.org/10.1007/BF01404109.

[10] Jules Viennot, Arthur Wendling, Armaël Guéneau, and François Pottier. Verified purely functional catenable real-time deques. arXiv:2505.07681v3, 3 July 2026. https://arxiv.org/abs/2505.07681v3.

Revision history

Draft 5, 21 September 2026. Consolidated the web and PDF editions; integrated virtual initialization into the compiler proof; stated the sequence contract in the direct construction; replaced the numerical distance claim with symbolic bounds; and shortened repeated exposition.

10 September 2026 corrections. The initial fixed graph is encoded in a finite decoder table. The six-call formulas A=6K+4, r=6K+8A=6K+4,\ r=6K+8 were replaced by complete client schedules. The later proposed radii 55/874, client radius 1750, and scaffold distance 1751 remain withdrawn because the checker did not establish source-path coverage or pointer provenance.

Archived Draft 4 PDF · Historical radius audit