Documentation

Linglib.Core.Grammar

Grammar #

Grammar comparison interface and empirical testing infrastructure.

Defines:

structure V2Data :

Theory-neutral V2 data: for each clause type, whether verb movement to second position is observed. Used by Fragment V2 files for descriptive encoding of cross-Germanic V2 variation.

Instances For
    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      Equations
      Instances For
        def instDecidableEqV2Data.decEq (x✝ x✝¹ : V2Data) :
        Decidable (x✝ = x✝¹)
        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          inductive ClauseType :

          Clause types - determines constraints on word order.

          Instances For
            Equations
            Instances For
              Equations
              def precedes (p q : WordBool) (ws : List Word) :

              Does some word satisfying p precede some word satisfying q?

              Equations
              Instances For

                Is this a nominal category that can be a subject?

                Equations
                Instances For
                  def isSubject (w : Word) :

                  Is this word a non-wh subject?

                  Equations
                  Instances For

                    Does the auxiliary precede the subject?

                    Equations
                    Instances For

                      Does the subject precede the auxiliary?

                      Equations
                      Instances For
                        class Grammar (G : Type) :

                        A Grammar assigns derivations to strings. Derivations are proof objects.

                        • Derivation : Type

                          The type of derivations/analyses this grammar produces

                        • realizes : Derivation GList WordClauseTypeProp

                          Whether a derivation yields a given string with given clause type

                        • derives : GList WordClauseTypeProp

                          Whether the grammar can produce some derivation for a string

                        Instances
                          structure MinimalPair :

                          A minimal pair: grammatical vs ungrammatical, with context

                          Instances For
                            structure PhenomenonData :

                            Collection of minimal pairs for a phenomenon

                            Instances For
                              def capturesMinimalPairBy (pred : List WordBool) (pair : MinimalPair) :

                              Check if a grammaticality predicate captures a minimal pair.

                              Captures the pair iff the predicate accepts the grammatical sentence and rejects the ungrammatical sentence.

                              Equations
                              Instances For

                                Check if a grammaticality predicate captures all minimal pairs in a phenomenon dataset.

                                Equations
                                Instances For
                                  def Grammar.capturesPair (G : Type) [Grammar G] (g : G) (pair : MinimalPair) :

                                  A grammar captures a minimal pair if it derives the good one and blocks the bad one

                                  Equations
                                  Instances For
                                    def Grammar.capturesPhenomenon (G : Type) [Grammar G] (g : G) (phenom : PhenomenonData) :

                                    A grammar captures a phenomenon if it captures all its minimal pairs

                                    Equations
                                    Instances For
                                      theorem grammars_agree_on_phenomenon (G₁ G₂ : Type) [Grammar G₁] [Grammar G₂] (g₁ : G₁) (g₂ : G₂) (phenom : PhenomenonData) (h₁ : Grammar.capturesPhenomenon G₁ g₁ phenom) (h₂ : Grammar.capturesPhenomenon G₂ g₂ phenom) (pair : MinimalPair) (hp : pair phenom.pairs) :

                                      If two grammars both capture a phenomenon, they agree on grammatical sentences

                                      structure SentencePair :

                                      String-based minimal pair for theory-neutral phenomena.

                                      Unlike MinimalPair which uses List Word (requiring feature specifications), this type uses raw strings that can be parsed by any theory. This keeps empirical data in Phenomena/ free from theoretical commitments.

                                      • grammatical : String

                                        The grammatical sentence

                                      • ungrammatical : String

                                        The ungrammatical sentence

                                      • clauseType : ClauseType

                                        Clause type (declarative, question, etc.)

                                      • description : String

                                        Description of what the pair tests

                                      • citation : Option String

                                        Optional citation for the data

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

                                            String-based phenomenon data for theory-neutral representation.

                                            This is the string-based analogue of PhenomenonData. Phenomena files should use this type so that empirical data is decoupled from any particular grammatical theory's representation.

                                            • name : String

                                              Name of the phenomenon

                                            • List of minimal pairs

                                            • generalization : String

                                              Generalization captured by this data

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