equal
deleted
inserted
replaced
38 val arity_sorts: Pretty.pp -> tsig -> string -> sort -> sort list |
38 val arity_sorts: Pretty.pp -> tsig -> string -> sort -> sort list |
39 |
39 |
40 (*special treatment of type vars*) |
40 (*special treatment of type vars*) |
41 val strip_sorts: typ -> typ |
41 val strip_sorts: typ -> typ |
42 val no_tvars: typ -> typ |
42 val no_tvars: typ -> typ |
43 val varifyT: typ -> typ |
|
44 val unvarifyT: typ -> typ |
|
45 val varify: term * (string * sort) list -> term * ((string * sort) * indexname) list |
43 val varify: term * (string * sort) list -> term * ((string * sort) * indexname) list |
46 val freeze_thaw_type: typ -> typ * (typ -> typ) |
44 val freeze_thaw_type: typ -> typ * (typ -> typ) |
47 val freeze_type: typ -> typ |
45 val freeze_type: typ -> typ |
48 val freeze_thaw: term -> term * (term -> term) |
46 val freeze_thaw: term -> term * (term -> term) |
49 val freeze: term -> term |
47 val freeze: term -> term |
226 (case typ_tvars T of [] => T |
224 (case typ_tvars T of [] => T |
227 | vs => raise TYPE ("Illegal schematic type variable(s): " ^ |
225 | vs => raise TYPE ("Illegal schematic type variable(s): " ^ |
228 commas_quote (map (Term.string_of_vname o #1) vs), [T], [])); |
226 commas_quote (map (Term.string_of_vname o #1) vs), [T], [])); |
229 |
227 |
230 |
228 |
231 (* varify, unvarify *) |
229 (* varify *) |
232 |
|
233 val varifyT = map_type_tfree (fn (a, S) => TVar ((a, 0), S)); |
|
234 val unvarifyT = map_type_tvar (fn ((a, 0), S) => TFree (a, S) | v => TVar v); |
|
235 |
230 |
236 fun varify (t, fixed) = |
231 fun varify (t, fixed) = |
237 let |
232 let |
238 val fs = Term.fold_types (Term.fold_atyps |
233 val fs = Term.fold_types (Term.fold_atyps |
239 (fn TFree v => if member (op =) fixed v then I else insert (op =) v | _ => I)) t []; |
234 (fn TFree v => if member (op =) fixed v then I else insert (op =) v | _ => I)) t []; |