The fuelled call judgment is 𝑏;𝜇;𝜌𝑠⊢𝗉𝖾𝑒⇓𝑞;𝜇′. With 𝑃(𝑓)=(⃗𝑥𝑠;⃗𝑥𝑑;𝑒𝑓), 𝜋=(𝑓,⃗𝑛), and componentwise ̂⃗𝑞=𝗅𝗂𝖿𝗍(⃗𝑞), every noncall rule above lifts by threading the table through its premises from left to right while leaving the budget unchanged. Its three call rules are
The corresponding vector judgments apply these scalar rules from left to right. Offline residualization returns a program only through a finite completed graph (𝜈,𝐸,𝑟0): 𝜈 injectively names every reached static call state, 𝐸 contains the specialized equation for each named state, every residual call targets another state in dom(𝜈), and the main expression yields 𝑟0. A state is named before its body is specialized, so a revisit is a back edge. If this reachability expansion does not terminate, no residual program is returned. The finite-return proof maintains I𝑘(𝜇,𝜇∗): every pending entry has one allocating ancestor and one eventual equation, every completed entry simulates its source body below height 𝑘, and fuel-zero retention is closed under source calls. Recursive hits are justified by smaller evaluation height, not by induction on the cyclic table.
SC-CBV driving, folding, and whistle
An SC-CBV configuration is a residual context focused on one expression. The source’s 𝗅𝖾𝗍𝗋𝖾𝖼 is macro-expanded using its distinguished global fixpoint before concrete evaluation. The chapter’s pedagogical projection 𝖽𝗋𝗂𝗏𝖾0 is partial and contains only beta, known-case, and open-case configurations; the full driver is the ordered source ledger R1–R20. Write 𝑅⟨𝑒⟩ for context plugging, let 𝑎 range over obstructed expressions, and let 𝜌 record fresh residual names paired with earlier calls. For 𝐵={𝑝𝑖⇒𝑒𝑖}𝑖, put 𝐵𝑅𝑥={𝑝𝑖⇒𝖣[]((𝑅⟨𝑒𝑖⟩)[𝑝𝑖/𝑥])}𝑖,𝐵𝑅={𝑝𝑖⇒𝖣[](𝑅⟨𝑒𝑖⟩)}𝑖. The complete ordered ledger is 𝑅1−−𝑅3:𝖣𝑅(𝑛)=𝑅⟨𝑛⟩,𝖣𝑅(𝑥)=𝑅⟨𝑥⟩,𝖣𝑅(𝑔)=𝖣𝖺𝗉𝗉𝑅(𝑔);𝑅4−−𝑅6:𝖣[](𝑘(⃗𝑒))=𝑘(𝖣[](⃗𝑒)),𝖣𝑅(𝑥⃗𝑒)=𝑅⟨𝑥𝖣[](⃗𝑒)⟩,𝖣[](𝜆⃗𝑥.𝑒)=𝜆⃗𝑥.𝖣[](𝑒);𝑅7:𝖣𝑅(𝑛1⊕𝑛2)=𝖣[](𝑅⟨𝑛⟩),𝑛=𝗉𝗋𝗂𝗆⊕(𝑛1,𝑛2).𝑅8:𝖣𝑅(𝑒1⊕𝑒2)=⎧{
{⎨{
{⎩𝖣[](𝑒1)⊕𝖣[](𝑒2),𝑒1⊕𝑒2=𝑎,𝖣𝑅⟨𝑒1⊕[]⟩(𝑒2),𝑒1=𝑛or𝑎,𝖣𝑅⟨[]⊕𝑒2⟩(𝑒1),otherwise.𝑅9−−𝑅10:𝖣𝑅((𝜆⃗𝑥.𝑓)⃗𝑒)=𝖣𝑅(𝗅𝖾𝗍⃗𝑥=⃗𝑒𝗂𝗇𝑓),𝖣𝑅(𝑒𝑒′)=𝖣𝑅⟨[]𝑒′⟩(𝑒);𝑅11−−𝑅12:𝖣𝑅(𝗅𝖾𝗍𝑥=𝑛𝗂𝗇𝑓)=𝖣[](𝑅⟨𝑓[𝑛/𝑥]⟩),𝖣𝑅(𝗅𝖾𝗍𝑥=𝑦𝗂𝗇𝑓)=𝖣[](𝑅⟨𝑓[𝑦/𝑥]⟩), where the last equation requires that 𝑦 was not introduced by a preceding split. For R13, let 𝐿=𝗅𝖾𝗍𝑥=𝑒𝗂𝗇𝑓 and 𝑄=𝑥∈𝗌𝗍𝗋𝗂𝖼𝗍(𝑓)∩𝗅𝗂𝗇𝖾𝖺𝗋(𝑓). Then 𝑅13:𝖣𝑅(𝐿)={𝖣[](𝑅⟨𝑓[𝑒/𝑥]⟩),𝑄,𝗅𝖾𝗍𝑥=𝖣[](𝑒)𝗂𝗇𝖣[](𝑅⟨𝑓⟩),otherwise;𝑅14:𝖣𝑅(𝗅𝖾𝗍𝗋𝖾𝖼𝑔=𝑣𝗂𝗇𝑒)=𝖣[],𝐺′,𝜌(𝑅⟨𝑒⟩),𝐺′=𝐺∪{𝑔↦𝑣};𝑅15−−𝑅17:𝖣𝑅(𝖢[𝑥;𝐵])=𝖢[𝑥;𝐵𝑅𝑥],𝖣𝑅(𝖢[𝑘𝑗(⃗𝑒);𝐵])=𝖣[](𝑅⟨𝗅𝖾𝗍⃗𝑥𝑗=⃗𝑒𝗂𝗇𝑒𝑗⟩),𝖣𝑅(𝖢[𝑛𝑗;𝐵])=𝖣[](𝑅⟨𝑒𝑗⟩);𝑅18−−𝑅20:𝖣𝑅(𝖢[𝑎;𝐵])=𝖢[𝖣[](𝑎);𝐵𝑅],𝖣𝑅(𝖢[𝑒;𝐵])=𝖣𝑅𝖼𝖺𝗌𝖾(𝑒),𝖣𝑅(𝑒)=𝑅⟨𝑒⟩. Here 𝑅𝖼𝖺𝗌𝖾=𝑅⟨𝖢[[];𝐵]⟩ in R19; the rules are tried in numerical order. The obstructed grammar is 𝑎::=𝑥∣𝑛⊕𝑎∣𝑎⊕𝑛∣𝑎⊕𝑎∣𝑎⃗𝑒.
The application ledger completes the driver card. An entry for a configuration 𝑄, with ordered free-variable vector ⃗𝑥, is 𝜌(ℎ)=𝜆⃗𝑥.𝑄; write (ℎ,𝑄)∈𝜌 for this assertion. Put ̂𝑔=𝑅⟨𝑔⟩. The alternatives are tried in the displayed order: 𝐴1:𝖣𝖺𝗉𝗉𝑅,𝐺,𝜌(𝑔)=ℎ⃗𝑥,(ℎ,𝑒1)∈𝜌,𝜎𝑒1=̂𝑔,⃗𝑥=𝜎(fv(𝑒1));𝐴2:𝖣𝖺𝗉𝗉𝑅,𝐺,𝜌(𝑔)=̂𝑔,(ℎ,𝑒1)∈𝜌,𝑒1≼̂𝑔≼𝑒1;𝐴3:𝖣𝖺𝗉𝗉𝑅,𝐺,𝜌(𝑔)=[𝖣[](⃗𝑓)/⃗𝑦]𝖣[](𝑓𝑔),(ℎ,𝑒1)∈𝜌,𝑒1≼̂𝑔,(𝑓𝑔,⃗𝑓,⃗𝑦)=𝗌𝗉𝗅𝗂𝗍(̂𝑔,𝑒1). If none of A1–A3 applies, choose the first residual name ℎ allowed by the chapter’s allocation condition and put (𝑔,𝑣)∈𝐺,⃗𝑥=fv(̂𝑔),𝜌′=𝜌∪{ℎ↦𝜆⃗𝑥.̂𝑔},𝑒=𝖣[],𝐺,𝜌′(𝑅⟨𝑣⟩). For Sub(𝑒), the finite set of strict proper subexpressions of 𝑒, the remaining ordered alternatives are 𝐴4𝑎:𝖣𝖺𝗉𝗉𝑅,𝐺,𝜌(𝑔)=[𝖣[](⃗𝑓)/⃗𝑦]𝖣[](𝑓𝑔),𝑒1∈Sub(𝑒)istheselectedterm,𝑒1≼̂𝑔,̂𝑔⧸≼𝑒1,(𝑓𝑔,⃗𝑓,⃗𝑦)=𝗌𝗉𝗅𝗂𝗍(̂𝑔,𝑒1);𝐴4𝑏:𝖣𝖺𝗉𝗉𝑅,𝐺,𝜌(𝑔)=𝗅𝖾𝗍𝗋𝖾𝖼ℎ=𝜆⃗𝑥.𝑒𝗂𝗇ℎ⃗𝑥,ℎ∈fn(𝑒);𝐴4𝑐:𝖣𝖺𝗉𝗉𝑅,𝐺,𝜌(𝑔)=𝑒,ℎ∉fn(𝑒).
The pedagogical projection’s beta rule is
𝖽𝗋𝗂𝗏𝖾0(𝑅⟨(𝜆𝑥.𝑒)𝑣⟩)={([𝑣/𝑥],𝑅⟨𝑒⟩)}
D-Beta
For B={𝑐𝑖(⃗𝑥𝑖)⇒𝑒𝑖}𝑖∈𝐼, put 𝜃𝑗=[𝑐𝑗(⃗𝑧𝑗)/𝑦],𝑄𝑗=𝑅𝜃𝑗⟨𝖼𝖺𝗌𝖾𝑐𝑗(⃗𝑧𝑗)𝗈𝖿B⟩. A known constructor case selects one branch and substitutes its fields; an open-variable case refines the scrutinee once for every constructor and retains the case for the next known-case node:
𝑗∈𝐼
𝖽𝗋𝗂𝗏𝖾0(𝑅⟨𝖼𝖺𝗌𝖾𝑐𝑗(⃗𝑣)𝗈𝖿B⟩)={([⃗𝑣/⃗𝑥𝑗],𝑅⟨𝑒𝑗⟩)}
D-Case-Known
𝑦isfree𝑗∈𝐼
𝖽𝗋𝗂𝗏𝖾0(𝑅⟨𝖼𝖺𝗌𝖾𝑦𝗈𝖿B⟩)={(𝜃𝑗,𝑄𝑗)}𝑗∈𝐼
D-Case-Open
For beta and known-case edges, compatibility means the closed parent takes one concrete call-by-value contraction to the instantiated child; for an open-case edge it means equality after shape refinement. Alpha-equivalent configurations fold to the earlier residual function. Homeomorphic embedding on constructor trees is generated by
𝑥≼𝑦
Emb-Var
𝑛1≼𝑛2
Emb-Num
𝑠≼𝑡𝑖
𝑠≼𝑐(𝑡1,…,𝑡𝑘)
Emb-Dive
𝑠𝑖≼𝑡𝑖(1≤𝑖≤𝑘)
𝑐(𝑠1,…,𝑠𝑘)≼𝑐(𝑡1,…,𝑡𝑘)
Emb-Couple
When the whistle fires, most-specific generalization returns substitutions (𝜃1,𝜃2) and a common pattern 𝑔 with 𝑔𝜃1=𝑒1 and 𝑔𝜃2=𝑒2; processing continues on the smaller generalized nodes under the source’s memo invariant.
The dual-context staging core
𝖳𝗌𝗍𝖺𝗀𝖾 separates persistent assumptions 𝑢::𝐴∈Δ from ordinary assumptions 𝑥:𝐴∈Γ:
𝑥:𝐴∈Γ
Δ;Γ⊢𝑥:𝐴
T-Var
𝑢::𝐴∈Δ
Δ;Γ⊢𝑢:𝐴
T-MVar
Δ;Γ,𝑥:𝐴⊢𝑀:𝐵
Δ;Γ⊢𝜆𝑥:𝐴.𝑀:𝐴→𝐵
T-Abs
Δ;Γ⊢𝑀:𝐴→𝐵Δ;Γ⊢𝑁:𝐴
Δ;Γ⊢𝑀𝑁:𝐵
T-App
Δ;∅⊢𝑀:𝐴
Δ;Γ⊢𝖻𝗈𝗑𝑀:◻𝐴
T-Box
Δ;Γ⊢𝑀:◻𝐴Δ,𝑢::𝐴;Γ⊢𝑁:𝐵
Δ;Γ⊢𝗅𝖾𝗍𝖻𝗈𝗑𝑢=𝑀𝗂𝗇𝑁:𝐵
T-LetBox
Staged computation has the two contractions
(𝜆𝑥:𝐴.𝑀)𝑁⟶𝑀[𝑁/𝑥]
TS-Beta
𝗅𝖾𝗍𝖻𝗈𝗑𝑢=𝖻𝗈𝗑𝑀𝗂𝗇𝑁⟶𝑁[𝑀/𝑢]
TS-BoxBeta
Its complete compatible closure is
𝑀⟶𝑀′
𝜆𝑥:𝐴.𝑀⟶𝜆𝑥:𝐴.𝑀′
TS-Lam
𝑀⟶𝑀′
𝑀𝑁⟶𝑀′𝑁
TS-AppL
𝑁⟶𝑁′
𝑀𝑁⟶𝑀𝑁′
TS-AppR
𝑀⟶𝑀′
𝗅𝖾𝗍𝖻𝗈𝗑𝑢=𝑀𝗂𝗇𝑁⟶𝗅𝖾𝗍𝖻𝗈𝗑𝑢=𝑀′𝗂𝗇𝑁
TS-LetL
𝑁⟶𝑁′
𝗅𝖾𝗍𝖻𝗈𝗑𝑢=𝑀𝗂𝗇𝑁⟶𝗅𝖾𝗍𝖻𝗈𝗑𝑢=𝑀𝗂𝗇𝑁′
TS-LetR
There is no congruence beneath a box. The box-introduction premise’s empty ordinary context is the scope invariant; persistent substitution may cross a box and ordinary substitution may not.
Davies–Pfenning’s conservative two-level source is a different card. It has run-time and compile-time judgments Δ;Γ⊢𝑟𝑒:𝜏 and Δ⊢𝑐𝑒:𝜎, with separately phase-marked Mini-ML constructors for functions, products, unit, naturals, case, and fixed points. For 𝑝∈{𝑟,𝑐}, let C𝑟=Δ;Γ and C𝑐=Δ. Its ordinary constructors have the complete phase-indexed rule schema
𝑥:𝑇∈C𝑝
C𝑝⊢𝑝𝑥:𝑇
2-Varp
C𝑝,𝑥:𝑇1⊢𝑝𝑒:𝑇2
C𝑝⊢𝑝𝜆𝑝𝑥:𝑇1.𝑒:𝑇1→𝑇2
2-Lamp
C𝑝⊢𝑝𝑒1:𝑇1→𝑇2C𝑝⊢𝑝𝑒2:𝑇1
C𝑝⊢𝑝𝑒1@𝑝𝑒2:𝑇2
2-Appp
C𝑝,𝑥:𝑇⊢𝑝𝑒:𝑇
C𝑝⊢𝑝𝖿𝗂𝗑𝑝𝑥:𝑇.𝑒:𝑇
2-Fixp
C𝑝⊢𝑝𝑒1:𝑇1C𝑝⊢𝑝𝑒2:𝑇2
C𝑝⊢𝑝⟨𝑒1,𝑒2⟩𝑝:𝑇1×𝑇2
2-Pairp
C𝑝⊢𝑝𝑒:𝑇1×𝑇2
C𝑝⊢𝑝𝗉𝗋𝗈𝗃𝑝𝑖(𝑒):𝑇𝑖
2-Projp
C𝑝⊢𝑝⟨⟩𝑝:1
2-Unitp
C𝑝⊢𝑝𝗓𝑝:𝗇𝖺𝗍
2-Zerop
C𝑝⊢𝑝𝑒:𝗇𝖺𝗍
C𝑝⊢𝑝𝗌𝑝𝑒:𝗇𝖺𝗍
2-Succp
C𝑝⊢𝑝𝑒0:𝗇𝖺𝗍C𝑝⊢𝑝𝑒𝑧:𝑇C𝑝,𝑥:𝗇𝖺𝗍⊢𝑝𝑒𝑠:𝑇
C𝑝⊢𝑝𝖼𝖺𝗌𝖾𝑝𝑒0𝗈𝖿𝗓⇒𝑒𝑧∣𝗌𝑥⇒𝑒𝑠:𝑇
2-Casep
Its only phase-changing rules are
Δ⊢𝑐𝑒:𝜏――
Δ;Γ⊢𝑟𝑒:𝜏
2-Down
Δ;∅⊢𝑟𝑒:𝜏
Δ⊢𝑐𝑒:𝜏――
2-Up
The mutually recursive translation sends 𝜏―― to ◻‖𝜏‖ and has the exact boundary equations ‖――𝑒‖=𝗎𝗇𝖻𝗈𝗑1|――𝑒|,|𝑒――|=𝖻𝗈𝗑‖𝑒――‖. The target judgment S⊢𝑖𝑀:𝐴 uses a stack of ordinary contexts. Its load-bearing function and boundary rules are
𝑥:𝑇∈last(S)
S⊢𝑖𝑥:𝑇
I-Var
S,𝑥:𝑇⊢𝑖𝑀:𝑈
S⊢𝑖𝜆𝑥:𝑇.𝑀:𝑇→𝑈
I-Abs
S⊢𝑖𝑀:𝑇→𝑈S⊢𝑖𝑁:𝑇
S⊢𝑖𝑀𝑁:𝑈
I-App
S;∅⊢𝑖𝑀:𝑇
S⊢𝑖𝖻𝗈𝗑𝑀:◻𝑇
I-Box
S⊢𝑖𝑀:◻𝑇
S;Γ⊢𝑖𝗎𝗇𝖻𝗈𝗑1𝑀:𝑇
I-Unbox1
The remaining target rules are
S,𝑥:𝑇⊢𝑖𝑀:𝑇
S⊢𝑖𝖿𝗂𝗑𝑥:𝑇.𝑀:𝑇
I-Fix
S⊢𝑖𝑀:𝑇1S⊢𝑖𝑁:𝑇2
S⊢𝑖⟨𝑀,𝑁⟩:𝑇1×𝑇2
I-Pair
S⊢𝑖𝑀:𝑇1×𝑇2
S⊢𝑖𝗉𝗋𝗈𝗃𝑗(𝑀):𝑇𝑗
I-Proj
S⊢𝑖⟨⟩:1
I-Unit
S⊢𝑖𝗓:𝗇𝖺𝗍
I-Zero
S⊢𝑖𝑀:𝗇𝖺𝗍
S⊢𝑖𝗌𝑀:𝗇𝖺𝗍
I-Succ
S⊢𝑖𝑀:𝗇𝖺𝗍S⊢𝑖𝑀𝑧:𝑇S,𝑥:𝗇𝖺𝗍⊢𝑖𝑀𝑠:𝑇
S⊢𝑖𝖼𝖺𝗌𝖾𝑀𝗈𝖿𝗓⇒𝑀𝑧∣𝗌𝑥⇒𝑀𝑠:𝑇
I-Case
Box pushes an empty component and 𝗎𝗇𝖻𝗈𝗑1 crosses exactly one boundary. These are every target family used by the translation. Its conservative embedding proves both preservation and reflection of the two typing judgments; it is not a relabelling of 𝖳𝗌𝗍𝖺𝗀𝖾.
MacoCaml compilation boundary
The separate MacoCaml source judgment 𝜎1;Ω;Γ⊢⋆𝑛𝑒:𝜏⇝𝑒′;𝜎2,⋆∈{𝑐,𝑠,𝑞}, threads a compile-time heap, records the integer binding level and compiler mode, and returns elaborated core syntax. Quotation and nested splice are
𝜎1;Ω;Γ⊢𝑞𝑛+1𝑒:𝜏⇝𝑒′;𝜎2
𝜎1;Ω;Γ⊢𝑐∨𝑠𝑛⟨𝑒⟩:𝖢𝗈𝖽𝖾𝜏⇝⟨𝑒′⟩;𝜎2
MC-Quote
𝜎1;Ω;Γ⊢𝑠𝑛−1𝑒:𝖢𝗈𝖽𝖾𝜏⇝𝑒′;𝜎2
𝜎1;Ω;Γ⊢𝑞𝑛$𝑒:𝜏⇝$𝑒′;𝜎2
MC-Splice
The symbol 𝑐∨𝑠 denotes one rule instance at each mode. A top-level splice instead uses
𝜎1;Ω;Γ⊢𝑠𝑛−1𝑒:𝖢𝗈𝖽𝖾𝜏⇝𝑒′;𝜎2𝜎2;Ω⊢𝑒′⟶∗0⟨𝑣⟩;𝜎3
𝜎1;Ω;Γ⊢𝑐𝑛$𝑒:𝜏⇝𝑣;𝜎3
MC-CodeGen
The empty-heap consequence is theorem 129.10. These rules are not modal box rules.
Tan–Wei semantics-preserving two-stage cards
The pure comparison calculus 𝜆|2| has stages 𝑠∈{𝟙,𝟚}, reification effects 𝜖∈{⊥,⊤}, and the two judgments Γ⊢𝑠𝑡:𝜏∣𝜖,Γ⊢𝑡:𝜏∣𝜖. Its code types distinguish complete code 𝗋𝖾𝗉(𝜏) from a reifiable fragment 𝖿𝗋𝖺𝗀(𝜏). The bridge rules are
Γ⊢𝟙𝑡:𝜏∣⊥
Γ⊢𝑡:𝜏∣⊥
TW-Pure
Γ⊢𝟙𝑡:𝖿𝗋𝖺𝗀(𝜏)∣𝜖
Γ⊢𝑡:𝗋𝖾𝗉(𝜏)∣𝜖
TW-Rep
The administrative rules are
Γ⊢𝟚𝑡:𝜏∣⊥
Γ⊢𝟙𝖼𝗈𝖽𝖾𝑡:𝗋𝖾𝗉(𝜏)∣⊥
TW-Code
Γ⊢𝟚𝑡:𝜏∣⊥
Γ⊢𝟙𝗋𝖾𝖿𝗅𝖾𝖼𝗍𝑡:𝖿𝗋𝖺𝗀(𝜏)∣⊤
TW-Reflect
Γ⊢𝟚𝑡1:𝜏1∣⊥Γ,𝑥𝟚:𝜏1⊢𝑡2:𝗋𝖾𝗉(𝜏2)∣𝜖𝖶𝖥𝟚(𝜏1)
Γ⊢𝟙𝗅𝖾𝗍𝖼𝑥=𝑡1𝗂𝗇𝑡2:𝗋𝖾𝗉(𝜏2)∣⊥
TW-LetC
For 𝑥 fresh, automatic let insertion is the root-compatible step 𝑃[𝐸[𝗋𝖾𝖿𝗅𝖾𝖼𝗍𝑡]]⟶𝑃[𝗅𝖾𝗍𝖼𝑥=𝑡𝗂𝗇𝐸[𝖼𝗈𝖽𝖾𝑥]], where 𝐸 contains only ordinary pure evaluation frames and 𝑃 is a reification context. Stage erasure sends inserted 𝗅𝖾𝗍𝖼 to ordinary let and deletes the remaining administrative staging forms.
The 𝜆𝗋𝖾𝖿|2| delta adds natural-number locations and stores. Generated-stage allocation, get, and put build fragments under ⊢𝟙; the corresponding executing operations occur only under ⊢𝟚. The run-rule delta is
𝗌𝗍𝗈𝗋𝖾𝖥𝗋𝖾𝖾(𝑡)∅⊢𝑡:𝗋𝖾𝗉(𝜏)∣𝜖
Γ⊢𝟙𝗋𝗎𝗇𝑡:𝜏∣⊥
TW-Run-Ref
Its store-freedom and empty-context premises ensure that first-stage evaluation begins and ends with the empty store. Its logical relation adds a world which is a partial bijection of locations and extends that world after allocation. The exact pure and reference consequences are lemma 129.11, theorem 129.12; neither card is 𝖳𝗌𝗍𝖺𝗀𝖾, MetaOCaml, or LMS.
Dependent multistage typing
Stages are finite words 𝐴,𝐵 over stage variables. Context declarations record an exact stage, and variable use requires that exact match. Kinds and types have the complete formation and checking rules
Γ⊢∗𝗄𝗂𝗇𝖽@𝐴
MD-Kind-Star
Γ⊢𝜏::∗@𝐴Γ,𝑥:𝜏@𝐴⊢𝐾𝗄𝗂𝗇𝖽@𝐴
Γ⊢Π𝑥:𝜏.𝐾𝗄𝗂𝗇𝖽@𝐴
MD-Kind-Pi
𝑋::𝐾∈Σ
Γ⊢𝑋::𝐾@𝐴
MD-TConst
Γ⊢𝜎::Π𝑥:𝜏.𝐾@𝐴Γ⊢𝑀:𝜏@𝐴
Γ⊢𝜎𝑀::𝐾[𝑀/𝑥]@𝐴
MD-TApp
Γ⊢𝜏::∗@𝐴𝛼
Γ⊢▹𝛼𝜏::∗@𝐴
MD-TCode
Γ⊢𝜏::𝐾@𝐴𝛼∉FTV(Γ)∪FTV(𝐴)
Γ⊢∀𝛼.𝜏::𝐾@𝐴
MD-TForall
Γ⊢𝜏::∗@𝐴
Γ⊢𝜏::∗@𝐴𝛼
MD-TCSP
Γ⊢𝜏::𝐾@𝐴Γ⊢𝐾≡𝐽@𝐴
Γ⊢𝜏::𝐽@𝐴
MD-TConv
Γ⊢𝜏::∗@𝐴Γ,𝑥:𝜏@𝐴⊢𝜎::∗@𝐴
Γ⊢Π𝑥:𝜏.𝜎::∗@𝐴
MD-Pi
The complete term-typing card begins with
𝑐:𝜏∈Σ
Γ⊢𝑐:𝜏@𝐴
MD-Const
𝑥:𝜏@𝐴∈Γ
Γ⊢𝑥:𝜏@𝐴
MD-Var
Γ⊢𝜏::∗@𝐴Γ,𝑥:𝜏@𝐴⊢𝑀:𝜎@𝐴
Γ⊢𝜆𝑥:𝜏.𝑀:Π𝑥:𝜏.𝜎@𝐴
MD-Abs
Γ⊢𝑀:Π𝑥:𝜏.𝜎@𝐴Γ⊢𝑁:𝜏@𝐴
Γ⊢𝑀𝑁:𝜎[𝑁/𝑥]@𝐴
MD-App
Γ⊢𝑀:𝜏@𝐴Γ⊢𝜏≡𝜎::∗@𝐴
Γ⊢𝑀:𝜎@𝐴
MD-Conv
Quotation, escape, stage abstraction/application, and cross-stage persistence are
Γ⊢𝑀:𝜏@𝐴𝛼
Γ⊢⟨𝑀⟩𝛼:▹𝛼𝜏@𝐴
MD-Quote
Γ⊢𝑀:▹𝛼𝜏@𝐴
Γ⊢∼𝛼𝑀:𝜏@𝐴𝛼
MD-Escape
Γ⊢𝑀:𝜏@𝐴𝛼∉FTV(Γ)∪FTV(𝐴)
Γ⊢Λ𝛼.𝑀:∀𝛼.𝜏@𝐴
MD-SAbs
Γ⊢𝑀:∀𝛼.𝜏@𝐴
Γ⊢𝑀𝐵:𝜏[𝐵/𝛼]@𝐴
MD-SApp
Γ⊢𝑀:𝜏@𝐴
Γ⊢%𝛼𝑀:𝜏@𝐴𝛼
MD-CSP
The three equality judgments are Γ⊢𝐾≡𝐽@𝐴, Γ⊢𝜏≡𝜎::𝐾@𝐴, and Γ⊢𝑀≡𝑁:𝜏@𝐴. Kind equality is generated by
Γ⊢𝜏≡𝜎::∗@𝐴Γ,𝑥:𝜏@𝐴⊢𝐾≡𝐽@𝐴
Γ⊢Π𝑥:𝜏.𝐾≡Π𝑥:𝜎.𝐽@𝐴
MD-QK-Pi
Γ⊢𝐾≡𝐽@𝐴
Γ⊢𝐾≡𝐽@𝐴𝛼
MD-QK-CSP
Γ⊢𝐾𝗄𝗂𝗇𝖽@𝐴
Γ⊢𝐾≡𝐾@𝐴
MD-QK-Refl
Γ⊢𝐾≡𝐽@𝐴
Γ⊢𝐽≡𝐾@𝐴
MD-QK-Sym
Γ⊢𝐾≡𝐽@𝐴Γ⊢𝐽≡𝐼@𝐴
Γ⊢𝐾≡𝐼@𝐴
MD-QK-Trans
Type equality is generated by
Γ⊢𝜏≡𝜎::∗@𝐴Γ,𝑥:𝜏@𝐴⊢𝜌≡𝜋::∗@𝐴
Γ⊢Π𝑥:𝜏.𝜌≡Π𝑥:𝜎.𝜋::∗@𝐴
MD-QT-Pi
Γ⊢𝜏≡𝜎::Π𝑥:𝜌.𝐾@𝐴Γ⊢𝑀≡𝑁:𝜌@𝐴
Γ⊢𝜏𝑀≡𝜎𝑁::𝐾[𝑀/𝑥]@𝐴
MD-QT-App
Γ⊢𝜏≡𝜎::∗@𝐴𝛼
Γ⊢▹𝛼𝜏≡▹𝛼𝜎::∗@𝐴
MD-QT-Code
Γ⊢𝜏≡𝜎::∗@𝐴𝛼∉FTV(Γ)∪FTV(𝐴)
Γ⊢∀𝛼.𝜏≡∀𝛼.𝜎::∗@𝐴
MD-QT-Forall
Γ⊢𝜏≡𝜎::∗@𝐴
Γ⊢𝜏≡𝜎::∗@𝐴𝛼
MD-QT-CSP
Γ⊢𝜏::𝐾@𝐴
Γ⊢𝜏≡𝜏::𝐾@𝐴
MD-QT-Refl
Γ⊢𝜏≡𝜎::𝐾@𝐴
Γ⊢𝜎≡𝜏::𝐾@𝐴
MD-QT-Sym
Γ⊢𝜏≡𝜎::𝐾@𝐴Γ⊢𝜎≡𝜌::𝐾@𝐴
Γ⊢𝜏≡𝜌::𝐾@𝐴
MD-QT-Trans
Term congruence and equivalence are
Γ⊢𝜏≡𝜎::∗@𝐴Γ,𝑥:𝜏@𝐴⊢𝑀≡𝑁:𝜌@𝐴
Γ⊢𝜆𝑥:𝜏.𝑀≡𝜆𝑥:𝜎.𝑁:Π𝑥:𝜏.𝜌@𝐴
MD-Q-Abs
Γ⊢𝑀≡𝐿:Π𝑥:𝜎.𝜏@𝐴Γ⊢𝑁≡𝑂:𝜎@𝐴
Γ⊢𝑀𝑁≡𝐿𝑂:𝜏[𝑁/𝑥]@𝐴
MD-Q-App
Γ⊢𝑀≡𝑁:𝜏@𝐴𝛼
Γ⊢⟨𝑀⟩𝛼≡⟨𝑁⟩𝛼:▹𝛼𝜏@𝐴
MD-Q-Quote
Γ⊢𝑀≡𝑁:▹𝛼𝜏@𝐴
Γ⊢∼𝛼𝑀≡∼𝛼𝑁:𝜏@𝐴𝛼
MD-Q-Escape
Γ⊢𝑀≡𝑁:𝜏@𝐴𝛼∉FTV(Γ)∪FTV(𝐴)
Γ⊢Λ𝛼.𝑀≡Λ𝛼.𝑁:∀𝛼.𝜏@𝐴
MD-Q-SAbs
Γ⊢𝑀≡𝑁:∀𝛼.𝜏@𝐴
Γ⊢𝑀𝐵≡𝑁𝐵:𝜏[𝐵/𝛼]@𝐴
MD-Q-SApp
Γ⊢𝑀≡𝑁:𝜏@𝐴
Γ⊢%𝛼𝑀≡%𝛼𝑁:𝜏@𝐴𝛼
MD-Q-CSP
Γ⊢𝑀:𝜏@𝐴
Γ⊢𝑀≡𝑀:𝜏@𝐴
MD-Q-Refl
Γ⊢𝑀≡𝑁:𝜏@𝐴
Γ⊢𝑁≡𝑀:𝜏@𝐴
MD-Q-Sym
Γ⊢𝑀≡𝑁:𝜏@𝐴Γ⊢𝑁≡𝐿:𝜏@𝐴
Γ⊢𝑀≡𝐿:𝜏@𝐴
MD-Q-Trans
Its four computational axioms are
Γ,𝑥:𝜎@𝐴⊢𝑀:𝜏@𝐴Γ⊢𝑁:𝜎@𝐴
Γ⊢(𝜆𝑥:𝜎.𝑀)𝑁≡𝑀[𝑁/𝑥]:𝜏[𝑁/𝑥]@𝐴
MD-Q-Beta
Γ⊢𝑀≡𝑁:𝜏@𝐴𝛼
Γ⊢∼𝛼⟨𝑀⟩𝛼≡𝑁:𝜏@𝐴𝛼
MD-Q-Splice
Γ⊢Λ𝛼.𝑀:∀𝛼.𝜏@𝐴
Γ⊢(Λ𝛼.𝑀)𝐵≡𝑀[𝐵/𝛼]:𝜏[𝐵/𝛼]@𝐴
MD-Q-StageBeta
Γ⊢𝑀:𝜏@𝐴𝛼Γ⊢𝑀:𝜏@𝐴
Γ⊢%𝛼𝑀≡𝑀:𝜏@𝐴𝛼
MD-Q-Percent
For staged evaluation, constant-headed neutral spines and values are defined mutually by ℎ𝜀::=𝑐∣ℎ𝜀𝑣𝜀∣ℎ𝜀𝐵,ℎ𝐴′::=𝑐∣𝑥∣ℎ𝐴′𝑣𝐴′∣ℎ𝐴′𝐵∣∼𝛼ℎ𝜀(𝐴′=𝛼),𝑣𝜀::=ℎ𝜀∣𝜆𝑥:𝜏.𝑀∣⟨𝑣𝛼⟩𝛼∣Λ𝛼.𝑣𝜀,𝑣𝐴′::=ℎ𝐴′∣𝜆𝑥:𝜏.𝑣𝐴′∣𝑣𝐴′𝑣𝐴′∣⟨𝑣𝐴′𝛼⟩𝛼∣Λ𝛼.𝑣𝐴′∣𝑣𝐴′𝐵∣∼𝛼𝑣𝐴″(𝐴′=𝐴″𝛼,𝐴″≠𝜀)∣%𝛼𝑣𝐴″(𝐴′=𝐴″𝛼). Let 𝐷 be either 𝜀 or one stage variable. The hole of 𝐸𝐴𝐷 lies at stage 𝐷, and the whole context lies at stage 𝐴: 𝐸𝜀𝐷::=[](𝐷=𝜀)∣𝐸𝜀𝐷𝑀∣𝑣𝜀𝐸𝜀𝐷∣⟨𝐸𝛼𝐷⟩𝛼∣Λ𝛼.𝐸𝜀𝐷∣𝐸𝜀𝐷𝐶,𝐸𝐴′𝐷::=[](𝐴′=𝐷)∣𝜆𝑥:𝜏.𝐸𝐴′𝐷∣𝐸𝐴′𝐷𝑀∣𝑣𝐴′𝐸𝐴′𝐷∣⟨𝐸𝐴′𝛼𝐷⟩𝛼∣∼𝛼𝐸𝐴𝐷(𝐴𝛼=𝐴′)∣Λ𝛼.𝐸𝐴′𝐷∣𝐸𝐴′𝐷𝐶∣%𝛼𝐸𝐴𝐷(𝐴𝛼=𝐴′). The redex grammar is 𝑅𝜀::=(𝜆𝑥:𝜏.𝑀)𝑣𝜀∣(Λ𝛼.𝑣𝜀)𝐶,𝑅𝛼::=∼𝛼⟨𝑣𝛼⟩𝛼. The staged relation consists exactly of 𝐸𝐴𝜀[(𝜆𝑥:𝜏.𝑀)𝑣𝜀]⟶𝑠𝐸𝐴𝜀[𝑀[𝑣𝜀/𝑥]],𝐸𝐴𝜀[(Λ𝛼.𝑣𝜀)𝐶]⟶𝑠𝐸𝐴𝜀[𝑣𝜀[𝐶/𝛼]],𝐸𝐴𝛼[∼𝛼⟨𝑣𝛼⟩𝛼]⟶𝑠𝐸𝐴𝛼[𝑣𝛼]. These are published 𝜆𝖬𝖣 rules. The theorem-bearing book-local system 𝜆𝖬𝖣𝗂𝗌 deletes type-equivalence rule MD-QT-CSP; code-head inversion additionally states the body-formation premise required because the remaining type-level CSP formation rule can move a code type to a later word. Its staged final forms extend the published value grammar by constant-headed spines, which repairs stuck function-constant applications without adding a full-reduction rule. Its full contexts remain in the term syntactic category and never enter a binder annotation, type, or kind. A typed dependent-annotation peak therefore refutes exact syntactic confluence; the chapter proves confluence only modulo binder-annotation erasure. These explicit boundaries govern the chapter’s preservation, term-only normalization, annotation-erased confluence, decomposition, and staged-progress proofs. They are not the exact published metatheorem package.