Langlib

Langlib.Classes.ContextSensitive.Closure.EmptyWord

Context-sensitive languages: adjoining the empty word #

If L is generated by a non-contracting unrestricted grammar (equivalently, by an ε-free context-sensitive grammar), then {ε} ∪ L is context-sensitive.

The construction adds a fresh start symbol S' = none on top of the grammar g₀, together with the two rules S' → ε and S' → S₀. The original rules are lifted unchanged along some : g₀.nt → Option g₀.nt, so they remain non-contracting and S' never occurs on a right-hand side — exactly the side condition the broad definition of is_CS requires when the S → ε rule is present.

This is the closure lemma used to handle the acceptEmpty = true branch of LBA ⊆ CS.

g₀ with a fresh start symbol none, plus rules none → ε and none → S₀, the original rules lifted along some.

Equations
  • One or more equations did not get rendered due to their size.
Instances For

    g₀ lifts into addEmpty_grammar g₀ along some, with id as the (total) sink.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For

      The grammar is context-sensitive #

      Language equality #

      theorem is_CS_insert_empty_of_noncontracting {T : Type} (g₀ : grammar T) (h : grammar_noncontracting g₀) :
      is_CS fun (w : List T) => w = [] grammar_language g₀ w

      Adjoining ε to a non-contracting language stays context-sensitive.

      theorem is_CS_insert_empty_of_CS_grammar {T : Type} (g : CS_grammar T) :
      is_CS fun (w : List T) => w = [] CS_language g w

      Adjoining ε to an ε-free context-sensitive language stays context-sensitive.