Exercise 130.1.
From Γ ⊢𝑣 :𝖵𝖾𝖼 𝐴 𝑛@𝜀, rule MD-CSP derives Γ ⊢%𝛼𝑣 :𝖵𝖾𝖼 𝐴 𝑛@𝛼; the corresponding type is well formed at 𝛼 by MD-TCSP. Rule MD-Quote therefore gives Γ⊢⟨%𝛼𝑣⟩𝛼:▹𝛼(𝖵𝖾𝖼𝐴𝑛)@𝜀. After removing %𝛼, the quotation premise would require Γ⊢𝑣:𝖵𝖾𝖼𝐴𝑛@𝛼. The declaration of 𝑣 is at 𝜀, and MD-Var requires an exact stage match, so that premise fails.
Exercise 130.2.
Inversion of the redex typing gives Γ ⊢Λ𝛼.𝑀 :∀𝛼.𝜏@𝐴 and hence, after renaming 𝛼 fresh for Γ,𝐴,𝐵, the premise Γ ⊢𝑀 :𝜏@𝐴. Rule MD-SApp types the redex at 𝜏[𝐵/𝛼]@𝐴. The stage-substitution clause of lemma 130.3 yields Γ[𝐵/𝛼]⊢𝑀[𝐵/𝛼]:𝜏[𝐵/𝛼]@𝐴[𝐵/𝛼]. Freshness makes the context and 𝐴 unchanged, giving exactly the type of the contractum. If the result type were left as 𝜏, a free occurrence of 𝛼 in 𝜏 would remain after its binder disappeared; the claimed conclusion would be ill formed and would not match the MD-SApp conclusion.
Exercise 130.3.
Write the outer redex as (Λ𝛼.𝑀)𝐵. If 𝑀 ⟶𝑀′, the peak is (Λ𝛼.𝑀)𝐵⟶𝑀[𝐵/𝛼],(Λ𝛼.𝑀)𝐵⟶(Λ𝛼.𝑀′)𝐵. Compatibility of stage substitution with full reduction, proved by induction on the inner reduction, gives 𝑀[𝐵/𝛼] ⟶∗𝑀′[𝐵/𝛼]. Stage substitution does not duplicate a term occurrence, but it can expand one labelled escape–quotation pair into a shell containing |𝐵| primitive splices. For example, with a constant 𝑐 and 𝐵 =𝛽𝛾, take 𝑀=⟨∼𝛼⟨𝑐⟩𝛼⟩𝛼. After the outer stage-beta step its residual inner redex is 𝗊𝛽𝛾(𝖾𝛽𝛾(𝗊𝛽𝛾(𝑐))). Contract the 𝛽-splice and then the 𝛾-splice to obtain 𝗊𝛽𝛾(𝖾𝛽𝛾(𝗊𝛽𝛾(𝑐)))𝛽-splice⟶𝗊𝛽𝛾(𝖾𝛾(𝗊𝛾(𝑐)))𝛾-splice⟶𝗊𝛽𝛾(𝑐). For a word of length 𝑛, the same shell induction transports the residual through exactly 𝑛 primitive splice contractions; for the empty word the two substituted endpoints coincide. Contracting stage beta on the right gives 𝑀′[𝐵/𝛼]. Thus the residual inner step is transported through stage substitution, while the residual outer redex remains at the root of (Λ𝛼.𝑀′)𝐵.
For the splice peak, write the term as ∼𝛼⟨𝑀⟩𝛼 with an ordinary beta step 𝑀 ⟶𝑀′. The root step yields 𝑀, which takes that beta step to 𝑀′. Quotation and escape compatibility yield ∼𝛼⟨𝑀′⟩𝛼, whose root splice step also yields 𝑀′. These are the two required common reducts.
Exercise 130.4.
Use the signature constants 𝑎0,𝑎1 :𝐴 from the chapter. Persist them and form at stage 𝛼 𝑣2=𝖼𝗈𝗇𝗌1(%𝛼𝑎1)(𝖼𝗈𝗇𝗌0(%𝛼𝑎0)𝗇𝗂𝗅):𝖵𝖾𝖼𝐴2@𝛼. Then MD-Quote gives ⟨𝑣2⟩𝛼 : ▹𝛼(𝖵𝖾𝖼 𝐴 2)@𝜀. The generator is the empty-stage term 𝐺2 =⟨𝑣2⟩𝛼; staged evaluation stops immediately at that quotation because its constant-headed constructor applications at stage 𝛼 are future-stage values, not contractions. Inverting its type with lemma 130.2 verifies the body judgment at the extended stage 𝛼. The CSP markers make persistence explicit but are removable by MD-Q-Percent, since MD-Const types the signature constants at both stages. This closed example therefore satisfies the empty-stage hypothesis of theorem 130.15.
Exercise 130.5.
Start generation in the empty store. Allocation chooses its least unused location, so (∅,𝗇𝖾𝗐0)⟼({ℓ0↦0},ℓ0). Unrestricted CSP constructs the code value 𝐶 =⟨!(%𝛼ℓ0)⟩𝛼. The generation boundary returns 𝐶 and discards the generation store, leaving (∅,𝐶).
For the first later evaluation, allocation again chooses location zero: (∅,𝗇𝖾𝗐0)⟼({ℓ0↦0},ℓ0),({ℓ0↦0},!ℓ0)⟼({ℓ0↦0},0). For the second, the same rule with initializer one gives (∅,𝗇𝖾𝗐1)⟼({ℓ0↦1},ℓ0),({ℓ0↦1},!ℓ0)⟼({ℓ0↦1},1). The identical closed code value 𝐶 therefore returns zero or one according to a store allocated after generation. A canonical-forms argument that treats a closed code value as carrying every resource needed by its body is false; equivalently, the store-independent reduct assumed when commuting a generated code step with an unrelated later allocation is false. The pure calculus’s CSP rule therefore requires a world/store discipline before it can persist locations.