Lectures onType Theory
Semi-unification and polymorphic recursion
appendix sectionrules

Semi-unification and polymorphic recursion

Arrow terms are M,N::=αMN. A finite family {MisuNi}i=1n is solved by one outer substitution S and one matcher Ri for each inequality: Ri(S(Mi))=S(Ni)(1in). Equations may be retained as S(P)=S(Q), or encoded as (P,P)su(P,Q) using one fixed binary constructor.

The Milner–Mycroft calculus adds the following rule to the HM rules above:

Γ,x:σMMe:σ
ΓMMfix x.e:σ
MM-Fix

Its first-order presentation protects in ρ¯ one variable monotype for every ambient nongeneric variable, together with the monotypes of enclosing lambda-bound variables:

A(x)=τ(τ,ρ¯)su(τ,ρ¯)
A;ρ¯FOx:τ
FO-Var
A,x:τ1;(ρ¯,τ1)FOe:τ2
A;ρ¯FOλx.e:τ1τ2
FO-Abs
A;ρ¯FOe1:τ2τA;ρ¯FOe2:τ2
A;ρ¯FOe1e2:τ
FO-App
A;ρ¯FOe1:τ1A,x:τ1;ρ¯FOe2:τ2
A;ρ¯FOlet x=e1 in e2:τ2
FO-Let
A,x:τx;ρ¯FOe:τb(τx,ρ¯)su(τb,ρ¯)(τb,ρ¯)su(τx,ρ¯)(τb,ρ¯)su(τ,ρ¯)
A;ρ¯FOfix x.e:τ
FO-Fix

The generator SEI assigns a fresh root ap to every syntax occurrence and a disjoint binder monotype bp to every lambda or fix at p. If immediate subterms have roots q,r, its five local constraints are xp(A(x),ρ¯)su(ap,ρ¯)(λx.eq)papbpaq(e1qe2r)paqarap(let x=e1q in e2r)papar(fix x.eq)p(bp,ρ¯)su(aq,ρ¯),(aq,ρ¯)su(bp,ρ¯),(aq,ρ¯)su(ap,ρ¯). Subproblems use the environment and protected-tuple extensions stated in definition 5.11; occurrence variables in distinct subproblems are fresh.

Search the book

Type to search the local edition.