218 |
218 |
219 fun inf _ (Const (_, T)) tye_idx = (T, tye_idx) |
219 fun inf _ (Const (_, T)) tye_idx = (T, tye_idx) |
220 | inf _ (Free (_, T)) tye_idx = (T, tye_idx) |
220 | inf _ (Free (_, T)) tye_idx = (T, tye_idx) |
221 | inf _ (Var (_, T)) tye_idx = (T, tye_idx) |
221 | inf _ (Var (_, T)) tye_idx = (T, tye_idx) |
222 | inf bs (Bound i) tye_idx = |
222 | inf bs (Bound i) tye_idx = |
223 (snd (nth bs i handle Subscript => err_loose i), tye_idx) |
223 (snd (nth bs i handle General.Subscript => err_loose i), tye_idx) |
224 | inf bs (Abs (x, T, t)) tye_idx = |
224 | inf bs (Abs (x, T, t)) tye_idx = |
225 let val (U, tye_idx') = inf ((x, T) :: bs) t tye_idx |
225 let val (U, tye_idx') = inf ((x, T) :: bs) t tye_idx |
226 in (T --> U, tye_idx') end |
226 in (T --> U, tye_idx') end |
227 | inf bs (t $ u) tye_idx = |
227 | inf bs (t $ u) tye_idx = |
228 let |
228 let |