src/Pure/Isar/theory_target.ML
changeset 25514 4b508bb31a6c
parent 25485 33840a854e63
child 25519 8570745cb40b
equal deleted inserted replaced
25513:b7de6e23e143 25514:4b508bb31a6c
   288     (*consts*)
   288     (*consts*)
   289     val (consts, lthy') = fold_map (declare_const ta (member (op =) xs)) vars lthy;
   289     val (consts, lthy') = fold_map (declare_const ta (member (op =) xs)) vars lthy;
   290     val global_consts = map (Term.dest_Const o Term.head_of o Thm.term_of o Thm.rhs_of o #2) consts;
   290     val global_consts = map (Term.dest_Const o Term.head_of o Thm.term_of o Thm.rhs_of o #2) consts;
   291 
   291 
   292     (*axioms*)
   292     (*axioms*)
   293     val resubst_instparams = map_aterms (fn t as Free (v, T) =>
   293     val hyps = map Thm.term_of (Assumption.assms_of lthy');
   294       (case Class.instantiation_param lthy' v
       
   295        of NONE => t
       
   296         | SOME c => Const (c, T)) | t => t)
       
   297     val hyps = map Thm.term_of (Assumption.assms_of lthy')
       
   298       |> map resubst_instparams;
       
   299     fun axiom ((name, atts), props) thy = thy
   294     fun axiom ((name, atts), props) thy = thy
   300       |> fold_map (Thm.add_axiom hyps) (PureThy.name_multi name props)
   295       |> fold_map (Thm.add_axiom hyps) (PureThy.name_multi name props)
   301       |-> (fn ths => pair ((name, atts), [(ths, [])]));
   296       |-> (fn ths => pair ((name, atts), [(ths, [])]));
   302   in
   297   in
   303     lthy'
   298     lthy'