src/Pure/Isar/generic_target.ML
changeset 70544 16e98f89a29c
parent 70494 41108e3e9ca5
child 71178 c7d4f2ab40b9
equal deleted inserted replaced
70543:33749040b6f8 70544:16e98f89a29c
   304   in (result'', result) end;
   304   in (result'', result) end;
   305 
   305 
   306 fun bind_name lthy b =
   306 fun bind_name lthy b =
   307   (Local_Theory.full_name lthy b, Binding.default_pos_of b);
   307   (Local_Theory.full_name lthy b, Binding.default_pos_of b);
   308 
   308 
       
   309 fun map_facts f = map (apsnd (map (apfst (map f))));
       
   310 
   309 in
   311 in
   310 
   312 
   311 fun notes target_notes kind facts lthy =
   313 fun notes target_notes kind facts lthy =
   312   let
   314   let
   313     val facts' = facts
   315     val facts' = facts
   314       |> map (fn (a, bs) =>
   316       |> map (fn (a, bs) =>
   315           (a, Global_Theory.burrow_fact (Global_Theory.name_multi (bind_name lthy (fst a))) bs))
   317           (a, Global_Theory.burrow_fact (Global_Theory.name_multi (bind_name lthy (fst a))) bs))
   316       |> Global_Theory.map_facts (import_export_proof lthy);
   318       |> map_facts (import_export_proof lthy);
   317     val local_facts = Global_Theory.map_facts #1 facts';
   319     val local_facts = map_facts #1 facts';
   318     val global_facts = Global_Theory.map_facts #2 facts';
   320     val global_facts = map_facts #2 facts';
   319   in
   321   in
   320     lthy
   322     lthy
   321     |> target_notes kind global_facts (Attrib.partial_evaluation lthy local_facts)
   323     |> target_notes kind global_facts (Attrib.partial_evaluation lthy local_facts)
   322     |> Attrib.local_notes kind local_facts
   324     |> Attrib.local_notes kind local_facts
   323   end;
   325   end;