Semantic Equivalence and Spurious Ambiguity #
CCG derivations fall into equivalence classes: multiple derivations yield identical interpretations due to the associativity of functional composition. This is sometimes called "spurious ambiguity" — but it's not really ambiguity, since all derivations in an equivalence class have the same meaning.
Key concepts #
- Semantic equivalence — two derivations are equivalent iff they have the same category and the same meaning.
- Source of equivalence — the
Bcombinator is associative (B (B f g) h = B f (B g h)), so(f ∘ g) ∘ h = f ∘ (g ∘ h)in the semantics. - Equivalence classes — for a string of
nwords there areCatalan(n-1)binary bracketings, all yielding the same meaning if built purely from composition. - Processing — a parser need only find one derivation per equivalence class.
Two derivations are semantically equivalent iff they span the same substring, have the same category, and have the same meaning.
This defines equivalence for "spurious ambiguity" analysis.
- cat : Cat
First derivation's category
- meaning₁ : Intensional.Denot E W (catToTy self.cat)
First derivation's meaning
- meaning₂ : Intensional.Denot E W (catToTy self.cat)
Second derivation's meaning
The meanings are equal
Instances For
Semantic equivalence for category-meaning pairs.
Equations
- CCG.Equivalence.semanticallyEquivalent cm₁ cm₂ = ∃ (h : cm₁.fst = cm₂.fst), h ▸ cm₁.snd = cm₂.snd
Instances For
Semantic equivalence is reflexive.
Semantic equivalence is symmetric.
Semantic equivalence is transitive.
B (composition) is associative: (f ∘ g) ∘ h = f ∘ (g ∘ h)
Associativity stated pointwise.
Consequence: Two ways of composing three functions yield the same result.
This is why "Harry thinks that Anna married" can be derived by:
- (Harry ∘ thinks) ∘ (that ∘ (Anna ∘ married))
- Harry ∘ (thinks ∘ that) ∘ (Anna ∘ married)
- Harry ∘ (thinks ∘ (that ∘ Anna)) ∘ married ... etc.
All yield the same predicate-argument structure.
A chart entry: category + meaning for a span.
- leftPos : ℕ
- rightPos : ℕ
- cat : Cat
- meaning : Intensional.Denot E W (catToTy self.cat)
Instances For
Two chart entries match if they have the same span, category, and meaning.
Equations
Instances For
The matching relation is decidable for categories (not meanings in general).
Equations
Instances For
An equivalence class of derivations: all have the same meaning.
- cat : Cat
- meaning : Intensional.Denot E W (catToTy self.cat)
Instances For
Real ambiguity: multiple equivalence classes for the same string.
Equations
- CCG.Equivalence.reallyAmbiguous classes = (classes.length > 1)
Instances For
Spuriously ambiguous: multiple derivations but only one equivalence class.
Equations
- CCG.Equivalence.spuriouslyAmbiguous derivCount classes = (derivCount > 1 ∧ classes.length = 1)