src/Pure/Isar/generic_target.ML
changeset 56140 ed92ce2ac88e
parent 54883 dd04a8b654fc
child 56141 c06202417c4a
equal deleted inserted replaced
56139:b7add947a6ef 56140:ed92ce2ac88e
   177     |> target_notes kind global_facts (Attrib.partial_evaluation lthy local_facts)
   177     |> target_notes kind global_facts (Attrib.partial_evaluation lthy local_facts)
   178     |> Attrib.local_notes kind local_facts
   178     |> Attrib.local_notes kind local_facts
   179   end;
   179   end;
   180 
   180 
   181 fun locale_notes locale kind global_facts local_facts =
   181 fun locale_notes locale kind global_facts local_facts =
   182   Local_Theory.background_theory
   182   Local_Theory.background_notes kind (Attrib.map_facts (K []) global_facts) #>
   183     (Attrib.global_notes kind (Attrib.map_facts (K []) global_facts) #> snd) #>
       
   184   (fn lthy => lthy |>
   183   (fn lthy => lthy |>
   185     Local_Theory.target (fn ctxt => ctxt |>
   184     Local_Theory.target (fn ctxt => ctxt |>
   186       Locale.add_thmss locale kind (standard_facts lthy ctxt local_facts))) #>
   185       Locale.add_thmss locale kind (standard_facts lthy ctxt local_facts))) #>
   187   (fn lthy => lthy |>
   186   (fn lthy => lthy |>
   188     Local_Theory.map_contexts (fn level => fn ctxt =>
   187     Local_Theory.map_contexts (fn level => fn ctxt =>
   309         const_declaration (fn level => level <> Local_Theory.level lthy')
   308         const_declaration (fn level => level <> Local_Theory.level lthy')
   310           Syntax.mode_default ((b, mx), lhs)
   309           Syntax.mode_default ((b, mx), lhs)
   311     |> pair (lhs, def));
   310     |> pair (lhs, def));
   312 
   311 
   313 fun theory_notes kind global_facts local_facts =
   312 fun theory_notes kind global_facts local_facts =
   314   Local_Theory.background_theory (Attrib.global_notes kind global_facts #> snd) #>
   313   Local_Theory.background_notes kind global_facts #>
   315   (fn lthy => lthy |> Local_Theory.map_contexts (fn level => fn ctxt =>
   314   (fn lthy => lthy |> Local_Theory.map_contexts (fn level => fn ctxt =>
   316     if level = Local_Theory.level lthy then ctxt
   315     if level = Local_Theory.level lthy then ctxt
   317     else
   316     else
   318       ctxt |> Attrib.local_notes kind
   317       ctxt |> Attrib.local_notes kind
   319         (Element.transform_facts (Local_Theory.standard_morphism lthy ctxt) local_facts) |> snd));
   318         (Element.transform_facts (Local_Theory.standard_morphism lthy ctxt) local_facts) |> snd));