Documentation

Linglib.Semantics.Composition.Toy

A toy model for type-driven composition #

toyModel is a small extensional model for exercising the composition engine, with four entities (John, Mary, a pizza and a book), one world, and a signature of two constants and eight content relations, which toyStructure interprets as equalities on the entities. The fragment is of the kind Heim and Kratzer interpret in their textbook, with proper names, intransitive and transitive verbs, and common nouns. The words toyWords translate English word forms to symbols, and the lexicon toyLexicon and the denotations Toy.sleeps, Toy.sees, … are read off the model; with the logical words, quantified trees translate to logical forms that read back to first-order formulas.

Main definitions #

Implementation notes #

The signature follows mathlib's concrete-language idiom (Mathlib/ModelTheory/Algebra/Ring/Basic.lean), with arity-indexed symbol inductives and per-symbol abbreviations in Toy. The structure is a closed term, so a claim about particular entities reduces by rfl to an equality on ToyEntity. Binary relations take the subject first in the structure and the object first as transitive-verb denotations, as Model.pred₂ does.

References #

The entities of the toy model are John, Mary, a pizza and a book.

Instances For
    def HeimKratzer.instReprToyEntity.repr :
    ToyEntity → ℕ → Std.Format
    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      @[instance_reducible]
      Equations
      inductive HeimKratzer.toyFunc :
      ℕ → Type

      The function symbols of the toy signature are the constants naming entities.

      Instances For
        inductive HeimKratzer.toyRel :
        ℕ → Type

        The relation symbols of the toy signature are the content words at their arities.

        Instances For
          def HeimKratzer.instDecidableEqToyRel.decEq {a✝ : ℕ} (x✝ x✝¹ : toyRel a✝) :
          Decidable (x✝ = x✝¹)
          Equations
          Instances For
            def HeimKratzer.toyLang :
            FirstOrder.Language

            The toy signature has the toy constants as function symbols and the toy content words as relation symbols.

            Equations
            Instances For
              @[reducible, inline]

              In the toy structure the names denote their entities, John sleeps, John and Mary laugh and are the students and the persons, the pizza is the one pizza, John and Mary see each other, and both eat the pizza and read the book. Binary relations take the subject first.

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

                The toy composition model is extensional, with the toy structure at its one world.

                Equations
                Instances For

                  The per-symbol abbreviations have the types toyLang.Constants and toyLang.Relations n, so symbols elaborate without unfolding toyLang.

                  @[reducible, inline]
                  Equations
                  Instances For
                    @[reducible, inline]
                    Equations
                    Instances For
                      @[reducible, inline]
                      abbrev HeimKratzer.Toy.sleepRel :
                      toyLang.Relations 1
                      Equations
                      Instances For
                        @[reducible, inline]
                        abbrev HeimKratzer.Toy.laughRel :
                        toyLang.Relations 1
                        Equations
                        Instances For
                          @[reducible, inline]
                          Equations
                          Instances For
                            @[reducible, inline]
                            Equations
                            Instances For
                              @[reducible, inline]
                              abbrev HeimKratzer.Toy.pizzaRel :
                              toyLang.Relations 1
                              Equations
                              Instances For
                                @[reducible, inline]
                                abbrev HeimKratzer.Toy.seeRel :
                                toyLang.Relations 2
                                Equations
                                Instances For
                                  @[reducible, inline]
                                  abbrev HeimKratzer.Toy.eatRel :
                                  toyLang.Relations 2
                                  Equations
                                  Instances For
                                    @[reducible, inline]
                                    abbrev HeimKratzer.Toy.readRel :
                                    toyLang.Relations 2
                                    Equations
                                    Instances For

                                      The denotations of the toy content words are read off the model at its one world.

                                      def HeimKratzer.toyWords :
                                      String → Option ((ty : Montague.Ty) × FirstOrderConstant toyLang ty)

                                      The toy content words translate to the symbols of the toy signature.

                                      Equations
                                      Instances For

                                        The toy lexicon is the lexicon the toy words induce over the toy model.

                                        Equations
                                        Instances For

                                          The toy lexicon has entries of the three first-order lexical types only.

                                          Logical forms and their readback #

                                          With the logical words, a quantifier-raised tree translates to its logical form, with the mode at each node, and the logical form reads back to the first-order formula of its truth conditions.

                                          def HeimKratzer.toyVocabulary (s : String) :
                                          Option ((ty : Montague.Ty) × FirstOrderConstant toyLang ty)

                                          The toy vocabulary translates the toy content words and the logical words.

                                          Equations
                                          Instances For

                                            Every student sleeps, with the subject raised over the trace of index 1.

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

                                              In the logical form of every student sleeps the determiner applies forward to the noun and to the abstraction over the trace, which the verb applies backward to.

                                              In every student who sleeps laughs the relative clause abstracts over its trace and intersects with the noun by predicate modification.

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