src/Pure/Isar/locale.ML
changeset 32113 bafffa63ebfd
parent 32074 76d6ba08a05f
child 32800 57fcca4e7c0e
     1.1 --- a/src/Pure/Isar/locale.ML	Mon Jul 20 09:52:09 2009 +0200
     1.2 +++ b/src/Pure/Isar/locale.ML	Mon Jul 20 16:49:05 2009 +0200
     1.3 @@ -68,9 +68,8 @@
     1.4    val intro_locales_tac: bool -> Proof.context -> thm list -> tactic
     1.5  
     1.6    (* Registrations and dependencies *)
     1.7 -  val add_registration: string * (morphism * morphism) -> theory -> theory
     1.8 +  val add_registration_eqs: string * morphism -> thm list -> morphism -> theory -> theory
     1.9    val amend_registration: morphism -> string * morphism -> theory -> theory
    1.10 -  val add_registration_eqs: string * morphism -> thm list -> morphism -> theory -> theory
    1.11    val add_dependency: string -> string * morphism -> morphism -> theory -> theory
    1.12  
    1.13    (* Diagnostic *)
    1.14 @@ -295,8 +294,7 @@
    1.15  fun activate_declarations dep = Context.proof_map (fn context =>
    1.16    let
    1.17      val thy = Context.theory_of context;
    1.18 -    val context' = roundup thy activate_decls dep (get_idents context, context) |-> put_idents;
    1.19 -  in context' end);
    1.20 +  in roundup thy activate_decls dep (get_idents context, context) |-> put_idents end);
    1.21  
    1.22  fun activate_facts dep context =
    1.23    let
    1.24 @@ -346,11 +344,6 @@
    1.25  fun all_registrations thy = Registrations.get thy
    1.26    |> map reg_morph;
    1.27  
    1.28 -fun add_registration (name, (base_morph, export)) thy =
    1.29 -  roundup thy (fn (name', morph') => Registrations.map (cons ((name', (morph', export)), stamp ())))
    1.30 -    (name, base_morph) (get_idents (Context.Theory thy), thy)
    1.31 -  (* FIXME |-> (Context.theory_map o put_idents_diag)*) |> snd;
    1.32 -
    1.33  fun amend_registration morph (name, base_morph) thy =
    1.34    let
    1.35      val regs = map #1 (Registrations.get thy);
    1.36 @@ -373,8 +366,10 @@
    1.37      val morph = if null eqns then proto_morph
    1.38        else proto_morph $> Element.eq_morphism thy eqns;
    1.39    in
    1.40 -    thy
    1.41 -    |> add_registration (dep, (morph, export))
    1.42 +    (get_idents (Context.Theory thy), thy)
    1.43 +    |> roundup thy (fn (dep', morph') =>
    1.44 +        Registrations.map (cons ((dep', (morph', export)), stamp ()))) (dep, morph)
    1.45 +    |> snd
    1.46      |> Context.theory_map (activate_facts (dep, morph $> export))
    1.47    end;
    1.48