For QTC0, 𝜏::=𝛼∣𝖨𝗇𝗍∣𝖡𝗈𝗈𝗅∣𝖲𝗍𝗋𝗂𝗇𝗀∣𝖫𝗂𝗌𝗍𝜏∣𝜏→𝜏,𝑝::=𝐾𝜏,𝜎::=∀¯𝛼.𝑃⇒𝜏. The finite superclass graph is acyclic. Each primitive instance head begins with a constructor. Every premise is headed by a proper subterm of the result head. Resolution uses the finite effective table I↑: for each primitive clause and each reachable superclass it contains the clause obtained by following the fixed shortest superclass path. Its builder is the primitive constructor followed by that path’s dictionary projection. For each requested class, all effective result heads must be pairwise nonunifiable. This check is performed after closure, so a direct 𝖤𝗊𝖨𝗇𝗍 clause is rejected when it would overlap the projection derived from 𝖮𝗋𝖽𝖨𝗇𝗍. An evidence context has distinct canonical keys. The fixed partial selector 𝖻𝖾𝗌𝗍Δ chooses exact local evidence first. Otherwise it chooses the uniquely ordered shortest superclass projection. Resolution consists of exactly
𝖻𝖾𝗌𝗍Δ(𝐾𝜏)=𝑑
𝗋𝖾𝗌𝗈𝗅𝗏𝖾C,Δ(𝐾𝜏)=𝑑
E-Local
𝖻𝖾𝗌𝗍Δ(𝐾𝜏)↑𝗉𝗂𝖼𝗄C(𝐾𝜏)=(𝑃,𝑏)𝗋𝖾𝗌𝗈𝗅𝗏𝖾C,Δ(𝑝)=𝑑𝑝(𝑝∈𝑃)
𝗋𝖾𝗌𝗈𝗅𝗏𝖾C,Δ(𝐾𝜏)=𝑏¯𝑑𝑝
E-Instance
The partial function 𝗉𝗂𝖼𝗄 freshens and one-way-matches the unique effective candidate; it is not symmetric unification.
Normalization 𝗇𝖿C uses one fixed-priority agenda. It processes exact or projected local evidence before instances; allocates a fresh hole only for an unresolved variable-headed request; and expands an unresolved constructor request through its unique one-way-matching instance. Completed constructor frames install their evidence for later agenda requests. Duplicate goals share the first recorded evidence, and a retained subclass hole discharges its superclass holes. A missing constructor-headed instance rejects immediately. Its total result is 𝗋𝖾𝗃𝖾𝖼𝗍(𝑝)or𝗈𝗄(𝑄,𝜂), where 𝑄 is the ordered irredundant variable-headed hole set and 𝜂 reconstructs every input request jointly from those holes. The open sets 𝑃 and 𝑄 have the same solvable ground instances. More exactly, if normalization returns 𝗈𝗄(𝑄,𝜂), then for every substitution 𝑆, normalizing 𝑆𝑃 and 𝑆𝑄 rejects together or returns the same canonical set with commuting evidence templates. If canonical 𝑅 entails 𝑆𝑃, then it entails 𝑆𝑄; this is the factorization direction used by principality. A source judgment is formed only with canonical 𝑃 and canonical, unambiguous schemes in Γ. Its four rules are
Here generalization quantifies exactly the variables of the normalized predicates and result type that are not fixed by Γ, retains the other canonical predicates as 𝑃𝑟, records the template 𝜁, and requires 𝖿𝗍𝗏(𝑄)⊆𝖿𝗍𝗏(𝜏1). Type substitution acts on an environment through the partial canonical action 𝑆⋆Γ: it freshens bound variables, substitutes only free variables, renormalizes each predicate interface, and records the induced evidence transport. Substitution naturality of normalization gives 𝑇⋆𝑆⋆Γ=𝑇∘𝑆⋆Γ up to fresh binders whenever both sides are defined, with alpha-equivalent composite evidence transports.
Qualified inference returns 𝑊C(Γ,𝑒)=(𝑃,𝑆,𝜏). Writing 𝖼𝗇𝖿C(𝑃)=𝑄 for the successful canonical predicate component, its four clauses are:
a fresh instance (𝑄′,𝜏′) of Γ(𝑥) returns (𝖼𝗇𝖿C(𝑄′),𝗂𝖽,𝜏′);
an abstraction chooses fresh 𝑎, recursively obtains (𝑃,𝑆,𝜏) in Γ,𝑥:𝑎, and returns (𝑃,𝑆,𝑆(𝑎)→𝜏);
an application obtains (𝑃1,𝑆1,𝜏1), then (𝑃2,𝑆2,𝜏2) in 𝑆1⋆Γ, sets 𝑈=𝗆𝗀𝗎(𝑆2𝜏1,𝜏2→𝑎), and returns (𝖼𝗇𝖿C(𝑈(𝑆2𝑃1∪𝑃2)),𝑈∘𝑆2∘𝑆1,𝑈(𝑎));
a let obtains (𝑃1,𝑆1,𝜏1), generalizes it in 𝑆1⋆Γ to (𝑃𝑟,𝜎,𝜁), then obtains (𝑃2,𝑆2,𝜏2) in 𝑆1⋆Γ,𝑥:𝜎, and returns (𝖼𝗇𝖿C(𝑆2𝑃𝑟∪𝑃2),𝑆2∘𝑆1,𝜏2).
Every failed normalization or ambiguity check rejects at its displayed clause; evidence templates are uniquely recomputed from the recorded W derivation rather than hidden in a fourth return component.
The evidence-explicit target core adds type and dictionary abstraction and application: 𝑢::=𝑥∣𝜆𝑥:𝑇.𝑢∣𝑢1𝑢2∣𝐥𝐞𝐭𝑥=𝑢1𝐢𝐧𝑢2∣Λ𝛼.𝑢∣𝑢[𝑇]∣𝜆{𝑑:𝐷}.𝑢∣𝑢{𝛿}∣𝑐𝑖∣𝜋𝐾,𝐾′𝑢. The dictionary forms are typed by
Γ,𝑑:𝐷⊢𝑢:𝑇
Γ⊢𝜆{𝑑:𝐷}.𝑢:𝐷→𝑇
U-DictLam
Γ⊢𝑢:𝐷→𝑇Γ⊢𝛿:𝐷
Γ⊢𝑢{𝛿}:𝑇
U-DictApp
Superclass edges and instances contribute 𝜋𝐾,𝐾′:∀𝛼.𝐾′𝐷(𝛼)→𝐾𝐷(𝛼),𝑐𝑖:∀¯𝛼.(𝑝1)𝐷→⋯→(𝑝𝑚)𝐷→𝐾𝐷(𝐶¯𝜏). For canonical 𝑃, let Δ𝑃=𝑑𝑝:𝑝𝐷 in canonical order. An evidence template 𝜂 acts by hole replacement 𝜂⋅𝑢, and a type substitution acts on core syntax and templates by 𝑆†𝑢. Elaboration is indexed by the successful W derivation W. Its complete family is
For let, if 𝜁:Δ𝑃𝑟,Δ𝑄⇒𝖾Δ𝑃1 is the generalization template and 𝜂:Δ𝑃⇒𝖾Δ𝑆2𝑃𝑟,Δ𝑃2, write 𝜂𝑟,𝜂2 for its restrictions and define 𝑢𝗅𝖾𝗍:=𝐥𝐞𝐭𝑥=Λ¯𝑎.𝜆{¯𝑑𝑄:|𝑄|}.((𝜂𝑟∪𝗂𝖽𝑄)∘𝑆2†𝜁)⋅𝑆2†𝑢1𝐢𝐧𝜂2⋅𝑢2.
The target environment is |𝑆⋆Γ|, where 𝑆 is the substitution returned by W. The exact top-level closure is 𝖼𝗅𝗈𝗌𝖾C(𝑒)=Λ¯𝑎.𝜆{¯𝑑𝑄:|𝑄|}.𝜁⋅𝑢 when W at the empty environment succeeds, generalization returns no residual predicates, and 𝑢 is the displayed W-indexed elaboration. Missing ground evidence or ambiguity rejects closure. The evidence-core roots are ordinary, type, dictionary, and let beta under call-by-value compatible closure. Brace erasure has forward step simulation and existential reverse lifting; it is not injective.
For the explicitly typed ground compatibility exercises, retain the annotated forms 𝑠::=⋯∣𝖾𝗊[𝐴](𝑠1,𝑠2)∣(𝐾𝐴⇒𝑠)∣𝑠⟨𝐾,𝐴⟩. They specialize the preceding QTC0 elaboration rather than forming a second inference calculus. A finite ground table Σ and a local evidence map Ψ each contain at most one entry per normalized class/type key, and 𝗋𝖾𝗌𝗈𝗅𝗏𝖾Ψ,Σ tries the local map before the table. The three annotated rules are
𝗋𝖾𝗌𝗈𝗅𝗏𝖾Ψ,Σ(𝖤𝗊,𝐴)=𝑑Ψ;Σ⊢𝑠𝑖⇝𝑒𝑖(𝑖=1,2)
Ψ;Σ⊢𝖾𝗊[𝐴](𝑠1,𝑠2)⇝𝑑𝑒1𝑒2
ED-Method
𝑑freshΨ[(𝐾,𝐴)↦𝑑];Σ⊢𝑠⇝𝑒
Ψ;Σ⊢(𝐾𝐴⇒𝑠)⇝𝜆𝑑:𝐾𝐷(𝐴).𝑒
ED-Bind
Ψ;Σ⊢𝑠⇝𝑒𝗋𝖾𝗌𝗈𝗅𝗏𝖾Ψ,Σ(𝐾,𝐴)=𝑑
Ψ;Σ⊢𝑠⟨𝐾,𝐴⟩⇝𝑒𝑑
ED-Discharge
The bounded associated-type extension ATS0 adds saturated synonym applications and equality constraints: 𝜂::=𝑆¯𝜏,𝜋::=𝐾𝜏∣𝜂=𝜏,𝜃::=∀¯𝛼.𝑃⇒𝐾𝜏∣∀¯𝛼.𝜂=𝜏. Entailment Θ⊩𝜋 includes class specialization and modus ponens together with reflexivity, symmetry, transitivity, and congruence for equality. The distinctive rules and algorithmic judgment are Θ⊩𝖢𝗈𝗅𝗅𝖾𝖼𝗍𝗌𝜏Θ⊢𝖤𝗅𝖾𝗆𝜏𝗍𝗒𝗉𝖾AT−WFΘ∣Γ⊢𝑒:𝜏1Θ⊩𝜏1=𝜏2Θ∣Γ⊢𝑒:𝜏2AT−Conv,Θ,𝑈∣𝑇Γ⊢𝖶𝑒:𝜏. The last judgment returns class constraints, pending equality constraints, a substitution, and a monotype. Its imported soundness endpoint is theorem 13.23; no completeness or principality result is attached to this extension. Its exact admission conditions also require specific nonoverlapping constructor-headed instances, decreasing contexts, saturated synonym applications, the designated variable-headed form for programmer equality constraints, and the two fixed-variable checks stated in section 13.4. The source paper omits its evidence rules; the displayed dictionary/type-passing instance in the chapter is the book’s local target sketch.
The separately imported COCHIS comparison uses predicative types, monotypes, terms, and contexts 𝜌::=𝛼∣𝜌1→𝜌2∣∀𝛼.𝜌∣𝜌1⇒𝜌2,𝜎::=𝛼∣𝜎1→𝜎2,𝑒::=𝑥∣𝜆(𝑥:𝜌).𝑒∣𝑒1𝑒2∣Λ𝛼.𝑒∣𝑒𝜎∣?𝜌∣𝜆?𝜌.𝑒∣𝑒1𝗐𝗂𝗍𝗁𝑒2,Δ::=∅∣Δ,𝑥:𝜌∣Δ,𝛼∣Δ,?𝜌:𝑥. Only monotypes instantiate ∀. Its resolution judgments are Δ⊢𝗋𝜌⇝𝐸,𝐴;Δ⊢𝖿[𝜌]⇝𝐸,𝐴;Δ;[Δ′]⊢𝗅𝜏⇝𝐸,Δ;[𝜌];𝑥⊢𝗆¯𝜌;¯𝑧;𝜏⇝𝐸,𝗌𝗍𝖺𝖻𝗅𝖾(𝐴;Δ;𝜌;𝑥;𝜏). The load-bearing recursive rules are
𝗍𝗒𝗏𝖺𝗋𝗌(Δ);Δ⊢𝖿[𝜌]⇝𝐸
Δ⊢𝗋𝜌⇝𝐸
C-R-Main
𝐴;Δ,?𝜌1:𝑧⊢𝖿[𝜌2]⇝𝐸𝑧fresh
𝐴;Δ⊢𝖿[𝜌1⇒𝜌2]⇝𝜆𝑧:|𝜌1|.𝐸
C-R-IAbs
𝐴;Δ;[Δ]⊢𝗅𝜏⇝𝐸
𝐴;Δ⊢𝖿[𝜏]⇝𝐸
C-R-Simp
Δ;[𝜌];𝑥⊢𝗆¯𝜌;¯𝑧;𝜏⇝𝐸𝐴;Δ⊢𝖿[¯𝜌]⇝¯𝐸
𝐴;Δ;[Δ′,?𝜌:𝑥]⊢𝗅𝜏⇝𝐸[¯𝐸/¯𝑧]
C-L-Match
𝗌𝗍𝖺𝖻𝗅𝖾(𝐴;Δ;𝜌;𝑥;𝜏)𝐴;Δ;[Δ′]⊢𝗅𝜏⇝𝐸
𝐴;Δ;[Δ′,?𝜌:𝑥]⊢𝗅𝜏⇝𝐸
C-L-NoMatch
Δ;[𝜏];𝑥⊢𝗆∅;∅;𝜏⇝𝑥
C-M-Simp
Δ,?𝜌1:𝑧;[𝜌2];𝑥𝑧⊢𝗆¯𝜌;¯𝑧;𝜏⇝𝐸𝑧fresh
Δ;[𝜌1⇒𝜌2];𝑥⊢𝗆𝜌1,¯𝜌;𝑧,¯𝑧;𝜏⇝𝐸
C-M-IApp
Δ⊢𝜎Δ;[𝜌[𝜎/𝛼]];𝑥[𝜎]⊢𝗆¯𝜌;¯𝑧;𝜏⇝𝐸
Δ;[∀𝛼.𝜌];𝑥⊢𝗆¯𝜌;¯𝑧;𝜏⇝𝐸
C-M-TApp
Quantifier matching instantiates [∀𝛼.𝜌];𝑥 to [𝜌[𝜎/𝛼]];𝑥[𝜎] when Δ⊢𝜎, then continues matching. The unambiguity predicate is 𝖴𝖠(𝐴;𝜏)iff𝐴⊆𝖿𝗍𝗏(𝜏),𝖴𝖠(𝐴;∀𝛼.𝜌)iff𝖴𝖠(𝐴∪{𝛼};𝜌),𝖴𝖠(𝐴;𝜌1⇒𝜌2)iff𝖴𝖠(𝐴;𝜌1)and𝖴𝖠(𝐴;𝜌2). The valid-substitution judgment 𝗏𝖺𝗅𝗂𝖽(𝐴;Δ;𝜃) extends by the singleton substitution [𝜎/𝛼] only when 𝛼∈𝐴, Δ=Δ0,𝛼,Δ1, 𝜎 is well scoped in Δ0, and the remainder is valid in (Δ0,Δ1)[𝜎/𝛼]. Finally, 𝗌𝗍𝖺𝖻𝗅𝖾(𝐴;Δ;𝜌;𝑥;𝜏) excludes every such valid substitution under which the skipped 𝜌 would match 𝜏. This card reproduces the comparison’s recursive evidence plumbing; the complete systems and remaining premises are source-cited to Figs. 2 and 6–10 in the chapter.