C |- cdr : ∀α. [α] → [α] | |||||||||||||||||||||||
C |- cdr : [α] → [α] | C |- L : [α] | ||||||||||||||||||||||
C |- null: ∀ α.[α] → bool | C |- length : [α] → int | C |- cdr(L) : [α] | |||||||||||||||||||||
C |- null : [α] → bool | C |- L : [α] | C |- succ : int → int | C |- length(cdr(L)) : int | ||||||||||||||||||||
C |- null(L) : bool | C |- 0 : int | C |- succ(length(cdr(L))) : int | |||||||||||||||||||||
C |- if null(L) then 0 else succ(length(cdr(L))) : int | |||||||||||||||||||||||
B |- λL. if null(L) then 0 else succ(length(cdr(L))) : [α] → int | |||||||||||||||||||||||
B |- λL. if null(L) then 0 else succ(length(cdr(L))) : ∀ α. [α] → int | |||||||||||||||||||||||
A |- fix length. λL. if null(L) then 0 else succ(length(cdr(L))) : ∀ α. [α] → int |
0 | : | int |
null | : | ∀α. [α] → bool |
cdr | : | ∀α. [α] → [α] |
succ | : | int → int |
(S1 o S2) t2 = (S1) t1 = int
(S1 U S2) t2 = (t1 : int; t2 : t1) t2 = t1
= let (R, r) | = | W(A, λx.x) | in |
let (S, s) | = | W(RA, 3) | in |
let U | = | Unify(I, Sr, s → b1) | in |
(USR, U(b1)) |
= let (R, r) | = | (let (R, r) = W(A.x:b2, x)in (R, R(b2 → r)) | in |
let (S, s) | = | W(RA, 3) | in |
let U | = | Unify(I, Sr, s → b1) | in |
(USR, U(b1)) |
= let (R, r) | = | (let (R, r) = (I, b2) in (R, R(b2 → r)) | in |
let (S, s) | = | W(RA, 3) | in |
let U | = | Unify(I, Sr, s → b1) | in |
(USR, U(b1)) |
= let (R, r) | = | (I, b2 → b2) | in |
let (S, s) | = | W(RA, 3) | in |
let U | = | Unify(I, Sr, s → b1) | in |
(USR, U(b1)) |
= let (S, s) | = | W(A, 3) | in |
let U | = | Unify(I, S(b2 → b2), s → b1) | in |
(USR, U(b1)) |
= let (S, s) | = | (I, int) | in |
let U | = | Unify(I, S(b2 → b2), s → b1) | in |
(USI, U(b1)) |
= let U | = | Unify(I, b2 → b2, int → b1) | in |
(U, U(b1)) |
= let U | = | Unify( Unify(I, b2, int), b2, b1 ) | in |
(U, U(b1)) |
= let U | = | Unify( b2:int, b2, b1 ) | in |
(U, U(b1)) |
= let U | = | Unify( b2:int, int, b1 ) | in |
(U, U(b1)) |
= let U | = | (b1 : int)(b2 : int) | in |
(U, U(b1)) |