Documentation

Linglib.Syntax.ConstructionGrammar.Licensing

Constructional licensing #

The licensing model of constructional grammar ([Sag12]; [Gol95]): an utterance token is grammatical iff every constituent in it instantiates some construction of the network. Constructicon.licenses is the recognizer — a constituent's daughters must match some construction's typed form slot-by-slot (formMatches), and each daughter must itself be licensed; words are licensed lexically.

Matching is relative to a POS lexicon String → Option UD.UPOS. headed fillers are checked against immediate daughters (a flat approximation of headedness), and semantic constraints are not checkable at this level and match any token. Slot constraints are enforced where they can be: negMinus rejects a negated daughter (SlotConstraint.allows).

Main declarations #

An utterance token: a word or a constituent with daughter tokens.

Instances For

    Boolean equality on tokens (hand-rolled: Token is a nested inductive, outside the deriving handlers' fragment).

    Equations
    Instances For
      def ConstructionGrammar.Token.beqList :
      List TokenList TokenBool

      Boolean equality on token lists.

      Equations
      Instances For
        theorem ConstructionGrammar.Token.beq_iff_eq (a b : Token) :
        a.beq b = true a = b
        theorem ConstructionGrammar.Token.beqList_iff_eq (as bs : List Token) :
        beqList as bs = true as = bs
        @[instance_reducible]
        Equations
        def ConstructionGrammar.SlotFiller.matches (pos : StringOption UD.UPOS) :
        SlotFiller StringTokenBool

        Does a token satisfy a slot filler, relative to a POS lexicon? semantic constraints are not checkable at this level and match any token; headed requires the head word as an immediate daughter, of the required category.

        Equations
        Instances For

          Does a token respect a slot constraint? negMinus forbids a negation daughter; locMinus and refEmpty concern the slot's external syntax and semantics and are not checkable against the daughter itself.

          Equations
          Instances For
            def ConstructionGrammar.formMatches (pos : StringOption UD.UPOS) (form : TypedForm String) (ts : List Token) :
            Bool

            A daughter sequence instantiates a typed form: same arity, and each daughter matches its slot's filler and respects its slot's constraints.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              def ConstructionGrammar.Constructicon.licenses {Sem : Type u_1} (cx : Constructicon Sem) (pos : StringOption UD.UPOS) :
              TokenBool

              The licensing recognizer: words are licensed lexically; a constituent is licensed iff its daughters instantiate some construction of the network and are each licensed themselves.

              Equations
              Instances For
                def ConstructionGrammar.Constructicon.licensesList {Sem : Type u_1} (cx : Constructicon Sem) (pos : StringOption UD.UPOS) :
                List TokenBool

                All tokens in a list are licensed.

                Equations
                Instances For
                  def ConstructionGrammar.Constructicon.Licenses {Sem : Type u_1} (cx : Constructicon Sem) (pos : StringOption UD.UPOS) (t : Token) :

                  cx licenses token t (relative to a POS lexicon): every constituent instantiates some construction of the network. Defined via the licenses recognizer, so concrete cases are kernel-decidable.

                  Equations
                  Instances For
                    @[instance_reducible]
                    instance ConstructionGrammar.instDecidableLicenses {Sem : Type u_1} (cx : Constructicon Sem) (pos : StringOption UD.UPOS) (t : Token) :
                    Decidable (cx.Licenses pos t)
                    Equations