Let the caller’s printed 𝑥 carry scope set 𝑆. Expansion allocates fresh stamps 𝑠1,𝑠2∉𝑆 and produces 𝗅𝖾𝗍𝑥𝑆∪{𝑠1}=𝑒1𝗂𝗇𝗅𝖾𝗍𝑥𝑆∪{𝑠2}=𝑒2𝗂𝗇(𝑥𝑆∪{𝑠2},𝑥𝑆∪{𝑠1}). Identifiers copied from 𝑒1,𝑒2 retain their caller scopes. A free 𝑥𝑆 inside 𝑒1 therefore resolves to the caller declaration: neither introduced binder has a scope set contained in 𝑆. The two generated references resolve respectively to the unique declarations whose scope sets are 𝑆∪{𝑠2} and 𝑆∪{𝑠1}. Maximal-subset resolution is unique in all three cases.
For Γ0=(𝑐:𝖢𝗈𝖽𝖾(ℕ)@0), the complete tree is (𝑐:𝖢𝗈𝖽𝖾(ℕ)@0)∈Γ0Γ0⊢0𝑐:𝖢𝗈𝖽𝖾(ℕ)Q−VarΓ0⊢1𝗌𝗉𝗅𝗂𝖼𝖾(𝑐):ℕQ−SpliceΓ0⊢11:ℕNatΓ0⊢1𝗌𝗉𝗅𝗂𝖼𝖾(𝑐)+1:ℕAddΓ0⊢0𝗊𝗎𝗈𝗍𝖾(𝗌𝗉𝗅𝗂𝖼𝖾(𝑐)+1):𝖢𝗈𝖽𝖾(ℕ)Q−Quote. For Γ1=(𝑑:𝖢𝗈𝖽𝖾(ℕ)@1), the nested tree is (𝑑:𝖢𝗈𝖽𝖾(ℕ)@1)∈Γ1Γ1⊢1𝑑:𝖢𝗈𝖽𝖾(ℕ)Q−VarΓ1⊢2𝗌𝗉𝗅𝗂𝖼𝖾(𝑑):ℕQ−SpliceΓ1⊢1𝗊𝗎𝗈𝗍𝖾(𝗌𝗉𝗅𝗂𝖼𝖾(𝑑)):𝖢𝗈𝖽𝖾(ℕ)Q−QuoteΓ1⊢0𝗊𝗎𝗈𝗍𝖾(𝗊𝗎𝗈𝗍𝖾(𝗌𝗉𝗅𝗂𝖼𝖾(𝑑))):𝖢𝗈𝖽𝖾(𝖢𝗈𝖽𝖾(ℕ))Q−Quote. The phases are therefore 1 at the variable premise, 2 at the splice conclusion, 1 at the inner quotation conclusion, and 0 at the outer quotation conclusion. Finally, Γ𝑥=(𝑥:ℕ@0) contains no declaration 𝑥:ℕ@1. Hence the attempted addition premise Γ𝑥⊢1𝑥:ℕ has no Q-Var derivation, so neither Γ𝑥⊢1𝑥+1:ℕ nor Γ𝑥⊢0𝗊𝗎𝗈𝗍𝖾(𝑥+1):𝖢𝗈𝖽𝖾(ℕ) is derivable.
The analytical Boolean macro has the two clauses 𝗎𝗇𝗅𝗂𝖿𝗍𝖡𝗈𝗈𝗅⟨𝗍𝗍⟩⇒𝗍𝗍,𝗎𝗇𝗅𝗂𝖿𝗍𝖡𝗈𝗈𝗅⟨𝖿𝖿⟩⇒𝖿𝖿. The first pattern judgment checks the quoted pattern at code type 𝖢𝗈𝖽𝖾𝟐 and returns the empty pattern environment; the second has the same input and output. Consequently both branches check at 𝟐, so the whole match has result type 𝟐. A pattern ⟨⌊𝑦⌋⟩ is rejected because its body contains the splice form itself, whereas the pattern judgment matches only the simply typed fragment with 𝖿𝗂𝗑, not quotation or splicing forms. No pattern rule can derive a judgment for that body, regardless of the type assigned to 𝑦. Admitting it would require extending the pattern grammar, pattern reduction, and the source’s preservation proof.