src/Pure/global_theory.ML
changeset 70985 2866fee241ee
parent 70904 caf91f9b847b
child 71006 41685289b8eb
equal deleted inserted replaced
70984:5e98925f86ed 70985:2866fee241ee
   286 val app_facts =
   286 val app_facts =
   287   apfst flat oo fold_map (fn (thms, atts) => fn thy =>
   287   apfst flat oo fold_map (fn (thms, atts) => fn thy =>
   288     fold_map (Thm.theory_attributes atts) (map (Thm.transfer thy) thms) thy);
   288     fold_map (Thm.theory_attributes atts) (map (Thm.transfer thy) thms) thy);
   289 
   289 
   290 fun apply_facts name_flags1 name_flags2 (b, facts) thy =
   290 fun apply_facts name_flags1 name_flags2 (b, facts) thy =
   291   if Binding.is_empty b then app_facts facts thy |-> register_proofs
   291   if Binding.is_empty b then
       
   292     let
       
   293       val (thms, thy') = app_facts facts thy;
       
   294       val _ =
       
   295         if Proofterm.export_proof_boxes_required thy' then
       
   296           Proofterm.export_proof_boxes (map Thm.proof_of thms)
       
   297         else ();
       
   298     in register_proofs thms thy' end
   292   else
   299   else
   293     let
   300     let
   294       val name_pos= bind_name thy b;
   301       val name_pos = bind_name thy b;
   295       val (thms', thy') = thy
   302       val (thms', thy') = thy
   296         |> app_facts (map (apfst (name_thms name_flags1 name_pos)) facts)
   303         |> app_facts (map (apfst (name_thms name_flags1 name_pos)) facts)
   297         |>> name_thms name_flags2 name_pos |-> register_proofs;
   304         |>> name_thms name_flags2 name_pos |-> register_proofs;
   298       val thy'' = thy' |> add_facts (b, Lazy.value thms');
   305       val thy'' = thy' |> add_facts (b, Lazy.value thms');
   299     in (map (Thm.transfer thy'') thms', thy'') end;
   306     in (map (Thm.transfer thy'') thms', thy'') end;