| author | haftmann | 
| Tue, 31 Aug 2010 14:21:06 +0200 | |
| changeset 38926 | 24f82786cc57 | 
| parent 38831 | 4933a3dfd745 | 
| child 39557 | fe5722fce758 | 
| permissions | -rw-r--r-- | 
| 38309 | 1  | 
(* Title: Pure/Isar/theory_target.ML  | 
2  | 
Author: Makarius  | 
|
3  | 
Author: Florian Haftmann, TU Muenchen  | 
|
4  | 
||
5  | 
Common target infrastructure.  | 
|
6  | 
*)  | 
|
7  | 
||
8  | 
signature GENERIC_TARGET =  | 
|
9  | 
sig  | 
|
| 38313 | 10  | 
val define: (((binding * typ) * mixfix) * (binding * term)  | 
11  | 
-> term list * term list -> local_theory -> (term * thm) * local_theory)  | 
|
| 38309 | 12  | 
-> (binding * mixfix) * (Attrib.binding * term) -> local_theory  | 
13  | 
-> (term * (string * thm)) * local_theory  | 
|
14  | 
val notes: (string  | 
|
15  | 
-> (Attrib.binding * (thm list * Args.src list) list) list  | 
|
16  | 
-> (Attrib.binding * (thm list * Args.src list) list) list  | 
|
17  | 
-> local_theory -> local_theory)  | 
|
18  | 
-> string -> (Attrib.binding * (thm list * Args.src list) list) list  | 
|
19  | 
-> local_theory -> (string * thm list) list * local_theory  | 
|
| 38310 | 20  | 
val abbrev: (string * bool -> binding * mixfix -> term * term  | 
| 
38312
 
9dd57db3c0f2
moved extra_tfrees check for mixfix syntax to Generic_Target
 
haftmann 
parents: 
38311 
diff
changeset
 | 
21  | 
-> term list -> local_theory -> local_theory)  | 
| 38310 | 22  | 
-> string * bool -> (binding * mixfix) * term -> local_theory  | 
23  | 
-> (term * term) * local_theory  | 
|
| 
38341
 
72dba5bd5f63
moved theory-level target operation fragements to Generic_Target; adjusted bootstrap order
 
haftmann 
parents: 
38315 
diff
changeset
 | 
24  | 
|
| 
 
72dba5bd5f63
moved theory-level target operation fragements to Generic_Target; adjusted bootstrap order
 
haftmann 
parents: 
38315 
diff
changeset
 | 
25  | 
val theory_declaration: declaration -> local_theory -> local_theory  | 
| 
 
72dba5bd5f63
moved theory-level target operation fragements to Generic_Target; adjusted bootstrap order
 
haftmann 
parents: 
38315 
diff
changeset
 | 
26  | 
val theory_foundation: ((binding * typ) * mixfix) * (binding * term)  | 
| 
 
72dba5bd5f63
moved theory-level target operation fragements to Generic_Target; adjusted bootstrap order
 
haftmann 
parents: 
38315 
diff
changeset
 | 
27  | 
-> term list * term list -> local_theory -> (term * thm) * local_theory  | 
| 
 
72dba5bd5f63
moved theory-level target operation fragements to Generic_Target; adjusted bootstrap order
 
haftmann 
parents: 
38315 
diff
changeset
 | 
28  | 
val theory_notes: string -> (Attrib.binding * (thm list * Args.src list) list) list  | 
| 
 
72dba5bd5f63
moved theory-level target operation fragements to Generic_Target; adjusted bootstrap order
 
haftmann 
parents: 
38315 
diff
changeset
 | 
29  | 
-> local_theory -> local_theory  | 
| 
 
72dba5bd5f63
moved theory-level target operation fragements to Generic_Target; adjusted bootstrap order
 
haftmann 
parents: 
38315 
diff
changeset
 | 
30  | 
val theory_abbrev: Syntax.mode -> (binding * mixfix) * term  | 
| 
 
72dba5bd5f63
moved theory-level target operation fragements to Generic_Target; adjusted bootstrap order
 
haftmann 
parents: 
38315 
diff
changeset
 | 
31  | 
-> local_theory -> local_theory  | 
| 38309 | 32  | 
end;  | 
33  | 
||
34  | 
structure Generic_Target: GENERIC_TARGET =  | 
|
35  | 
struct  | 
|
36  | 
||
| 
38341
 
72dba5bd5f63
moved theory-level target operation fragements to Generic_Target; adjusted bootstrap order
 
haftmann 
parents: 
38315 
diff
changeset
 | 
37  | 
(** lifting primitive to target operations **)  | 
| 
 
72dba5bd5f63
moved theory-level target operation fragements to Generic_Target; adjusted bootstrap order
 
haftmann 
parents: 
38315 
diff
changeset
 | 
38  | 
|
| 
38312
 
9dd57db3c0f2
moved extra_tfrees check for mixfix syntax to Generic_Target
 
haftmann 
parents: 
38311 
diff
changeset
 | 
39  | 
(* mixfix syntax *)  | 
| 
 
9dd57db3c0f2
moved extra_tfrees check for mixfix syntax to Generic_Target
 
haftmann 
parents: 
38311 
diff
changeset
 | 
40  | 
|
| 
 
9dd57db3c0f2
moved extra_tfrees check for mixfix syntax to Generic_Target
 
haftmann 
parents: 
38311 
diff
changeset
 | 
41  | 
fun check_mixfix ctxt (b, extra_tfrees) mx =  | 
| 
 
9dd57db3c0f2
moved extra_tfrees check for mixfix syntax to Generic_Target
 
haftmann 
parents: 
38311 
diff
changeset
 | 
42  | 
if null extra_tfrees then mx  | 
| 
 
9dd57db3c0f2
moved extra_tfrees check for mixfix syntax to Generic_Target
 
haftmann 
parents: 
38311 
diff
changeset
 | 
43  | 
else  | 
| 
38831
 
4933a3dfd745
more careful treatment of context visibility flag wrt. spurious warnings;
 
wenzelm 
parents: 
38757 
diff
changeset
 | 
44  | 
(Context_Position.if_visible ctxt warning  | 
| 
38312
 
9dd57db3c0f2
moved extra_tfrees check for mixfix syntax to Generic_Target
 
haftmann 
parents: 
38311 
diff
changeset
 | 
45  | 
      ("Additional type variable(s) in specification of " ^ Binding.str_of b ^ ": " ^
 | 
| 
 
9dd57db3c0f2
moved extra_tfrees check for mixfix syntax to Generic_Target
 
haftmann 
parents: 
38311 
diff
changeset
 | 
46  | 
commas (map (Syntax.string_of_typ ctxt o TFree) (sort_wrt #1 extra_tfrees)) ^  | 
| 
 
9dd57db3c0f2
moved extra_tfrees check for mixfix syntax to Generic_Target
 
haftmann 
parents: 
38311 
diff
changeset
 | 
47  | 
(if mx = NoSyn then ""  | 
| 
 
9dd57db3c0f2
moved extra_tfrees check for mixfix syntax to Generic_Target
 
haftmann 
parents: 
38311 
diff
changeset
 | 
48  | 
else "\nDropping mixfix syntax " ^ Pretty.string_of (Syntax.pretty_mixfix mx)));  | 
| 
 
9dd57db3c0f2
moved extra_tfrees check for mixfix syntax to Generic_Target
 
haftmann 
parents: 
38311 
diff
changeset
 | 
49  | 
NoSyn);  | 
| 
 
9dd57db3c0f2
moved extra_tfrees check for mixfix syntax to Generic_Target
 
haftmann 
parents: 
38311 
diff
changeset
 | 
50  | 
|
| 
 
9dd57db3c0f2
moved extra_tfrees check for mixfix syntax to Generic_Target
 
haftmann 
parents: 
38311 
diff
changeset
 | 
51  | 
|
| 38309 | 52  | 
(* define *)  | 
53  | 
||
| 38311 | 54  | 
fun define foundation ((b, mx), ((proto_b_def, atts), rhs)) lthy =  | 
| 38309 | 55  | 
let  | 
56  | 
val thy = ProofContext.theory_of lthy;  | 
|
57  | 
val thy_ctxt = ProofContext.init_global thy;  | 
|
58  | 
||
| 38311 | 59  | 
val b_def = Thm.def_binding_optional b proto_b_def;  | 
| 38309 | 60  | 
|
61  | 
(*term and type parameters*)  | 
|
62  | 
val crhs = Thm.cterm_of thy rhs;  | 
|
63  | 
val (defs, rhs') = Local_Defs.export_cterm lthy thy_ctxt crhs ||> Thm.term_of;  | 
|
64  | 
val rhs_conv = MetaSimplifier.rewrite true defs crhs;  | 
|
65  | 
||
66  | 
val xs = Variable.add_fixed (Local_Theory.target_of lthy) rhs' [];  | 
|
67  | 
val T = Term.fastype_of rhs;  | 
|
68  | 
val tfreesT = Term.add_tfreesT T (fold (Term.add_tfreesT o #2) xs []);  | 
|
69  | 
val extra_tfrees = rev (subtract (op =) tfreesT (Term.add_tfrees rhs []));  | 
|
| 
38312
 
9dd57db3c0f2
moved extra_tfrees check for mixfix syntax to Generic_Target
 
haftmann 
parents: 
38311 
diff
changeset
 | 
70  | 
val mx' = check_mixfix lthy (b, extra_tfrees) mx;  | 
| 38309 | 71  | 
|
72  | 
val type_params = map (Logic.mk_type o TFree) extra_tfrees;  | 
|
73  | 
val term_params =  | 
|
74  | 
rev (Variable.fixes_of (Local_Theory.target_of lthy))  | 
|
75  | 
|> map_filter (fn (_, x) =>  | 
|
76  | 
(case AList.lookup (op =) xs x of  | 
|
77  | 
SOME T => SOME (Free (x, T))  | 
|
78  | 
| NONE => NONE));  | 
|
79  | 
val params = type_params @ term_params;  | 
|
80  | 
||
81  | 
val U = map Term.fastype_of params ---> T;  | 
|
82  | 
||
83  | 
(*foundation*)  | 
|
| 38315 | 84  | 
val ((lhs', global_def), lthy2) = foundation  | 
| 38313 | 85  | 
(((b, U), mx'), (b_def, rhs')) (type_params, term_params) lthy;  | 
| 38309 | 86  | 
|
87  | 
(*local definition*)  | 
|
| 38315 | 88  | 
val ((lhs, local_def), lthy3) = lthy2  | 
| 38309 | 89  | 
|> Local_Defs.add_def ((b, NoSyn), lhs');  | 
| 38315 | 90  | 
val def = Local_Defs.trans_terms lthy3  | 
| 38309 | 91  | 
[(*c == global.c xs*) local_def,  | 
92  | 
(*global.c xs == rhs'*) global_def,  | 
|
93  | 
(*rhs' == rhs*) Thm.symmetric rhs_conv];  | 
|
94  | 
||
95  | 
(*note*)  | 
|
| 38315 | 96  | 
val ([(res_name, [res])], lthy4) = lthy3  | 
| 38311 | 97  | 
|> Local_Theory.notes_kind "" [((b_def, atts), [([def], [])])];  | 
| 38315 | 98  | 
in ((lhs, (res_name, res)), lthy4) end;  | 
| 38309 | 99  | 
|
100  | 
||
101  | 
(* notes *)  | 
|
102  | 
||
103  | 
fun import_export_proof ctxt (name, raw_th) =  | 
|
104  | 
let  | 
|
105  | 
val thy = ProofContext.theory_of ctxt;  | 
|
106  | 
val thy_ctxt = ProofContext.init_global thy;  | 
|
107  | 
val certT = Thm.ctyp_of thy;  | 
|
108  | 
val cert = Thm.cterm_of thy;  | 
|
109  | 
||
110  | 
(*export assumes/defines*)  | 
|
111  | 
val th = Goal.norm_result raw_th;  | 
|
112  | 
val (defs, th') = Local_Defs.export ctxt thy_ctxt th;  | 
|
| 38310 | 113  | 
val assms = map (MetaSimplifier.rewrite_rule defs o Thm.assume)  | 
114  | 
(Assumption.all_assms_of ctxt);  | 
|
| 38309 | 115  | 
val nprems = Thm.nprems_of th' - Thm.nprems_of th;  | 
116  | 
||
117  | 
(*export fixes*)  | 
|
118  | 
val tfrees = map TFree (Thm.fold_terms Term.add_tfrees th' []);  | 
|
119  | 
val frees = map Free (Thm.fold_terms Term.add_frees th' []);  | 
|
120  | 
val (th'' :: vs) = (th' :: map (Drule.mk_term o cert) (map Logic.mk_type tfrees @ frees))  | 
|
121  | 
|> Variable.export ctxt thy_ctxt  | 
|
122  | 
|> Drule.zero_var_indexes_list;  | 
|
123  | 
||
124  | 
(*thm definition*)  | 
|
125  | 
val result = PureThy.name_thm true true name th'';  | 
|
126  | 
||
127  | 
(*import fixes*)  | 
|
128  | 
val (tvars, vars) =  | 
|
129  | 
chop (length tfrees) (map (Thm.term_of o Drule.dest_term) vs)  | 
|
130  | 
|>> map Logic.dest_type;  | 
|
131  | 
||
132  | 
val instT = map_filter (fn (TVar v, T) => SOME (v, T) | _ => NONE) (tvars ~~ tfrees);  | 
|
133  | 
val inst = filter (is_Var o fst) (vars ~~ frees);  | 
|
134  | 
val cinstT = map (pairself certT o apfst TVar) instT;  | 
|
135  | 
val cinst = map (pairself (cert o Term.map_types (Term_Subst.instantiateT instT))) inst;  | 
|
136  | 
val result' = Thm.instantiate (cinstT, cinst) result;  | 
|
137  | 
||
138  | 
(*import assumes/defines*)  | 
|
139  | 
val assm_tac = FIRST' (map (fn assm => Tactic.compose_tac (false, assm, 0)) assms);  | 
|
140  | 
val result'' =  | 
|
141  | 
(case SINGLE (Seq.INTERVAL assm_tac 1 nprems) result' of  | 
|
142  | 
        NONE => raise THM ("Failed to re-import result", 0, [result'])
 | 
|
143  | 
| SOME res => Local_Defs.contract ctxt defs (Thm.cprop_of th) res)  | 
|
144  | 
|> Goal.norm_result  | 
|
145  | 
|> PureThy.name_thm false false name;  | 
|
146  | 
||
147  | 
in (result'', result) end;  | 
|
148  | 
||
149  | 
fun notes target_notes kind facts lthy =  | 
|
150  | 
let  | 
|
151  | 
val thy = ProofContext.theory_of lthy;  | 
|
152  | 
val facts' = facts  | 
|
153  | 
|> map (fn (a, bs) => (a, PureThy.burrow_fact (PureThy.name_multi  | 
|
154  | 
(Local_Theory.full_name lthy (fst a))) bs))  | 
|
155  | 
|> PureThy.map_facts (import_export_proof lthy);  | 
|
156  | 
val local_facts = PureThy.map_facts #1 facts';  | 
|
157  | 
val global_facts = PureThy.map_facts #2 facts';  | 
|
158  | 
in  | 
|
159  | 
lthy  | 
|
160  | 
|> target_notes kind global_facts local_facts  | 
|
161  | 
|> ProofContext.note_thmss kind (Attrib.map_facts (Attrib.attribute_i thy) local_facts)  | 
|
162  | 
end;  | 
|
163  | 
||
164  | 
||
165  | 
(* abbrev *)  | 
|
166  | 
||
167  | 
fun abbrev target_abbrev prmode ((b, mx), t) lthy =  | 
|
168  | 
let  | 
|
169  | 
val thy_ctxt = ProofContext.init_global (ProofContext.theory_of lthy);  | 
|
170  | 
val target_ctxt = Local_Theory.target_of lthy;  | 
|
171  | 
||
172  | 
val t' = Assumption.export_term lthy target_ctxt t;  | 
|
173  | 
val xs = map Free (rev (Variable.add_fixed target_ctxt t' []));  | 
|
174  | 
val u = fold_rev lambda xs t';  | 
|
175  | 
||
176  | 
val extra_tfrees =  | 
|
177  | 
subtract (op =) (Term.add_tfreesT (Term.fastype_of u) []) (Term.add_tfrees u []);  | 
|
| 
38312
 
9dd57db3c0f2
moved extra_tfrees check for mixfix syntax to Generic_Target
 
haftmann 
parents: 
38311 
diff
changeset
 | 
178  | 
val mx' = check_mixfix lthy (b, extra_tfrees) mx;  | 
| 38309 | 179  | 
|
180  | 
val global_rhs =  | 
|
181  | 
singleton (Variable.export_terms (Variable.declare_term u target_ctxt) thy_ctxt) u;  | 
|
182  | 
in  | 
|
183  | 
lthy  | 
|
| 
38312
 
9dd57db3c0f2
moved extra_tfrees check for mixfix syntax to Generic_Target
 
haftmann 
parents: 
38311 
diff
changeset
 | 
184  | 
|> target_abbrev prmode (b, mx') (global_rhs, t') xs  | 
| 38309 | 185  | 
|> ProofContext.add_abbrev Print_Mode.internal (b, t) |> snd  | 
186  | 
|> Local_Defs.fixed_abbrev ((b, NoSyn), t)  | 
|
187  | 
end;  | 
|
188  | 
||
| 
38341
 
72dba5bd5f63
moved theory-level target operation fragements to Generic_Target; adjusted bootstrap order
 
haftmann 
parents: 
38315 
diff
changeset
 | 
189  | 
|
| 
 
72dba5bd5f63
moved theory-level target operation fragements to Generic_Target; adjusted bootstrap order
 
haftmann 
parents: 
38315 
diff
changeset
 | 
190  | 
(** primitive theory operations **)  | 
| 
 
72dba5bd5f63
moved theory-level target operation fragements to Generic_Target; adjusted bootstrap order
 
haftmann 
parents: 
38315 
diff
changeset
 | 
191  | 
|
| 
 
72dba5bd5f63
moved theory-level target operation fragements to Generic_Target; adjusted bootstrap order
 
haftmann 
parents: 
38315 
diff
changeset
 | 
192  | 
fun theory_declaration decl lthy =  | 
| 
 
72dba5bd5f63
moved theory-level target operation fragements to Generic_Target; adjusted bootstrap order
 
haftmann 
parents: 
38315 
diff
changeset
 | 
193  | 
let  | 
| 
 
72dba5bd5f63
moved theory-level target operation fragements to Generic_Target; adjusted bootstrap order
 
haftmann 
parents: 
38315 
diff
changeset
 | 
194  | 
val global_decl = Morphism.form  | 
| 
 
72dba5bd5f63
moved theory-level target operation fragements to Generic_Target; adjusted bootstrap order
 
haftmann 
parents: 
38315 
diff
changeset
 | 
195  | 
(Morphism.transform (Local_Theory.global_morphism lthy) decl);  | 
| 
 
72dba5bd5f63
moved theory-level target operation fragements to Generic_Target; adjusted bootstrap order
 
haftmann 
parents: 
38315 
diff
changeset
 | 
196  | 
in  | 
| 
 
72dba5bd5f63
moved theory-level target operation fragements to Generic_Target; adjusted bootstrap order
 
haftmann 
parents: 
38315 
diff
changeset
 | 
197  | 
lthy  | 
| 
38757
 
2b3e054ae6fc
renamed Local_Theory.theory(_result) to Local_Theory.background_theory(_result) to emphasize that this belongs to the infrastructure and is rarely appropriate in user-space tools;
 
wenzelm 
parents: 
38341 
diff
changeset
 | 
198  | 
|> Local_Theory.background_theory (Context.theory_map global_decl)  | 
| 
38341
 
72dba5bd5f63
moved theory-level target operation fragements to Generic_Target; adjusted bootstrap order
 
haftmann 
parents: 
38315 
diff
changeset
 | 
199  | 
|> Local_Theory.target (Context.proof_map global_decl)  | 
| 
 
72dba5bd5f63
moved theory-level target operation fragements to Generic_Target; adjusted bootstrap order
 
haftmann 
parents: 
38315 
diff
changeset
 | 
200  | 
end;  | 
| 
 
72dba5bd5f63
moved theory-level target operation fragements to Generic_Target; adjusted bootstrap order
 
haftmann 
parents: 
38315 
diff
changeset
 | 
201  | 
|
| 
 
72dba5bd5f63
moved theory-level target operation fragements to Generic_Target; adjusted bootstrap order
 
haftmann 
parents: 
38315 
diff
changeset
 | 
202  | 
fun theory_foundation (((b, U), mx), (b_def, rhs)) (type_params, term_params) lthy =  | 
| 
 
72dba5bd5f63
moved theory-level target operation fragements to Generic_Target; adjusted bootstrap order
 
haftmann 
parents: 
38315 
diff
changeset
 | 
203  | 
let  | 
| 
38757
 
2b3e054ae6fc
renamed Local_Theory.theory(_result) to Local_Theory.background_theory(_result) to emphasize that this belongs to the infrastructure and is rarely appropriate in user-space tools;
 
wenzelm 
parents: 
38341 
diff
changeset
 | 
204  | 
val (const, lthy2) = lthy |> Local_Theory.background_theory_result  | 
| 
38341
 
72dba5bd5f63
moved theory-level target operation fragements to Generic_Target; adjusted bootstrap order
 
haftmann 
parents: 
38315 
diff
changeset
 | 
205  | 
(Sign.declare_const ((b, U), mx));  | 
| 
 
72dba5bd5f63
moved theory-level target operation fragements to Generic_Target; adjusted bootstrap order
 
haftmann 
parents: 
38315 
diff
changeset
 | 
206  | 
val lhs = list_comb (const, type_params @ term_params);  | 
| 
38757
 
2b3e054ae6fc
renamed Local_Theory.theory(_result) to Local_Theory.background_theory(_result) to emphasize that this belongs to the infrastructure and is rarely appropriate in user-space tools;
 
wenzelm 
parents: 
38341 
diff
changeset
 | 
207  | 
val ((_, def), lthy3) = lthy2 |> Local_Theory.background_theory_result  | 
| 
38341
 
72dba5bd5f63
moved theory-level target operation fragements to Generic_Target; adjusted bootstrap order
 
haftmann 
parents: 
38315 
diff
changeset
 | 
208  | 
(Thm.add_def false false (b_def, Logic.mk_equals (lhs, rhs)));  | 
| 
 
72dba5bd5f63
moved theory-level target operation fragements to Generic_Target; adjusted bootstrap order
 
haftmann 
parents: 
38315 
diff
changeset
 | 
209  | 
in ((lhs, def), lthy3) end;  | 
| 
 
72dba5bd5f63
moved theory-level target operation fragements to Generic_Target; adjusted bootstrap order
 
haftmann 
parents: 
38315 
diff
changeset
 | 
210  | 
|
| 
 
72dba5bd5f63
moved theory-level target operation fragements to Generic_Target; adjusted bootstrap order
 
haftmann 
parents: 
38315 
diff
changeset
 | 
211  | 
fun theory_notes kind global_facts lthy =  | 
| 
 
72dba5bd5f63
moved theory-level target operation fragements to Generic_Target; adjusted bootstrap order
 
haftmann 
parents: 
38315 
diff
changeset
 | 
212  | 
let  | 
| 
 
72dba5bd5f63
moved theory-level target operation fragements to Generic_Target; adjusted bootstrap order
 
haftmann 
parents: 
38315 
diff
changeset
 | 
213  | 
val thy = ProofContext.theory_of lthy;  | 
| 
 
72dba5bd5f63
moved theory-level target operation fragements to Generic_Target; adjusted bootstrap order
 
haftmann 
parents: 
38315 
diff
changeset
 | 
214  | 
val global_facts' = Attrib.map_facts (Attrib.attribute_i thy) global_facts;  | 
| 
 
72dba5bd5f63
moved theory-level target operation fragements to Generic_Target; adjusted bootstrap order
 
haftmann 
parents: 
38315 
diff
changeset
 | 
215  | 
in  | 
| 
 
72dba5bd5f63
moved theory-level target operation fragements to Generic_Target; adjusted bootstrap order
 
haftmann 
parents: 
38315 
diff
changeset
 | 
216  | 
lthy  | 
| 
38757
 
2b3e054ae6fc
renamed Local_Theory.theory(_result) to Local_Theory.background_theory(_result) to emphasize that this belongs to the infrastructure and is rarely appropriate in user-space tools;
 
wenzelm 
parents: 
38341 
diff
changeset
 | 
217  | 
|> Local_Theory.background_theory (PureThy.note_thmss kind global_facts' #> snd)  | 
| 
38341
 
72dba5bd5f63
moved theory-level target operation fragements to Generic_Target; adjusted bootstrap order
 
haftmann 
parents: 
38315 
diff
changeset
 | 
218  | 
|> Local_Theory.target (ProofContext.note_thmss kind global_facts' #> snd)  | 
| 
 
72dba5bd5f63
moved theory-level target operation fragements to Generic_Target; adjusted bootstrap order
 
haftmann 
parents: 
38315 
diff
changeset
 | 
219  | 
end;  | 
| 
 
72dba5bd5f63
moved theory-level target operation fragements to Generic_Target; adjusted bootstrap order
 
haftmann 
parents: 
38315 
diff
changeset
 | 
220  | 
|
| 
38757
 
2b3e054ae6fc
renamed Local_Theory.theory(_result) to Local_Theory.background_theory(_result) to emphasize that this belongs to the infrastructure and is rarely appropriate in user-space tools;
 
wenzelm 
parents: 
38341 
diff
changeset
 | 
221  | 
fun theory_abbrev prmode ((b, mx), t) =  | 
| 
 
2b3e054ae6fc
renamed Local_Theory.theory(_result) to Local_Theory.background_theory(_result) to emphasize that this belongs to the infrastructure and is rarely appropriate in user-space tools;
 
wenzelm 
parents: 
38341 
diff
changeset
 | 
222  | 
Local_Theory.background_theory  | 
| 
 
2b3e054ae6fc
renamed Local_Theory.theory(_result) to Local_Theory.background_theory(_result) to emphasize that this belongs to the infrastructure and is rarely appropriate in user-space tools;
 
wenzelm 
parents: 
38341 
diff
changeset
 | 
223  | 
(Sign.add_abbrev (#1 prmode) (b, t) #->  | 
| 
 
2b3e054ae6fc
renamed Local_Theory.theory(_result) to Local_Theory.background_theory(_result) to emphasize that this belongs to the infrastructure and is rarely appropriate in user-space tools;
 
wenzelm 
parents: 
38341 
diff
changeset
 | 
224  | 
(fn (lhs, _) => Sign.notation true prmode [(lhs, mx)]));  | 
| 
38341
 
72dba5bd5f63
moved theory-level target operation fragements to Generic_Target; adjusted bootstrap order
 
haftmann 
parents: 
38315 
diff
changeset
 | 
225  | 
|
| 38309 | 226  | 
end;  |