Documentation

Linglib.Theories.Pragmatics.NeoGricean.Core.Alternatives

Types of pragmatic alternatives.

Following @cite{horn-1984} and @cite{levinson-2000}:

  • Q-alternatives: Compete on informativity (Quantity principle)
  • M-alternatives: Compete on form cost (Manner principle)

These generate different types of implicatures via different mechanisms.

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

      A unified pragmatic alternative.

      Captures both Q-alternatives and M-alternatives with their relevant properties.

      • altType : AlternativeType

        Type of alternative (Q vs M)

      • form : String

        The alternative form

      • originalForm : String

        The original form being compared to

      • isBetter : Bool

        Is this alternative "better" (stronger for Q, cheaper for M)?

      • explanation : String

        Explanation of the comparison

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

          A Horn Set is an unordered collection of expressions.

          Following Geurts' argument on p.58, we use sets not scales. The ordering (which term is stronger) is determined at the SENTENCE level by checking semantic entailment, not by a fixed word-level ordering.

          This is crucial for handling DE contexts correctly:

          • In UE context: "all" → "some" (all stronger)
          • In DE context: "some" → "all" (some stronger!)

          The same Horn set {some, all} works for both contexts.

          • members : List α

            The members of the Horn set

          Instances For
            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              def NeoGricean.Alternatives.HornSet.contains {α : Type} [BEq α] (h : HornSet α) (x : α) :

              Check if a term is in a Horn set.

              Equations
              Instances For
                def NeoGricean.Alternatives.HornSet.otherMembers {α : Type} [BEq α] (h : HornSet α) (x : α) :
                List α

                Get all other members of a Horn set (potential alternatives).

                Equations
                Instances For

                  The quantifier Horn set: {some, most, all}

                  Uses type-safe QuantExpr from Core.Scale. Note: This is a SET, not an ordered scale. The ordering comes from sentence-level semantics, not from this data structure.

                  Equations
                  Instances For

                    The numeral Horn set: {one, two, three,...} Uses strings for now (numerals are more complex).

                    Equations
                    Instances For

                      A sentence context for alternative generation.

                      What counts as a "stronger alternative" depends on the polarity of the context, not just the Horn set.

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

                          Common UE context: simple assertion

                          Equations
                          Instances For

                            Common DE context: under negation

                            Equations
                            Instances For

                              DE context: restrictor of universal

                              Equations
                              Instances For

                                An alternative utterance with its source term and context.

                                • term : α

                                  The alternative term from the Horn set

                                • isStrongerInContext : Bool

                                  Whether this is a stronger alternative in context

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

                                    Abstract entailment checker for sentences.

                                    In a real implementation, this would check semantic entailment. Here we use a simple model based on polarity.

                                    Instances For
                                      def NeoGricean.Alternatives.generateAlternatives {α : Type} [BEq α] (hornSet : HornSet α) (checker : EntailmentChecker α) (context : SentenceContext) (term : α) :

                                      Generate alternatives to a term using a Horn set and entailment checker.

                                      Equations
                                      • One or more equations did not get rendered due to their size.
                                      Instances For
                                        def NeoGricean.Alternatives.strongerAlternatives {α : Type} [BEq α] (hornSet : HornSet α) (checker : EntailmentChecker α) (context : SentenceContext) (term : α) :
                                        List α

                                        Get only the stronger alternatives (the ones that generate implicatures).

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

                                          Standard quantifier strength ordering (for UE contexts).

                                          Uses QuantExpr.entails from Core.Scale:

                                          • all > most > some (in terms of logical strength)
                                          • "all" entails "some", so "all" is stronger
                                          Equations
                                          Instances For

                                            Reversed quantifier strength (for DE contexts).

                                            In DE context, "some" is stronger than "all" at sentence level. "No one ate some" entails "No one ate all".

                                            Equations
                                            Instances For

                                              Entailment checker for quantifiers (type-safe).

                                              Grounded in Core.Scale.Quantifiers.entails.

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

                                                Connective strength in UE context. "and" is stronger than "or".

                                                Equations
                                                Instances For

                                                  Entailment checker for connectives (type-safe).

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

                                                    "some" has no stronger alternatives in DE context.

                                                    In DE context, "some" is already the strongest term. This explains why "not all" implicature is blocked in DE contexts.

                                                    Convert a HornScale (from Core.Scale) to a HornSet.

                                                    This allows us to reuse the scale definitions while treating them as unordered sets. The ordering comes from the SentenceContext.

                                                    Equations
                                                    Instances For

                                                      String-based quantifier checker for interface with syntax.

                                                      Converts strings to QuantExpr, then uses the type-safe checker.

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

                                                        String-based connective checker for interface with syntax.

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

                                                          String-based quantifier set for interface with syntax.

                                                          Equations
                                                          Instances For

                                                            String-based connective set for interface with syntax.

                                                            Equations
                                                            Instances For

                                                              Polar variance: do antonyms have the same truth conditions in this construction?

                                                              This determines whether M-alternatives exist:

                                                              • Polar-VARIANT: "taller than" ≠ "shorter than" → no M-alternatives
                                                              • Polar-INVARIANT: "as tall as" = "as short as" → M-alternatives exist

                                                              From @cite{rett-2015} Chapter 5.

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

                                                                  An M-alternative set: forms differing in cost but not truth conditions.

                                                                  Unlike Q-alternatives (which differ in informativity), M-alternatives are EQUIVALENT in meaning but differ in production cost.

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

                                                                      Generate M-alternatives from an antonym pair.

                                                                      M-alternatives are generated when:

                                                                      1. The construction is polar-invariant (antonyms semantically equivalent)
                                                                      2. Markedness can be determined for the pair

                                                                      Returns none if no M-alternatives exist.

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

                                                                        Check if a form is the marked member of an M-alternative pair.

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

                                                                          Get the M-alternative for a form (if any).

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

                                                                            Generate all pragmatic alternatives (both Q and M) for a form.

                                                                            This is the unified entry point for alternative generation.

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

                                                                              Key distinction between Q-alternatives and M-alternatives.

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