Documentation

Linglib.Pragmatics.RSA.ScoreChain

RSA score chains in ℚ≥0 #

Combinators for the exact-rational face of RSA models: literal listener, exponentiated speaker with cost, joint pragmatic listener, marginals, and stacked higher-order speakers. A study composes these into its chain and wraps normalization sites with PMF.ofScores; predictions then reduce to ℚ≥0 comparisons closed by decide +kernel via the PMF.ofScores_lt family.

s1 applies PMF.scoresWith mid-tower, so a zero-mass utterance row takes its declared fallback inside the ℚ≥0 values — downstream marginals are total and the PMF bridges need no side conditions.

Scope: this face covers natural-α, rational-parameter models. Models with transcendental ingredients state their chains on the ℝ≥0∞ RSA.Canonical/operator face with kernel-certified rational bounds on named atoms.

Main definitions #

Kernel hygiene #

def RSA.Score.l0 {U : Type u_1} {W : Type u_2} [Fintype W] (meaning : UWBool) (prior : Wℚ≥0) (u : U) (w : W) :
ℚ≥0

Literal listener: prior conditioned on the meaning's truth, row-wise (÷0 = 0 on utterances true nowhere; speakers complete such rows via their fallback).

Equations
  • RSA.Score.l0 meaning prior u w = (if meaning u w = true then prior w else 0) / w' : W, if meaning u w' = true then prior w' else 0
Instances For
    def RSA.Score.s1 {U : Type u_1} {W : Type u_2} [Fintype U] (l0 : UWℚ≥0) (α : ) (cost : Uℚ≥0) (fb : PMF.Fallback U) (w : W) :
    Uℚ≥0

    Speaker scores: (l0 u w)^α · cost u, normalized over utterances and completed by fb on zero-mass rows. α : ℕ keeps the chain in ℚ≥0; cost is the multiplicative cost factor (e.g. a rationalized exp (−C)).

    Equations
    Instances For
      def RSA.Score.l1Joint {U : Type u_1} {W : Type u_2} {Lat : Type u_3} (prior : W × Latℚ≥0) (s1 : W × LatUℚ≥0) (u : U) (p : W × Lat) :
      ℚ≥0

      Joint pragmatic-listener scores over world × latent coordinates: prior p · s1 p u. Wrap with PMF.ofScores for the joint listener PMF, or marginalize first.

      Equations
      Instances For
        def RSA.Score.worldMarginal {W : Type u_2} {Lat : Type u_3} [Fintype Lat] (f : W × Latℚ≥0) (w : W) :
        ℚ≥0

        World marginal of joint scores.

        Equations
        Instances For
          def RSA.Score.latentMarginal {W : Type u_2} {Lat : Type u_3} [Fintype W] (f : W × Latℚ≥0) (l : Lat) :
          ℚ≥0

          Latent marginal of joint scores.

          Equations
          Instances For
            def RSA.Score.s2 {U : Type u_1} {W : Type u_2} {Lat : Type u_3} [Fintype U] (l1World : UWℚ≥0) (l1Lat : ULatℚ≥0) (α β : ) (cost : Uℚ≥0) (fb : PMF.Fallback U) (l : Lat) (w : W) :
            Uℚ≥0

            Stacked speaker: scores over utterances from pragmatic-listener coordinates l1World^α · l1Lat^β · cost, fallback-completed. Higher levels iterate the same shape.

            Equations
            Instances For

              Basic lemmas #

              theorem RSA.Score.l0_le_one {U : Type u_1} {W : Type u_2} [Fintype W] (meaning : UWBool) (prior : Wℚ≥0) (u : U) (w : W) :
              l0 meaning prior u w 1
              theorem RSA.Score.l0_eq_zero_of_not_meaning {U : Type u_1} {W : Type u_2} [Fintype W] {meaning : UWBool} {u : U} {w : W} (h : ¬meaning u w = true) (prior : Wℚ≥0) :
              l0 meaning prior u w = 0
              theorem RSA.Score.s1_sum_eq_one {U : Type u_1} {W : Type u_2} [Fintype U] (l0 : UWℚ≥0) (α : ) (cost : Uℚ≥0) (fb : PMF.Fallback U) (w : W) :
              u : U, s1 l0 α cost fb w u = 1
              theorem RSA.Score.worldMarginal_l1Joint_total {U : Type u_1} {W : Type u_2} {Lat : Type u_3} [Fintype W] [Fintype Lat] (prior : W × Latℚ≥0) (s1 : W × LatUℚ≥0) (u : U) :
              w : W, worldMarginal (l1Joint prior s1 u) w = p : W × Lat, prior p * s1 p u