Documentation

Linglib.Syntax.CCG.Derivation

CCG derivations #

This file defines the modern rule theory of CCG ([Ste19]): the combinatory rules as an indexed family, and intrinsically typed derivations over them.

The Combinatory Projection Principle: syntactic combinatory rules are binary, linearly ordered, type-dependent rules applying to string-adjacent categories. Rule is the modern rule inventory — application, first- and second-order composition in harmonic and crossing variants, each gated on the primary functor's slash modality — and Derivation therefore needs exactly one binary node constructor, so a value of Derivation α c is a derivation of category c and "derives c" is typechecking. Following [Ste19], type-raising is morpholexical — the work of case morphemes, not a syntactic rule — so raised categories enter as lexical leaves, and coordination is likewise lexical: a conjunction is an ordinary entry of category (X \⋆ X) /⋆ X whose star slashes confine it to application. Composition stops at second order, the chapter's full inventory. The substitution rules and the morphemic slash of [Ste19] are not modeled.

Main definitions #

inductive CCG.Rule (α : Type u_2) :
Cat αCat αCat αType u_2

Rule α l r c: a binary combinatory rule instance combining a left constituent of category l with a right constituent of category r to give c. Harmonic rules require the primary slash's modality ≤ diamond, crossing rules ≤ cross; application admits every modality.

Instances For
    def CCG.Rule.IsComp {α : Type u_1} {l r c : Cat α} :
    Rule α l r cProp

    The rule is a composition (of any order or direction) rather than an application.

    Equations
    Instances For
      @[instance_reducible]
      instance CCG.instDecidableIsComp {α : Type u_1} {l r c : Cat α} (ru : Rule α l r c) :
      Decidable ru.IsComp
      Equations
      inductive CCG.Derivation (α : Type u_2) :
      Cat αType u_2

      A CCG derivation of category c, intrinsically typed: a lexical leaf, or a binary Rule node — the Combinatory Projection Principle's binarity, once. A value of Derivation α c is a well-formed derivation, so "derives c" is typechecking.

      Instances For
        @[reducible, inline]
        abbrev CCG.Derivation.fapp {α : Type u_1} {x y : Cat α} {m : Modality} (d₁ : Derivation α (x.rslash m y)) (d₂ : Derivation α y) :

        Forward application >.

        Equations
        Instances For
          @[reducible, inline]
          abbrev CCG.Derivation.bapp {α : Type u_1} {x y : Cat α} {m : Modality} (d₁ : Derivation α y) (d₂ : Derivation α (x.lslash m y)) :

          Backward application <.

          Equations
          Instances For
            @[reducible, inline]
            abbrev CCG.Derivation.fcomp {α : Type u_1} {x y z : Cat α} {m n : Modality} (h : m Modality.diamond) (d₁ : Derivation α (x.rslash m y)) (d₂ : Derivation α (y.rslash n z)) :
            Derivation α (x.rslash n z)

            Forward harmonic composition >B.

            Equations
            Instances For
              @[reducible, inline]
              abbrev CCG.Derivation.bcomp {α : Type u_1} {x y z : Cat α} {m n : Modality} (h : m Modality.diamond) (d₁ : Derivation α (y.lslash n z)) (d₂ : Derivation α (x.lslash m y)) :
              Derivation α (x.lslash n z)

              Backward harmonic composition <B.

              Equations
              Instances For
                @[reducible, inline]
                abbrev CCG.Derivation.fcompx {α : Type u_1} {x y z : Cat α} {m n : Modality} (h : m Modality.cross) (d₁ : Derivation α (x.rslash m y)) (d₂ : Derivation α (y.lslash n z)) :
                Derivation α (x.lslash n z)

                Forward crossing composition >B×.

                Equations
                Instances For
                  @[reducible, inline]
                  abbrev CCG.Derivation.bcompx {α : Type u_1} {x y z : Cat α} {m n : Modality} (h : m Modality.cross) (d₁ : Derivation α (y.rslash n z)) (d₂ : Derivation α (x.lslash m y)) :
                  Derivation α (x.rslash n z)

                  Backward crossing composition <B×.

                  Equations
                  Instances For
                    @[reducible, inline]
                    abbrev CCG.Derivation.fcomp2 {α : Type u_1} {x y z w : Cat α} {m n p : Modality} (h : m Modality.diamond) (d₁ : Derivation α (x.rslash m y)) (d₂ : Derivation α ((y.rslash n z).rslash p w)) :
                    Derivation α ((x.rslash n z).rslash p w)

                    Forward second-order composition >B².

                    Equations
                    Instances For
                      @[reducible, inline]
                      abbrev CCG.Derivation.bcomp2 {α : Type u_1} {x y z w : Cat α} {m n p : Modality} (h : m Modality.diamond) (d₁ : Derivation α ((y.lslash n z).lslash p w)) (d₂ : Derivation α (x.lslash m y)) :
                      Derivation α ((x.lslash n z).lslash p w)

                      Backward second-order composition <B².

                      Equations
                      Instances For
                        @[reducible, inline]
                        abbrev CCG.Derivation.fcompx2 {α : Type u_1} {x y z w : Cat α} {m n p : Modality} (h : m Modality.cross) (d₁ : Derivation α (x.rslash m y)) (d₂ : Derivation α ((y.lslash n z).lslash p w)) :
                        Derivation α ((x.lslash n z).lslash p w)

                        Forward crossing second-order composition >B²×.

                        Equations
                        Instances For
                          @[reducible, inline]
                          abbrev CCG.Derivation.bcompx2 {α : Type u_1} {x y z w : Cat α} {m n p : Modality} (h : m Modality.cross) (d₁ : Derivation α ((y.rslash n z).rslash p w)) (d₂ : Derivation α (x.lslash m y)) :
                          Derivation α ((x.rslash n z).rslash p w)

                          Backward crossing second-order composition <B²×.

                          Equations
                          Instances For
                            def CCG.Derivation.yield {α : Type u_1} {c : Cat α} :
                            Derivation α cList String

                            The surface string a derivation spells out: its leaf forms, left to right.

                            Rule nodes concatenate their daughters, so the yield is independent of the derivation's combinatory structure — the property that lets a CCG derivation witness a string language.

                            Equations
                            Instances For
                              def CCG.Derivation.opCount {α : Type u_1} {c : Cat α} :
                              Derivation α c

                              The number of combinatory rule applications in a derivation.

                              Equations
                              Instances For
                                def CCG.Derivation.LexIn {α : Type u_1} (L : List (String × Cat α)) {c : Cat α} :
                                Derivation α cProp

                                Every lexical leaf of the derivation is an entry of the lexicon L.

                                Equations
                                Instances For
                                  @[instance_reducible]
                                  instance CCG.Derivation.LexIn.decidable {α : Type u_1} [DecidableEq α] (L : List (String × Cat α)) {c : Cat α} (d : Derivation α c) :
                                  Decidable (LexIn L d)
                                  Equations
                                  def CCG.Derivation.HasComp {α : Type u_1} {c : Cat α} :
                                  Derivation α cProp

                                  The derivation contains a composition node (of any order or direction).

                                  Equations
                                  Instances For
                                    @[instance_reducible]
                                    instance CCG.Derivation.HasComp.decidable {α : Type u_1} {c : Cat α} (d : Derivation α c) :
                                    Decidable d.HasComp
                                    Equations