936 (* facts *) |
936 (* facts *) |
937 |
937 |
938 local |
938 local |
939 |
939 |
940 fun update_thms _ (b, NONE) ctxt = ctxt |> map_facts (Facts.del (full_name ctxt b)) |
940 fun update_thms _ (b, NONE) ctxt = ctxt |> map_facts (Facts.del (full_name ctxt b)) |
941 | update_thms do_props (b, SOME ths) ctxt = ctxt |> map_facts |
941 | update_thms flags (b, SOME ths) ctxt = ctxt |> map_facts |
942 (Facts.add_local (Context.Proof ctxt) do_props (b, ths) #> snd); |
942 (Facts.add_static (Context.Proof ctxt) flags (b, ths) #> snd); |
943 |
943 |
944 in |
944 in |
945 |
945 |
946 fun note_thmss kind = fold_map (fn ((b, more_atts), raw_facts) => fn ctxt => |
946 fun note_thmss kind = fold_map (fn ((b, more_atts), raw_facts) => fn ctxt => |
947 let |
947 let |
950 fun app (ths, atts) = |
950 fun app (ths, atts) = |
951 fold_map (Thm.proof_attributes (surround (Thm.kind kind) (atts @ more_atts))) ths; |
951 fold_map (Thm.proof_attributes (surround (Thm.kind kind) (atts @ more_atts))) ths; |
952 val (res, ctxt') = fold_map app facts ctxt; |
952 val (res, ctxt') = fold_map app facts ctxt; |
953 val thms = Global_Theory.name_thms false false name (flat res); |
953 val thms = Global_Theory.name_thms false false name (flat res); |
954 val Mode {stmt, ...} = get_mode ctxt; |
954 val Mode {stmt, ...} = get_mode ctxt; |
955 in ((name, thms), ctxt' |> update_thms stmt (b, SOME thms)) end); |
955 in ((name, thms), ctxt' |> update_thms {strict = false, index = stmt} (b, SOME thms)) end); |
956 |
956 |
957 fun put_thms do_props thms ctxt = ctxt |
957 fun put_thms index thms ctxt = ctxt |
958 |> map_naming (K Name_Space.local_naming) |
958 |> map_naming (K Name_Space.local_naming) |
959 |> Context_Position.set_visible false |
959 |> Context_Position.set_visible false |
960 |> update_thms do_props (apfst Binding.name thms) |
960 |> update_thms {strict = false, index = index} (apfst Binding.name thms) |
961 |> Context_Position.restore_visible ctxt |
961 |> Context_Position.restore_visible ctxt |
962 |> restore_naming ctxt; |
962 |> restore_naming ctxt; |
963 |
963 |
964 end; |
964 end; |
965 |
965 |