Documentation

Linglib.Theories.Interfaces.SyntaxSemantics.CCG.Interface

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

      A sentence is true if its meaning holds

      Equations
      Instances For

        Forward application preserves semantic typing: If X/Y combines with Y to give X, then (σ→τ) applied to σ gives τ

        Backward application preserves semantic typing: If Y combines with X\Y to give X, then (σ→τ) applied to σ gives τ

        A semantic derivation: pairs a CCG category with its meaning. This represents a node in the derivation tree with its semantic interpretation.

        Instances For
          def CCG.applyMeaning {F : Core.Logic.Intensional.Frame} {σ τ : Core.Logic.Intensional.Ty} (f : F.Denot (σ τ)) (x : F.Denot σ) :
          F.Denot τ

          Apply a function meaning to an argument meaning

          Equations
          Instances For

            Composition is function application

            For a lexical entry, we can always extract its meaning.

            theorem CCG.combination_has_meaning {F : Core.Logic.Intensional.Frame} {x y : Cat} (functor_meaning : F.Denot (catToTy (x.rslash y))) (arg_meaning : F.Denot (catToTy y)) :
            (result : F.Denot (catToTy x)), result = functor_meaning arg_meaning

            If we have meanings for functor and argument with compatible types, we can compute the meaning of the result.

            theorem CCG.john_sees_mary_typed_derivation :
            have sees_ty := Semantics.Montague.ToyLexicon.sees_sem; have mary_ty := Semantics.Montague.ToyEntity.mary; have sees_mary_ty := sees_ty mary_ty; have john_ty := Semantics.Montague.ToyEntity.john; have result := sees_mary_ty john_ty; result

            The complete derivation of "John sees Mary" preserving types

            theorem CCG.mary_sleeps_typed_derivation :
            have sleeps_ty := Semantics.Montague.ToyLexicon.sleeps_sem; have mary_ty := Semantics.Montague.ToyEntity.mary; have result := sleeps_ty mary_ty; ¬result

            The derivation of "Mary sleeps" preserving types

            theorem CCG.forward_app_homomorphism {F : Core.Logic.Intensional.Frame} {x y : Cat} (f_sem : F.Denot (catToTy (x.rslash y))) (a_sem : F.Denot (catToTy y)) :
            f_sem a_sem = f_sem a_sem

            Forward application satisfies the homomorphism: ⟦fapp(f, a)⟧ = ⟦f⟧(⟦a⟧)

            The semantic interpretation of syntactic combination is function application.

            theorem CCG.backward_app_homomorphism {F : Core.Logic.Intensional.Frame} {x y : Cat} (a_sem : F.Denot (catToTy y)) (f_sem : F.Denot (catToTy (x.lslash y))) :
            f_sem a_sem = f_sem a_sem

            Backward application satisfies the homomorphism: ⟦bapp(a, f)⟧ = ⟦f⟧(⟦a⟧)

            The order of arguments in syntax doesn't affect semantic composition.

            A semantic interpretation: category paired with its meaning

            Instances For

              Semantic lexicon: maps words to interpretations

              Equations
              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
                Instances For
                  def CCG.getMeaning (result : Option (Interp Semantics.Montague.toyModel)) :
                  Option Prop

                  Helper to extract meaning from interpretation result

                  Equations
                  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
                    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
                      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
                        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:

                          1. Type-raising (T combinator)
                          2. Forward composition (B combinator)
                          3. Generalized conjunction (pointwise ∧)
                          4. 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
                          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.