src/Pure/Isar/obtain.ML
changeset 19897 fe661eb3b0e7
parent 19844 2c1fdc397ded
child 19906 c23a0e65b285
equal deleted inserted replaced
19896:286d950883bc 19897:fe661eb3b0e7
   119     (*obtain asms*)
   119     (*obtain asms*)
   120     val (asms_ctxt, proppss) = prep_propp (fix_ctxt, map snd raw_asms);
   120     val (asms_ctxt, proppss) = prep_propp (fix_ctxt, map snd raw_asms);
   121     val asm_props = maps (map fst) proppss;
   121     val asm_props = maps (map fst) proppss;
   122     val asms = map fst (Attrib.map_specs (prep_att thy) raw_asms) ~~ proppss;
   122     val asms = map fst (Attrib.map_specs (prep_att thy) raw_asms) ~~ proppss;
   123 
   123 
   124     val _ = ProofContext.warn_extra_tfrees fix_ctxt asms_ctxt;
   124     val _ = Variable.warn_extra_tfrees fix_ctxt asms_ctxt;
   125 
   125 
   126     (*obtain statements*)
   126     (*obtain statements*)
   127     val thesisN = Term.variant xs AutoBind.thesisN;
   127     val thesisN = Term.variant xs AutoBind.thesisN;
   128     val (thesis_var, thesis) = bind_judgment fix_ctxt thesisN;
   128     val (thesis_var, thesis) = bind_judgment fix_ctxt thesisN;
   129 
   129 
   218 fun inferred_type (x, _, mx) ctxt =
   218 fun inferred_type (x, _, mx) ctxt =
   219   let val ((_, T), ctxt') = ProofContext.inferred_param x ctxt
   219   let val ((_, T), ctxt') = ProofContext.inferred_param x ctxt
   220   in ((x, T, mx), ctxt') end;
   220   in ((x, T, mx), ctxt') end;
   221 
   221 
   222 fun polymorphic (vars, ctxt) =
   222 fun polymorphic (vars, ctxt) =
   223   let val Ts = map Logic.dest_type (ProofContext.polymorphic ctxt (map (Logic.mk_type o #2) vars))
   223   let val Ts = map Logic.dest_type (Variable.polymorphic ctxt (map (Logic.mk_type o #2) vars))
   224   in map2 (fn (x, _, mx) => fn T => ((x, T), mx)) vars Ts end;
   224   in map2 (fn (x, _, mx) => fn T => ((x, T), mx)) vars Ts end;
   225 
   225 
   226 fun gen_guess prep_vars raw_vars int state =
   226 fun gen_guess prep_vars raw_vars int state =
   227   let
   227   let
   228     val _ = Proof.assert_forward_or_chain state;
   228     val _ = Proof.assert_forward_or_chain state;
   306           let
   306           let
   307             val xs = map fst vars;
   307             val xs = map fst vars;
   308             val props = map fst propp;
   308             val props = map fst propp;
   309             val (parms, ctxt'') =
   309             val (parms, ctxt'') =
   310               ctxt'
   310               ctxt'
   311               |> fold ProofContext.declare_term props
   311               |> fold Variable.declare_term props
   312               |> fold_map ProofContext.inferred_param xs;
   312               |> fold_map ProofContext.inferred_param xs;
   313             val asm = Term.list_all_free (parms, Logic.list_implies (props, thesis));
   313             val asm = Term.list_all_free (parms, Logic.list_implies (props, thesis));
   314           in
   314           in
   315             ctxt' |> (snd o ProofContext.add_fixes_i (map (fn x => (x, NONE, NoSyn)) xs));
   315             ctxt' |> (snd o ProofContext.add_fixes_i (map (fn x => (x, NONE, NoSyn)) xs));
   316             ctxt' |> ProofContext.add_assms_i ProofContext.assume_export
   316             ctxt' |> ProofContext.add_assms_i ProofContext.assume_export