Langlib

Langlib.Classes.Indexed.Closure.IntersectionRegular

Indexed Languages Intersected with Regular Languages #

For an indexed grammar in Aho normal form, annotate each nonterminal with the entry and exit states of a DFA. Binary rules thread an intermediate state, push/pop rules preserve both endpoints, and terminal rules realize one DFA transition. Parse certificates give a compact soundness and completeness proof.

structure IndexedDFA.nt (N σ : Type) :

An indexed nonterminal annotated with the DFA states immediately before and after the word generated by that nonterminal.

  • start : σ
  • core : N
  • stop : σ
Instances For
    def IndexedDFA.instDecidableEqNt.decEq {N✝ σ✝ : Type} [DecidableEq N✝] [DecidableEq σ✝] (x✝ x✝¹ : nt N✝ σ✝) :
    Decidable (x✝ = x✝¹)
    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      instance IndexedDFA.nt.fintype {N σ : Type} [Fintype N] [Fintype σ] :
      Fintype (nt N σ)
      Equations
      • One or more equations did not get rendered due to their size.
      def IndexedGrammar.dfaBinaryRule {T σ : Type} (g : IndexedGrammar T) (r : IRule T g.nt g.flag) (p m q : σ) (B C : g.nt) :
      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        def IndexedGrammar.dfaPopRule {T σ : Type} (g : IndexedGrammar T) (r : IRule T g.nt g.flag) (p q : σ) (f : g.flag) (B : g.nt) :
        Equations
        Instances For
          def IndexedGrammar.dfaPushRule {T σ : Type} (g : IndexedGrammar T) (r : IRule T g.nt g.flag) (p q : σ) (f : g.flag) (B : g.nt) :
          Equations
          Instances For
            def IndexedGrammar.dfaTerminalRule {T σ : Type} (g : IndexedGrammar T) (M : DFA T σ) (r : IRule T g.nt g.flag) (p : σ) (a : T) :
            Equations
            Instances For
              def IndexedGrammar.dfaRulesFor {T σ : Type} [Fintype σ] (g : IndexedGrammar T) (M : DFA T σ) (r : IRule T g.nt g.flag) :

              All DFA-threaded copies of one indexed-normal-form rule. Malformed rules contribute no product rules.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                def IndexedGrammar.dfaProduct {T σ : Type} [Fintype σ] (g : IndexedGrammar T) (M : DFA T σ) (p q : σ) :

                Product of a normal-form indexed grammar and a DFA, with fixed initial and final DFA states.

                Equations
                Instances For
                  theorem Indexed_of_Indexed_inter_regular {T : Type} [Fintype T] (L R : Language T) (hL : is_Indexed L) (hR : R.IsRegular) :
                  is_Indexed (LR)

                  An indexed language intersected with a regular language is indexed.

                  Predicate-form closure theorem used by the closure table.