Type-driven interpretation #
This file is the composition engine of Heim and Kratzer's type-driven interpretation, with the
intensional application of von Fintel and Heim and the event identification of Kratzer
(eventIdentification), parameterized over an effect functor M in the style of Bumford and
Charlow. A node denotes an M-computation in the domain of its semantic type,
a Denotation, and each composition principle lifts through the Applicative structure of
M, so the pure Heim and Kratzer engine is the instance M = Id. A terminal node denotes
what its leaf interpretation gives it, a string in a Lexicon or a fragment carrier through
its readings; a non-branching node denotes what its daughter does; a binary node composes by
functional application in either order, then intensional functional application, then
predicate modification, then event identification, whichever the daughters' types admit first;
a trace denotes its index's value under the assignment; and a binder abstracts over its index
by Predicate Abstraction, which is a capability of the effect (PredAbs) rather than a given.
A tree is interpreted by evaluating its translation (Composition/Term.lean): the composition
modes are the typed operations of Composition/Mode.lean, selected by the daughters' types
alone, and interp is the evaluation of the term a tree translates to. Each equation of the
engine is then a fact about that evaluation, and the pure engine is the denotation of the term
(interp_eq_eval_translate).
Main declarations #
interpinterprets a tree under an assignment, over any leaf type, as the evaluation of its translation; a binary node composes byMontague.Ty.mode?(interp_node_binary).tyBinaryis the type a binary node composes to, a function of the daughters' types alone.ty?is the type a tree composes to, a function of the types of its leaves alone, and the type of its denotation (interp_map_fst).interp_congr_of_agreeand its corollaries are Heim and Kratzer's theorems on variable binding: interpretability and the composed type never depend on the assignment (interp_map_fst_congr), and a tree's denotation depends on it only at the traces free in the tree.readingscomposes a lexicon of sets of readings, the values the engine computes over the tree's resolutions; the engine on an unambiguous lexicon is the special case (readings_eq_of_choice) and a binary node's readings compose pointwise (mem_readings_node_binary).interp_eq_eval_translate: the pure engine is the denotation of the tree's term.
Implementation notes #
Binary nodes sequence effects in linear order, the left daughter's first whichever daughter is
the function, so at M = Cont R surface scope is the default reading and inverse scope needs
a reordered evaluation (Composition/Cont.lean). Predicate Abstraction needs a distributor
(E → M (Ty.Domain ty)) → M (E → Ty.Domain ty), which scope effects lack, so under them .bind
nodes fail and binding comes from the order of effects instead; making the distributor optional
turns that rivalry into a fact instance resolution checks. The abstraction's fallback value
valueAt is never reached, since types do not depend on the assignment. The category parameter
of a tree is ignored, composition being type-driven.
References #
The pure engine computes in Id, whose applicative operations are application. The lemmas
are simp lemmas in this namespace only, since they identify Id α with α.
The value of an interpreted daughter at the type τ, with the default v where the
daughter is uninterpretable or of another type. Types do not depend on the assignment
(interp_map_fst_congr), so under Predicate Abstraction the default is never reached
(valueAt_of_map_fst).
Equations
- HeimKratzer.Tree.valueAt τ v (some ⟨ty, val⟩) = if h : ty = τ then h ▸ val else v
- HeimKratzer.Tree.valueAt τ v none = v
Instances For
Tree interpretation #
The denotation of a term whose constants are denotations, at its type.
Equations
- One or more equations did not get rendered due to their size.
Instances For
In the denotation of a tree under an assignment, by the composition principles of [HK98], a terminal denotes what its leaf interpretation gives it, a non-branching node what its daughter does, a binary node what the mode its daughters' types select composes, a trace the value of its index, and a binder the abstraction over its index, when the effect has a distributor. It is the denotation of the tree's term, each word's denotation its constant.
Equations
- HeimKratzer.Tree.interp lex g t = (HeimKratzer.Tree.translate lex t).bind (HeimKratzer.Tree.evalAt g)
Instances For
Reduction lemmas #
One @[simp] lemma per constructor, so that a derivation reduces by simp toward its
composed denotation.
A node whose daughters its label does not license denotes nothing.
The type of a tree #
The type a tree composes to is a function of the types of its leaves: ty? computes it by the
recursion of interp, with tyBinary at the binary nodes, and interp_map_fst is the
agreement. Interpretability is therefore decided by the types of the leaves alone.
The type two daughters compose to, the mother's type under the mode their types select.
Equations
- HeimKratzer.Tree.tyBinary σ τ = Option.map (fun (x : (τ_1 : Montague.Ty) × HeimKratzer.Mode σ τ τ_1) => x.fst) (σ.mode? τ)
Instances For
The type a tree composes to, from the types lexTy gives its leaves, with abs saying
whether the effect supports Predicate Abstraction.
Equations
- One or more equations did not get rendered due to their size.
- HeimKratzer.Tree.ty? lexTy abs (RoseTree.node (PhraseStructure.Tree.Label.terminal a w) []) = lexTy w
- HeimKratzer.Tree.ty? lexTy abs (RoseTree.node (PhraseStructure.Tree.Label.node a) [t]) = HeimKratzer.Tree.ty? lexTy abs t
- HeimKratzer.Tree.ty? lexTy abs (RoseTree.node (PhraseStructure.Tree.Label.node a) children) = none
- HeimKratzer.Tree.ty? lexTy abs (RoseTree.node (PhraseStructure.Tree.Label.segment a) [t]) = HeimKratzer.Tree.ty? lexTy abs t
- HeimKratzer.Tree.ty? lexTy abs (RoseTree.node (PhraseStructure.Tree.Label.segment a) children) = none
- HeimKratzer.Tree.ty? lexTy abs (RoseTree.node (PhraseStructure.Tree.Label.trace a a_1) []) = some Montague.Ty.e
- HeimKratzer.Tree.ty? lexTy abs (RoseTree.node (PhraseStructure.Tree.Label.bind a a_1) [body]) = if abs = true then Option.map Montague.Ty.e.fn (HeimKratzer.Tree.ty? lexTy abs body) else none
- HeimKratzer.Tree.ty? lexTy abs x✝ = none
Instances For
A node whose daughters its label does not license has no type.
The type of a tree's denotation is the type ty? computes from the types of its leaves.
A tree is interpretable exactly when the types of its leaves give it a type.
Assignment dependence and free variables #
[HK98]'s theorems on variable binding (§5.4.2): the denotation of a tree depends
on the assignment only at the traces free in it. Interpretability and the type composed do not
depend on the assignment at all (interp_map_fst_congr), so with total assignments their
theorem (9), that a tree with no free occurrence of the index i denotes alike under an
assignment and its modification at i, is interp_update_of_not_mem_freeIndices, and their
(10), that a closed tree denotes alike under every assignment, is interp_congr_of_closed.
Whether a tree is interpretable, and at which type, does not depend on the assignment.
Assignments agreeing on the traces free in a tree give it the same denotation, the coincidence theorem ([HK98] §5.4.2).
By [HK98]'s (9), a tree with no free trace at index i denotes alike under an
assignment and its modification at i.
By [HK98]'s (10), a closed tree denotes alike under every assignment.
Readings of an ambiguous lexicon #
A word may have several available readings. A resolution of a tree chooses one reading for
each occurrence of a word, and the readings of the tree are the values the engine computes
over its resolutions. The engine on a lexicon with one reading per word is the special case
(readings_eq_of_choice), and a binary node's readings are the pointwise compositions of its
daughters' (mem_readings_node_binary).
Interpretation commutes with relabelling the leaves.
The readings of a tree under a leaf interpretation giving each word a set of readings, the values the engine computes over the resolutions of the tree, each occurrence of a word resolved to one of its readings.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A value the engine computes under a choice of readings is the value of a resolved tree.
A value the engine computes under a choice among the readings is a reading.
On a lexicon with one reading per word, the readings are the engine's values.
A binary node's readings are the pointwise compositions of its daughters'.
Interpretation is evaluation of the translation #
Interpreting a tree whose words denote what an interpretation I of their constants gives
is evaluating the tree's term under I.