src/Pure/Isar/obtain.ML
changeset 60407 53ef7b78e78a
parent 60406 12cc54fac9b0
child 60408 1fd46ced2fa8
equal deleted inserted replaced
60406:12cc54fac9b0 60407:53ef7b78e78a
   125     val asms =
   125     val asms =
   126       map (fn ((b, raw_atts), _) => (b, map (prep_att fix_ctxt) raw_atts)) raw_asms ~~
   126       map (fn ((b, raw_atts), _) => (b, map (prep_att fix_ctxt) raw_atts)) raw_asms ~~
   127       map (map (rpair [])) asm_propss;
   127       map (map (rpair [])) asm_propss;
   128 
   128 
   129     (*obtain params*)
   129     (*obtain params*)
   130     val (Ts, params_ctxt) = fold_map Proof_Context.inferred_param xs' (declare_asms fix_ctxt);
   130     val (params, params_ctxt) =
   131     val params = map Free (xs' ~~ Ts);
   131       declare_asms fix_ctxt |> fold_map Proof_Context.inferred_param xs' |>> map Free;
   132     val cparams = map (Thm.cterm_of params_ctxt) params;
   132     val cparams = map (Thm.cterm_of params_ctxt) params;
   133     val binds' = map (apsnd (fold_rev Term.dependent_lambda_name (xs ~~ params))) binds;
   133     val binds' = map (apsnd (fold_rev Term.dependent_lambda_name (xs ~~ params))) binds;
   134 
   134 
   135     val _ = Variable.warn_extra_tfrees fix_ctxt params_ctxt;
   135     val _ = Variable.warn_extra_tfrees fix_ctxt params_ctxt;
   136 
   136 
   257   in ((vars', rule''), ctxt') end;
   257   in ((vars', rule''), ctxt') end;
   258 
   258 
   259 fun inferred_type (binding, _, mx) ctxt =
   259 fun inferred_type (binding, _, mx) ctxt =
   260   let
   260   let
   261     val x = Variable.check_name binding;
   261     val x = Variable.check_name binding;
   262     val (T, ctxt') = Proof_Context.inferred_param x ctxt
   262     val ((_, T), ctxt') = Proof_Context.inferred_param x ctxt
   263   in ((x, T, mx), ctxt') end;
   263   in ((x, T, mx), ctxt') end;
   264 
   264 
   265 fun polymorphic ctxt vars =
   265 fun polymorphic ctxt vars =
   266   let val Ts = map Logic.dest_type (Variable.polymorphic ctxt (map (Logic.mk_type o #2) vars))
   266   let val Ts = map Logic.dest_type (Variable.polymorphic ctxt (map (Logic.mk_type o #2) vars))
   267   in map2 (fn (x, _, mx) => fn T => ((x, T), mx)) vars Ts end;
   267   in map2 (fn (x, _, mx) => fn T => ((x, T), mx)) vars Ts end;