equal
deleted
inserted
replaced
480 explode #> scan_valids #> implode |
480 explode #> scan_valids #> implode |
481 end; |
481 end; |
482 |
482 |
483 val type_name = sanitize_name o Long_Name.base_name; |
483 val type_name = sanitize_name o Long_Name.base_name; |
484 |
484 |
485 fun define_overloaded (c, U) v (b_def, rhs) = Local_Theory.theory_result |
485 fun define_overloaded (c, U) v (b_def, rhs) = Local_Theory.background_theory_result |
486 (AxClass.declare_overloaded (c, U) ##>> AxClass.define_overloaded b_def (c, rhs)) |
486 (AxClass.declare_overloaded (c, U) ##>> AxClass.define_overloaded b_def (c, rhs)) |
487 ##> (map_instantiation o apsnd) (filter_out (fn (_, (v', _)) => v' = v)) |
487 ##> (map_instantiation o apsnd) (filter_out (fn (_, (v', _)) => v' = v)) |
488 ##> Local_Theory.target synchronize_inst_syntax; |
488 ##> Local_Theory.target synchronize_inst_syntax; |
489 |
489 |
490 fun foundation (((b, U), mx), (b_def, rhs)) (type_params, term_params) lthy = |
490 fun foundation (((b, U), mx), (b_def, rhs)) (type_params, term_params) lthy = |
570 fun gen_instantiation_instance do_proof after_qed lthy = |
570 fun gen_instantiation_instance do_proof after_qed lthy = |
571 let |
571 let |
572 val (tycos, vs, sort) = (#arities o the_instantiation) lthy; |
572 val (tycos, vs, sort) = (#arities o the_instantiation) lthy; |
573 val arities_proof = maps (fn tyco => Logic.mk_arities (tyco, map snd vs, sort)) tycos; |
573 val arities_proof = maps (fn tyco => Logic.mk_arities (tyco, map snd vs, sort)) tycos; |
574 fun after_qed' results = |
574 fun after_qed' results = |
575 Local_Theory.theory (fold (AxClass.add_arity o Thm.varifyT_global) results) |
575 Local_Theory.background_theory (fold (AxClass.add_arity o Thm.varifyT_global) results) |
576 #> after_qed; |
576 #> after_qed; |
577 in |
577 in |
578 lthy |
578 lthy |
579 |> do_proof after_qed' arities_proof |
579 |> do_proof after_qed' arities_proof |
580 end; |
580 end; |