CSG → LBA (Kuroda): soundness #
This file proves the soundness half: every accepting run of kMachine g₀ on w exhibits a
derivation [S] ⇒* w (kMachine_sound).
It is a forward invariant SoundClaim over configurations reachable from the initial one
(sound_invariant, by induction on the run), with one phase per machine state. The simulator
reduces the decoded form toward [S] by reverse rule applications, so the current form always
forward-derives to the target w·terminal; the applyRule phase carries the loop invariant of
a backward pass, and the accept-check phase (check_sound, gotoLeft_check_sound) certifies the
final form is exactly [S].
Soundness: a reachable accepting run exhibits a derivation #
Decode one tape cell to the sentential-form symbol it represents: a raw input cell
some (inl t) decodes to terminal t (so the decoded form is unchanged during the init sweep),
a work cell decodes to its work symbol, a blank to nothing.
Equations
- KurodaConstruction.decodeCell g₀ none = none
- KurodaConstruction.decodeCell g₀ (some (Sum.inl t)) = some (symbol.terminal t)
- KurodaConstruction.decodeCell g₀ (some (Sum.inr (fst, fst_1, ws))) = ws
Instances For
The sentential form represented by a whole tape (the non-blank decoded cells, in order).
Equations
- KurodaConstruction.decodeForm g₀ c = List.filterMap id (List.ofFn fun (k : Fin (n + 1)) => KurodaConstruction.decodeCell g₀ (c k))
Instances For
take (i+1) peels the i-th cell off the decoded prefix.
The decoded form splits at the head into prefix, head cell, and suffix.
The head-moved tape after an echo write at head (cell value re-written) with head.val < n
is the same canonical tape with the head advanced one cell.
Soundness of the accept check (reverse of check_sweep): if a check sweep whose verified
prefix spells [S] iff seen reaches an accepting configuration, the whole track spells [S].
Soundness of the gotoLeft + accept-check phase. If gotoLeft (from any head) reaches an
accepting configuration, the work track spells [S].
The phase-indexed soundness invariant maintained FORWARD along a run from the initial
configuration. The simulator reduces the working form toward [S] by reverse rule applications,
so at every reachable configuration the current form derives (forward) to the target w·terminal.
The structure (cAt/mkCell) flows forward from init, which is why the induction is forward.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Forward soundness invariant. Every configuration reachable from the initial one satisfies
SoundClaim.
Soundness of the simulator. If the backward simulator accepts w, then the working
track passed through a valid (reverse) derivation, so g₀ derives w from its start symbol.