280 let |
280 let |
281 val thy = theory_of ctxt; |
281 val thy = theory_of ctxt; |
282 val syntax = syntax_of ctxt; |
282 val syntax = syntax_of ctxt; |
283 val consts = consts_of ctxt; |
283 val consts = consts_of ctxt; |
284 val t' = t |
284 val t' = t |
285 |> K abbrevs ? rewrite_term thy (Consts.abbrevs_of consts (! print_mode @ [""])) |
285 |> abbrevs ? rewrite_term thy (Consts.abbrevs_of consts (! print_mode @ [""])) |
286 |> Sign.extern_term (Consts.extern_early consts) thy |
286 |> Sign.extern_term (Consts.extern_early consts) thy |
287 |> LocalSyntax.extern_term syntax; |
287 |> LocalSyntax.extern_term syntax; |
288 in |
288 in |
289 Sign.pretty_term' (Context.Proof ctxt) (LocalSyntax.syn_of syntax) (Consts.extern consts) t' |
289 Sign.pretty_term' (Context.Proof ctxt) (LocalSyntax.syn_of syntax) (Consts.extern consts) t' |
290 end; |
290 end; |
762 |
762 |
763 (* lthms_containing *) |
763 (* lthms_containing *) |
764 |
764 |
765 fun lthms_containing ctxt spec = |
765 fun lthms_containing ctxt spec = |
766 FactIndex.find (fact_index_of ctxt) spec |
766 FactIndex.find (fact_index_of ctxt) spec |
767 |> map ((not o valid_thms ctxt) ? apfst (fn name => |
767 |> map (fn (name, ths) => |
768 NameSpace.hidden (if name = "" then "unnamed" else name))); |
768 if valid_thms ctxt (name, ths) then (name, ths) |
|
769 else (NameSpace.hidden (if name = "" then "unnamed" else name), ths)); |
769 |
770 |
770 |
771 |
771 (* name space operations *) |
772 (* name space operations *) |
772 |
773 |
773 val no_base_names = map_naming NameSpace.no_base_names; |
774 val no_base_names = map_naming NameSpace.no_base_names; |
807 |
808 |
808 local |
809 local |
809 |
810 |
810 fun gen_note_thmss get k = fold_map (fn ((bname, more_attrs), raw_facts) => fn ctxt => |
811 fun gen_note_thmss get k = fold_map (fn ((bname, more_attrs), raw_facts) => fn ctxt => |
811 let |
812 let |
812 val name = full_name ctxt bname; |
|
813 val stmt = is_stmt ctxt; |
813 val stmt = is_stmt ctxt; |
814 |
|
815 val kind = if stmt then [] else [PureThy.kind k]; |
814 val kind = if stmt then [] else [PureThy.kind k]; |
816 val facts = raw_facts |> map (apfst (get ctxt)) |
815 |
817 |> (if stmt then I else PureThy.name_thmss name); |
816 val facts = map (apfst (get ctxt)) raw_facts; |
818 |
|
819 fun app (th, attrs) x = |
817 fun app (th, attrs) x = |
820 swap (foldl_map (Thm.proof_attributes (attrs @ more_attrs @ kind)) (x, th)); |
818 swap (foldl_map (Thm.proof_attributes (attrs @ more_attrs @ kind)) (x, th)); |
821 val (res, ctxt') = fold_map app facts ctxt; |
819 val (res, ctxt') = fold_map app facts ctxt; |
822 val thms = flat res |
820 val thms = flat res; |
823 |> (if stmt then I else PureThy.name_thms false name); |
|
824 in ((bname, thms), ctxt' |> update_thms stmt (bname, SOME thms)) end); |
821 in ((bname, thms), ctxt' |> update_thms stmt (bname, SOME thms)) end); |
825 |
822 |
826 in |
823 in |
827 |
824 |
828 val note_thmss = gen_note_thmss get_thms; |
825 val note_thmss = gen_note_thmss get_thms; |