equal
deleted
inserted
replaced
514 (* rules *) |
514 (* rules *) |
515 |
515 |
516 fun stripped_sorts thy t = |
516 fun stripped_sorts thy t = |
517 let |
517 let |
518 val tfrees = rev (Term.add_tfrees t []); |
518 val tfrees = rev (Term.add_tfrees t []); |
519 val tfrees' = map (fn a => (a, [])) (Name.invent Name.context Name.aT (length tfrees)); |
519 val tfrees' = map (fn a => (a, [])) (Name.variant_list [] (map #1 tfrees)); |
520 val recover = |
520 val recover = |
521 map2 (fn (a', S') => fn (a, S) => (((a', 0), S'), Thm.global_ctyp_of thy (TVar ((a, 0), S)))) |
521 map2 (fn (a', S') => fn (a, S) => (((a', 0), S'), Thm.global_ctyp_of thy (TVar ((a, 0), S)))) |
522 tfrees' tfrees; |
522 tfrees' tfrees; |
523 val strip = map (apply2 TFree) (tfrees ~~ tfrees'); |
523 val strip = map (apply2 TFree) (tfrees ~~ tfrees'); |
524 val t' = Term.map_types (Term.map_atyps (perhaps (AList.lookup (op =) strip))) t; |
524 val t' = Term.map_types (Term.map_atyps (perhaps (AList.lookup (op =) strip))) t; |