CCG Syntax-Semantics Interface #
This file defines the compositional interpretation of CCG derivations. Categories
encode semantic types (catToTy, which ignores slash modalities — they control
combinatory potential, not meaning), and because Derivation is intrinsically typed,
Derivation.interp needs no run-time category checks and no casts: application is
function application and every composition rule is a B-combinator composition of
the daughters' meanings ([Ste19]). Type-raising and coordination are lexical,
so their semantic action (T, generalized conjunction) enters through the lexicon.
A lexicon is well-typed by construction — it returns meanings at the queried
category — so soundness of the interface is a typing fact rather than a theorem.
Main definitions #
catToTy: maps CCG categories to semantic types.SemLexicon: a semantic lexicon — for each word and category, optionally a meaning at that category.Derivation.interp: the meaning of a derivation of categoryc, at typecatToTy c;noneonly when a word is missing from the lexicon.
Main statements #
Derivation.interp_fcomp_assoc,Derivation.interp_fapp_fcomp(and backward mirrors): spurious ambiguity — reassociating a composition-application chain cannot change a constituent's interpretation ([Ste00a]; the matching-entry tests of [Kar89] and [PS87a] exploit exactly this invariance).
Worked toy-fragment derivations and the non-constituent-coordination semantics
theorems live in Studies/Steedman2000.lean.
Type correspondence #
Map CCG categories to semantic types. Slash modalities are ignored: they control combinatory potential, not meaning.
Equations
- CCG.catToTy (CCG.Cat.atom CCG.Atom.S) = Intensional.Ty.t
- CCG.catToTy (CCG.Cat.atom CCG.Atom.NP) = Intensional.Ty.e
- CCG.catToTy (CCG.Cat.atom CCG.Atom.N) = (Intensional.Ty.e ⇒ Intensional.Ty.t)
- CCG.catToTy (CCG.Cat.atom CCG.Atom.PP) = (Intensional.Ty.e ⇒ Intensional.Ty.t)
- CCG.catToTy (x_1.rslash a y) = (CCG.catToTy y ⇒ CCG.catToTy x_1)
- CCG.catToTy (x_1.lslash a y) = (CCG.catToTy y ⇒ CCG.catToTy x_1)
Instances For
Type correspondence for transitive verbs
Type correspondence for intransitive verbs
Derivation interpretation #
Semantic lexicon: for each word and queried category, optionally a meaning at that
category — well-typed by construction. Raised and coordinating entries carry their
semantic action here (T, generalized conjunction), per the morpholexical treatment
of [Ste19].
Equations
- CCG.SemLexicon E W = (String → (c : CCG.Cat CCG.Atom) → Option (Intensional.Denot E W (CCG.catToTy c)))
Instances For
The semantic action of a rule — the "rule-to-rule relation" of [Ste19]:
application applies, every composition rule is a B-combinator composition of the
daughters' meanings (second-order rules compose under one argument).
Equations
- CCG.Rule.fapp.sem f x✝ = f x✝
- CCG.Rule.bapp.sem x✝ f = f x✝
- (CCG.Rule.fcomp h).sem f g = Combinator.B f g
- (CCG.Rule.bcomp h).sem g f = Combinator.B f g
- (CCG.Rule.fcompx h).sem f g = Combinator.B f g
- (CCG.Rule.bcompx h).sem g f = Combinator.B f g
- (CCG.Rule.fcomp2 h).sem f g = fun (w : Intensional.Denot E W (CCG.catToTy w)) (z : Intensional.Denot E W (CCG.catToTy z)) => f (g w z)
- (CCG.Rule.bcomp2 h).sem g f = fun (w : Intensional.Denot E W (CCG.catToTy w)) (z : Intensional.Denot E W (CCG.catToTy z)) => f (g w z)
- (CCG.Rule.fcompx2 h).sem f g = fun (w : Intensional.Denot E W (CCG.catToTy w)) (z : Intensional.Denot E W (CCG.catToTy z)) => f (g w z)
- (CCG.Rule.bcompx2 h).sem g f = fun (w : Intensional.Denot E W (CCG.catToTy w)) (z : Intensional.Denot E W (CCG.catToTy z)) => f (g w z)
Instances For
Interpret a derivation compositionally: leaves consult the lexicon and each rule
node acts by its Rule.sem. The category bookkeeping is carried by Derivation's
index, so no run-time category checks (and no casts) are needed; the result is none
only when a word is missing from the lexicon.
Equations
- CCG.Derivation.interp lex (CCG.Derivation.lex f x✝) = lex f x✝
- CCG.Derivation.interp lex (CCG.Derivation.node ru d₁ d₂) = do let __do_lift ← CCG.Derivation.interp lex d₁ let __do_lift_1 ← CCG.Derivation.interp lex d₂ some (ru.sem __do_lift __do_lift_1)
Instances For
Spurious ambiguity #
Composition is semantically associative, so left- and right-branching derivations of
the same composition-application chain receive the same interpretation — with no
assumption on the lexicon. This is the local source of CCG's "spurious ambiguity"
([Ste00a]; the matching-entry tests of [Kar89] and
[PS87a] exploit exactly this invariance): a chart parser may keep
one derivation per equivalence class, because reassociating fcomp/fapp (or
bcomp/bapp) nodes cannot change what a constituent means.
Reassociating a forward-composition chain preserves interpretation: B is
semantically associative.
Composing before applying is the same as applying twice: B f g x = f (g x),
lifted to derivations.
Reassociating a backward-composition chain preserves interpretation — the mirror
of interp_fcomp_assoc.
Applying twice is the same as backward-composing first — the mirror of
interp_fapp_fcomp.