equal
deleted
inserted
replaced
338 |
338 |
339 val params = map (prep_param thy) raw_params; |
339 val params = map (prep_param thy) raw_params; |
340 val params_typs = map (fn param => |
340 val params_typs = map (fn param => |
341 let |
341 let |
342 val ty = Sign.the_const_type thy param; |
342 val ty = Sign.the_const_type thy param; |
343 val var = case Term.typ_tvars ty |
343 val _ = case Term.typ_tvars ty |
344 of [(v, _)] => v |
344 of [_] => () |
345 | _ => error ("exactly one type variable required in parameter " ^ quote param); |
345 | _ => error ("exactly one type variable required in parameter " ^ quote param); |
346 val ty' = Term.typ_subst_TVars [(var, TFree (param_tyvarname, []))] ty; |
346 val ty' = Term.map_type_tvar (fn _ => TFree (param_tyvarname, [class])) ty; |
347 in (param, ty') end) params; |
347 in (param, ty') end) params; |
348 val operational = length params_typs > 0 orelse |
348 val operational = length params_typs > 0 orelse |
349 length (filter (the_default false o Option.map |
349 length (filter (the_default false o Option.map |
350 (fn AxClass { operational, ... } => operational) o lookup_def thy) super) > 1; |
350 (fn AxClass { operational, ... } => operational) o lookup_def thy) super) > 1; |
351 |
351 |