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 #
ToyEntity: the entity domain.toyLang,toyStructure: the signature and its interpretation.toyModel: the one-world composition model.toyWords,toyLexicon: the content words and the lexicon they induce.Toy.logicalWords,toyVocabulary: the logical words, and all the toy words.
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 #
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- HeimKratzer.instReprToyEntity = { reprPrec := HeimKratzer.instReprToyEntity.repr }
Equations
- HeimKratzer.instDecidableEqToyEntity x✝ y✝ = if h : x✝.ctorIdx = y✝.ctorIdx then isTrue ⋯ else isFalse ⋯
Equations
- HeimKratzer.instFintypeToyEntity = { elems := { val := ↑HeimKratzer.ToyEntity.enumList, nodup := HeimKratzer.ToyEntity.enumList_nodup }, complete := HeimKratzer.instFintypeToyEntity._proof_1 }
The function symbols of the toy signature are the constants naming entities.
Instances For
Equations
- HeimKratzer.instDecidableEqToyFunc.decEq HeimKratzer.toyFunc.john HeimKratzer.toyFunc.john = isTrue HeimKratzer.instDecidableEqToyFunc.decEq._proof_1
- HeimKratzer.instDecidableEqToyFunc.decEq HeimKratzer.toyFunc.john HeimKratzer.toyFunc.mary = isFalse HeimKratzer.instDecidableEqToyFunc.decEq._proof_3
- HeimKratzer.instDecidableEqToyFunc.decEq HeimKratzer.toyFunc.mary HeimKratzer.toyFunc.john = isFalse HeimKratzer.instDecidableEqToyFunc.decEq._proof_4
- HeimKratzer.instDecidableEqToyFunc.decEq HeimKratzer.toyFunc.mary HeimKratzer.toyFunc.mary = isTrue HeimKratzer.instDecidableEqToyFunc.decEq._proof_2
Instances For
Equations
- HeimKratzer.instDecidableEqToyRel.decEq HeimKratzer.toyRel.sleep HeimKratzer.toyRel.sleep = isTrue HeimKratzer.instDecidableEqToyRel.decEq._proof_1
- HeimKratzer.instDecidableEqToyRel.decEq HeimKratzer.toyRel.sleep HeimKratzer.toyRel.laugh = isFalse HeimKratzer.instDecidableEqToyRel.decEq._proof_3
- HeimKratzer.instDecidableEqToyRel.decEq HeimKratzer.toyRel.sleep HeimKratzer.toyRel.student = isFalse HeimKratzer.instDecidableEqToyRel.decEq._proof_4
- HeimKratzer.instDecidableEqToyRel.decEq HeimKratzer.toyRel.sleep HeimKratzer.toyRel.person = isFalse HeimKratzer.instDecidableEqToyRel.decEq._proof_5
- HeimKratzer.instDecidableEqToyRel.decEq HeimKratzer.toyRel.sleep HeimKratzer.toyRel.pizza = isFalse HeimKratzer.instDecidableEqToyRel.decEq._proof_6
- HeimKratzer.instDecidableEqToyRel.decEq HeimKratzer.toyRel.laugh HeimKratzer.toyRel.sleep = isFalse HeimKratzer.instDecidableEqToyRel.decEq._proof_7
- HeimKratzer.instDecidableEqToyRel.decEq HeimKratzer.toyRel.laugh HeimKratzer.toyRel.laugh = isTrue HeimKratzer.instDecidableEqToyRel.decEq._proof_2
- HeimKratzer.instDecidableEqToyRel.decEq HeimKratzer.toyRel.laugh HeimKratzer.toyRel.student = isFalse HeimKratzer.instDecidableEqToyRel.decEq._proof_8
- HeimKratzer.instDecidableEqToyRel.decEq HeimKratzer.toyRel.laugh HeimKratzer.toyRel.person = isFalse HeimKratzer.instDecidableEqToyRel.decEq._proof_9
- HeimKratzer.instDecidableEqToyRel.decEq HeimKratzer.toyRel.laugh HeimKratzer.toyRel.pizza = isFalse HeimKratzer.instDecidableEqToyRel.decEq._proof_10
- HeimKratzer.instDecidableEqToyRel.decEq HeimKratzer.toyRel.student HeimKratzer.toyRel.sleep = isFalse HeimKratzer.instDecidableEqToyRel.decEq._proof_11
- HeimKratzer.instDecidableEqToyRel.decEq HeimKratzer.toyRel.student HeimKratzer.toyRel.laugh = isFalse HeimKratzer.instDecidableEqToyRel.decEq._proof_12
- HeimKratzer.instDecidableEqToyRel.decEq HeimKratzer.toyRel.student HeimKratzer.toyRel.student = isTrue HeimKratzer.instDecidableEqToyRel.decEq._proof_29
- HeimKratzer.instDecidableEqToyRel.decEq HeimKratzer.toyRel.student HeimKratzer.toyRel.person = isFalse HeimKratzer.instDecidableEqToyRel.decEq._proof_13
- HeimKratzer.instDecidableEqToyRel.decEq HeimKratzer.toyRel.student HeimKratzer.toyRel.pizza = isFalse HeimKratzer.instDecidableEqToyRel.decEq._proof_14
- HeimKratzer.instDecidableEqToyRel.decEq HeimKratzer.toyRel.person HeimKratzer.toyRel.sleep = isFalse HeimKratzer.instDecidableEqToyRel.decEq._proof_15
- HeimKratzer.instDecidableEqToyRel.decEq HeimKratzer.toyRel.person HeimKratzer.toyRel.laugh = isFalse HeimKratzer.instDecidableEqToyRel.decEq._proof_16
- HeimKratzer.instDecidableEqToyRel.decEq HeimKratzer.toyRel.person HeimKratzer.toyRel.student = isFalse HeimKratzer.instDecidableEqToyRel.decEq._proof_17
- HeimKratzer.instDecidableEqToyRel.decEq HeimKratzer.toyRel.person HeimKratzer.toyRel.person = isTrue HeimKratzer.instDecidableEqToyRel.decEq._proof_30
- HeimKratzer.instDecidableEqToyRel.decEq HeimKratzer.toyRel.person HeimKratzer.toyRel.pizza = isFalse HeimKratzer.instDecidableEqToyRel.decEq._proof_18
- HeimKratzer.instDecidableEqToyRel.decEq HeimKratzer.toyRel.pizza HeimKratzer.toyRel.sleep = isFalse HeimKratzer.instDecidableEqToyRel.decEq._proof_19
- HeimKratzer.instDecidableEqToyRel.decEq HeimKratzer.toyRel.pizza HeimKratzer.toyRel.laugh = isFalse HeimKratzer.instDecidableEqToyRel.decEq._proof_20
- HeimKratzer.instDecidableEqToyRel.decEq HeimKratzer.toyRel.pizza HeimKratzer.toyRel.student = isFalse HeimKratzer.instDecidableEqToyRel.decEq._proof_21
- HeimKratzer.instDecidableEqToyRel.decEq HeimKratzer.toyRel.pizza HeimKratzer.toyRel.person = isFalse HeimKratzer.instDecidableEqToyRel.decEq._proof_22
- HeimKratzer.instDecidableEqToyRel.decEq HeimKratzer.toyRel.pizza HeimKratzer.toyRel.pizza = isTrue HeimKratzer.instDecidableEqToyRel.decEq._proof_31
- HeimKratzer.instDecidableEqToyRel.decEq HeimKratzer.toyRel.see HeimKratzer.toyRel.see = isTrue HeimKratzer.instDecidableEqToyRel.decEq._proof_32
- HeimKratzer.instDecidableEqToyRel.decEq HeimKratzer.toyRel.see HeimKratzer.toyRel.eat = isFalse HeimKratzer.instDecidableEqToyRel.decEq._proof_23
- HeimKratzer.instDecidableEqToyRel.decEq HeimKratzer.toyRel.see HeimKratzer.toyRel.read = isFalse HeimKratzer.instDecidableEqToyRel.decEq._proof_24
- HeimKratzer.instDecidableEqToyRel.decEq HeimKratzer.toyRel.eat HeimKratzer.toyRel.see = isFalse HeimKratzer.instDecidableEqToyRel.decEq._proof_25
- HeimKratzer.instDecidableEqToyRel.decEq HeimKratzer.toyRel.eat HeimKratzer.toyRel.eat = isTrue HeimKratzer.instDecidableEqToyRel.decEq._proof_33
- HeimKratzer.instDecidableEqToyRel.decEq HeimKratzer.toyRel.eat HeimKratzer.toyRel.read = isFalse HeimKratzer.instDecidableEqToyRel.decEq._proof_26
- HeimKratzer.instDecidableEqToyRel.decEq HeimKratzer.toyRel.read HeimKratzer.toyRel.see = isFalse HeimKratzer.instDecidableEqToyRel.decEq._proof_27
- HeimKratzer.instDecidableEqToyRel.decEq HeimKratzer.toyRel.read HeimKratzer.toyRel.eat = isFalse HeimKratzer.instDecidableEqToyRel.decEq._proof_28
- HeimKratzer.instDecidableEqToyRel.decEq HeimKratzer.toyRel.read HeimKratzer.toyRel.read = isTrue HeimKratzer.instDecidableEqToyRel.decEq._proof_34
Instances For
The toy signature has the toy constants as function symbols and the toy content words as relation symbols.
Equations
- HeimKratzer.toyLang = { Functions := HeimKratzer.toyFunc, Relations := HeimKratzer.toyRel }
Instances For
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
- HeimKratzer.toyModel = { E := HeimKratzer.ToyEntity, W := Unit, interp := fun (x : Unit) => HeimKratzer.toyStructure }
Instances For
The per-symbol abbreviations have the types toyLang.Constants and toyLang.Relations n, so
symbols elaborate without unfolding toyLang.
Instances For
Instances For
Equations
Instances For
Equations
Instances For
Instances For
Instances For
Equations
Instances For
Equations
Instances For
Equations
Instances For
Equations
Instances For
The denotations of the toy content words are read off the model at its one world.
Instances For
Instances For
Instances For
Instances For
Instances For
Instances For
The toy content words translate to the symbols of the toy signature.
Equations
- HeimKratzer.toyWords "John" = some ⟨Montague.Ty.e, HeimKratzer.FirstOrderConstant.name HeimKratzer.Toy.johnConst⟩
- HeimKratzer.toyWords "Mary" = some ⟨Montague.Ty.e, HeimKratzer.FirstOrderConstant.name HeimKratzer.Toy.maryConst⟩
- HeimKratzer.toyWords "sleeps" = some ⟨Montague.Ty.e ⇒ Montague.Ty.t, HeimKratzer.FirstOrderConstant.rel₁ HeimKratzer.Toy.sleepRel⟩
- HeimKratzer.toyWords "laughs" = some ⟨Montague.Ty.e ⇒ Montague.Ty.t, HeimKratzer.FirstOrderConstant.rel₁ HeimKratzer.Toy.laughRel⟩
- HeimKratzer.toyWords "student" = some ⟨Montague.Ty.e ⇒ Montague.Ty.t, HeimKratzer.FirstOrderConstant.rel₁ HeimKratzer.Toy.studentRel⟩
- HeimKratzer.toyWords "person" = some ⟨Montague.Ty.e ⇒ Montague.Ty.t, HeimKratzer.FirstOrderConstant.rel₁ HeimKratzer.Toy.personRel⟩
- HeimKratzer.toyWords "pizza" = some ⟨Montague.Ty.e ⇒ Montague.Ty.t, HeimKratzer.FirstOrderConstant.rel₁ HeimKratzer.Toy.pizzaRel⟩
- HeimKratzer.toyWords "sees" = some ⟨Montague.Ty.e ⇒ Montague.Ty.e ⇒ Montague.Ty.t, HeimKratzer.FirstOrderConstant.rel₂ HeimKratzer.Toy.seeRel⟩
- HeimKratzer.toyWords "eats" = some ⟨Montague.Ty.e ⇒ Montague.Ty.e ⇒ Montague.Ty.t, HeimKratzer.FirstOrderConstant.rel₂ HeimKratzer.Toy.eatRel⟩
- HeimKratzer.toyWords "reads" = some ⟨Montague.Ty.e ⇒ Montague.Ty.e ⇒ Montague.Ty.t, HeimKratzer.FirstOrderConstant.rel₂ HeimKratzer.Toy.readRel⟩
- HeimKratzer.toyWords x✝ = none
Instances For
The toy lexicon is the lexicon the toy words induce over the toy model.
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.
The English logical words translate to the logical first-order constants.
Equations
- HeimKratzer.Toy.logicalWords "every" = some ⟨Montague.Ty.det, HeimKratzer.FirstOrderConstant.every⟩
- HeimKratzer.Toy.logicalWords "some" = some ⟨Montague.Ty.det, HeimKratzer.FirstOrderConstant.some⟩
- HeimKratzer.Toy.logicalWords "no" = some ⟨Montague.Ty.det, HeimKratzer.FirstOrderConstant.no⟩
- HeimKratzer.Toy.logicalWords "not" = some ⟨Montague.Ty.t ⇒ Montague.Ty.t, HeimKratzer.FirstOrderConstant.neg⟩
- HeimKratzer.Toy.logicalWords "and" = some ⟨Montague.Ty.t ⇒ Montague.Ty.t ⇒ Montague.Ty.t, HeimKratzer.FirstOrderConstant.conj⟩
- HeimKratzer.Toy.logicalWords "or" = some ⟨Montague.Ty.t ⇒ Montague.Ty.t ⇒ Montague.Ty.t, HeimKratzer.FirstOrderConstant.disj⟩
- HeimKratzer.Toy.logicalWords x✝ = none
Instances For
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.