Lectures onType Theory
Effect-capability signatures, translations, and metatheorems
appendix sectionsignatures

Effect-capability signatures, translations, and metatheorems

System Xi interface

Fix the operation signature Ω(F)=τ1τ0; it is suppressed from every judgment below, and Δ(f) is rightmost lookup. The source interface consists of Γe:τ,ΓΔb:σ,ΓΔs:τ. The runtime interface replaces the empty label context by a finite Ξ. Runtime labels have answer types, capabilities have block type τ1τ0, and delimiters bind one fresh label. Runtime configurations are derivation indexed: a generated capability retains the outer derivation of its handler body, and the displayed extrinsic X-Cap rule decomposes the ordered allocation stack as Ξ0,:τ,Ξ+ and types that body under its exact birth prefix Ξ0. Block substitutions on runtime derivations must respect these restricted occurrence contexts; crossed later delimiters remain in the reified continuation, not in the stored clause. Reduction is ss, generated by the rules in subappendix A.29 and closed under the displayed evaluation contexts. Generatedness is the reachability predicate GenΩ(s), and lemma 32.4 preserves it together with scope respect across every reduction step.

The local proof chain is weakening and substitutioncanonical formsprogress and preservationabsence of reachable undelimited capability states. The conclusion is only the printed System-Xi safety consequence. It is not the Effekt source theorem, abstraction safety, noninterference, or a theorem about the full implementation.

The named Effekt-to-System-Xi translation

Fix a canonical order on finite Effekt sets. The source name classes for values, ordinary blocks, and operations are pairwise disjoint, and target block-context lookup is rightmost so the capability introduced by a handler shadows an outer same-operation capability only in its handled premise. If Σ(F)=τ1τ0, define CapOpΣ(F)=τ1τ0. For F¯=F1,,Fn, abbreviate CapOpΣ(F¯)=CapOpΣ(F1),,CapOpΣ(Fn). Then CapEffΣ({F¯})=F1:CapOpΣ(F1),,Fn:CapOpΣ(Fn),CapTyΣ((τ¯,σ¯)τ/{F¯})=(τ¯,CapTyΣ(σ¯),CapOpΣ(F¯))τ. Extend CapTy pointwise to Δ. The statement map is directed by the source typing derivation: Σ supplies operation types, and the current Δ supplies the ordered capability list used at a block call. The short clauses are CapStmtΣ,Δ(e)=e,CapStmtΣ,Δ(val x=s0;s1)=val x=CapStmtΣ,Δ(s0);CapStmtΣ,Δ(s1),CapStmtΣ,Δ(f(e¯,g¯))=f(e¯,g¯,F¯),CapStmtΣ,Δ(effect F(x:τ1):τ0;s)=CapStmtΣ,Δ(s),CapStmtΣ,Δ(do F(e))=F(e). The two binding clauses are CapStmtΣ,Δ(def f(x¯,g¯):τ/{F¯}=s0;s)=def f={(x¯,g¯,F¯)CapStmtΣ,Δ(s0)};CapStmtΣ,Δ(s), and CapStmtΣ,Δ(try{s}with F{(x:τ1)sh})=handle{FCapStmtΣ,Δ(s)}=with{(x,resume)CapStmtΣ,Δ(sh)}. The call clause takes F¯ from the declared source block type. Operation declarations disappear; handler translation binds the capability and resumption explicitly. In the handler proof, the common outer target context is CapTyΣ(Δ),CapEffΣ((ε{F})εh). Its handled premise receives a terminal binding for F, which shadows any outer F required by εh; the clause sees the unextended outer context. This is the exact target counterpart of source effect subtraction. The theorem interface is ΓΔΣs:τεΓCapTyΣ(Δ),CapEffΣ(ε)CapStmtΣ,Δ(s):τ. The proof is theorem 32.15. Combining it with System-Xi safety gives the selected Effekt effect-safety corollary, not a new System-Xi theorem.

Tunnelling logical-relation interface

The selected source and dynamic interfaces are ΔPΞT type,ΔPΞe effects, ΔPΓΞt:[T]e,ΔPΓΞh:Fe,tt. The first two judgments and the ordinary typing rules are the chapter’s exact closure around the four characteristic rules printed in Figure 10. Appendix A.1 of Cornell technical report 1813/60202 supplies the common-effect T-App/T-Let rules, the type and effect preorders, and T-Sub. Appendix B supplies Compatibility Lemmas 7–19 for the rules it enumerates [ZM19b]; the chapter separately proves the omitted T-Let case by evaluation-context composition. Union-effect forms are derived by subsumption to a common join. These results remain theorems about the tunnelling calculus, not about a translation to System Xi.

The explicit label parameter is a finite well-formed context Ξ. Every context extension binds a fresh name; in particular T-Down requires both dom(Ξ) before extending Ξ and fl(T,e¯) before discharging the delimiter. The numerical step index is hidden by the later modality. The tunnelling relation does not quantify over a separate order of future label contexts. Closing environments have the shapes δ(α)=¯1,¯2,ϕ,ρ(h)=H11,H22,η,γ(x)=v1,v2. The semantic signature is W, O, T, K, S, V, H, U, with open lifting by the environments above. The compatibility lemmas state that every typing rule preserves log, and together establish the fundamental property. The imported boundary is Theorems 1–3 of [ZM19a]: parametricity (the fundamental property), closed type safety, and logical-refinement soundness for the tunnelling calculus, with the report supplying the complete rule and compatibility boundary [ZM19b]. No System-Xi translation is part of this interface.

Olaf optional boundary

Olaf uses ΔΘΓΞt:[τ]c,L;tL;t. Its new invariant is that lifetime effects occur in effect sequences and its continuation types record effects on both sides of control transfer. Assuming Ξ and Γ are well formed, the imported results are Theorems 1–3 of [ZSM20]: parametricity, closed empty-effect type safety, and logical-refinement soundness for Olaf. They do not add bidirectional operations to the preceding calculi or imply linear resumptions.

Source-bounded comparison cards

The control-flow linearity card uses the local occurrence predicate uses(r,M)q only to distinguish zero, one, and multiple syntactic resumption uses. It imports no theorem: Tang et al.’s soundness results require their full qualified type system, constraint entailment, and operational semantics [THLM24].

White’s locality card fixes the dependent context restriction y(Σ) and box introduction rule of §3.2, Figure 2, pp. 12–13; the reflection card fixes WΣ(τ), reify, and reflect from §3.4, Figure 4, pp. 14–15 [Whi26]. The semantic comparison in §4.8, p. 23 belongs only to that calculus. These cards import definitions and rules, not a System-Xi, Effekt, tunnelling, or Olaf theorem.

Metatheorem and evidence ledger

card status and locator exact conclusion excluded transfer
System Xi local proofs; source Def. 4.2, Thms. 4.3–4.4, pp. 15–16 progress, preservation, and no reachable undelimited capability no Effekt, abstraction, ownership, or noninterference theorem
Effekt translation local proof matching source Thm. 5.1, p. 17 typed source statements translate to typed capability-passing statements no theorem about the full Effekt implementation
Effekt safety derived through the translation closed empty-effect source programs translate to nonstuck executions not assigned directly to System Xi
Tunnelling imported Thms. 1–3, p. 22 parametricity, closed safety, and logical soundness no System-Xi translation or compiler correctness
Olaf imported Thms. 1–3, p. 23 parametricity, type safety, and logical soundness for Olaf no control-flow linearity or theorem for earlier cards
Linearity comparison local occurrence predicate; source boundary §§3–5 classifies the displayed resumption syntax by use count no linear-handler soundness theorem imported
Locality and
reflection
source Figs. 2, 4, pp. 12–15;
semantic boundary §4.8, p. 23
dependent restriction, box, reify, and reflect rules no authority-token or tunnelling theorem
Kappa corpus finite execution record in subsubappendix E.3.7 ten cases and five failing semantic mutations no progress, preservation, translation, or logical-relation proof

Search the book

Type to search the local edition.