Lectures onType Theory
Polar algebraic subtyping and biunification
appendix sectionrules

Polar algebraic subtyping and biunification

Let b{Unit,Bool,Int,String}. The ambient local algebra and its positive and negative sublanguages are T::=bαTTTTTTμα.T,P::=b+α+PPNPμα.P,N::=bαNNPNμα.N. The four atoms are primitive nullary heads. A general lambda-lifted scheme is [Δ]T; a polar scheme is [Δ]P+, with negative environment entries. For some type substitution ρ, scheme subsumption is [Δ]T[Δ]Tdom(Δ)dom(Δ),Δ(x)aρ(Δ(x)),ρ(T)aT, where the middle condition ranges over xdom(Δ). The declarative rules are

Π(x^)=S
Π0x^:S
Var-Let
αFV(Π)
Π0x:[x:α]α
Var-Lam
Π0e:[Δ]T
Π0λx.e:[Δx](Δ(x)T)
Abs
Π0e1:[Δ](T1T2)Π0e2:[Δ]T1
Π0e1e2:[Δ]T2
App
Π0e1:[Δ1]T1Π,x^:[Δ1]T10e2:[Δ2]T2
Π0let x^=e1 in e2:[Δ1Δ2]T2
Let
Π0():[]Unit
Unit
q{true,false}
Π0q:[]Bool
Bool
Π0e0:[Δ]BoolΠ0e1:[Δ]TΠ0e2:[Δ]T
Π0if e0 then e1 else e2:[Δ]T
If
Π0e:SSS
Π0e:S
Sub

No record encoding transfers a theorem to this calculus. The decisive decomposer equations are subB0((N1P1)a(P2N2))={P2aN1,P1aN2},subB0((P1P2)aN)={P1aN,P2aN},subB0(Pa(N1N2))={PaN1,PaN2},subB0(aN)=,subB0(Pa)=,subB0(b+ab)=. The two μ-cases unfold one side; unequal rigid heads are undefined. Atomic rules apply [Nα/α,α/α+]to αaN,[α/α,Pα/α+]to Paα, with the guarded recursive actions (19.3). The recursive work list is B0(H;)=id,B0(H;c,C)=B0(H;C)cH,B0(H;αaN,C)=B0(θH;θC)θ,θ=θαaN,B0(H;Paα,C)=B0(θH;θC)θ,θ=θPaα,B0(H;c,C)=B0(H{c};subB0(c),C)subB0(c) defined. The reflexive atomic case is deleted before the two elimination equations. The syntax-tree function is partial. The finite local automaton procedure B^0 visits positive–negative state pairs, realizes atomic actions by graph merging, and is the terminating solver used by theorem 19.13. Equations (19.8)(19.12) give the complete structural definition of P0. Nonrecursive atomic instance preservation is lemma 19.6; guarded recursive preservation is lemma 19.7.

Search the book

Type to search the local edition.