Langlib

Langlib.Classes.ContextSensitive.Decidability.Characterization

Code-with-CS-shape characterizes the context-sensitive languages #

The bounded-search language contextSensitiveLanguageOf : Code T → Language T agrees with the actual grammar language only on context-sensitive codes. So the adequate, effective presentation of the CS class uses the subtype of codes whose decoded grammar is context-sensitive:

CSCode T := {c : Code T // grammar_context_sensitive (ofCode c)}.

This file:

Boolean folds with clean specifications #

def ContextSensitive.boolAll {β : Type} (p : βBool) (l : List β) :

boolAll p l is true iff every element satisfies p.

Equations
Instances For
    def ContextSensitive.boolAny {β : Type} (p : βBool) (l : List β) :

    boolAny p l is true iff some element satisfies p.

    Equations
    Instances For
      theorem ContextSensitive.boolAll_eq_true {β : Type} (p : βBool) (l : List β) :
      boolAll p l = true bl, p b = true
      theorem ContextSensitive.boolAny_eq_true {β : Type} (p : βBool) (l : List β) :
      boolAny p l = true bl, p b = true
      theorem ContextSensitive.primrec_boolAll {β : Type} [Primcodable β] {p : βBool} (hp : Primrec₂ p) :
      Primrec fun (x : × List β) => boolAll (p x.1) x.2
      theorem ContextSensitive.primrec_boolAny {β : Type} [Primcodable β] {p : βBool} (hp : Primrec₂ p) :
      Primrec fun (x : × List β) => boolAny (p x.1) x.2

      The CS-shape decision procedure #

      def ContextSensitive.epsOrNc {T : Type} (init : ) (r : grule T ) :

      The single-rule "epsilon or noncontracting" check, relative to an initial index.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        def ContextSensitive.isEps {T : Type} (init : ) (r : grule T ) :

        The single-rule "is an initial epsilon rule" check.

        Equations
        Instances For
          def ContextSensitive.notOnRhs {T : Type} [DecidableEq T] (init : ) (r : grule T ) :

          The single-rule "initial nonterminal not on this rule's RHS" check.

          Equations
          Instances For

            Boolean decision of grammar_context_sensitive (ofCode c).

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

              Correctness of the decision procedure #

              Primitive recursiveness of the decision procedure #

              The adequate, effective CS presentation #

              @[reducible, inline]

              The subtype of codes whose decoded grammar is context-sensitive. It is Primcodable because the CS-shape predicate is primitive recursive (primrecPred_isCS).

              Equations
              Instances For

                The language presented by a context-sensitive code.

                Equations
                Instances For

                  On a context-sensitive code, the bounded-search language is the grammar language.

                  The CS code presentation is adequate: it denotes exactly the context-sensitive languages (the library's class CS).

                  Uniform membership for the CS presentation is computable.

                  Context-sensitive membership is uniformly computable as a statement about the class CS: the context-sensitive codes form an adequate, effective presentation with uniformly decidable membership.