Map CCG categories to semantic types
Equations
- CCG.catToTy (CCG.Cat.atom CCG.Atom.S) = Semantics.Montague.Ty.t
- CCG.catToTy (CCG.Cat.atom CCG.Atom.NP) = Semantics.Montague.Ty.e
- CCG.catToTy (CCG.Cat.atom CCG.Atom.N) = (Semantics.Montague.Ty.e ⇒ Semantics.Montague.Ty.t)
- CCG.catToTy (CCG.Cat.atom CCG.Atom.PP) = (Semantics.Montague.Ty.e ⇒ Semantics.Montague.Ty.t)
- CCG.catToTy (x_1.rslash y) = (CCG.catToTy y ⇒ CCG.catToTy x_1)
- CCG.catToTy (x_1.lslash y) = (CCG.catToTy y ⇒ CCG.catToTy x_1)
Instances For
A CCG lexical entry with semantics
Instances For
Semantic lexicon for the toy model
Equations
- One or more equations did not get rendered due to their size.
Instances For
Instances For
Instances For
Equations
Instances For
Instances For
Instances For
Equations
Instances For
Instances For
Instances For
Instances For
Instances For
Instances For
A sentence is true if its meaning is true
Equations
- CCG.sentenceTrue meaning = (meaning = true)
Instances For
Type correspondence for transitive verbs
Type correspondence for intransitive verbs
A semantic derivation: pairs a CCG category with its meaning. This represents a node in the derivation tree with its semantic interpretation.
- cat : Cat
Instances For
Apply a function meaning to an argument meaning
Equations
- CCG.applyMeaning f x = f x
Instances For
Composition is function application
For a lexical entry, we can always extract its meaning.
If we have meanings for functor and argument with compatible types, we can compute the meaning of the result.
The complete derivation of "John sees Mary" preserving types
The derivation of "Mary sleeps" preserving types
Forward application satisfies the homomorphism: ⟦fapp(f, a)⟧ = ⟦f⟧(⟦a⟧)
The semantic interpretation of syntactic combination is function application.
Backward application satisfies the homomorphism: ⟦bapp(a, f)⟧ = ⟦f⟧(⟦a⟧)
The order of arguments in syntax doesn't affect semantic composition.
Semantic lexicon: maps words to interpretations
Equations
- CCG.SemLexicon m = (String → CCG.Cat → Option (CCG.Interp m))
Instances For
The toy semantic lexicon
Equations
- One or more equations did not get rendered due to their size.
- CCG.toySemLexicon "John" (CCG.Cat.atom CCG.Atom.NP) = some { cat := CCG.NP, meaning := Semantics.Montague.ToyEntity.john }
- CCG.toySemLexicon "Mary" (CCG.Cat.atom CCG.Atom.NP) = some { cat := CCG.NP, meaning := Semantics.Montague.ToyEntity.mary }
- CCG.toySemLexicon "beans" (CCG.Cat.atom CCG.Atom.NP) = some { cat := CCG.NP, meaning := Semantics.Montague.ToyEntity.pizza }
- CCG.toySemLexicon "sleeps" ((CCG.Cat.atom CCG.Atom.S).lslash (CCG.Cat.atom CCG.Atom.NP)) = some { cat := CCG.IV, meaning := Semantics.Montague.ToyLexicon.sleeps_sem }
- CCG.toySemLexicon "laughs" ((CCG.Cat.atom CCG.Atom.S).lslash (CCG.Cat.atom CCG.Atom.NP)) = some { cat := CCG.IV, meaning := Semantics.Montague.ToyLexicon.laughs_sem }
- CCG.toySemLexicon word cat = none
Instances For
Interpret a CCG derivation, computing its meaning from the lexicon.
Returns none if the derivation is ill-formed or uses unknown words.
Equations
- One or more equations did not get rendered due to their size.
- (CCG.DerivStep.lex entry).interp lex = lex entry.form entry.cat
- (d_2.ftr t).interp lex = do let __discr ← d_2.interp lex match __discr with | { cat := x, meaning := m } => some { cat := CCG.forwardTypeRaise x t, meaning := CCG.T✝ m }
- (d_2.btr t).interp lex = do let __discr ← d_2.interp lex match __discr with | { cat := x, meaning := m } => some { cat := CCG.backwardTypeRaise x t, meaning := CCG.T✝ m }
Instances For
Helper to extract meaning from interpretation result
Equations
- CCG.getMeaning (some { cat := CCG.Cat.atom CCG.Atom.S, meaning := m }) = some m
- CCG.getMeaning result = none
Instances For
Interpretation of "John sleeps" produces correct truth value
Interpretation of "John sees Mary" produces correct truth value
Type-raised "John": John:NP → S/(S\NP) via forward type-raising
Equations
- CCG.john_typeraised = (CCG.DerivStep.lex { form := "John", cat := CCG.NP }).ftr CCG.S
Instances For
"John sees Mary" via type-raising: John sees Mary NP (S\NP)/NP NP ↓T(S) S/(S\NP) (S\NP)/NP NP └────>────────┘ S\NP └──────>──────────────────────┘ S Note: Type-raised subject uses FORWARD application (it's S/(S\NP), seeking S\NP to its right)
Equations
- CCG.john_sees_mary_via_tr = CCG.john_typeraised.fapp ((CCG.DerivStep.lex { form := "sees", cat := CCG.TV }).fapp (CCG.DerivStep.lex { form := "Mary", cat := CCG.NP }))
Instances For
Type-raised derivation produces correct truth value
"John likes" as S/NP via type-raising + composition (for coordination): John likes NP (S\NP)/NP ↓T(S) S/(S\NP) └──────>B────┘ S/NP
This is the constituent that can coordinate with "Mary hates" in "John likes and Mary hates beans".
Equations
- CCG.john_likes_composed = CCG.john_typeraised.fcomp (CCG.DerivStep.lex { form := "likes", cat := CCG.TV })
Instances For
THE COORDINATION SEMANTICS THEOREM
The interpretation of non-constituent coordination "John likes and Mary hates beans" is semantically well-formed (produces a truth value).
This is non-trivial because it requires:
- Type-raising (T combinator)
- Forward composition (B combinator)
- Generalized conjunction (pointwise ∧)
- Forward application
All four operations must compose correctly for the derivation to succeed.
Extract the meaning of a coordination derivation as a function.
For an S/NP derivation (like "John likes and Mary hates"), the meaning is a predicate on entities.
Equations
- CCG.getPredicateMeaning (some { cat := (CCG.Cat.atom CCG.Atom.S).rslash (CCG.Cat.atom CCG.Atom.NP), meaning := m }) = some m
- CCG.getPredicateMeaning result = none
Instances For
Helper to extract predicate from coordination result.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Helper to compute pointwise conjunction of two predicate meanings.
Equations
- One or more equations did not get rendered due to their size.
Instances For
THE POINTWISE CONJUNCTION THEOREM
The meaning of "John likes and Mary hates" (category S/NP) is the pointwise conjunction of "John likes" and "Mary hates".
That is: ⟦John likes and Mary hates⟧(x) = ⟦John likes⟧(x) ∧ ⟦Mary hates⟧(x)
This is the semantic counterpart to the syntactic coordination rule.
THE TRUTH-CONDITIONAL CORRECTNESS THEOREM
The truth value of "John likes and Mary hates beans" is true iff both John likes beans AND Mary hates beans.
In our toy model (where likes = hates = sees), this computes to the conjunction of the two predications.