Langlib

Langlib.Grammars.Unrestricted.Definition

Unrestricted Grammar Definitions #

This file defines unrestricted grammars and their derivations.

Main declarations #

inductive symbol (T N : Type) :

The type of symbols is the disjoint union of terminals and nonterminals.

Instances For
    structure grule (T N : Type) :

    Transformation rule for a grammar without any restrictions.

    Instances For
      structure grammar (T : Type) :

      Grammar (unrestricted) that generates words over the alphabet T (a type of terminals).

      Instances For
        def grammar_transforms {T : Type} (g : grammar T) (w₁ w₂ : List (symbol T g.nt)) :

        One step of grammatical transformation.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          def grammar_derives {T : Type} (g : grammar T) :
          List (symbol T g.nt)List (symbol T g.nt)Prop

          Any number of steps of grammatical transformation; reflexive+transitive closure of grammar_transforms.

          Equations
          Instances For
            def grammar_generates {T : Type} (g : grammar T) (w : List T) :

            Accepts a word (a list of terminals) iff it can be derived from the initial nonterminal.

            Equations
            Instances For
              def grammar_language {T : Type} (g : grammar T) :

              The set of words that can be derived from the initial nonterminal.

              Equations
              Instances For