src/Pure/Isar/class_target.ML
changeset 37236 739d8b9c59da
parent 37146 f652333bbf8e
parent 37232 c10fb22a5e0c
child 37246 b3ff14122645
equal deleted inserted replaced
37225:32c5251f78cd 37236:739d8b9c59da
   241      of SOME dep_morph => Locale.add_dependency sub
   241      of SOME dep_morph => Locale.add_dependency sub
   242           (sup, dep_morph $> Element.satisfy_morphism (the_list some_wit)) export
   242           (sup, dep_morph $> Element.satisfy_morphism (the_list some_wit)) export
   243       | NONE => I
   243       | NONE => I
   244   in
   244   in
   245     thy
   245     thy
   246     |> AxClass.add_classrel classrel
   246     |> AxClass.add_classrel true classrel
   247     |> ClassData.map (Graph.add_edge (sub, sup))
   247     |> ClassData.map (Graph.add_edge (sub, sup))
   248     |> activate_defs sub (these_defs thy diff_sort)
   248     |> activate_defs sub (these_defs thy diff_sort)
   249     |> add_dependency
   249     |> add_dependency
   250   end;
   250   end;
   251 
   251 
   364 local
   364 local
   365 
   365 
   366 fun gen_classrel mk_prop classrel thy =
   366 fun gen_classrel mk_prop classrel thy =
   367   let
   367   let
   368     fun after_qed results =
   368     fun after_qed results =
   369       ProofContext.theory ((fold o fold) AxClass.add_classrel results);
   369       ProofContext.theory ((fold o fold) (AxClass.add_classrel true) results);
   370   in
   370   in
   371     thy
   371     thy
   372     |> ProofContext.init_global
   372     |> ProofContext.init_global
   373     |> Proof.theorem NONE after_qed [[(mk_prop thy classrel, [])]]
   373     |> Proof.theorem NONE after_qed [[(mk_prop thy classrel, [])]]
   374   end;
   374   end;
   529 fun gen_instantiation_instance do_proof after_qed lthy =
   529 fun gen_instantiation_instance do_proof after_qed lthy =
   530   let
   530   let
   531     val (tycos, vs, sort) = (#arities o the_instantiation) lthy;
   531     val (tycos, vs, sort) = (#arities o the_instantiation) lthy;
   532     val arities_proof = maps (fn tyco => Logic.mk_arities (tyco, map snd vs, sort)) tycos;
   532     val arities_proof = maps (fn tyco => Logic.mk_arities (tyco, map snd vs, sort)) tycos;
   533     fun after_qed' results =
   533     fun after_qed' results =
   534       Local_Theory.theory (fold (AxClass.add_arity o Thm.varifyT_global) results)
   534       Local_Theory.theory (fold (AxClass.add_arity true o Thm.varifyT_global) results)
   535       #> after_qed;
   535       #> after_qed;
   536   in
   536   in
   537     lthy
   537     lthy
   538     |> do_proof after_qed' arities_proof
   538     |> do_proof after_qed' arities_proof
   539   end;
   539   end;
   589   let
   589   let
   590     val (tycos, vs, sort) = read_multi_arity thy raw_arities;
   590     val (tycos, vs, sort) = read_multi_arity thy raw_arities;
   591     val sorts = map snd vs;
   591     val sorts = map snd vs;
   592     val arities = maps (fn tyco => Logic.mk_arities (tyco, sorts, sort)) tycos;
   592     val arities = maps (fn tyco => Logic.mk_arities (tyco, sorts, sort)) tycos;
   593     fun after_qed results = ProofContext.theory
   593     fun after_qed results = ProofContext.theory
   594       ((fold o fold) AxClass.add_arity results);
   594       ((fold o fold) (AxClass.add_arity true) results);
   595   in
   595   in
   596     thy
   596     thy
   597     |> ProofContext.init_global
   597     |> ProofContext.init_global
   598     |> Proof.theorem NONE after_qed (map (fn t => [(t, [])]) arities)
   598     |> Proof.theorem NONE after_qed (map (fn t => [(t, [])]) arities)
   599   end;
   599   end;