Documentation

Linglib.Theories.Syntax.Common.Inversion

Subject–auxiliary inversion helpers #

Word-list predicates for detecting subject–auxiliary inversion in a linearised string, shared by HPSG (Theories/Syntax/HPSG/Inversion.lean) and Minimalism (Theories/Syntax/Minimalism/Inversion.lean) accounts.

The helpers operate on raw List Word, using UD UPOS tags and the wh feature. They make no commitment to either theory's representation of the inversion alternation; both theories' bridge theorems quantify over these predicates to license their own inversion derivations.

Two API layers:

Note isSubjectWord is so named (rather than isSubject) to avoid a naming collision with UD.DepRel.isSubject, which classifies dependency labels rather than words.

def Inversion.precedes (p q : WordBool) (ws : List Word) :
Bool

Does the earliest p-word precede the earliest q-word in ws?

Returns false if no p-word or no q-word exists. Note this is weaker than the existential reading "∃ i, j, p (ws[i]) ∧ q (ws[j]) ∧ i < j" — only the first match of each predicate is considered. For inversion-style word-order questions this matches the linguist's intended reading (was the first auxiliary before the first subject?).

Equations
  • Inversion.precedes p q ws = match List.findIdx? p ws, List.findIdx? q ws with | some i, some j => decide (i < j) | x, x_1 => false
Instances For

    Is this a nominal category that can be a subject?

    Equations
    Instances For

      Is this word a non-wh subject?

      Named isSubjectWord rather than isSubject to avoid a name collision with UD.DepRel.isSubject (which classifies dependency labels).

      Equations
      Instances For
        def Inversion.auxPrecedesSubject (ws : List Word) :
        Bool

        Does the auxiliary precede the subject?

        Equations
        Instances For
          def Inversion.subjectPrecedesAux (ws : List Word) :
          Bool

          Does the subject precede the auxiliary?

          Equations
          Instances For

            Prop-valued companion to isSubjectWord.

            Equations
            Instances For

              Prop-valued companion to auxPrecedesSubject.

              Equations
              Instances For

                Prop-valued companion to subjectPrecedesAux.

                Equations
                Instances For