Documentation

Linglib.Core.Logic.NaturalLogic

Natural Logic Relations and Entailment Signatures #

@cite{icard-2012} @cite{maccartney-manning-2009}

Framework-agnostic infrastructure for the natural logic relation algebra and entailment signatures, following @cite{icard-2012} "Inclusion and Exclusion in Natural Language."

Contents #

  1. NLRelation — 7 natural logic relations (≡, ⊑, ⊒, ^, |, ⌣, #)
  2. EntailmentSig — 9 entailment signatures unifying monotonicity/additivity

Key operations #

Algebraic structure #

The seven basic set-theoretic relations between denotations (@cite{maccartney-manning-2009}, @cite{icard-2012} §1).

SymbolNameSet relationExample
equivalenceA = Bcouch / sofa
forwardA ⊂ Bdog / animal
reverseA ⊃ Banimal / dog
^negationA ∩ B = ∅, A ∪ B = Uhappy / unhappy
|alternationA ∩ B = ∅cat / dog
coverA ∪ B = Uanimal / nondog
#independentall other caseshungry / tall
Instances For
    Equations
    • One or more equations did not get rendered due to their size.
    Instances For

      Informativity ordering on NL relations.

      R ≤ R' means R is at least as informative as R'. The lattice has ≡ at the bottom (most informative) and # at the top (least informative).

      Key: ^ (negation) refines both | (alternation) and ⌣ (cover), because knowing sets are complementary tells you both that they're disjoint (|) and exhaustive (⌣).

      Equations
      Instances For
        Equations
        • One or more equations did not get rendered due to their size.

        Join operation ⋈ (@cite{icard-2012}, Lemma 1.5).

        Given xRy and yR'z, determines the strongest relation x(R⋈R')z. This is the "join" in the relation algebra sense (not lattice join).

        Equations
        Instances For

          ≡ is the identity for join.

          Entailment signature.

          An entailment signature classifies a function by its algebraic properties with respect to ∨ and ∧. This unifies the separate monotonicity and additivity hierarchies into one 9-element lattice.

          SymbolNameProperties
          allPreserves all 7 relations
          +monoMonotone (= UE)
          antiAntitone (= DE)
          additivef(A∨B)=f(A)∨f(B), f(⊤)=⊤
          antiAddf(A∨B)=f(A)∧f(B)
          multf(A∧B)=f(A)∧f(B), f(⊥)=⊥
          antiMultf(A∧B)=f(A)∨f(B), f(⊥)=⊤
          ⊕⊞addMultAdditive + Multiplicative
          ◇⊟antiAddMultAnti-additive + Anti-mult
          Instances For
            Equations
            • One or more equations did not get rendered due to their size.
            Instances For

              Refinement ordering on entailment signatures.

              The lattice has all at the bottom (most specific) and mono/anti at the top of their respective halves.

              Equations
              Instances For
                Equations
                • One or more equations did not get rendered due to their size.

                Projection of a NL relation through a function of given signature (@cite{icard-2012}, Lemma 2.4).

                If xRy and f has signature φ, then f(x) [R]^φ f(y). Returns the ≪-maximal relation guaranteed to hold between f(x) and f(y).

                The table follows from the algebraic definitions:

                • Additive: f(x∨y) = f(x)∨f(y), f(1)=1 → preserves ∨ → [∧]^⊕ = ∼ (cover from x∨y=1)
                • Multiplicative: f(x∧y) = f(x)∧f(y), f(0)=0 → preserves ∧ → [|]^⊞ = | (disjoint from x∧y=0)
                • Anti-additive: f(x∨y) = f(x)∧f(y), f(1)=0 → [∼]^◇ = | (from x∨y=1 ⟹ f(x)∧f(y)=0)
                • Anti-multiplicative: f(x∧y) = f(x)∨f(y), f(0)=1 → [|]^⊟ = ∼ (from x∧y=0 ⟹ f(x)∨f(y)=1)
                • Mono/anti alone: only preserves ⊑/⊒; ^, |, ∼ all weaken to #
                Equations
                Instances For

                  Projection preserves equiv for all signatures.

                  Composition of entailment signatures (@cite{icard-2012}, Lemma 2.7).

                  Derived from project: compose(ψ, φ) is the unique signature whose projection table matches projecting through φ then ψ. This makes projection_composition hold by finite verification rather than requiring two independently maintained tables to agree.

                  The signature is identified by probing with forward and negation, which suffice to distinguish all 9 signatures (with all handled separately as the identity element).

                  Equations
                  Instances For

                    Composition is associative.

                    Equations
                    • One or more equations did not get rendered due to their size.

                    Strength of downward entailingness.

                    Names the three levels of the DE hierarchy:

                    • .weak = DE only (licenses weak NPIs: ever, any)
                    • .antiAdditive = DE + ∨→∧ distributive (licenses strong NPIs: lift a finger)
                    • .antiMorphic = AA + ∧→∨ distributive (= negation)
                    Instances For
                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For

                        Strength of upward entailingness (dual of DEStrength).

                        Names the three levels of the UE hierarchy:

                        Instances For
                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For

                            Map an entailment signature to DE strength, derived from project.

                            A signature is DE iff it reverses forward entailment: [⊑]^φ = ⊒. Within the DE side, anti-additivity is detected by [∼]^φ = | (the ∨→∧ swap: x∨y=1 ⟹ f(x)∧f(y)=0), and anti-morphism additionally requires [|]^φ = ∼ (the ∧→∨ swap).

                            Returns none for UE-side signatures.

                            Equations
                            • One or more equations did not get rendered due to their size.
                            Instances For

                              Map an entailment signature to UE strength, derived from project.

                              A signature is UE iff it preserves forward entailment: [⊑]^φ = ⊑. Additivity is detected by [∼]^φ = ∼ (∨-preservation: x∨y=1 ⟹ f(x)∨f(y)=1), and multiplicativity by [|]^φ = | (∧-preservation: x∧y=0 ⟹ f(x)∧f(y)=0).

                              Returns none for DE-side signatures.

                              Equations
                              • One or more equations did not get rendered due to their size.
                              Instances For

                                Whether a context preserves or reverses entailment direction.

                                This is a coarsening of EntailmentSig: all UE-side signatures collapse to .upward, all DE-side signatures collapse to .downward. Contexts that are neither monotone nor antitone (e.g., "exactly n") are .nonMonotonic.

                                Used by:

                                • NeoGricean: determines which alternatives count as "stronger"
                                • RSA: polarity-sensitive inference
                                • Any theory computing scalar implicatures
                                Instances For
                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  Instances For

                                    Map an entailment signature to the coarser ContextPolarity type, derived from project.

                                    A signature is UE iff it preserves forward entailment ([⊑]^φ = ⊑), DE iff it reverses it ([⊑]^φ = ⊒).

                                    Equations
                                    • One or more equations did not get rendered due to their size.
                                    Instances For

                                      toContextPolarity is a monoid homomorphism: composing signatures then coarsening gives the same result as coarsening then composing polarities.

                                      This theorem connects the fine-grained EntailmentSig monoid to the coarse ContextPolarity composition, ensuring the two systems can never disagree.

                                      Compute the projectivity signature of a context from the signatures along the path from the target position to the root (@cite{icard-2012}, Definition 2.9).

                                      Given a parse tree and a target position (e.g., "dangerous" in "Every job that involves a giant squid is dangerous"), the path collects the top signature of each node from the target up to the root. The composed signature is List.prod, using the Monoid instance.

                                      Example from Icard §3.2: path = [⊞, ⊕, ◇] (top(is) ∘ top(involves) ∘ top(every_restrictor)) contextProjectivity path = ◇ (anti-additive)

                                      Equations
                                      Instances For

                                        Projection composition (@cite{icard-2012}, Corollary 2.12).

                                        Projecting through f then g is the same as projecting through g∘f. This is the compositionality principle: nested function application corresponds to signature composition.

                                        Since compose is derived from project (via fromProjectionPair), the only content of this theorem is that the two probe relations (forward, negation) suffice to determine the full projection table.

                                        Any DE-side signature licenses weak NPIs.

                                        This connects Icard's signature lattice to @cite{ladusaw-1980}: a signature on the DE side (anti, antiAdd, antiMult, antiAddMult) creates a DE context, which is sufficient for weak NPI licensing.

                                        Anti-additive or stronger signature licenses strong NPIs.

                                        Strong NPIs (lift a finger, in weeks) require anti-additive contexts. In Icard's system, this corresponds to signatures antiAdd, antiAddMult — but NOT plain anti or antiMult.

                                        Negation has the anti-morphism signature ◇⊟ (strongest DE signature).

                                        Equations
                                        Instances For