This appendix freezes the selected rules used by chapter 33. Identical metavariables in the three cards do not identify their judgments.
𝖬𝖾𝗍[T]
Fix an effect structure T, a signature Σ(ℓ)=𝐴⇝𝐵, and the modality action and composition from section 33.1. Write 𝖫(Γ′) for the composite of locks in Γ′. Kinds are 𝖠𝖻𝗌, 𝖠𝗇𝗒, and 𝖤𝖿𝖿, with 𝖠𝖻𝗌 the sole proper subkind of 𝖠𝗇𝗒. The effect structure supplies extension kinding Γ⊢𝐷:𝖤𝖿𝖿 and equivalence Γ⊢𝐷≡T𝐷′. The induced effect-context interface is
Γ⊢∅:𝖤𝖿𝖿
E-Empty
𝜖:𝖤𝖿𝖿∈Γ
Γ⊢𝜖:𝖤𝖿𝖿
E-Var
Γ⊢𝐷:𝖤𝖿𝖿Γ⊢𝐸:𝖤𝖿𝖿
Γ⊢𝐷,𝐸:𝖤𝖿𝖿
E-Cons
Γ⊢∅≡T∅
E-EqEmpty
𝜖:𝖤𝖿𝖿∈Γ
Γ⊢𝜖≡T𝜖
E-EqVar
Γ⊢𝐷1≡T𝐷2Γ⊢𝐸1≡T𝐸2
Γ⊢𝐷1,𝐸1≡T𝐷2,𝐸2
E-EqCons
Γ⊢𝐸,𝐷≡T𝐹
Γ⊢𝐸⪯𝖾𝐹
E-Include
Variables have their declared kind; 1:𝖠𝖻𝗌; [𝐸]𝐴:𝖠𝖻𝗌 when 𝐴:𝖠𝗇𝗒; ⟨𝐷⟩𝐴:𝐾 when 𝐴:𝐾; arrows have kind 𝖠𝗇𝗒; and ∀𝛼𝐾.𝐴:𝐾′ when Γ,𝛼:𝐾⊢𝐴:𝐾′. Each operation declaration 𝐴⇝𝐵 requires 𝐴,𝐵:𝖠𝖻𝗌.
For completeness, the value-type kinding rules are
Γ⊢𝐴:𝖠𝖻𝗌
Γ⊢𝐴:𝖠𝗇𝗒
K-Sub
𝛼:𝐾∈Γ
Γ⊢𝛼:𝐾
K-Var
Γ⊢1:𝖠𝖻𝗌
K-Unit
Γ⊢[𝐸]Γ⊢𝐴:𝖠𝗇𝗒
Γ⊢◻[𝐸]𝐴:𝖠𝖻𝗌
K-AbsBox
Γ⊢⟨𝐷⟩Γ⊢𝐴:𝐾
Γ⊢◻⟨𝐷⟩𝐴:𝐾
K-ExtBox
Γ⊢𝐴:𝖠𝗇𝗒Γ⊢𝐵:𝖠𝗇𝗒
Γ⊢𝐴→𝐵:𝖠𝗇𝗒
K-Arrow
Γ,𝛼:𝐾⊢𝐴:𝐾′
Γ⊢∀𝛼𝐾.𝐴:𝐾′
K-Forall
Γ⊢𝐸:𝖤𝖿𝖿
Γ⊢[𝐸]
K-AbsMod
Γ⊢𝐷:𝖤𝖿𝖿
Γ⊢⟨𝐷⟩
K-ExtMod
Γ⊢𝐴:𝖠𝖻𝗌Γ⊢𝐵:𝖠𝖻𝗌
Γ⊢𝐴⇝𝐵
K-OpSig
Figure 9, Appendix B.1, p. 31 of [TL26] reuses 𝐾 for both the quantified variable and the body kind in K-Forall. That printing rejects the paper’s own effect-polymorphic capability translation. Rule K-Forall above makes the necessary distinction between binder kind 𝐾 and body kind 𝐾′.
Modal and type equivalence are structural over the selected effect equivalence:
Γ⊢𝐸≡T𝐹
Γ⊢[𝐸]≡𝖬𝖾𝗍[𝐹]
Eq-AbsMod
Γ⊢𝐷≡T𝐷′
Γ⊢⟨𝐷⟩≡𝖬𝖾𝗍⟨𝐷′⟩
Eq-ExtMod
𝛼:𝐾∈Γ
Γ⊢𝛼≡𝖬𝖾𝗍𝛼
Eq-Var
Γ⊢1≡𝖬𝖾𝗍1
Eq-Unit
Γ⊢𝜇≡𝖬𝖾𝗍𝜈Γ⊢𝐴≡𝖬𝖾𝗍𝐵
Γ⊢◻𝜇𝐴≡𝖬𝖾𝗍◻𝜈𝐵
Eq-Box
Γ⊢𝐴≡𝖬𝖾𝗍𝐴′Γ⊢𝐵≡𝖬𝖾𝗍𝐵′
Γ⊢𝐴→𝐵≡𝖬𝖾𝗍𝐴′→𝐵′
Eq-Arrow
Γ,𝛼:𝐾⊢𝐴≡𝖬𝖾𝗍𝐵
Γ⊢∀𝛼𝐾.𝐴≡𝖬𝖾𝗍∀𝛼𝐾.𝐵
Eq-Forall
The context well-formedness judgment is Γ@𝐸. Its full rules are
∅@𝐸
WF-Empty
Γ@𝐹Γ⊢𝐴:𝐾
Γ,𝑥:𝜇𝐹𝐴@𝐹
WF-Var
Γ@𝐹𝜇(𝐹)=𝐸
Γ,𝗅𝗈𝖼𝗄(𝜇𝐹)@𝐸
WF-Lock
Γ@𝐸
Γ,𝛼:𝐾@𝐸
WF-TVar
Γ@𝐸Γ⊢𝐴⇝𝐵
Γ,ℓ:𝐴⇝𝐵@𝐸
WF-Label
The effect-structure kinding rules and the following term rules complete the frozen target signature.
Γ⊢():1@𝐸
M-Unit
Γ,𝑥:𝐴⊢𝑀:𝐵@𝐸
Γ⊢𝜆𝑥𝐴.𝑀:𝐴→𝐵@𝐸
M-Abs
Γ⊢𝑀:𝐴→𝐵@𝐸Γ⊢𝑁:𝐴@𝐸
Γ⊢𝑀𝑁:𝐵@𝐸
M-App
Γ,𝛼:𝐾⊢𝑉:𝐴@𝐸
Γ⊢Λ𝛼𝐾.𝑉:∀𝛼𝐾.𝐴@𝐸
M-TAbs
Γ⊢𝑀:∀𝛼𝐾.𝐴@𝐸Γ⊢𝐵:𝐾
Γ⊢𝑀𝐵:𝐴[𝐵/𝛼]@𝐸
M-TApp
Variable access factors through a type-sensitive auxiliary transformation:
Γ⊢𝐴:𝖠𝖻𝗌
Γ⊢(𝜇,𝐴)⇒𝜈@𝐹
M-Aux-Abs
Γ⊢𝜇⇒𝜈@𝐹
Γ⊢(𝜇,𝐴)⇒𝜈@𝐹
M-Aux-Mod
Γ⊢(𝜇,𝐴)⇒𝖫(Γ′)@𝐹
Γ,𝑥:𝜇𝐹𝐴,Γ′⊢𝑥:𝐴@𝐸
M-Var
Γ,𝗅𝗈𝖼𝗄(𝜇𝐹)⊢𝑉:𝐴@𝜇(𝐹)
Γ⊢𝗆𝗈𝖽𝜇𝑉:◻𝜇𝐴@𝐹
M-Mod
Γ,𝗅𝗈𝖼𝗄(𝜈𝐹)⊢𝑉:◻𝜇𝐴@𝜈(𝐹)Γ,𝑥:(𝜈∘𝜇)𝐹𝐴⊢𝑁:𝐵@𝐹
Γ⊢𝗅𝖾𝗍𝜈𝗆𝗈𝖽𝜇𝑥=𝑉𝗂𝗇𝑁:𝐵@𝐹
M-LetMod
Only values may be introduced or eliminated by these rules. The ordinary unit, abstraction, application, type-abstraction, and type-application rules are the call-by-value System-F rules, all at one displayed effect context. Operations and fresh local labels use
Value normal forms and evaluation contexts are 𝑈::=()∣𝑥∣𝜆𝑥𝐴.𝑀∣Λ𝛼𝐾.𝑉∣𝗆𝗈𝖽𝜇𝑈,𝐾::=[]∣𝐾𝑀∣𝑈𝐾∣𝐾𝐴∣𝗆𝗈𝖽𝜇𝐾∣𝖽𝗈ℓ𝐾∣𝗅𝖾𝗍𝜈𝗆𝗈𝖽𝜇𝑥=𝐾𝗂𝗇𝑀∣𝗁𝖺𝗇𝖽𝗅𝖾𝜇𝐾𝗐𝗂𝗍𝗁𝐻. The unit case is the minimal repair identified in section 33.1; all other clauses reproduce source Figure 2. The complete roots are (𝜆𝑥𝐴.𝑀)𝑈⇝0𝑀[𝑈/𝑥],(Λ𝛼𝐾.𝑈)𝐴⇝0𝑈[𝐴/𝛼],𝗅𝖾𝗍𝜈𝗆𝗈𝖽𝜇𝑥=𝗆𝗈𝖽𝜇𝑈𝗂𝗇𝑁⇝0𝑁[𝑈/𝑥],𝗅𝗈𝖼𝖺𝗅ℓ:𝐴⇝𝐵𝗂𝗇𝑀;Ω⇝0𝑀[ℓ′/ℓ];(Ω,ℓ′:𝐴⇝𝐵),𝗁𝖺𝗇𝖽𝗅𝖾𝜇𝑈𝗐𝗂𝗍𝗁𝐻⇝0𝑁[𝗆𝗈𝖽𝜇∘⟨ℓ⟩𝑈/𝑥],𝗁𝖺𝗇𝖽𝗅𝖾𝜇𝐾[𝖽𝗈ℓ𝑈]𝗐𝗂𝗍𝗁𝐻⇝0𝑁′[𝑈/𝑝,𝗆𝗈𝖽𝜇(𝜆𝑦.𝗁𝖺𝗇𝖽𝗅𝖾𝜇𝐾[𝑦]𝗐𝗂𝗍𝗁𝐻)/𝑟]. The generated label ℓ′ avoids dom(Σ,Ω). The last contraction requires that 𝐾 bind no handler for ℓ; one-step reduction is the compatible closure under 𝐾.
System 𝐹𝜀
The kinds, rows, types, contexts, values, and computations are 𝐾::=𝖵𝖺𝗅𝗎𝖾∣𝖤𝖿𝖿𝖾𝖼𝗍,𝐸::=∅∣𝜖∣ℓ,𝐸,𝐴::=1∣𝛼∣𝐴→𝐸𝐵∣∀𝛼𝐾.𝐴,Γ::=∅∣Γ,𝑥:𝐴∣Γ,𝛼:𝐾,𝑉::=()∣𝑥∣𝜆𝐸𝑥𝐴.𝑀∣Λ𝛼𝐾.𝑉∣𝗁𝖺𝗇𝖽𝗅𝖾𝗋𝐻,𝑀::=𝗋𝖾𝗍𝗎𝗋𝗇𝑉∣𝑉𝑊∣𝑉𝐴∣𝗅𝖾𝗍𝑥=𝑀𝗂𝗇𝑁∣𝖽𝗈ℓ𝑉,𝐻::={ℓ𝑝𝑟↦𝑁}. Rows preserve duplicates and are equal modulo permutation. The judgments are Γ⊢𝑣𝑉:𝐴 and Γ⊢𝑐𝑀:𝐴!𝐸. Their complete static rules are
Γ⊢𝑣():1
F-Unit
𝑥:𝐴∈Γ
Γ⊢𝑣𝑥:𝐴
F-Var
Γ,𝛼:𝐾⊢𝑣𝑉:𝐴
Γ⊢𝑣Λ𝛼𝐾.𝑉:∀𝛼𝐾.𝐴
F-TAbs
Figure 11, Appendix D.1, p. 44 of [TL26] prints 𝐴, rather than ∀𝛼𝐾.𝐴, in the conclusion of its type-abstraction rule. The displayed conclusion is the minimal well-formed repair: it is the type consumed by F-TApp and by the paper’s translation clause.
Γ,𝑥:𝐴⊢𝑐𝑀:𝐵!𝐸
Γ⊢𝑣𝜆𝐸𝑥𝐴.𝑀:𝐴→𝐸𝐵
F-Abs
Γ⊢𝑣𝑉:𝐴→𝐸𝐵Γ⊢𝑣𝑊:𝐴
Γ⊢𝑐𝑉𝑊:𝐵!𝐸
F-App
Γ⊢𝑣𝑉:𝐴
Γ⊢𝑐𝗋𝖾𝗍𝗎𝗋𝗇𝑉:𝐴!𝐸
F-Return
Γ⊢𝑣𝑉:∀𝛼𝐾.𝐵Γ⊢𝐴:𝐾
Γ⊢𝑐𝑉𝐴:𝐵[𝐴/𝛼]!𝐸
F-TApp
Γ⊢𝑐𝑀:𝐴!𝐸Γ,𝑥:𝐴⊢𝑐𝑁:𝐵!𝐸
Γ⊢𝑐𝗅𝖾𝗍𝑥=𝑀𝗂𝗇𝑁:𝐵!𝐸
F-Let
Σ(ℓ)=𝐴⇝𝐵Γ⊢𝑣𝑉:𝐴
Γ⊢𝑐𝖽𝗈ℓ𝑉:𝐵!(ℓ,𝐸)
F-Do
Σ(ℓ)=𝐴′⇝𝐵′Γ,𝑝:𝐴′,𝑟:𝐵′→𝐸𝐴⊢𝑐𝑁:𝐴!𝐸
Γ⊢𝑣𝗁𝖺𝗇𝖽𝗅𝖾𝗋{ℓ𝑝𝑟↦𝑁}:(1→ℓ,𝐸𝐴)→𝐸𝐴
F-Handler
Runtime computations add 𝗁𝖺𝗇𝖽𝗅𝖾𝑀𝗐𝗂𝗍𝗁𝐻, with contexts 𝑅::=[]∣𝗅𝖾𝗍𝑥=𝑅𝗂𝗇𝑁∣𝗁𝖺𝗇𝖽𝗅𝖾𝑅𝗐𝗂𝗍𝗁𝐻. The complete roots of Figure 12, Appendix D.1, pp. 44–45 are (Λ𝛼𝐾.𝑉)𝐴⇝0𝑉[𝐴/𝛼],(𝜆𝐸𝑥𝐴.𝑀)𝑉⇝0𝑀[𝑉/𝑥],(𝗁𝖺𝗇𝖽𝗅𝖾𝗋𝐻)𝑉⇝0𝗁𝖺𝗇𝖽𝗅𝖾(𝑉())𝗐𝗂𝗍𝗁𝐻,𝗁𝖺𝗇𝖽𝗅𝖾(𝗋𝖾𝗍𝗎𝗋𝗇𝑉)𝗐𝗂𝗍𝗁𝐻⇝0𝗋𝖾𝗍𝗎𝗋𝗇𝑉,𝗁𝖺𝗇𝖽𝗅𝖾𝑅[𝖽𝗈ℓ𝑉]𝗐𝗂𝗍𝗁𝐻⇝0𝑁[𝑉/𝑝,(𝜆𝐸𝑦.𝗁𝖺𝗇𝖽𝗅𝖾𝑅[𝗋𝖾𝗍𝗎𝗋𝗇𝑦]𝗐𝗂𝗍𝗁𝐻)/𝑟]. The final root requires ℓ∉bl(𝑅) and (ℓ𝑝𝑟↦𝑁)∈𝐻; reduction is closed under 𝑅.
System 𝐶
The exact static grammar is 𝐴::=1∣𝑇@𝐶,𝑇::=(¯𝐴;¯𝑓:¯𝑇)⇒𝐵,𝐶::=∅∣{𝑓}∣𝐶∪𝐶′,Γ::=∅∣Γ,𝑥:𝐴∣Γ,𝑓:𝐶𝑇∣Γ,𝑓:∗𝑇,𝑉::=𝑥∣()∣𝖻𝗈𝗑𝑃,𝑃::=𝑓∣{(¯𝑥:¯𝐴;¯𝑓:¯𝑇)⇒𝑀}∣𝗎𝗇𝖻𝗈𝗑𝑉,𝑀::=𝗋𝖾𝗍𝗎𝗋𝗇𝑉∣𝑃(¯𝑉;¯𝑄)∣𝗅𝖾𝗍𝑥=𝑀𝗂𝗇𝑁∣𝖽𝖾𝖿𝑓=𝑃𝗂𝗇𝑁∣𝗍𝗋𝗒{𝑓𝐴′⇒𝐵′⇒𝑀}𝗐𝗂𝗍𝗁{𝑝,𝑟↦𝑁}. System 𝐶 has judgments Γ⊢𝑣𝑉:𝐴, Γ⊢𝑏𝑃:𝑇∣𝐶, and Γ⊢𝑐𝑀:𝐴∣𝐶. The complete static rules are
These are Figure 4, §5.1, p. 21 of [TL26]. The handler premise binds 𝑓 as tracked; its clause binds 𝑟 transparently with the residual capability set.
Runtime syntax extends capabilities by labels: Ω::=∅∣Ω,ℓ:(𝐴)⇒𝐵,𝐶::=⋯∣{ℓ},𝑃::=⋯∣𝖼𝖺𝗉ℓ,𝑀::=⋯∣𝗍𝗋𝗒ℓ𝑀𝗐𝗂𝗍𝗁𝐻,𝐾::=[]∣𝗅𝖾𝗍𝑥=𝐾𝗂𝗇𝑁∣𝖽𝖾𝖿𝑓=𝐾𝗂𝗇𝑁∣𝗍𝗋𝗒ℓ𝐾𝗐𝗂𝗍𝗁𝐻. For the operation root, abbreviate the reified deep resumption by 𝗋𝖾𝗌𝗎𝗆𝖾ℓ,𝐾,𝐻:={(𝑦)⇒𝗍𝗋𝗒ℓ𝐾[𝗋𝖾𝗍𝗎𝗋𝗇𝑦]𝗐𝗂𝗍𝗁𝐻}. In addition to compatible closure, the roots are 𝗎𝗇𝖻𝗈𝗑(𝖻𝗈𝗑𝑃)⇝0𝑃,𝗅𝖾𝗍𝑥=𝗋𝖾𝗍𝗎𝗋𝗇𝑉𝗂𝗇𝑁⇝0𝑁[𝑉/𝑥],𝖽𝖾𝖿𝑓=𝑃𝗂𝗇𝑁⇝0𝑁[𝑃/𝑓],{(¯𝑥;¯𝑓)⇒𝑀}(¯𝑉;¯𝑄)⇝0𝑀[¯𝑉/¯𝑥,¯𝑄/¯𝑓,¯𝐶/¯𝑓],𝗍𝗋𝗒{𝑓𝐴⇒𝐵⇒𝑀}𝗐𝗂𝗍𝗁𝐻;Ω⇝0𝗍𝗋𝗒ℓ𝑀[𝖼𝖺𝗉ℓ/𝑓,{ℓ}/𝑓]𝗐𝗂𝗍𝗁𝐻;(Ω,ℓ:(𝐴)⇒𝐵),𝗍𝗋𝗒ℓ(𝗋𝖾𝗍𝗎𝗋𝗇𝑉)𝗐𝗂𝗍𝗁𝐻⇝0𝗋𝖾𝗍𝗎𝗋𝗇𝑉,𝗍𝗋𝗒ℓ𝐾[𝖼𝖺𝗉ℓ(𝑉)]𝗐𝗂𝗍𝗁𝐻⇝0𝑁[𝑉/𝑝,𝗋𝖾𝗌𝗎𝗆𝖾ℓ,𝐾,𝐻/𝑟]. Here 𝐻={𝑝,𝑟↦𝑁}, the fourth root uses ∅⊢𝑏𝑄𝑗:𝑇𝑗∣𝐶𝑗 for each actual block, the generated ℓ is fresh, and the last root requires ℓ∉bl(𝐾). These are Figure 13, Appendix D.2, pp. 44–45 of the same source. Block beta substitutes actual blocks in terms and their capability sets in types as two distinct simultaneous components.
The two translations are the type-directed maps in section 33.2, section 33.3. They share no source judgment and must not be composed through a presumed inverse.