Lectures onType Theory
ch:capture-types: ch:capture-types
appendix sectionsolutions

ch:capture-types: ch:capture-types

exercise 51.1.

The first substitution gives {a,b,y}, and removing y gives {a,b}. The equation [C/x]= gives [{a}/x]=.

exercise 51.2.

By SC-Var, it suffices to derive {p}cap. A second SC-Var reduces this to cap, the empty instance of SC-Set-L. The declaration of q permits any value capturing at most p; neither SC-Var step asserts equality with the declared bound.

exercise 51.3.

Rule App-C substitutes cv(Ug,Γ)= for f. Therefore the result is Π(z:).. Capture-set substitution removes f from the singleton; App-C is the typing rule that requests the substitution.

exercise 51.4.

Put A=Π(z:S).T and F=A. The requested introduction steps are f:FΓ,f:FΓ,f:Ff:{f}AVarC and Γ,f:Ff:{f}AΓλ(f:F).f:Π(f:F).{f}AAbsC For g:{c,d}A, the elimination is Γλ(f:F).f:Π(f:F).{f}AΓg:{c,d}AΓ(λ(f:F).f)g:{c,d}AAppC

exercise 51.5.

Static widening gives the result domain U. Exact beta substitution gives U. Preservation would need Π(y:U).T<:Π(y:U).T. Arrow subtyping reverses domains, so its premise is U<:U, which would require cap. No subcapturing rule derives that judgment.

exercise 51.6.

If kfv(v), SC-Set-R gives {k}capfv(v). Capture prediction gives fv(v)capcv(T,Γ). Transitivity derives the judgment forbidden by the delimiter. Hence no accepted returned value contains k free.

Search the book

Type to search the local edition.