Langlib

Langlib.Classes.ContextFree.Closure.ConcatenationBonus

Context-Free Concatenation Bonus Construction #

This file records a direct grammar construction for context-free closure under concatenation.

Main declarations #

def combined_grammar {T : Type} (gₗ gᵣ : CF_grammar T) :
Equations
  • One or more equations did not get rendered due to their size.
Instances For
    def combined_rule_of_rule₁ {T : Type} {g₁ g₂ : CF_grammar T} (r : g₁.nt × List (symbol T g₁.nt)) :
    (combined_grammar g₁ g₂).nt × List (symbol T (combined_grammar g₁ g₂).nt)
    Equations
    Instances For
      def combined_rule_of_rule₂ {T : Type} {g₁ g₂ : CF_grammar T} (r : g₂.nt × List (symbol T g₂.nt)) :
      (combined_grammar g₁ g₂).nt × List (symbol T (combined_grammar g₁ g₂).nt)
      Equations
      Instances For
        theorem bonus_CF_of_CF_c_CF {T : Type} (L₁ L₂ : Language T) :
        is_CF L₁ is_CF L₂is_CF (L₁ * L₂)

        An explicit grammar construction witnessing closure of context-free languages under concatenation.