Documentation

Linglib.Studies.AbramskySadrzadeh2014

Semantic unification as sheaf gluing #

Abramsky and Sadrzadeh model basic Discourse Representation Structures as a presheaf on a category of contexts — a finite vocabulary of relation symbols with a finite set of variables — and read anaphora resolution as sheaf gluing: the local theories of the parts of a discourse glue along a cover (the choice of which discourse referents to identify) exactly when some global theory restricts to each of them. The presheaf is DRT.presheaf, covers and gluing are DRT.Cover and DRT.Cover.IsGluing, and the paper's reading of a cover as DRT's merge followed by unification of referents is DRT.Cover.coe_conditions_toDRS_glue.

The paper's Proposition 1 says gluings are unique when they exist, its proof building the candidate DRT.Cover.pushforward. Uniqueness holds when every literal of the glued context factors through a cover map (DRT.Cover.IsGluing.unique), as in the first example (snores_unique), but fails on the paper's own second example, where John(b) is invisible to every restriction and may be added to the listed gluing (isGluing_beats_insert, not_isSeparatedFor_beats). What is unique is the least gluing, which glues whenever the vocabularies are pairwise disjoint and the cover maps injective (DRT.Cover.isGluing_glue); the two obstructions otherwise both occur in the paper: overlapping vocabularies in the discussion example (not_exists_isGluing_overlap) and inconsistency when it is merged with John (not_exists_isGluing_merged). The four linguistic examples are decided by kernel computation (isGluing_snores, isGluing_beats, isGluing_grey, isGluing_broke).

The probabilistic half composes the presheaf with the distribution functor distribution R of a semiring R, whose gluing is DRT.Cover.IsGluing (DRT.presheaf L V ⋙ distribution R). The bananas discourse instantiates the paper's ranking of covers by corpus frequencies: pushing the covering distribution forward along the gluing map (gluingDistribution) makes ripe bananas, cheeky monkeys the most likely resolution (gluingDistribution_ripe).

References #

The distribution functor #

def AbramskySadrzadeh2014.Distribution (R : Type r) [AddCommMonoid R] [One R] (S : Type u) :
Type (max u r)

Finitely supported R-weightings of S summing to 1 — the paper's D_R(S).

Equations
Instances For
    noncomputable def AbramskySadrzadeh2014.Distribution.map {R : Type r} [AddCommMonoid R] [One R] {S T : Type u} (f : ST) (d : Distribution R S) :

    The image distribution along a map.

    Equations
    Instances For
      @[simp]
      theorem AbramskySadrzadeh2014.Distribution.map_id {R : Type r} [AddCommMonoid R] [One R] {S : Type u} (d : Distribution R S) :
      map id d = d
      theorem AbramskySadrzadeh2014.Distribution.map_comp {R : Type r} [AddCommMonoid R] [One R] {S T U : Type u} (f : ST) (g : TU) (d : Distribution R S) :
      map (g f) d = map g (map f d)
      noncomputable def AbramskySadrzadeh2014.Distribution.ofWeights {ι : Type u} [Fintype ι] (w : ι) (h : i : ι, w i 0) :

      The distribution proportional to a weighting with nonzero total.

      Equations
      Instances For
        noncomputable def AbramskySadrzadeh2014.distribution (R : Type r) [AddCommMonoid R] [One R] :
        CategoryTheory.Functor (Type u) (Type (max u r))

        The distribution functor D_R.

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

          The paper's examples #

          inductive AbramskySadrzadeh2014.Rel :
          Type

          Relation symbols of the paper's examples, by arity.

          Instances For
            def AbramskySadrzadeh2014.instDecidableEqRel.decEq {a✝ : } (x✝ x✝¹ : Rel a✝) :
            Decidable (x✝ = x✝¹)
            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              @[reducible, inline]
              abbrev AbramskySadrzadeh2014.lang :
              FirstOrder.Language

              The relational language of the examples.

              Equations
              Instances For

                Variables of the paper's examples.

                Instances For
                  @[instance_reducible]
                  Equations
                  def AbramskySadrzadeh2014.lit {c : DRT.Context lang Var} {n : } (r : Rel n) (args : Fin nVar) (pos : Bool := true) (hr : n, r c.vocab := by decide +kernel) (h : ∀ (i : Fin n), args i c.vars := by decide +kernel) :

                  The literal A(x̄), or ¬A(x̄) for pos := false.

                  Equations
                  • AbramskySadrzadeh2014.lit r args pos hr h = { rel := n, r, hr, args := fun (i : Fin (↑n, r, hr).fst) => args i, , pos := pos }
                  Instances For
                    def AbramskySadrzadeh2014.hom {c c' : DRT.Context lang Var} (f : VarVar) (hf : tc.vars, f t c'.vars := by decide +kernel) (hL : c.vocabc'.vocab := by decide +kernel) :
                    c c'

                    The context morphism acting as f on variables.

                    Equations
                    Instances For

                      Example 1: John sleeps. He snores. #

                      @[reducible, inline]

                      The glued context of the first example.

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

                        The cover {x} ↦ z ↤ {y} merging he with John.

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

                          s₁ = {John(x), sleeps(x)}, s₂ = {snores(y)}.

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

                            s = {John(z), sleeps(z), snores(z)}.

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

                              Every literal over {z} factors through the cover, so the gluing is unique.

                              Example 2: John beats his donkey. #

                              @[reducible, inline]

                              The glued context of the second example.

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

                                The cover xa, yb, u ↦ a, vb.

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

                                  s₁ = {John(x)}, s₂ = {donkey(y)}, s₃ = {owns(u, v), beats(u, v)}.

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

                                    s = {John(a), donkey(b), owns(a, b), beats(a, b)}.

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

                                      s ∪ {John(b)}: John(b) factors through no cover map, so adding it changes no restriction and the listed gluing is not unique.

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

                                        Example 3: John owns a donkey. It is grey. #

                                        @[reducible, inline]

                                        The glued context of the third example.

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

                                          The covering contexts of the third example.

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

                                            s₁ = {John(x), Man(x)}, s₂ = {donkey(y), ¬Man(y)}, s₃ = {grey(z)}.

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

                                              The cover merging it with John: xa, ya, zb.

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

                                                Merging x and y forces Man and ¬Man of one referent.

                                                The cover merging it with the donkey: xa, yb, zb.

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

                                                  s = {John(a), Man(a), donkey(b), ¬Man(b), grey(b)}.

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

                                                    Example 4: John put the cup on the plate. He broke it. #

                                                    @[reducible, inline]

                                                    The glued context of the fourth example.

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

                                                      The covering contexts of the fourth example.

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

                                                        s₁ = {John(x), Cup(y), Plate(z), PutOn(x, y, z)}, s₂ = {Broke(u, v)}.

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

                                                          The two plausible antecedents of it.

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

                                                            The cover extending the identity on {x, y, z} by ux and v the chosen antecedent.

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

                                                              {John(x), Cup(y), Plate(z), PutOn(x, y, z), Broke(x, ·)} with the chosen antecedent.

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

                                                                Either choice of antecedent yields a gluing.

                                                                The discussion example: overlapping vocabularies #

                                                                @[reducible, inline]

                                                                The glued context of the discussion example.

                                                                Equations
                                                                Instances For

                                                                  The cover x ↦ z, uw and y ↦ z, vw, both parts carrying the whole vocabulary.

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

                                                                    s₁ = {R(x), S(u)}, s₂ = {S(y), R(v)}.

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

                                                                      The sections are consistent but do not glue: S(z) restricts to S(x) ∉ s₁.

                                                                      Probabilistic anaphora: *John gave the bananas to the monkeys. They were ripe. They were #

                                                                      cheeky.*

                                                                      @[reducible, inline]

                                                                      The glued context of the bananas discourse.

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

                                                                        The covering contexts of the bananas discourse.

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

                                                                          s₁ = {John(x), Banana(y), Monkey(z), Gave(x, y, z)}, s₂ = {Ripe(u)}, s₃ = {Cheeky(v)}.

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

                                                                            The antecedents available to each they.

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

                                                                              The covering c extending the identity on {x, y, z} by u ↦ c.1 and v ↦ c.2.

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

                                                                                The candidate global section t_c induced by the covering c.

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

                                                                                  Each covering weighted by the summed frequencies of its mergings, normalised.

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

                                                                                    The distribution d over global sections: the covering distribution pushed forward along c ↦ t_c.

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

                                                                                      Ripe bananas, cheeky monkeys (t₂) is the most likely resolution, with probability 1/2.