The call-by-value continuation calculus extends the simply typed products, sums, 𝟎, 𝟏, naturals, and arrows by 𝐴::=⋯∣𝖢𝗈𝗇𝗍𝐴,𝑒::=⋯∣𝗅𝖾𝗍𝖼𝖼𝑘:𝖢𝗈𝗇𝗍𝐴𝗂𝗇𝑒∣𝗍𝗁𝗋𝗈𝗐𝑒𝗍𝗈𝑒. Its two new surface rules are
Γ,𝑘:𝖢𝗈𝗇𝗍𝐴⊢𝑒:𝐴
Γ⊢𝗅𝖾𝗍𝖼𝖼𝑘:𝖢𝗈𝗇𝗍𝐴𝗂𝗇𝑒:𝐴
T-Letcc
Γ⊢𝑒1:𝐴Γ⊢𝑒2:𝖢𝗈𝗇𝗍𝐴Γ⊢𝐵𝗍𝗒𝗉𝖾
Γ⊢𝗍𝗁𝗋𝗈𝗐𝑒1𝗍𝗈𝑒2:𝐵
T-Throw
Runtime values additionally contain 𝖼𝗈𝗇𝗍(𝐾), and 𝐹::=[]𝑒∣𝑣[]∣⟨[],𝑒⟩∣⟨𝑣,[]⟩∣𝜋𝑖[]∣𝗂𝗇𝗅[]∣𝗂𝗇𝗋[]∣𝖼𝖺𝗌𝖾[]𝗈𝖿{𝗂𝗇𝗅𝑥↦𝑒1;𝗂𝗇𝗋𝑦↦𝑒2}∣𝖺𝖻𝗈𝗋𝗍𝐴([])∣𝗍𝗁𝗋𝗈𝗐[]𝗍𝗈𝑒∣𝗍𝗁𝗋𝗈𝗐𝑣𝗍𝗈[],𝐾::=∙∣𝐾;𝐹. States are 𝐾▹𝑒 and 𝐾◃𝑣. The complete pure roots are 𝐾▹𝑣⟶𝐾◃𝑣,𝐾▹𝑒1𝑒2⟶𝐾;[]𝑒2▹𝑒1,𝐾;[]𝑒2◃𝑣1⟶𝐾;𝑣1[]▹𝑒2,𝐾;(𝜆𝑥.𝑒)[]◃𝑣⟶𝐾▹𝑒[𝑣/𝑥],𝐾▹⟨𝑒1,𝑒2⟩⟶𝐾;⟨[],𝑒2⟩▹𝑒1,𝐾;⟨[],𝑒2⟩◃𝑣1⟶𝐾;⟨𝑣1,[]⟩▹𝑒2,𝐾;⟨𝑣1,[]⟩◃𝑣2⟶𝐾◃⟨𝑣1,𝑣2⟩,𝐾▹𝜋𝑖𝑒⟶𝐾;𝜋𝑖[]▹𝑒,𝐾;𝜋𝑖[]◃⟨𝑣1,𝑣2⟩⟶𝐾◃𝑣𝑖,𝐾▹𝗂𝗇𝗅𝑒⟶𝐾;𝗂𝗇𝗅[]▹𝑒,𝐾;𝗂𝗇𝗅[]◃𝑣⟶𝐾◃𝗂𝗇𝗅𝑣,𝐾▹𝗂𝗇𝗋𝑒⟶𝐾;𝗂𝗇𝗋[]▹𝑒,𝐾;𝗂𝗇𝗋[]◃𝑣⟶𝐾◃𝗂𝗇𝗋𝑣. The three push roots for ⟨𝑒1,𝑒2⟩, 𝗂𝗇𝗅𝑒, and 𝗂𝗇𝗋𝑒 apply only when their complete subject is not already a value; the corresponding return roots handle value subjects. This is the same value-first side condition used in the chapter. Writing 𝐶 for the displayed pair of case branches, the remaining pure roots are 𝐾▹𝖼𝖺𝗌𝖾𝑒𝗈𝖿𝐶⟶𝐾;𝖼𝖺𝗌𝖾[]𝗈𝖿𝐶▹𝑒,𝐾;𝖼𝖺𝗌𝖾[]𝗈𝖿𝐶◃𝗂𝗇𝗅𝑣⟶𝐾▹𝑒1[𝑣/𝑥],𝐾;𝖼𝖺𝗌𝖾[]𝗈𝖿𝐶◃𝗂𝗇𝗋𝑣⟶𝐾▹𝑒2[𝑣/𝑦],𝐾▹𝖺𝖻𝗈𝗋𝗍𝐴(𝑒)⟶𝐾;𝖺𝖻𝗈𝗋𝗍𝐴([])▹𝑒,𝐾;𝖺𝖽𝖽𝑚[]◃𝑛⟶𝐾◃(𝑚+𝑛). There is no return root for the abort frame. The complete control roots are 𝐾▹𝗅𝖾𝗍𝖼𝖼𝑘𝗂𝗇𝑒⟶𝐾▹𝑒[𝖼𝗈𝗇𝗍(𝐾)/𝑘],𝐾▹𝗍𝗁𝗋𝗈𝗐𝑒1𝗍𝗈𝑒2⟶𝐾;𝗍𝗁𝗋𝗈𝗐[]𝗍𝗈𝑒2▹𝑒1,𝐾;𝗍𝗁𝗋𝗈𝗐[]𝗍𝗈𝑒2◃𝑣⟶𝐾;𝗍𝗁𝗋𝗈𝗐𝑣𝗍𝗈[]▹𝑒2,𝐾;𝗍𝗁𝗋𝗈𝗐𝑣𝗍𝗈[]◃𝖼𝗈𝗇𝗍(𝐾′)⟶𝐾′◃𝑣.
For a fixed run answer 𝑅, frame typing is exactly []𝑒2(𝐴→𝐵)⇒𝐵(⊢𝑅𝑒2:𝐴)𝑣[]𝐴⇒𝐵(⊢𝑅𝑣:𝐴→𝐵)⟨[],𝑒2⟩𝐴⇒𝐴×𝐵(⊢𝑅𝑒2:𝐵)⟨𝑣,[]⟩𝐵⇒𝐴×𝐵(⊢𝑅𝑣:𝐴)𝜋𝑖[]𝐴1×𝐴2⇒𝐴𝑖𝗂𝗇𝗅[]𝐴⇒𝐴+𝐵𝗂𝗇𝗋[]𝐵⇒𝐴+𝐵𝖺𝖻𝗈𝗋𝗍𝐵([])𝟎⇒𝐵𝖼𝖺𝗌𝖾[]𝗈𝖿𝐶𝐴+𝐵⇒𝐶𝗍𝗁𝗋𝗈𝗐[]𝗍𝗈𝑒2𝐴⇒𝐵(⊢𝑅𝑒2:𝖢𝗈𝗇𝗍𝐴)𝗍𝗁𝗋𝗈𝗐𝑣𝗍𝗈[]𝖢𝗈𝗇𝗍𝐴⇒𝐵(⊢𝑅𝑣:𝐴). The case row requires 𝑥:𝐴⊢𝑅𝑒1:𝐶 and 𝑦:𝐵⊢𝑅𝑒2:𝐶. Stack, internal value, and state typing are
∙:𝑅⇒𝑅
K-Empty
𝐾:𝐵⇒𝑅𝐹:𝐴⇒𝐵
𝐾;𝐹:𝐴⇒𝑅
K-Push
𝐾:𝐴⇒𝑅
⊢𝑅𝖼𝗈𝗇𝗍(𝐾):𝖢𝗈𝗇𝗍𝐴
T-Cont
𝐾:𝐴⇒𝑅⊢𝑅𝑒:𝐴
⊢𝑅𝐾▹𝑒
S-Eval
𝐾:𝐴⇒𝑅⊢𝑅𝑣:𝐴
⊢𝑅𝐾◃𝑣
S-Ret
The fixed-answer CPS signature
The pure target has the same base, product, sum, and empty types and no control forms. Value and computation types are 𝟎𝗏=𝟎,𝟏𝗏=𝟏,𝖭𝖺𝗍𝗏=𝖭𝖺𝗍,(𝐴×𝐵)𝗏=𝐴𝗏×𝐵𝗏,(𝐴+𝐵)𝗏=𝐴𝗏+𝐵𝗏,(𝐴→𝐵)𝗏=𝐴𝗏→𝐵𝖼,(𝖢𝗈𝗇𝗍𝐴)𝗏=𝐴𝗏→𝟎,𝐴𝖼=(𝐴𝗏→𝟎)→𝟎. Values translate homomorphically, except (𝜆𝑥.𝑒)𝗏=𝜆𝑥.𝑒𝖼,𝖼𝗈𝗇𝗍(𝐾)𝗏=𝐾𝗄ℎ,𝑣𝖼=𝜆𝑘.𝑘𝑣𝗏. The complete nonvalue term translation is (𝑒1𝑒2)𝖼=𝜆𝑘.𝑒𝖼1(𝜆𝑓.𝑒𝖼2(𝜆𝑎.𝑓𝑎𝑘)),⟨𝑒1,𝑒2⟩𝖼=𝜆𝑘.𝑒𝖼1(𝜆𝑎.𝑒𝖼2(𝜆𝑏.𝑘⟨𝑎,𝑏⟩)),(𝜋𝑖𝑒)𝖼=𝜆𝑘.𝑒𝖼(𝜆𝑝.𝑘(𝜋𝑖𝑝)),(𝗂𝗇𝗅𝑒)𝖼=𝜆𝑘.𝑒𝖼(𝜆𝑎.𝑘(𝗂𝗇𝗅𝑎)),(𝗂𝗇𝗋𝑒)𝖼=𝜆𝑘.𝑒𝖼(𝜆𝑏.𝑘(𝗂𝗇𝗋𝑏)),(𝖺𝖻𝗈𝗋𝗍𝐴(𝑒))𝖼=𝜆𝑘:𝐴𝗏→𝟎.𝑒𝖼(𝜆𝑧:𝟎.𝑧),(𝗅𝖾𝗍𝖼𝖼𝑐𝗂𝗇𝑒)𝖼=𝜆𝜅:𝐴𝗏→𝟎.(𝑒𝖼[𝜅/𝑐])𝜅,(𝗍𝗁𝗋𝗈𝗐𝑒1𝗍𝗈𝑒2)𝖼=𝜆𝑘.𝑒𝖼1(𝜆𝑎.𝑒𝖼2(𝜆𝑐.𝑐𝑎)). For case, the continuation 𝑘 is passed to the translation of the selected branch. Fix fresh ℎ:𝑅𝗏→𝟎. The complete stack translation is ∙𝗄ℎ=ℎ,(𝐾;[]𝑒)𝗄ℎ=𝜆𝑓.𝑒𝖼(𝜆𝑎.𝑓𝑎𝐾𝗄ℎ),(𝐾;𝑣[])𝗄ℎ=𝜆𝑎.𝑣𝗏𝑎𝐾𝗄ℎ,(𝐾;⟨[],𝑒⟩)𝗄ℎ=𝜆𝑎.𝑒𝖼(𝜆𝑏.𝐾𝗄ℎ⟨𝑎,𝑏⟩),(𝐾;⟨𝑣,[]⟩)𝗄ℎ=𝜆𝑏.𝐾𝗄ℎ⟨𝑣𝗏,𝑏⟩,(𝐾;𝜋𝑖[])𝗄ℎ=𝜆𝑝.𝐾𝗄ℎ(𝜋𝑖𝑝),(𝐾;𝗂𝗇𝗅[])𝗄ℎ=𝜆𝑎.𝐾𝗄ℎ(𝗂𝗇𝗅𝑎),(𝐾;𝗂𝗇𝗋[])𝗄ℎ=𝜆𝑏.𝐾𝗄ℎ(𝗂𝗇𝗋𝑏),(𝐾;𝖺𝖻𝗈𝗋𝗍𝐴([]))𝗄ℎ=𝜆𝑧:𝟎.𝑧,(𝐾;𝗍𝗁𝗋𝗈𝗐[]𝗍𝗈𝑒)𝗄ℎ=𝜆𝑎.𝑒𝖼(𝜆𝑐.𝑐𝑎),(𝐾;𝗍𝗁𝗋𝗈𝗐𝑣𝗍𝗈[])𝗄ℎ=𝜆𝑐.𝑐𝑣𝗏. The case-frame clause is 𝜆𝑠.𝖼𝖺𝗌𝖾𝑠𝗈𝖿{𝗂𝗇𝗅𝑥↦𝑒𝖼1𝐾𝗄ℎ;𝗂𝗇𝗋𝑦↦𝑒𝖼2𝐾𝗄ℎ}. Finally ‖𝐾▹𝑒‖ℎ=𝑒𝖼𝐾𝗄ℎ,‖𝐾◃𝑣‖ℎ=𝐾𝗄ℎ𝑣𝗏.
The PPS ordered-row core and its four scoped deltas
The common kind, type/effect/row, term, and evaluation-context grammars are 𝜅::=𝖳∣𝖤∣𝖱,𝜏::=𝛼𝖳∣𝜏𝜌→𝜏∣∀𝛼::𝜅.𝜏,𝜀::=𝛼𝖤∣𝜀ext,𝜌::=𝛼𝖱∣𝜄∣𝜀⋅𝜌,𝑣::=𝑥∣𝜆𝑥.𝑒,𝑒::=𝑣∣𝑒𝑒∣[𝑒],𝐸::=[]∣𝐸𝑒∣𝑣𝐸∣[𝐸]. The variable subscripts are metanotational kind tags, and 𝜀ext ranges over one of the four extension-specific effect forms below. A metavariable 𝜎 ranges over an expression of the kind demanded by its judgment. Thus the raw grammar keeps types, single effects, and ordered rows distinct. Rows are ordered. Writing a single effect after the slash abbreviates the row 𝜀⋅𝜄. Kinding consists of K-Var, K-Arr, K-All, K-Nil, and K-Cons:
𝛼::𝜅∈Δ
Δ⊢𝛼::𝜅
K-Var
Δ⊢𝜏1::𝖳Δ⊢𝜌::𝖱Δ⊢𝜏2::𝖳
Δ⊢𝜏1𝜌→𝜏2::𝖳
K-Arr
Δ,𝛼::𝜅⊢𝜏::𝖳
Δ⊢∀𝛼::𝜅.𝜏::𝖳
K-All
Δ⊢𝜄::𝖱
K-Nil
Δ⊢𝜀::𝖤Δ⊢𝜌::𝖱
Δ⊢𝜀⋅𝜌::𝖱
K-Cons
The term judgment Δ;Γ⊢𝑒:𝜏/𝜌 is generated by P-Var, P-Lam, P-App, P-Gen, P-Inst, P-Sub, and P-Lift, exactly:
𝑥:𝜏∈Γ
Δ;Γ⊢𝑥:𝜏/𝜄
P-Var
Δ;Γ,𝑥:𝜏1⊢𝑒:𝜏2/𝜌
Δ;Γ⊢𝜆𝑥.𝑒:𝜏1𝜌→𝜏2/𝜄
P-Lam
Δ;Γ⊢𝑒1:𝜏1𝜌→𝜏2/𝜌Δ;Γ⊢𝑒2:𝜏1/𝜌
Δ;Γ⊢𝑒1𝑒2:𝜏2/𝜌
P-App
Δ,𝛼::𝜅;Γ⊢𝑒:𝜏/𝜄𝛼∉𝖥𝖵(Γ)
Δ;Γ⊢𝑒:∀𝛼::𝜅.𝜏/𝜄
P-Gen
Δ⊢𝜎::𝜅Δ;Γ⊢𝑒:∀𝛼::𝜅.𝜏/𝜌
Δ;Γ⊢𝑒:𝜏[𝜎/𝛼]/𝜌
P-Inst
Δ⊢𝜏1<:𝜏2Δ⊢𝜌1<:𝜌2Δ;Γ⊢𝑒:𝜏1/𝜌1
Δ;Γ⊢𝑒:𝜏2/𝜌2
P-Sub
Δ⊢𝜀::𝖤Δ;Γ⊢𝑒:𝜏/𝜌
Δ;Γ⊢[𝑒]:𝜏/𝜀⋅𝜌
P-Lift
Subtyping has reflexive, contravariant/covariant arrow, universal, nil-row, and same-head row-cons rules. In full:
Δ⊢𝜎<:𝜎
Sub-Refl
Δ⊢𝜏21<:𝜏11Δ⊢𝜌1<:𝜌2Δ⊢𝜏12<:𝜏22
Δ⊢(𝜏11𝜌1⟶𝜏12)<:(𝜏21𝜌2⟶𝜏22)
Sub-Arr
Δ,𝛼::𝜅⊢𝜏1<:𝜏2
Δ⊢∀𝛼::𝜅.𝜏1<:∀𝛼::𝜅.𝜏2
Sub-All
Δ⊢𝜌::𝖱
Δ⊢𝜄<:𝜌
Sub-Nil
Δ⊢𝜌1<:𝜌2
Δ⊢𝜀⋅𝜌1<:𝜀⋅𝜌2
Sub-Cons
Core roots are beta and [𝑣]⟼𝑣, closed under 𝐸. Freeness starts at 0-𝖿𝗋𝖾𝖾([]), is preserved by application frames, and satisfies 𝑛-𝖿𝗋𝖾𝖾(𝐸)(𝑛+1)-𝖿𝗋𝖾𝖾([𝐸]).
The exact deep-handler delta is 𝜀=Δ0.𝜏1⇒𝜏2, with rules
Its capture root substitutes 𝜆𝑧.𝐸[𝑧], omitting the reset. Every handler/reset context lowers the freeness index by one; every capture root requires a 0-free context.
The nonhomomorphic term clauses whose signatures the deltas support are 𝖣𝖧(𝗌𝗁𝗂𝖿𝗍0𝑘.𝑒)=𝖽𝗈(𝜆𝑘.𝖣𝖧(𝑒)),𝖣𝖧(⟨𝑒∣𝑥.𝑒𝑟⟩)=𝗁𝖺𝗇𝖽𝗅𝖾𝖣𝖧(𝑒){𝑓,𝑟.𝑓𝑟;𝑥.𝖣𝖧(𝑒𝑟)},𝖣𝖣(𝖽𝗈𝑣)=𝗌𝗁𝗂𝖿𝗍0𝑘.𝜆ℎ.ℎ𝖣𝖣(𝑣)(𝜆𝑥.𝑘𝑥ℎ),𝖣𝖣(𝗁𝖺𝗇𝖽𝗅𝖾𝑒{𝑥,𝑟.𝑒ℎ;𝑦.𝑒𝑟})=⟨𝖣𝖣(𝑒)∣𝑦.𝜆ℎ.𝖣𝖣(𝑒𝑟)⟩(𝜆𝑥.𝜆𝑟.𝖣𝖣(𝑒ℎ)),𝖲𝖧(𝖼𝗈𝗇𝗍𝗋𝗈𝗅0𝑘.𝑒)=𝖽𝗈(𝜆𝑘.𝖲𝖧(𝑒)),𝖲𝖧(⟨𝑒∣𝑥.𝑒𝑟⟩)=𝗁𝖺𝗇𝖽𝗅𝖾𝖲𝖧(𝑒){𝑓,𝑟.𝑓𝑟;𝑥.𝖲𝖧(𝑒𝑟)},𝖲𝖣(𝖽𝗈𝑣)=𝖼𝗈𝗇𝗍𝗋𝗈𝗅0𝑘.𝜆ℎ.ℎ𝖲𝖣(𝑣)𝑘,𝖲𝖣(𝗁𝖺𝗇𝖽𝗅𝖾𝑒{𝑥,𝑟.𝑒ℎ;𝑦.𝑒𝑟})=⟨𝖲𝖣(𝑒)∣𝑦.𝜆ℎ.𝖲𝖣(𝑒𝑟)⟩(𝜆𝑥.𝜆𝑟.𝖲𝖣(𝑒ℎ)).
For parity, the four single-effect translations are 𝖣𝖧(Δ0.𝜏/𝜌)=𝛼::𝖳.∀Δ0.((𝛼𝖣𝖧(𝜌)←←←←←←←←←←←→𝖣𝖧(𝜏))𝖣𝖧(𝜌)←←←←←←←←←←←→𝖣𝖧(𝜏))⇒𝛼,𝖣𝖣(Δ0.𝜏1⇒𝜏2)=𝛼::𝖳,𝛽::𝖱.(∀Δ0.𝖣𝖣(𝜏1)→(𝖣𝖣(𝜏2)𝛽→𝛼)𝛽→𝛼)𝛽→𝛼/𝛽,𝖲𝖧(𝜇𝛼.Δ0.𝜏1⇒𝜏2/𝜌)=𝜇𝛼.𝛽::𝖳.(∀Δ0.(𝛽𝛼⋅𝖲𝖧(𝜌)←←←←←←←←←←←←←→𝖲𝖧(𝜏1))𝖲𝖧(𝜌)←←←←←←←←←←→𝖲𝖧(𝜏2))⇒𝛽. For the reverse shallow clause, put 𝐻(𝑎,𝑏1,𝑏2,𝑔):=∀Δ0.𝖲𝖣(𝜏1)→(𝖲𝖣(𝜏2)𝑎⋅𝑔⟶𝑏1)𝑔→𝑏2. Then 𝖲𝖣(𝜇𝛼.Δ0.𝜏1⇒𝜏2)=𝜇𝛼.𝛽1::𝖳,𝛽2::𝖳,𝛾::𝖱.𝛽1⇒(𝐻(𝛼,𝛽1,𝛽2,𝛾)𝛾→𝛽2)/𝛾. In every displayed ∀Δ0, the quantifier scopes the entire following arrow expression and retains the declared kind of every member of Δ0.
The hypothetical dependent commuting-projection boundary
This is a separate call-by-name calculus, not 𝜆𝖪. 𝐴,𝐵::=⊥∣𝑡=𝑢∣∃𝑥:𝖭𝖺𝗍.𝐴,𝑡,𝑢::=𝑥∣𝑛∣𝗐𝗂𝗍𝑝∣𝖼𝖺𝗅𝗅𝖼𝖼𝑘𝑡,𝑝,𝑞::=𝑎∣𝗋𝖾𝖿𝗅∣(𝑡,𝑝)∣𝗉𝗋𝖿𝑝∣𝗌𝗎𝖻𝗌𝗍𝑝𝑞∣𝖼𝖺𝗅𝗅𝖼𝖼𝑘𝑝∣𝗍𝗁𝗋𝗈𝗐𝑘𝑝∣𝗍𝗁𝗋𝗈𝗐𝑘𝑡,𝑉::=𝑎∣𝗋𝖾𝖿𝗅∣(𝑡,𝑉). Contexts are sorted: Γ::=∅∣Γ,𝑥:𝖭𝖺𝗍∣Γ,𝑎:𝐴∣Γ,𝑘÷𝐴∣Γ,𝑘÷𝖭𝖺𝗍. Here 𝑘÷𝐴 names a proof continuation accepting an 𝐴-proof, and 𝑘÷𝖭𝖺𝗍 names a number continuation. The rules below print these entries as 𝑘:¬𝐴 and 𝑘:𝖭𝖺𝗍→⊥ for readability; they are continuation names rather than formulas or ordinary functions. Formula formation and the number/proof leaves are
Γ⊢⊥𝗉𝗋𝗈𝗉
Dep-Bot-F
Γ⊢𝑡:𝖭𝖺𝗍Γ⊢𝑢:𝖭𝖺𝗍
Γ⊢𝑡=𝑢𝗉𝗋𝗈𝗉
Dep-Eq-F
Γ,𝑥:𝖭𝖺𝗍⊢𝐴𝗉𝗋𝗈𝗉
Γ⊢∃𝑥:𝖭𝖺𝗍.𝐴𝗉𝗋𝗈𝗉
Dep-Ex-F
𝑛∈ℕ
Γ⊢𝑛:𝖭𝖺𝗍
Dep-Nat
𝑥:𝖭𝖺𝗍∈Γ
Γ⊢𝑥:𝖭𝖺𝗍
Dep-Var-N
𝑎:𝐴∈Γ
Γ⊢𝑎:𝐴
Dep-Var-P
The exact strong-pair and equality rules are
Γ⊢𝑡:𝖭𝖺𝗍Γ⊢𝑝:𝐴[𝑡/𝑥]
Γ⊢(𝑡,𝑝):∃𝑥:𝖭𝖺𝗍.𝐴
Dep-Pair
Γ⊢𝑝:∃𝑥:𝖭𝖺𝗍.𝐴
Γ⊢𝗐𝗂𝗍𝑝:𝖭𝖺𝗍
Dep-Wit
Γ⊢𝑝:∃𝑥:𝖭𝖺𝗍.𝐴
Γ⊢𝗉𝗋𝖿𝑝:𝐴[𝗐𝗂𝗍𝑝/𝑥]
Dep-Prf
𝑡≡𝑢
Γ⊢𝗋𝖾𝖿𝗅:𝑡=𝑢
Dep-Refl
Γ⊢𝑝:𝑡=𝑢Γ⊢𝑞:𝐵[𝑡/𝑥]
Γ⊢𝗌𝗎𝖻𝗌𝗍𝑝𝑞:𝐵[𝑢/𝑥]
Dep-Subst
Conversion along congruential formula convertibility is the explicit rule
Γ⊢𝑝:𝐴𝐴≡𝐵
Γ⊢𝑝:𝐵
Dep-Conv
Proof and number control have
Γ,𝑘:¬𝐴⊢𝑝:𝐴
Γ⊢𝖼𝖺𝗅𝗅𝖼𝖼𝑘𝑝:𝐴
Dep-Callcc-P
Γ,𝑘:¬𝐴⊢𝑝:𝐴Γ⊢𝐵𝗉𝗋𝗈𝗉
Γ,𝑘:¬𝐴⊢𝗍𝗁𝗋𝗈𝗐𝑘𝑝:𝐵
Dep-Throw-P
Γ,𝑘:𝖭𝖺𝗍→⊥⊢𝑡:𝖭𝖺𝗍
Γ⊢𝖼𝖺𝗅𝗅𝖼𝖼𝑘𝑡:𝖭𝖺𝗍
Dep-Callcc-N
Γ,𝑘:𝖭𝖺𝗍→⊥⊢𝑡:𝖭𝖺𝗍Γ⊢𝐵𝗉𝗋𝗈𝗉
Γ,𝑘:𝖭𝖺𝗍→⊥⊢𝗍𝗁𝗋𝗈𝗐𝑘𝑡:𝐵
Dep-Throw-N
The assumption 𝑘:¬𝐴 names a captured proof context accepting 𝐴 with command answer sort ⊥; 𝑘:𝖭𝖺𝗍→⊥ analogously names a captured number context. They are not lambda-bound function variables and are invoked only by their matching throws. Pair projections, equality substitution, commuting, and vacuity are 𝗐𝗂𝗍(𝑡,𝑝)⟼𝑡,𝗉𝗋𝖿(𝑡,𝑝)⟼𝑝,𝗌𝗎𝖻𝗌𝗍𝗋𝖾𝖿𝗅𝑝⟼𝑝,𝗐𝗂𝗍(𝖼𝖺𝗅𝗅𝖼𝖼𝑘𝑝)⟼𝖼𝖺𝗅𝗅𝖼𝖼𝑘(𝗐𝗂𝗍(𝑝[𝑘∘𝗐𝗂𝗍/𝑘])),𝖼𝖺𝗅𝗅𝖼𝖼𝑘𝑢⟼𝑢(𝑘∉𝖥𝖵(𝑢)). Reduction is closed under both sorts of 𝖼𝖺𝗅𝗅𝖼𝖼. The value-restricted variant changes Dep-Wit and Dep-Prf so their premise must be a syntactic 𝑉; no soundness theorem beyond that boundary is imported.
The polymorphic continuation counterexample card
For the separate ML assignment card, let 𝖢𝗅𝗈𝗌𝖾Γ(𝜏) universally quantify exactly ftv(𝜏)∖ftv(Γ), and write 𝜎≽𝜏 for monotype instantiation. Its complete rules are
Γ(𝑥)≽𝜏
Γ⊢𝑥:𝜏
ML-Var
Σ(𝑐)≽𝜏
Γ⊢𝑐:𝜏
ML-Const
Γ,𝑥:𝜏1⊢𝑒:𝜏2𝑥∉dom(Γ)
Γ⊢𝜆𝑥.𝑒:𝜏1→𝜏2
ML-Abs
Γ⊢𝑒1:𝜏2→𝜏Γ⊢𝑒2:𝜏2
Γ⊢𝑒1𝑒2:𝜏
ML-App
Γ⊢𝑒1:𝜏1Γ,𝑥:𝖢𝗅𝗈𝗌𝖾Γ(𝜏1)⊢𝑒2:𝜏2𝑥∉dom(Γ)
Γ⊢𝗅𝖾𝗍𝑥𝖻𝖾𝑒1𝗂𝗇𝑒2:𝜏2
ML-Let
At a fixed answer monotype, its continuation evaluator is generated by