src/Pure/thm.ML
changeset 3037 99ed078e6ae7
parent 3012 0d683397b74b
child 3061 25b2a895f864
equal deleted inserted replaced
3036:5aa3bb94b729 3037:99ed078e6ae7
  1199 (*Calls error rather than raising an exception because it is intended
  1199 (*Calls error rather than raising an exception because it is intended
  1200   for top-level use -- exception handling would not make sense here.
  1200   for top-level use -- exception handling would not make sense here.
  1201   The names in cs, if distinct, are used for the innermost parameters;
  1201   The names in cs, if distinct, are used for the innermost parameters;
  1202    preceding parameters may be renamed to make all params distinct.*)
  1202    preceding parameters may be renamed to make all params distinct.*)
  1203 fun rename_params_rule (cs, i) state =
  1203 fun rename_params_rule (cs, i) state =
  1204   let val Thm{sign,der,maxidx,hyps,prop,...} = state
  1204   let val Thm{sign,der,maxidx,hyps,...} = state
  1205       val (tpairs, Bs, Bi, C) = dest_state(state,i)
  1205       val (tpairs, Bs, Bi, C) = dest_state(state,i)
  1206       val iparams = map #1 (Logic.strip_params Bi)
  1206       val iparams = map #1 (Logic.strip_params Bi)
  1207       val short = length iparams - length cs
  1207       val short = length iparams - length cs
  1208       val newnames =
  1208       val newnames =
  1209             if short<0 then error"More names than abstractions!"
  1209             if short<0 then error"More names than abstractions!"
  1210             else variantlist(take (short,iparams), cs) @ cs
  1210             else variantlist(take (short,iparams), cs) @ cs
  1211       val freenames = map (#1 o dest_Free) (term_frees prop)
  1211       val freenames = map (#1 o dest_Free) (term_frees Bi)
  1212       val newBi = Logic.list_rename_params (newnames, Bi)
  1212       val newBi = Logic.list_rename_params (newnames, Bi)
  1213   in
  1213   in
  1214   case findrep cs of
  1214   case findrep cs of
  1215      c::_ => error ("Bound variables not distinct: " ^ c)
  1215      c::_ => error ("Bound variables not distinct: " ^ c)
  1216    | [] => (case cs inter_string freenames of
  1216    | [] => (case cs inter_string freenames of