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.
- quantity : AlternativeType
- manner : AlternativeType
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- NeoGricean.Alternatives.instBEqAlternativeType.beq x✝ y✝ = (x✝.ctorIdx == y✝.ctorIdx)
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
Equations
Get all other members of a Horn set (potential alternatives).
Equations
- h.otherMembers x = List.filter (fun (x_1 : α) => x_1 != x) h.members
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 connective Horn set: {or, and}
Equations
Instances For
The modal Horn set: {possible, necessary}
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.
- polarity : Core.NaturalLogic.ContextPolarity
The polarity of this context
- description : String
Description of the context
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Common UE context: simple assertion
Equations
- NeoGricean.Alternatives.simpleAssertion = { polarity := Core.NaturalLogic.ContextPolarity.upward, description := "Simple assertion (e.g., 'John ate ___')" }
Instances For
Common DE context: under negation
Equations
- NeoGricean.Alternatives.underNegation = { polarity := Core.NaturalLogic.ContextPolarity.downward, description := "Under negation (e.g., 'No one ate ___')" }
Instances For
DE context: restrictor of universal
Equations
- NeoGricean.Alternatives.universalRestrictor = { polarity := Core.NaturalLogic.ContextPolarity.downward, description := "Restrictor of 'every' (e.g., 'Every student who ate ___')" }
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
Equations
Abstract entailment checker for sentences.
In a real implementation, this would check semantic entailment. Here we use a simple model based on polarity.
- isStronger : Core.NaturalLogic.ContextPolarity → α → α → Bool
Check if term1 produces a stronger sentence than term2 in context
Instances For
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
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
- NeoGricean.Alternatives.quantifierStrengthUE q1 q2 = (Core.Scale.Quantifiers.entails q1 q2 && q1 != q2)
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
- NeoGricean.Alternatives.quantifierStrengthDE q1 q2 = (Core.Scale.Quantifiers.entails q2 q1 && q1 != q2)
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
- NeoGricean.Alternatives.connectiveStrengthUE c1 c2 = (Core.Scale.Connectives.entails c1 c2 && c1 != c2)
Instances For
Connective strength in DE context (reversed).
Equations
- NeoGricean.Alternatives.connectiveStrengthDE c1 c2 = (Core.Scale.Connectives.entails c2 c1 && c1 != c2)
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 stronger alternatives in UE context.
In UE context, "all" and "most" are stronger than "some".
"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.
"all" has stronger alternatives in DE context.
In DE context, "some" is stronger than "all" at sentence level.
Context determines alternatives.
The same Horn set produces different alternatives depending on context.
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
- NeoGricean.Alternatives.fromHornScale scale = { members := scale.members }
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
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.
- variant : PolarVariance
- invariant : PolarVariance
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- NeoGricean.Alternatives.instBEqPolarVariance.beq x✝ y✝ = (x✝.ctorIdx == y✝.ctorIdx)
Instances For
Polar variance by adjectival construction type.
Equations
- NeoGricean.Alternatives.polarVariance Semantics.Degree.AdjectivalConstruction.positive = NeoGricean.Alternatives.PolarVariance.variant
- NeoGricean.Alternatives.polarVariance Semantics.Degree.AdjectivalConstruction.comparative = NeoGricean.Alternatives.PolarVariance.variant
- NeoGricean.Alternatives.polarVariance Semantics.Degree.AdjectivalConstruction.equative = NeoGricean.Alternatives.PolarVariance.invariant
- NeoGricean.Alternatives.polarVariance Semantics.Degree.AdjectivalConstruction.degreeQuestion = NeoGricean.Alternatives.PolarVariance.invariant
- NeoGricean.Alternatives.polarVariance Semantics.Degree.AdjectivalConstruction.measurePhrase = NeoGricean.Alternatives.PolarVariance.variant
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.
- marked : String
The marked (costlier) form
- unmarked : String
The unmarked (cheaper) form
- dimension : Core.Dimension
The dimension they share (e.g., .height)
- costDifference : ℚ
The cost difference between forms
- construction : Semantics.Degree.AdjectivalConstruction
Construction where they're equivalent
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:
- The construction is polar-invariant (antonyms semantically equivalent)
- 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.