src/Pure/Isar/class_declaration.ML
changeset 38389 d7d915bae307
parent 38384 07c33be08476
child 38390 cb72d89bb444
equal deleted inserted replaced
38388:94d5624dd1f7 38389:d7d915bae307
   288        `(fn thy => calculate thy class sups base_sort param_map assm_axiom)
   288        `(fn thy => calculate thy class sups base_sort param_map assm_axiom)
   289     #-> (fn (base_morph, eq_morph, export_morph, axiom, assm_intro, of_class) =>
   289     #-> (fn (base_morph, eq_morph, export_morph, axiom, assm_intro, of_class) =>
   290        Context.theory_map (Locale.add_registration (class, base_morph)
   290        Context.theory_map (Locale.add_registration (class, base_morph)
   291          (Option.map (rpair true) eq_morph) export_morph)
   291          (Option.map (rpair true) eq_morph) export_morph)
   292     #> Class.register class sups params base_sort base_morph export_morph axiom assm_intro of_class))
   292     #> Class.register class sups params base_sort base_morph export_morph axiom assm_intro of_class))
   293     |> Named_Target.init (SOME class)
   293     |> Named_Target.init class
   294     |> pair class
   294     |> pair class
   295   end;
   295   end;
   296 
   296 
   297 in
   297 in
   298 
   298 
   321     val some_prop = try the_single props;
   321     val some_prop = try the_single props;
   322     val some_dep_morph = try the_single (map snd deps);
   322     val some_dep_morph = try the_single (map snd deps);
   323     fun after_qed some_wit =
   323     fun after_qed some_wit =
   324       ProofContext.theory (Class.register_subclass (sub, sup)
   324       ProofContext.theory (Class.register_subclass (sub, sup)
   325         some_dep_morph some_wit export)
   325         some_dep_morph some_wit export)
   326       #> ProofContext.theory_of #> Named_Target.init (SOME sub);
   326       #> ProofContext.theory_of #> Named_Target.init sub;
   327   in do_proof after_qed some_prop goal_ctxt end;
   327   in do_proof after_qed some_prop goal_ctxt end;
   328 
   328 
   329 fun user_proof after_qed some_prop =
   329 fun user_proof after_qed some_prop =
   330   Element.witness_proof (after_qed o try the_single o the_single)
   330   Element.witness_proof (after_qed o try the_single o the_single)
   331     [the_list some_prop];
   331     [the_list some_prop];