|
| 1 | +import Linglib.Core.Discourse.Goals |
| 2 | +import Linglib.Core.Discourse.SpeechActs |
| 3 | +import Linglib.Core.Discourse.QUD |
| 4 | + |
| 5 | +/-! |
| 6 | +# Scoreboard: Unified Discourse State |
| 7 | +@cite{roberts-2023} @cite{roberts-2012} @cite{lewis-1979} @cite{portner-2004} |
| 8 | +
|
| 9 | +The scoreboard K for a language game at time t is a tuple |
| 10 | +⟨I, M, ≺, CG, QUD, G⟩ (@cite{roberts-2023} §2.1.1), tracking: |
| 11 | +
|
| 12 | +- **I**: the set of interlocutors |
| 13 | +- **M**: illocutionary moves made so far (with subsets A, Q, D, Acc) |
| 14 | +- **≺**: temporal order on moves |
| 15 | +- **CG**: the common ground (propositions treated as mutually believed) |
| 16 | +- **QUD**: the ordered set of questions under discussion |
| 17 | +- **G**: the interlocutors' publicly evident goals, plans, and priorities |
| 18 | +
|
| 19 | +The three central elements — CG, QUD, G — are updated by the three |
| 20 | +canonical speech acts via the **Illocutionary Force Linking Principle** |
| 21 | +(@cite{roberts-2023} (56)): |
| 22 | +
|
| 23 | +| Clause type | Semantic type | Default force | Updates | |
| 24 | +|-------------|-------------------|---------------|---------| |
| 25 | +| declarative | proposition | assertion | CG | |
| 26 | +| interrogative| set of propositions| interrogation | QUD | |
| 27 | +| imperative | indexed property | direction | G | |
| 28 | +
|
| 29 | +## Relation to Prior Work |
| 30 | +
|
| 31 | +@cite{lewis-1979}'s "scorekeeping in a language game" introduced the |
| 32 | +metaphor. @cite{roberts-2012} formalized CG + QUD. @cite{portner-2004} |
| 33 | +added the addressee's ToDo list. @cite{roberts-2023} unifies all three |
| 34 | +into a single scoreboard and gives G richer internal structure |
| 35 | +(conditional goals with hierarchical priorities, following @cite{bratman-1987}). |
| 36 | +-/ |
| 37 | + |
| 38 | +namespace Core.Discourse |
| 39 | + |
| 40 | +open Core.Proposition (BProp) |
| 41 | + |
| 42 | +variable {W : Type*} |
| 43 | + |
| 44 | +/-- The semantic type of a clause, determining its default illocutionary force. |
| 45 | +
|
| 46 | + @cite{roberts-2023} (56): propositions → assertion, sets of propositions → |
| 47 | + interrogation, indexed properties → direction. -/ |
| 48 | +inductive SemanticType where |
| 49 | + /-- Type ⟨s, t⟩: a proposition (set of worlds) -/ |
| 50 | + | proposition |
| 51 | + /-- Type ⟨⟨s, t⟩, t⟩: a set of propositions (Hamblin question denotation) -/ |
| 52 | + | setOfPropositions |
| 53 | + /-- Type ⟨s, ⟨e, t⟩⟩: a property indexed to the addressee -/ |
| 54 | + | indexedProperty |
| 55 | + deriving DecidableEq, Repr |
| 56 | + |
| 57 | +/-- **Illocutionary Force Linking Principle** (@cite{roberts-2023} (56)): |
| 58 | + the default illocutionary force of a root sentence is determined by |
| 59 | + its semantic type. |
| 60 | +
|
| 61 | + (a) proposition → assertion |
| 62 | + (b) set of propositions → interrogation |
| 63 | + (c) indexed property → direction -/ |
| 64 | +def forceLinkingPrinciple : SemanticType → IllocutionaryMood |
| 65 | + | .proposition => .declarative |
| 66 | + | .setOfPropositions => .interrogative |
| 67 | + | .indexedProperty => .imperative |
| 68 | + |
| 69 | +/-- The default semantic type for each illocutionary mood (inverse of IFLP). -/ |
| 70 | +def defaultSemanticType : IllocutionaryMood → SemanticType |
| 71 | + | .declarative => .proposition |
| 72 | + | .interrogative => .setOfPropositions |
| 73 | + | .imperative => .indexedProperty |
| 74 | + | .promissive => .indexedProperty -- promissives also denote properties |
| 75 | + | .exclamative => .proposition -- exclamatives denote propositions |
| 76 | + |
| 77 | +/-- IFLP round-trips for the three core moods. -/ |
| 78 | +theorem iflp_roundtrip_decl : |
| 79 | + forceLinkingPrinciple (defaultSemanticType .declarative) = .declarative := rfl |
| 80 | +theorem iflp_roundtrip_interrog : |
| 81 | + forceLinkingPrinciple (defaultSemanticType .interrogative) = .interrogative := rfl |
| 82 | +theorem iflp_roundtrip_imp : |
| 83 | + forceLinkingPrinciple (defaultSemanticType .imperative) = .imperative := rfl |
| 84 | + |
| 85 | +/-! ## The Scoreboard -/ |
| 86 | + |
| 87 | +/-- An illocutionary move on the scoreboard. |
| 88 | +
|
| 89 | + @cite{roberts-2023} §2.1.1: M is the set of moves, with distinguished |
| 90 | + subsets A (assertions), Q (questions), D (directions), Acc (accepted). -/ |
| 91 | +structure Move (W : Type*) where |
| 92 | + /-- Which kind of speech act -/ |
| 93 | + mood : IllocutionaryMood |
| 94 | + /-- Propositional content (for assertions and questions; for directions, |
| 95 | + the propositional closure of the targeted property) -/ |
| 96 | + content : BProp W |
| 97 | + /-- Who made the move -/ |
| 98 | + agent : Nat -- agent index into interlocutors |
| 99 | + /-- Whether this move has been accepted by the interlocutors -/ |
| 100 | + accepted : Bool := false |
| 101 | + deriving Inhabited |
| 102 | + |
| 103 | +/-- The scoreboard K for a language game. |
| 104 | +
|
| 105 | + @cite{roberts-2023} §2.1.1: K = ⟨I, M, ≺, CG, QUD, G⟩. |
| 106 | + We represent ≺ implicitly via list order in `moves`. -/ |
| 107 | +structure Scoreboard (W : Type*) where |
| 108 | + /-- I: the interlocutors (by index) -/ |
| 109 | + numInterlocutors : Nat |
| 110 | + /-- M: illocutionary moves in temporal order (≺ = list position) -/ |
| 111 | + moves : List (Move W) := [] |
| 112 | + /-- CG: the common ground — propositions treated as mutually believed. |
| 113 | + Represented as a list of propositions; the context set is their |
| 114 | + intersection. -/ |
| 115 | + cg : List (BProp W) := [] |
| 116 | + /-- QUD: questions under discussion (as a stack of proposition-sets). |
| 117 | + Simplified from the full `QUDStack` for composability. -/ |
| 118 | + qud : List (BProp W) := [] |
| 119 | + /-- G: per-agent goal sets. `goals[i]` is G_i. |
| 120 | + Length should equal `numInterlocutors`. -/ |
| 121 | + goals : List (GoalSet W) := [] |
| 122 | + deriving Inhabited |
| 123 | + |
| 124 | +namespace Scoreboard |
| 125 | + |
| 126 | +/-- The context set: worlds compatible with all CG propositions. -/ |
| 127 | +def contextSet (K : Scoreboard W) : BProp W := |
| 128 | + λ w => K.cg.all (λ p => p w) |
| 129 | + |
| 130 | +/-- An agent's goal set. Returns empty if index out of bounds. -/ |
| 131 | +def agentGoals (K : Scoreboard W) (i : Nat) : GoalSet W := |
| 132 | + K.goals.getD i GoalSet.empty |
| 133 | + |
| 134 | +/-- **Assertion update** (@cite{roberts-2023} (57), following @cite{stalnaker-1978}): |
| 135 | + If a proposition is asserted and accepted, it is added to CG_K. -/ |
| 136 | +def assertionUpdate (K : Scoreboard W) (p : BProp W) (agent : Nat) : Scoreboard W := |
| 137 | + { K with |
| 138 | + cg := p :: K.cg |
| 139 | + moves := ⟨.declarative, p, agent, true⟩ :: K.moves } |
| 140 | + |
| 141 | +/-- **Interrogation update** (@cite{roberts-2023} (58), following @cite{roberts-2012}): |
| 142 | + If a question is posed and accepted, it is added to QUD_K. -/ |
| 143 | +def interrogationUpdate (K : Scoreboard W) (q : BProp W) (agent : Nat) : Scoreboard W := |
| 144 | + { K with |
| 145 | + qud := q :: K.qud |
| 146 | + moves := ⟨.interrogative, q, agent, true⟩ :: K.moves } |
| 147 | + |
| 148 | +/-- **Direction update** (@cite{roberts-2023} (59)): |
| 149 | + If a targeted property is issued to addressee i and accepted, |
| 150 | + G_i is revised to include the realization of the property in any |
| 151 | + applicable circumstances. -/ |
| 152 | +def directionUpdate (K : Scoreboard W) (p : BProp W) |
| 153 | + (speaker target : Nat) (priority : Nat := 0) : Scoreboard W := |
| 154 | + let newGoal : Goal W := { content := p, priority } |
| 155 | + let rec go : List (GoalSet W) → Nat → List (GoalSet W) |
| 156 | + | [], _ => [] |
| 157 | + | gs :: rest, i => (if i == target then gs.add newGoal else gs) :: go rest (i + 1) |
| 158 | + let updatedGoals := go K.goals 0 |
| 159 | + { K with |
| 160 | + goals := updatedGoals |
| 161 | + moves := ⟨.imperative, p, speaker, true⟩ :: K.moves } |
| 162 | + |
| 163 | +/-- Assertion update adds to CG. -/ |
| 164 | +theorem assertion_adds_to_cg (K : Scoreboard W) (p : BProp W) (a : Nat) : |
| 165 | + (K.assertionUpdate p a).cg = p :: K.cg := rfl |
| 166 | + |
| 167 | +/-- Direction update preserves CG. -/ |
| 168 | +theorem direction_preserves_cg (K : Scoreboard W) (p : BProp W) (s t pr : Nat) : |
| 169 | + (K.directionUpdate p s t pr).cg = K.cg := rfl |
| 170 | + |
| 171 | +/-- Direction update preserves QUD. -/ |
| 172 | +theorem direction_preserves_qud (K : Scoreboard W) (p : BProp W) (s t pr : Nat) : |
| 173 | + (K.directionUpdate p s t pr).qud = K.qud := rfl |
| 174 | + |
| 175 | +/-- Assertion update preserves G. -/ |
| 176 | +theorem assertion_preserves_goals (K : Scoreboard W) (p : BProp W) (a : Nat) : |
| 177 | + (K.assertionUpdate p a).goals = K.goals := rfl |
| 178 | + |
| 179 | +end Scoreboard |
| 180 | +end Core.Discourse |
0 commit comments