author | wenzelm |
Tue, 21 Nov 2006 18:07:30 +0100 | |
changeset 21434 | 944f80576be0 |
parent 21370 | d9dd7b4e5e69 |
child 21435 | 883337ea2f3b |
permissions | -rw-r--r-- |
18620
fc8b5f275359
Theory specifications --- with type-inference, but no internal polymorphism.
wenzelm
parents:
diff
changeset
|
1 |
(* Title: Pure/Isar/specification.ML |
fc8b5f275359
Theory specifications --- with type-inference, but no internal polymorphism.
wenzelm
parents:
diff
changeset
|
2 |
ID: $Id$ |
fc8b5f275359
Theory specifications --- with type-inference, but no internal polymorphism.
wenzelm
parents:
diff
changeset
|
3 |
Author: Makarius |
fc8b5f275359
Theory specifications --- with type-inference, but no internal polymorphism.
wenzelm
parents:
diff
changeset
|
4 |
|
21036 | 5 |
Derived local theory specifications --- with type-inference and |
18810 | 6 |
toplevel polymorphism. |
18620
fc8b5f275359
Theory specifications --- with type-inference, but no internal polymorphism.
wenzelm
parents:
diff
changeset
|
7 |
*) |
fc8b5f275359
Theory specifications --- with type-inference, but no internal polymorphism.
wenzelm
parents:
diff
changeset
|
8 |
|
fc8b5f275359
Theory specifications --- with type-inference, but no internal polymorphism.
wenzelm
parents:
diff
changeset
|
9 |
signature SPECIFICATION = |
fc8b5f275359
Theory specifications --- with type-inference, but no internal polymorphism.
wenzelm
parents:
diff
changeset
|
10 |
sig |
20890 | 11 |
val quiet_mode: bool ref |
12 |
val print_consts: local_theory -> (string * typ -> bool) -> (string * typ) list -> unit |
|
18771 | 13 |
val read_specification: (string * string option * mixfix) list -> |
18954 | 14 |
((string * Attrib.src list) * string list) list -> local_theory -> |
18771 | 15 |
(((string * typ) * mixfix) list * ((string * Attrib.src list) * term list) list) * |
18954 | 16 |
local_theory |
18771 | 17 |
val cert_specification: (string * typ option * mixfix) list -> |
18954 | 18 |
((string * Attrib.src list) * term list) list -> local_theory -> |
18771 | 19 |
(((string * typ) * mixfix) list * ((string * Attrib.src list) * term list) list) * |
18954 | 20 |
local_theory |
21 |
val axiomatization: (string * string option * mixfix) list -> |
|
22 |
((bstring * Attrib.src list) * string list) list -> local_theory -> |
|
23 |
(term list * (bstring * thm list) list) * local_theory |
|
24 |
val axiomatization_i: (string * typ option * mixfix) list -> |
|
25 |
((bstring * Attrib.src list) * term list) list -> local_theory -> |
|
26 |
(term list * (bstring * thm list) list) * local_theory |
|
27 |
val definition: |
|
18786 | 28 |
((string * string option * mixfix) option * ((string * Attrib.src list) * string)) list -> |
18954 | 29 |
local_theory -> (term * (bstring * thm)) list * local_theory |
30 |
val definition_i: |
|
18786 | 31 |
((string * typ option * mixfix) option * ((string * Attrib.src list) * term)) list -> |
18954 | 32 |
local_theory -> (term * (bstring * thm)) list * local_theory |
20784 | 33 |
val abbreviation: Syntax.mode -> ((string * string option * mixfix) option * string) list -> |
21275 | 34 |
local_theory -> (term * term) list * local_theory |
20784 | 35 |
val abbreviation_i: Syntax.mode -> ((string * typ option * mixfix) option * term) list -> |
21275 | 36 |
local_theory -> (term * term) list * local_theory |
21206
2af4c7b3f7ef
replaced const_syntax by notation, which operates on terms;
wenzelm
parents:
21036
diff
changeset
|
37 |
val notation: Syntax.mode -> (string * mixfix) list -> local_theory -> local_theory |
2af4c7b3f7ef
replaced const_syntax by notation, which operates on terms;
wenzelm
parents:
21036
diff
changeset
|
38 |
val notation_i: Syntax.mode -> (term * mixfix) list -> local_theory -> local_theory |
20914 | 39 |
val theorems: string -> ((bstring * Attrib.src list) * (thmref * Attrib.src list) list) list |
40 |
-> local_theory -> (bstring * thm list) list * local_theory |
|
41 |
val theorems_i: string -> ((bstring * Attrib.src list) * (thm list * Attrib.src list) list) list |
|
42 |
-> local_theory -> (bstring * thm list) list * local_theory |
|
21036 | 43 |
val theorem: string -> Method.text option -> (thm list list -> local_theory -> local_theory) -> |
44 |
string * Attrib.src list -> Element.context Locale.element list -> Element.statement -> |
|
45 |
local_theory -> Proof.state |
|
46 |
val theorem_i: string -> Method.text option -> (thm list list -> local_theory -> local_theory) -> |
|
47 |
string * Attrib.src list -> Element.context_i Locale.element list -> Element.statement_i -> |
|
48 |
local_theory -> Proof.state |
|
18620
fc8b5f275359
Theory specifications --- with type-inference, but no internal polymorphism.
wenzelm
parents:
diff
changeset
|
49 |
end; |
fc8b5f275359
Theory specifications --- with type-inference, but no internal polymorphism.
wenzelm
parents:
diff
changeset
|
50 |
|
fc8b5f275359
Theory specifications --- with type-inference, but no internal polymorphism.
wenzelm
parents:
diff
changeset
|
51 |
structure Specification: SPECIFICATION = |
fc8b5f275359
Theory specifications --- with type-inference, but no internal polymorphism.
wenzelm
parents:
diff
changeset
|
52 |
struct |
fc8b5f275359
Theory specifications --- with type-inference, but no internal polymorphism.
wenzelm
parents:
diff
changeset
|
53 |
|
21230
abfdce60b371
theorem statements: incorporate Obtain.statement, tuned;
wenzelm
parents:
21206
diff
changeset
|
54 |
|
20890 | 55 |
(* diagnostics *) |
56 |
||
57 |
val quiet_mode = ref false; |
|
58 |
||
59 |
fun print_consts _ _ [] = () |
|
60 |
| print_consts ctxt pred cs = |
|
61 |
if ! quiet_mode then () else Pretty.writeln (ProofDisplay.pretty_consts ctxt pred cs); |
|
62 |
||
21036 | 63 |
fun present_results ctxt res = |
64 |
if ! quiet_mode then () else ProofDisplay.present_results ctxt res; |
|
65 |
||
66 |
fun present_results' ctxt kind res = present_results ctxt ((kind, ""), res); |
|
20914 | 67 |
|
19664 | 68 |
|
18620
fc8b5f275359
Theory specifications --- with type-inference, but no internal polymorphism.
wenzelm
parents:
diff
changeset
|
69 |
(* prepare specification *) |
fc8b5f275359
Theory specifications --- with type-inference, but no internal polymorphism.
wenzelm
parents:
diff
changeset
|
70 |
|
18828 | 71 |
fun prep_specification prep_vars prep_propp prep_att raw_vars raw_specs ctxt = |
18620
fc8b5f275359
Theory specifications --- with type-inference, but no internal polymorphism.
wenzelm
parents:
diff
changeset
|
72 |
let |
18670 | 73 |
val thy = ProofContext.theory_of ctxt; |
18620
fc8b5f275359
Theory specifications --- with type-inference, but no internal polymorphism.
wenzelm
parents:
diff
changeset
|
74 |
|
18670 | 75 |
val (vars, vars_ctxt) = ctxt |> prep_vars raw_vars; |
76 |
val (xs, params_ctxt) = vars_ctxt |> ProofContext.add_fixes_i vars; |
|
77 |
val ((specs, vs), specs_ctxt) = |
|
19585 | 78 |
prep_propp (params_ctxt, map (map (rpair []) o snd) raw_specs) |
18620
fc8b5f275359
Theory specifications --- with type-inference, but no internal polymorphism.
wenzelm
parents:
diff
changeset
|
79 |
|> swap |>> map (map fst) |
18771 | 80 |
||>> fold_map ProofContext.inferred_param xs; |
18620
fc8b5f275359
Theory specifications --- with type-inference, but no internal polymorphism.
wenzelm
parents:
diff
changeset
|
81 |
|
18771 | 82 |
val params = vs ~~ map #3 vars; |
18620
fc8b5f275359
Theory specifications --- with type-inference, but no internal polymorphism.
wenzelm
parents:
diff
changeset
|
83 |
val names = map (fst o fst) raw_specs; |
18670 | 84 |
val atts = map (map (prep_att thy) o snd o fst) raw_specs; |
18620
fc8b5f275359
Theory specifications --- with type-inference, but no internal polymorphism.
wenzelm
parents:
diff
changeset
|
85 |
in ((params, (names ~~ atts) ~~ specs), specs_ctxt) end; |
fc8b5f275359
Theory specifications --- with type-inference, but no internal polymorphism.
wenzelm
parents:
diff
changeset
|
86 |
|
fc8b5f275359
Theory specifications --- with type-inference, but no internal polymorphism.
wenzelm
parents:
diff
changeset
|
87 |
fun read_specification x = |
18771 | 88 |
prep_specification ProofContext.read_vars ProofContext.read_propp Attrib.intern_src x; |
21370
d9dd7b4e5e69
replaced Variable.fix_frees by Variable.auto_fixes (depends on body mode);
wenzelm
parents:
21359
diff
changeset
|
89 |
|
18620
fc8b5f275359
Theory specifications --- with type-inference, but no internal polymorphism.
wenzelm
parents:
diff
changeset
|
90 |
fun cert_specification x = |
18670 | 91 |
prep_specification ProofContext.cert_vars ProofContext.cert_propp (K I) x; |
18620
fc8b5f275359
Theory specifications --- with type-inference, but no internal polymorphism.
wenzelm
parents:
diff
changeset
|
92 |
|
fc8b5f275359
Theory specifications --- with type-inference, but no internal polymorphism.
wenzelm
parents:
diff
changeset
|
93 |
|
18771 | 94 |
(* axiomatization *) |
18620
fc8b5f275359
Theory specifications --- with type-inference, but no internal polymorphism.
wenzelm
parents:
diff
changeset
|
95 |
|
20890 | 96 |
fun gen_axioms prep raw_vars raw_specs lthy = |
18620
fc8b5f275359
Theory specifications --- with type-inference, but no internal polymorphism.
wenzelm
parents:
diff
changeset
|
97 |
let |
20890 | 98 |
val (vars, specs) = fst (prep raw_vars raw_specs lthy); |
18828 | 99 |
val cs = map fst vars; |
18880
b8a1c3cdf739
axiomatization: retrict parameters to occurrences in specs;
wenzelm
parents:
18828
diff
changeset
|
100 |
val spec_frees = member (op =) (fold (fold Term.add_frees o snd) specs []); |
18786 | 101 |
|
20890 | 102 |
val ((consts, axioms), lthy') = lthy |
103 |
|> LocalTheory.consts spec_frees vars |
|
21370
d9dd7b4e5e69
replaced Variable.fix_frees by Variable.auto_fixes (depends on body mode);
wenzelm
parents:
21359
diff
changeset
|
104 |
||> fold (fold Variable.auto_fixes o snd) specs (* FIXME !? *) |
20890 | 105 |
||>> LocalTheory.axioms specs; |
18786 | 106 |
|
20890 | 107 |
(* FIXME generic target!? *) |
108 |
val hs = map (Term.head_of o #2 o Logic.dest_equals o Thm.prop_of o #2) consts; |
|
109 |
val lthy'' = lthy' |> LocalTheory.theory (Theory.add_finals_i false hs); |
|
110 |
||
111 |
val _ = print_consts lthy' spec_frees cs; |
|
112 |
in ((map #1 consts, axioms), lthy'') end; |
|
18786 | 113 |
|
18954 | 114 |
val axiomatization = gen_axioms read_specification; |
115 |
val axiomatization_i = gen_axioms cert_specification; |
|
18620
fc8b5f275359
Theory specifications --- with type-inference, but no internal polymorphism.
wenzelm
parents:
diff
changeset
|
116 |
|
18786 | 117 |
|
118 |
(* definition *) |
|
119 |
||
20890 | 120 |
fun gen_defs prep args lthy = |
18786 | 121 |
let |
20890 | 122 |
fun define (raw_var, (raw_a, raw_prop)) lthy1 = |
18786 | 123 |
let |
20890 | 124 |
val (vars, [((raw_name, atts), [prop])]) = |
125 |
fst (prep (the_list raw_var) [(raw_a, [raw_prop])] lthy1); |
|
126 |
val (((x, T), rhs), prove) = LocalDefs.derived_def lthy1 true prop; |
|
127 |
val name = Thm.def_name_optional x raw_name; |
|
18786 | 128 |
val mx = (case vars of [] => NoSyn | [((x', _), mx)] => |
129 |
if x = x' then mx |
|
130 |
else error ("Head of definition " ^ quote x ^ " differs from declaration " ^ quote x')); |
|
20890 | 131 |
val ((lhs, (_, th)), lthy2) = lthy1 |
132 |
(* |> LocalTheory.def ((x, mx), ((name ^ "_raw", []), rhs)); FIXME *) |
|
133 |
|> LocalTheory.def ((x, mx), ((name, []), rhs)); |
|
134 |
val ((b, [th']), lthy3) = lthy2 |
|
20914 | 135 |
|> LocalTheory.note ((name, atts), [prove lthy2 th]); |
21275 | 136 |
in (((x, T), (lhs, (b, th'))), LocalTheory.restore lthy3) end; |
18786 | 137 |
|
20890 | 138 |
val ((cs, defs), lthy') = lthy |> fold_map define args |>> split_list; |
18880
b8a1c3cdf739
axiomatization: retrict parameters to occurrences in specs;
wenzelm
parents:
18828
diff
changeset
|
139 |
val def_frees = member (op =) (fold (Term.add_frees o fst) defs []); |
20890 | 140 |
val _ = print_consts lthy' def_frees cs; |
141 |
in (defs, lthy') end; |
|
18786 | 142 |
|
18954 | 143 |
val definition = gen_defs read_specification; |
144 |
val definition_i = gen_defs cert_specification; |
|
18786 | 145 |
|
19080 | 146 |
|
147 |
(* abbreviation *) |
|
148 |
||
20890 | 149 |
fun gen_abbrevs prep mode args lthy = |
19080 | 150 |
let |
20890 | 151 |
fun abbrev (raw_var, raw_prop) lthy1 = |
19080 | 152 |
let |
19372
3ff5f1777743
abbreviation(_i): do not expand abbreviations, do not use derived_def;
wenzelm
parents:
19080
diff
changeset
|
153 |
val ((vars, [(_, [prop])]), _) = |
3ff5f1777743
abbreviation(_i): do not expand abbreviations, do not use derived_def;
wenzelm
parents:
19080
diff
changeset
|
154 |
prep (the_list raw_var) [(("", []), [raw_prop])] |
20890 | 155 |
(lthy1 |> ProofContext.expand_abbrevs false); |
156 |
val ((x, T), rhs) = LocalDefs.abs_def (#2 (LocalDefs.cert_def lthy1 prop)); |
|
21275 | 157 |
val mx = (case vars of [] => NoSyn | [((y, _), mx)] => |
158 |
if x = y then mx |
|
159 |
else error ("Head of abbreviation " ^ quote x ^ " differs from declaration " ^ quote y)); |
|
160 |
val ([abbr], lthy2) = lthy1 |
|
161 |
|> LocalTheory.abbrevs mode [((x, mx), rhs)]; |
|
162 |
in (((x, T), abbr), LocalTheory.restore lthy2) end; |
|
19080 | 163 |
|
21275 | 164 |
val (abbrs, lthy1) = lthy |
19544 | 165 |
|> ProofContext.set_syntax_mode mode |
166 |
|> fold_map abbrev args |
|
20890 | 167 |
||> ProofContext.restore_syntax_mode lthy; |
21275 | 168 |
val _ = print_consts lthy1 (K false) (map fst abbrs); |
169 |
in (map snd abbrs, lthy1) end; |
|
19080 | 170 |
|
171 |
val abbreviation = gen_abbrevs read_specification; |
|
172 |
val abbreviation_i = gen_abbrevs cert_specification; |
|
173 |
||
19664 | 174 |
|
21230
abfdce60b371
theorem statements: incorporate Obtain.statement, tuned;
wenzelm
parents:
21206
diff
changeset
|
175 |
(* notation *) |
19664 | 176 |
|
21206
2af4c7b3f7ef
replaced const_syntax by notation, which operates on terms;
wenzelm
parents:
21036
diff
changeset
|
177 |
fun gen_notation prep_const mode args lthy = |
2af4c7b3f7ef
replaced const_syntax by notation, which operates on terms;
wenzelm
parents:
21036
diff
changeset
|
178 |
lthy |> LocalTheory.notation mode (map (apfst (prep_const lthy)) args); |
19664 | 179 |
|
21206
2af4c7b3f7ef
replaced const_syntax by notation, which operates on terms;
wenzelm
parents:
21036
diff
changeset
|
180 |
val notation = gen_notation ProofContext.read_const; |
2af4c7b3f7ef
replaced const_syntax by notation, which operates on terms;
wenzelm
parents:
21036
diff
changeset
|
181 |
val notation_i = gen_notation (K I); |
19664 | 182 |
|
20914 | 183 |
|
21036 | 184 |
(* fact statements *) |
20914 | 185 |
|
186 |
fun gen_theorems prep_thms prep_att kind raw_facts lthy = |
|
187 |
let |
|
188 |
val k = if kind = "" then [] else [Attrib.kind kind]; |
|
189 |
val attrib = prep_att (ProofContext.theory_of lthy); |
|
190 |
val facts = raw_facts |> map (fn ((name, atts), bs) => |
|
191 |
((name, map attrib atts), |
|
192 |
bs |> map (fn (b, more_atts) => (prep_thms lthy b, map attrib more_atts @ k)))); |
|
193 |
val (res, lthy') = lthy |> LocalTheory.notes facts; |
|
21036 | 194 |
val _ = present_results' lthy' kind res; |
20914 | 195 |
in (res, lthy') end; |
196 |
||
197 |
val theorems = gen_theorems ProofContext.get_thms Attrib.intern_src; |
|
198 |
val theorems_i = gen_theorems (K I) (K I); |
|
199 |
||
21036 | 200 |
|
21230
abfdce60b371
theorem statements: incorporate Obtain.statement, tuned;
wenzelm
parents:
21206
diff
changeset
|
201 |
(* complex goal statements *) |
21036 | 202 |
|
203 |
local |
|
204 |
||
21236 | 205 |
fun prep_statement prep_att prep_stmt elems concl ctxt = |
206 |
(case concl of |
|
207 |
Element.Shows shows => |
|
21230
abfdce60b371
theorem statements: incorporate Obtain.statement, tuned;
wenzelm
parents:
21206
diff
changeset
|
208 |
let |
21236 | 209 |
val (_, _, elems_ctxt, propp) = prep_stmt elems (map snd shows) ctxt; |
21370
d9dd7b4e5e69
replaced Variable.fix_frees by Variable.auto_fixes (depends on body mode);
wenzelm
parents:
21359
diff
changeset
|
210 |
val goal_ctxt = fold (fold (Variable.auto_fixes o fst)) propp elems_ctxt; |
21236 | 211 |
val stmt = Attrib.map_specs prep_att (map fst shows ~~ propp); |
212 |
in ((stmt, []), goal_ctxt) end |
|
213 |
| Element.Obtains obtains => |
|
21230
abfdce60b371
theorem statements: incorporate Obtain.statement, tuned;
wenzelm
parents:
21206
diff
changeset
|
214 |
let |
21236 | 215 |
val case_names = obtains |> map_index |
216 |
(fn (i, ("", _)) => string_of_int (i + 1) | (_, (name, _)) => name); |
|
217 |
val constraints = obtains |> map (fn (_, (vars, _)) => |
|
218 |
Locale.Elem (Element.Constrains |
|
219 |
(vars |> map_filter (fn (x, SOME T) => SOME (x, T) | _ => NONE)))); |
|
21036 | 220 |
|
21236 | 221 |
val raw_propp = obtains |> map (fn (_, (_, props)) => map (rpair []) props); |
222 |
val (_, _, elems_ctxt, propp) = prep_stmt (elems @ constraints) raw_propp ctxt; |
|
223 |
||
224 |
val thesis = ObjectLogic.fixed_judgment (ProofContext.theory_of ctxt) AutoBind.thesisN; |
|
21036 | 225 |
|
21236 | 226 |
fun assume_case ((name, (vars, _)), asms) ctxt' = |
227 |
let |
|
228 |
val xs = map fst vars; |
|
229 |
val props = map fst asms; |
|
230 |
val (parms, _) = ctxt' |
|
231 |
|> fold Variable.declare_term props |
|
232 |
|> fold_map ProofContext.inferred_param xs; |
|
233 |
val asm = Term.list_all_free (parms, Logic.list_implies (props, thesis)); |
|
234 |
in |
|
235 |
ctxt' |> (snd o ProofContext.add_fixes_i (map (fn x => (x, NONE, NoSyn)) xs)); |
|
21370
d9dd7b4e5e69
replaced Variable.fix_frees by Variable.auto_fixes (depends on body mode);
wenzelm
parents:
21359
diff
changeset
|
236 |
ctxt' |> Variable.auto_fixes asm |
21236 | 237 |
|> ProofContext.add_assms_i Assumption.assume_export |
238 |
[((name, [ContextRules.intro_query NONE]), [(asm, [])])] |
|
239 |
|>> (fn [(_, [th])] => th) |
|
240 |
end; |
|
241 |
||
242 |
val atts = map Attrib.internal |
|
243 |
[RuleCases.consumes (~ (length obtains)), RuleCases.case_names case_names]; |
|
244 |
val stmt = [(("", atts), [(thesis, [])])]; |
|
245 |
||
246 |
val (facts, goal_ctxt) = elems_ctxt |
|
247 |
|> (snd o ProofContext.add_fixes_i [(AutoBind.thesisN, NONE, NoSyn)]) |
|
248 |
|> fold_map assume_case (obtains ~~ propp) |
|
249 |
|-> (fn ths => |
|
250 |
ProofContext.note_thmss_i [((Obtain.thatN, []), [(ths, [])])] #> #2 #> pair ths); |
|
251 |
in ((stmt, facts), goal_ctxt) end); |
|
21036 | 252 |
|
253 |
fun gen_theorem prep_att prep_stmt |
|
254 |
kind before_qed after_qed (name, raw_atts) raw_elems raw_concl lthy0 = |
|
255 |
let |
|
256 |
val _ = LocalTheory.assert lthy0; |
|
257 |
val thy = ProofContext.theory_of lthy0; |
|
21236 | 258 |
val attrib = prep_att thy; |
21206
2af4c7b3f7ef
replaced const_syntax by notation, which operates on terms;
wenzelm
parents:
21036
diff
changeset
|
259 |
|
21036 | 260 |
val (loc, ctxt, lthy) = |
261 |
(case (TheoryTarget.peek lthy0, exists (fn Locale.Expr _ => true | _ => false) raw_elems) of |
|
262 |
(SOME loc, true) => (* workaround non-modularity of in/includes *) (* FIXME *) |
|
21275 | 263 |
(SOME loc, ProofContext.init thy, LocalTheory.restore lthy0) |
21036 | 264 |
| _ => (NONE, lthy0, lthy0)); |
265 |
||
21236 | 266 |
val elems = raw_elems |> (map o Locale.map_elem) |
21036 | 267 |
(Element.map_ctxt {name = I, var = I, typ = I, term = I, fact = I, attrib = attrib}); |
21236 | 268 |
val ((stmt, facts), goal_ctxt) = prep_statement attrib (prep_stmt loc) elems raw_concl ctxt; |
21036 | 269 |
|
270 |
val k = if kind = "" then [] else [Attrib.kind kind]; |
|
21230
abfdce60b371
theorem statements: incorporate Obtain.statement, tuned;
wenzelm
parents:
21206
diff
changeset
|
271 |
val names = map (fst o fst) stmt; |
21236 | 272 |
val attss = map (fn ((_, atts), _) => atts @ k) stmt; |
21036 | 273 |
val atts = map attrib raw_atts @ k; |
274 |
||
275 |
fun after_qed' results goal_ctxt' = |
|
276 |
let val results' = burrow (ProofContext.export_standard goal_ctxt' lthy) results in |
|
277 |
lthy |
|
278 |
|> LocalTheory.notes ((names ~~ attss) ~~ map (fn ths => [(ths, [])]) results') |
|
279 |
|> (fn (res, lthy') => |
|
280 |
(present_results lthy' ((kind, name), res); |
|
281 |
if name = "" andalso null raw_atts then lthy' |
|
282 |
else #2 (LocalTheory.notes [((name, atts), [(maps #2 res, [])])] lthy'))) |
|
283 |
|> after_qed results' |
|
284 |
end; |
|
285 |
in |
|
286 |
goal_ctxt |
|
21359 | 287 |
|> Proof.theorem_i kind before_qed after_qed' (map snd stmt) |
21036 | 288 |
|> Proof.refine_insert facts |
289 |
end; |
|
290 |
||
21230
abfdce60b371
theorem statements: incorporate Obtain.statement, tuned;
wenzelm
parents:
21206
diff
changeset
|
291 |
in |
abfdce60b371
theorem statements: incorporate Obtain.statement, tuned;
wenzelm
parents:
21206
diff
changeset
|
292 |
|
21036 | 293 |
val theorem = gen_theorem Attrib.intern_src Locale.read_context_statement_i; |
294 |
val theorem_i = gen_theorem (K I) Locale.cert_context_statement; |
|
295 |
||
18620
fc8b5f275359
Theory specifications --- with type-inference, but no internal polymorphism.
wenzelm
parents:
diff
changeset
|
296 |
end; |
21036 | 297 |
|
298 |
end; |