src/Pure/Isar/locale.ML
changeset 20243 8b64a1ea9b1b
parent 20224 9c40a144ee0e
child 20307 a44096c94b3c
equal deleted inserted replaced
20242:cfea8e7f9ebd 20243:8b64a1ea9b1b
   880       let
   880       let
   881         val asms' = Attrib.map_specs (Attrib.attribute_i (ProofContext.theory_of ctxt)) asms;
   881         val asms' = Attrib.map_specs (Attrib.attribute_i (ProofContext.theory_of ctxt)) asms;
   882         val ts = maps (map #1 o #2) asms';
   882         val ts = maps (map #1 o #2) asms';
   883         val (ps, qs) = chop (length ts) axs;
   883         val (ps, qs) = chop (length ts) axs;
   884         val (_, ctxt') =
   884         val (_, ctxt') =
   885           ctxt |> fold ProofContext.fix_frees ts
   885           ctxt |> fold Variable.fix_frees ts
   886           |> ProofContext.add_assms_i (axioms_export (if ax_in_ctxt then ps else [])) asms';
   886           |> ProofContext.add_assms_i (axioms_export (if ax_in_ctxt then ps else [])) asms';
   887       in ((ctxt', Assumed qs), []) end
   887       in ((ctxt', Assumed qs), []) end
   888   | activate_elem _ _ ((ctxt, Derived ths), Assumes asms) =
   888   | activate_elem _ _ ((ctxt, Derived ths), Assumes asms) =
   889       ((ctxt, Derived ths), [])
   889       ((ctxt, Derived ths), [])
   890   | activate_elem _ _ ((ctxt, Assumed axs), Defines defs) =
   890   | activate_elem _ _ ((ctxt, Assumed axs), Defines defs) =
   892         val defs' = Attrib.map_specs (Attrib.attribute_i (ProofContext.theory_of ctxt)) defs;
   892         val defs' = Attrib.map_specs (Attrib.attribute_i (ProofContext.theory_of ctxt)) defs;
   893         val asms = defs' |> map (fn ((name, atts), (t, ps)) =>
   893         val asms = defs' |> map (fn ((name, atts), (t, ps)) =>
   894             let val ((c, _), t') = LocalDefs.cert_def ctxt t
   894             let val ((c, _), t') = LocalDefs.cert_def ctxt t
   895             in (t', ((if name = "" then Thm.def_name c else name, atts), [(t', ps)])) end);
   895             in (t', ((if name = "" then Thm.def_name c else name, atts), [(t', ps)])) end);
   896         val (_, ctxt') =
   896         val (_, ctxt') =
   897           ctxt |> fold (ProofContext.fix_frees o #1) asms
   897           ctxt |> fold (Variable.fix_frees o #1) asms
   898           |> ProofContext.add_assms_i LocalDefs.def_export (map #2 asms);
   898           |> ProofContext.add_assms_i LocalDefs.def_export (map #2 asms);
   899       in ((ctxt', Assumed axs), []) end
   899       in ((ctxt', Assumed axs), []) end
   900   | activate_elem _ _ ((ctxt, Derived ths), Defines defs) =
   900   | activate_elem _ _ ((ctxt, Derived ths), Defines defs) =
   901       ((ctxt, Derived ths), [])
   901       ((ctxt, Derived ths), [])
   902   | activate_elem _ is_ext ((ctxt, mode), Notes facts) =
   902   | activate_elem _ is_ext ((ctxt, mode), Notes facts) =