Removing an explicit endmarker #
An LR parser can read a fresh marker to make end-of-input observable. This
file packages the language-level step which removes that implementation
device: quotient by the singleton marker, then pull the result back along the
injective Option.some embedding.
The regular shape language consisting of any number of embedded terminals followed by exactly one endmarker.
Equations
Instances For
Properly endmarked words form a regular language.
theorem
is_DCF_endmarked_of_marked_machine
{T : Type}
[Fintype T]
(L : Language T)
(K : Language (Option T))
(hK : is_DCF K)
(hcorrect : ∀ (w : List T), List.map some w ++ [none] ∈ K ↔ w ∈ L)
:
It suffices for a DPDA implementation to be correct on properly marked inputs. Intersecting its language with the regular marker-shape language removes any behavior it may have on malformed encodings.