Context Tower #
@cite{abusch-1997} @cite{anand-nevins-2004} @cite{cumming-2026} @cite{schlenker-2003}
A depth-indexed stack of context shifts unifying the codebase's context-manipulation mechanisms: Kaplanian indexicals (origin access), shifted indexicals (local access), De Bruijn temporal indexing (depth-relative access), situation introduction (mood), and domain expansion (branching time).
The tower is parametric over any context type C. KContext serves as the canonical
instantiation — it represents what a single context layer looks like. The tower wraps
it with a stack of shifts.
Key Operations #
.origin— the root context (speech-act context, Kaplan's c*).innermost— the most deeply embedded context (fold all shifts over origin).contextAt k— the context at depth k (fold first k shifts).push σ— embed deeper by adding a new shift.root c— trivial tower (no shifts, depth 0)
How FA Composes with Towers #
FA takes two meanings (function and argument). Both are parameterized by the same
tower. FA applies the function to the argument at that tower. The tower is threaded
as a reader parameter — ContextTower C →... is the enriched meaning type.
Classification of context shifts by their linguistic source.
- attitude : ShiftLabel
- temporal : ShiftLabel
- evidential : ShiftLabel
- mood : ShiftLabel
- perspective : ShiftLabel
- quotation : ShiftLabel
- clauseChain : ShiftLabel
- roleShift : ShiftLabel
- generic : ShiftLabel
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Core.Context.instBEqShiftLabel.beq x✝ y✝ = (x✝.ctorIdx == y✝.ctorIdx)
Instances For
Equations
Equations
A single context shift: a function transforming a context, tagged with its linguistic source.
- apply : C → C
The context transformation
- label : ShiftLabel
What kind of linguistic operation introduced this shift
Instances For
A context tower: an origin context with a stack of shifts.
The origin is the speech-act context (Kaplan's c*). Each shift corresponds to an embedding operator (attitude verb, temporal shift, mood operator). Contexts at each depth are computed by folding shifts over the origin — the path condition holds by construction.
- origin : C
The root context (speech-act context)
- shifts : List (ContextShift C)
Shifts from outermost to innermost.
shifts[0]is the first embedding (e.g., the matrix attitude verb); the last element is the deepest.
Instances For
Embedding depth (number of shifts).
Instances For
The context at depth k, computed by folding the first k shifts over
the origin. Saturates at tower depth: contextAt k for k ≥ depth
returns the innermost context.
Equations
- t.contextAt k = List.foldl (fun (c : C) (σ : Core.Context.ContextShift C) => σ.apply c) t.origin (List.take k t.shifts)
Instances For
The innermost (most deeply embedded) context: fold all shifts over origin.
Equations
- t.innermost = List.foldl (fun (c : C) (σ : Core.Context.ContextShift C) => σ.apply c) t.origin t.shifts
Instances For
Trivial tower with no shifts.
Instances For
Push a new shift onto the tower (embed one level deeper).
Instances For
Pushing a shift updates the innermost context.
Equations
- Core.Context.instDecidableEqDepthSpec.decEq Core.Context.DepthSpec.origin Core.Context.DepthSpec.origin = isTrue ⋯
- Core.Context.instDecidableEqDepthSpec.decEq Core.Context.DepthSpec.origin Core.Context.DepthSpec.local = isFalse Core.Context.instDecidableEqDepthSpec.decEq._proof_1
- Core.Context.instDecidableEqDepthSpec.decEq Core.Context.DepthSpec.origin (Core.Context.DepthSpec.relative k) = isFalse ⋯
- Core.Context.instDecidableEqDepthSpec.decEq Core.Context.DepthSpec.local Core.Context.DepthSpec.origin = isFalse Core.Context.instDecidableEqDepthSpec.decEq._proof_3
- Core.Context.instDecidableEqDepthSpec.decEq Core.Context.DepthSpec.local Core.Context.DepthSpec.local = isTrue ⋯
- Core.Context.instDecidableEqDepthSpec.decEq Core.Context.DepthSpec.local (Core.Context.DepthSpec.relative k) = isFalse ⋯
- Core.Context.instDecidableEqDepthSpec.decEq (Core.Context.DepthSpec.relative k) Core.Context.DepthSpec.origin = isFalse ⋯
- Core.Context.instDecidableEqDepthSpec.decEq (Core.Context.DepthSpec.relative k) Core.Context.DepthSpec.local = isFalse ⋯
- Core.Context.instDecidableEqDepthSpec.decEq (Core.Context.DepthSpec.relative a) (Core.Context.DepthSpec.relative b) = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Equations
- Core.Context.instBEqDepthSpec.beq Core.Context.DepthSpec.origin Core.Context.DepthSpec.origin = true
- Core.Context.instBEqDepthSpec.beq Core.Context.DepthSpec.local Core.Context.DepthSpec.local = true
- Core.Context.instBEqDepthSpec.beq (Core.Context.DepthSpec.relative a) (Core.Context.DepthSpec.relative b) = (a == b)
- Core.Context.instBEqDepthSpec.beq x✝¹ x✝ = false
Instances For
Equations
Equations
Resolve to a concrete depth index given the tower depth.
Equations
- Core.Context.DepthSpec.origin.resolve towerDepth = 0
- Core.Context.DepthSpec.local.resolve towerDepth = towerDepth
- (Core.Context.DepthSpec.relative a).resolve towerDepth = a
Instances For
An access pattern: a depth specification plus a projection from context to value.
This is how context-dependent expressions specify what they read:
English "I" = ⟨.origin, KContext.agent⟩
Amharic "I" = ⟨.local, KContext.agent⟩
English "now" = ⟨.origin, KContext.time⟩
- depth : DepthSpec
Which depth to read from
- project : C → R
Which coordinate to extract
Instances For
Resolve an access pattern against a tower.
Instances For
Map a function over the projected result.
Instances For
Origin access is invariant under push. This is the formal content of Kaplan's thesis: expressions reading from the speech-act context are unaffected by embedding operators.
Local access updates with push: the innermost projection tracks the new shift.
In a root tower, origin and local access agree.