author | wenzelm |
Fri, 17 Dec 2010 17:08:56 +0100 | |
changeset 41228 | e1fce873b814 |
parent 39557 | fe5722fce758 |
child 41425 | 9acb7c501530 |
permissions | -rw-r--r-- |
18140
691c64d615a5
Explicit data structures for some Isar language elements.
wenzelm
parents:
diff
changeset
|
1 |
(* Title: Pure/Isar/element.ML |
691c64d615a5
Explicit data structures for some Isar language elements.
wenzelm
parents:
diff
changeset
|
2 |
Author: Makarius |
691c64d615a5
Explicit data structures for some Isar language elements.
wenzelm
parents:
diff
changeset
|
3 |
|
19777 | 4 |
Explicit data structures for some Isar language elements, with derived |
5 |
logical operations. |
|
18140
691c64d615a5
Explicit data structures for some Isar language elements.
wenzelm
parents:
diff
changeset
|
6 |
*) |
691c64d615a5
Explicit data structures for some Isar language elements.
wenzelm
parents:
diff
changeset
|
7 |
|
691c64d615a5
Explicit data structures for some Isar language elements.
wenzelm
parents:
diff
changeset
|
8 |
signature ELEMENT = |
691c64d615a5
Explicit data structures for some Isar language elements.
wenzelm
parents:
diff
changeset
|
9 |
sig |
19259 | 10 |
datatype ('typ, 'term) stmt = |
28084
a05ca48ef263
type Attrib.binding abbreviates Name.binding without attributes;
wenzelm
parents:
28079
diff
changeset
|
11 |
Shows of (Attrib.binding * ('term * 'term list) list) list | |
29578 | 12 |
Obtains of (binding * ((binding * 'typ option) list * 'term list)) list |
26336
a0e2b706ce73
renamed datatype thmref to Facts.ref, tuned interfaces;
wenzelm
parents:
25739
diff
changeset
|
13 |
type statement = (string, string) stmt |
a0e2b706ce73
renamed datatype thmref to Facts.ref, tuned interfaces;
wenzelm
parents:
25739
diff
changeset
|
14 |
type statement_i = (typ, term) stmt |
18140
691c64d615a5
Explicit data structures for some Isar language elements.
wenzelm
parents:
diff
changeset
|
15 |
datatype ('typ, 'term, 'fact) ctxt = |
29578 | 16 |
Fixes of (binding * 'typ option * mixfix) list | |
18140
691c64d615a5
Explicit data structures for some Isar language elements.
wenzelm
parents:
diff
changeset
|
17 |
Constrains of (string * 'typ) list | |
28084
a05ca48ef263
type Attrib.binding abbreviates Name.binding without attributes;
wenzelm
parents:
28079
diff
changeset
|
18 |
Assumes of (Attrib.binding * ('term * 'term list) list) list | |
a05ca48ef263
type Attrib.binding abbreviates Name.binding without attributes;
wenzelm
parents:
28079
diff
changeset
|
19 |
Defines of (Attrib.binding * ('term * 'term list)) list | |
a05ca48ef263
type Attrib.binding abbreviates Name.binding without attributes;
wenzelm
parents:
28079
diff
changeset
|
20 |
Notes of string * (Attrib.binding * ('fact * Attrib.src list) list) list |
26336
a0e2b706ce73
renamed datatype thmref to Facts.ref, tuned interfaces;
wenzelm
parents:
25739
diff
changeset
|
21 |
type context = (string, string, Facts.ref) ctxt |
a0e2b706ce73
renamed datatype thmref to Facts.ref, tuned interfaces;
wenzelm
parents:
25739
diff
changeset
|
22 |
type context_i = (typ, term, thm list) ctxt |
21581 | 23 |
val facts_map: (('typ, 'term, 'fact) ctxt -> ('a, 'b, 'c) ctxt) -> |
28084
a05ca48ef263
type Attrib.binding abbreviates Name.binding without attributes;
wenzelm
parents:
28079
diff
changeset
|
24 |
(Attrib.binding * ('fact * Attrib.src list) list) list -> |
a05ca48ef263
type Attrib.binding abbreviates Name.binding without attributes;
wenzelm
parents:
28079
diff
changeset
|
25 |
(Attrib.binding * ('c * Attrib.src list) list) list |
29603 | 26 |
val map_ctxt: {binding: binding -> binding, typ: 'typ -> 'a, term: 'term -> 'b, |
27 |
pattern: 'term -> 'b, fact: 'fact -> 'c, attrib: Attrib.src -> Attrib.src} -> |
|
28 |
('typ, 'term, 'fact) ctxt -> ('a, 'b, 'c) ctxt |
|
21528 | 29 |
val map_ctxt_attrib: (Attrib.src -> Attrib.src) -> |
30 |
('typ, 'term, 'fact) ctxt -> ('typ, 'term, 'fact) ctxt |
|
21481 | 31 |
val morph_ctxt: morphism -> context_i -> context_i |
19777 | 32 |
val pretty_stmt: Proof.context -> statement_i -> Pretty.T list |
33 |
val pretty_ctxt: Proof.context -> context_i -> Pretty.T list |
|
34 |
val pretty_statement: Proof.context -> string -> thm -> Pretty.T |
|
35 |
type witness |
|
29578 | 36 |
val prove_witness: Proof.context -> term -> tactic -> witness |
37 |
val witness_proof: (witness list list -> Proof.context -> Proof.context) -> |
|
38 |
term list list -> Proof.context -> Proof.state |
|
39 |
val witness_proof_eqs: (witness list list -> thm list -> Proof.context -> Proof.context) -> |
|
40 |
term list list -> term list -> Proof.context -> Proof.state |
|
41 |
val witness_local_proof: (witness list list -> Proof.state -> Proof.state) -> |
|
42 |
string -> term list list -> Proof.context -> bool -> Proof.state -> Proof.state |
|
38108 | 43 |
val witness_local_proof_eqs: (witness list list -> thm list -> Proof.state -> Proof.state) -> |
44 |
string -> term list list -> term list -> Proof.context -> bool -> Proof.state -> |
|
45 |
Proof.state |
|
21481 | 46 |
val morph_witness: morphism -> witness -> witness |
19777 | 47 |
val conclude_witness: witness -> thm |
22658
263d42253f53
Experimental interpretation code for definitions.
ballarin
parents:
22568
diff
changeset
|
48 |
val pretty_witness: Proof.context -> witness -> Pretty.T |
18140
691c64d615a5
Explicit data structures for some Isar language elements.
wenzelm
parents:
diff
changeset
|
49 |
val instT_type: typ Symtab.table -> typ -> typ |
691c64d615a5
Explicit data structures for some Isar language elements.
wenzelm
parents:
diff
changeset
|
50 |
val instT_term: typ Symtab.table -> term -> term |
691c64d615a5
Explicit data structures for some Isar language elements.
wenzelm
parents:
diff
changeset
|
51 |
val instT_thm: theory -> typ Symtab.table -> thm -> thm |
21481 | 52 |
val instT_morphism: theory -> typ Symtab.table -> morphism |
18140
691c64d615a5
Explicit data structures for some Isar language elements.
wenzelm
parents:
diff
changeset
|
53 |
val inst_term: typ Symtab.table * term Symtab.table -> term -> term |
691c64d615a5
Explicit data structures for some Isar language elements.
wenzelm
parents:
diff
changeset
|
54 |
val inst_thm: theory -> typ Symtab.table * term Symtab.table -> thm -> thm |
21481 | 55 |
val inst_morphism: theory -> typ Symtab.table * term Symtab.table -> morphism |
19777 | 56 |
val satisfy_thm: witness list -> thm -> thm |
21481 | 57 |
val satisfy_morphism: witness list -> morphism |
20264 | 58 |
val satisfy_facts: witness list -> |
28084
a05ca48ef263
type Attrib.binding abbreviates Name.binding without attributes;
wenzelm
parents:
28079
diff
changeset
|
59 |
(Attrib.binding * (thm list * Attrib.src list) list) list -> |
a05ca48ef263
type Attrib.binding abbreviates Name.binding without attributes;
wenzelm
parents:
28079
diff
changeset
|
60 |
(Attrib.binding * (thm list * Attrib.src list) list) list |
36674
d95f39448121
eq_morphism is always optional: avoid trivial morphism for empty list of equations
haftmann
parents:
36323
diff
changeset
|
61 |
val eq_morphism: theory -> thm list -> morphism option |
29218 | 62 |
val transfer_morphism: theory -> morphism |
38108 | 63 |
val generic_note_thmss: string -> (Attrib.binding * (thm list * Attrib.src list) list) list -> |
64 |
Context.generic -> (string * thm list) list * Context.generic |
|
30775
71f777103225
added Element.init, which unifies former activate_elem in element.ML and init_elem in locale.ML;
wenzelm
parents:
30763
diff
changeset
|
65 |
val init: context_i -> Context.generic -> Context.generic |
30777
9960ff945c52
simplified Element.activate(_i): singleton version;
wenzelm
parents:
30775
diff
changeset
|
66 |
val activate_i: context_i -> Proof.context -> context_i * Proof.context |
9960ff945c52
simplified Element.activate(_i): singleton version;
wenzelm
parents:
30775
diff
changeset
|
67 |
val activate: (typ, term, Facts.ref) ctxt -> Proof.context -> context_i * Proof.context |
18140
691c64d615a5
Explicit data structures for some Isar language elements.
wenzelm
parents:
diff
changeset
|
68 |
end; |
691c64d615a5
Explicit data structures for some Isar language elements.
wenzelm
parents:
diff
changeset
|
69 |
|
691c64d615a5
Explicit data structures for some Isar language elements.
wenzelm
parents:
diff
changeset
|
70 |
structure Element: ELEMENT = |
691c64d615a5
Explicit data structures for some Isar language elements.
wenzelm
parents:
diff
changeset
|
71 |
struct |
691c64d615a5
Explicit data structures for some Isar language elements.
wenzelm
parents:
diff
changeset
|
72 |
|
19777 | 73 |
(** language elements **) |
74 |
||
75 |
(* statement *) |
|
19259 | 76 |
|
77 |
datatype ('typ, 'term) stmt = |
|
28084
a05ca48ef263
type Attrib.binding abbreviates Name.binding without attributes;
wenzelm
parents:
28079
diff
changeset
|
78 |
Shows of (Attrib.binding * ('term * 'term list) list) list | |
29578 | 79 |
Obtains of (binding * ((binding * 'typ option) list * 'term list)) list; |
19259 | 80 |
|
81 |
type statement = (string, string) stmt; |
|
82 |
type statement_i = (typ, term) stmt; |
|
83 |
||
84 |
||
19777 | 85 |
(* context *) |
18140
691c64d615a5
Explicit data structures for some Isar language elements.
wenzelm
parents:
diff
changeset
|
86 |
|
691c64d615a5
Explicit data structures for some Isar language elements.
wenzelm
parents:
diff
changeset
|
87 |
datatype ('typ, 'term, 'fact) ctxt = |
29578 | 88 |
Fixes of (binding * 'typ option * mixfix) list | |
18140
691c64d615a5
Explicit data structures for some Isar language elements.
wenzelm
parents:
diff
changeset
|
89 |
Constrains of (string * 'typ) list | |
28084
a05ca48ef263
type Attrib.binding abbreviates Name.binding without attributes;
wenzelm
parents:
28079
diff
changeset
|
90 |
Assumes of (Attrib.binding * ('term * 'term list) list) list | |
a05ca48ef263
type Attrib.binding abbreviates Name.binding without attributes;
wenzelm
parents:
28079
diff
changeset
|
91 |
Defines of (Attrib.binding * ('term * 'term list)) list | |
a05ca48ef263
type Attrib.binding abbreviates Name.binding without attributes;
wenzelm
parents:
28079
diff
changeset
|
92 |
Notes of string * (Attrib.binding * ('fact * Attrib.src list) list) list; |
18140
691c64d615a5
Explicit data structures for some Isar language elements.
wenzelm
parents:
diff
changeset
|
93 |
|
26336
a0e2b706ce73
renamed datatype thmref to Facts.ref, tuned interfaces;
wenzelm
parents:
25739
diff
changeset
|
94 |
type context = (string, string, Facts.ref) ctxt; |
18140
691c64d615a5
Explicit data structures for some Isar language elements.
wenzelm
parents:
diff
changeset
|
95 |
type context_i = (typ, term, thm list) ctxt; |
691c64d615a5
Explicit data structures for some Isar language elements.
wenzelm
parents:
diff
changeset
|
96 |
|
21581 | 97 |
fun facts_map f facts = Notes ("", facts) |> f |> (fn Notes (_, facts') => facts'); |
98 |
||
29603 | 99 |
fun map_ctxt {binding, typ, term, pattern, fact, attrib} = |
100 |
fn Fixes fixes => Fixes (fixes |> map (fn (x, T, mx) => (binding x, Option.map typ T, mx))) |
|
28079
955c42c8a5e4
explicit type Name.binding for higher-specification elements;
wenzelm
parents:
27865
diff
changeset
|
101 |
| Constrains xs => Constrains (xs |> map (fn (x, T) => |
30585
6b2ba4666336
use Name.of_binding for basic logical entities without name space (fixes, case names etc.);
wenzelm
parents:
30510
diff
changeset
|
102 |
(Name.of_binding (binding (Binding.name x)), typ T))) |
18140
691c64d615a5
Explicit data structures for some Isar language elements.
wenzelm
parents:
diff
changeset
|
103 |
| Assumes asms => Assumes (asms |> map (fn ((a, atts), propps) => |
29603 | 104 |
((binding a, map attrib atts), propps |> map (fn (t, ps) => (term t, map pattern ps))))) |
18140
691c64d615a5
Explicit data structures for some Isar language elements.
wenzelm
parents:
diff
changeset
|
105 |
| Defines defs => Defines (defs |> map (fn ((a, atts), (t, ps)) => |
29603 | 106 |
((binding a, map attrib atts), (term t, map pattern ps)))) |
21440 | 107 |
| Notes (kind, facts) => Notes (kind, facts |> map (fn ((a, atts), bs) => |
28965 | 108 |
((binding a, map attrib atts), bs |> map (fn (ths, btts) => (fact ths, map attrib btts))))); |
18140
691c64d615a5
Explicit data structures for some Isar language elements.
wenzelm
parents:
diff
changeset
|
109 |
|
21528 | 110 |
fun map_ctxt_attrib attrib = |
29603 | 111 |
map_ctxt {binding = I, typ = I, term = I, pattern = I, fact = I, attrib = attrib}; |
21528 | 112 |
|
21481 | 113 |
fun morph_ctxt phi = map_ctxt |
28965 | 114 |
{binding = Morphism.binding phi, |
21481 | 115 |
typ = Morphism.typ phi, |
116 |
term = Morphism.term phi, |
|
29603 | 117 |
pattern = Morphism.term phi, |
21521 | 118 |
fact = Morphism.fact phi, |
21481 | 119 |
attrib = Args.morph_values phi}; |
18140
691c64d615a5
Explicit data structures for some Isar language elements.
wenzelm
parents:
diff
changeset
|
120 |
|
19808 | 121 |
|
18894 | 122 |
|
19259 | 123 |
(** pretty printing **) |
124 |
||
19267 | 125 |
fun pretty_items _ _ [] = [] |
126 |
| pretty_items keyword sep (x :: ys) = |
|
127 |
Pretty.block [Pretty.keyword keyword, Pretty.brk 1, x] :: |
|
128 |
map (fn y => Pretty.block [Pretty.str " ", Pretty.keyword sep, Pretty.brk 1, y]) ys; |
|
19259 | 129 |
|
28862 | 130 |
fun pretty_name_atts ctxt (b, atts) sep = |
30219 | 131 |
if Binding.is_empty b andalso null atts then [] |
132 |
else [Pretty.block (Pretty.breaks |
|
133 |
(Pretty.str (Binding.str_of b) :: Attrib.pretty_attribs ctxt atts @ [Pretty.str sep]))]; |
|
19259 | 134 |
|
135 |
||
136 |
(* pretty_stmt *) |
|
137 |
||
138 |
fun pretty_stmt ctxt = |
|
139 |
let |
|
24920 | 140 |
val prt_typ = Pretty.quote o Syntax.pretty_typ ctxt; |
141 |
val prt_term = Pretty.quote o Syntax.pretty_term ctxt; |
|
19267 | 142 |
val prt_terms = separate (Pretty.keyword "and") o map prt_term; |
19259 | 143 |
val prt_name_atts = pretty_name_atts ctxt; |
144 |
||
145 |
fun prt_show (a, ts) = |
|
19267 | 146 |
Pretty.block (Pretty.breaks (prt_name_atts a ":" @ prt_terms (map fst ts))); |
19259 | 147 |
|
28079
955c42c8a5e4
explicit type Name.binding for higher-specification elements;
wenzelm
parents:
27865
diff
changeset
|
148 |
fun prt_var (x, SOME T) = Pretty.block |
30223
24d975352879
renamed Binding.name_pos to Binding.make, renamed Binding.base_name to Binding.name_of, renamed Binding.map_base to Binding.map_name, added mandatory flag to Binding.qualify;
wenzelm
parents:
30219
diff
changeset
|
149 |
[Pretty.str (Binding.name_of x ^ " ::"), Pretty.brk 1, prt_typ T] |
24d975352879
renamed Binding.name_pos to Binding.make, renamed Binding.base_name to Binding.name_of, renamed Binding.map_base to Binding.map_name, added mandatory flag to Binding.qualify;
wenzelm
parents:
30219
diff
changeset
|
150 |
| prt_var (x, NONE) = Pretty.str (Binding.name_of x); |
26721 | 151 |
val prt_vars = separate (Pretty.keyword "and") o map prt_var; |
19259 | 152 |
|
19267 | 153 |
fun prt_obtain (_, ([], ts)) = Pretty.block (Pretty.breaks (prt_terms ts)) |
19259 | 154 |
| prt_obtain (_, (xs, ts)) = Pretty.block (Pretty.breaks |
19585 | 155 |
(prt_vars xs @ [Pretty.keyword "where"] @ prt_terms ts)); |
19259 | 156 |
in |
19267 | 157 |
fn Shows shows => pretty_items "shows" "and" (map prt_show shows) |
158 |
| Obtains obtains => pretty_items "obtains" "|" (map prt_obtain obtains) |
|
19259 | 159 |
end; |
160 |
||
18894 | 161 |
|
19259 | 162 |
(* pretty_ctxt *) |
163 |
||
164 |
fun pretty_ctxt ctxt = |
|
165 |
let |
|
24920 | 166 |
val prt_typ = Pretty.quote o Syntax.pretty_typ ctxt; |
167 |
val prt_term = Pretty.quote o Syntax.pretty_term ctxt; |
|
32091
30e2ffbba718
proper context for Display.pretty_thm etc. or old-style versions Display.pretty_thm_global, Display.pretty_thm_without_context etc.;
wenzelm
parents:
31794
diff
changeset
|
168 |
val prt_thm = Pretty.backquote o Display.pretty_thm ctxt; |
19259 | 169 |
val prt_name_atts = pretty_name_atts ctxt; |
170 |
||
19267 | 171 |
fun prt_mixfix NoSyn = [] |
172 |
| prt_mixfix mx = [Pretty.brk 2, Syntax.pretty_mixfix mx]; |
|
173 |
||
30223
24d975352879
renamed Binding.name_pos to Binding.make, renamed Binding.base_name to Binding.name_of, renamed Binding.map_base to Binding.map_name, added mandatory flag to Binding.qualify;
wenzelm
parents:
30219
diff
changeset
|
174 |
fun prt_fix (x, SOME T, mx) = Pretty.block (Pretty.str (Binding.name_of x ^ " ::") :: |
28079
955c42c8a5e4
explicit type Name.binding for higher-specification elements;
wenzelm
parents:
27865
diff
changeset
|
175 |
Pretty.brk 1 :: prt_typ T :: Pretty.brk 1 :: prt_mixfix mx) |
30223
24d975352879
renamed Binding.name_pos to Binding.make, renamed Binding.base_name to Binding.name_of, renamed Binding.map_base to Binding.map_name, added mandatory flag to Binding.qualify;
wenzelm
parents:
30219
diff
changeset
|
176 |
| prt_fix (x, NONE, mx) = Pretty.block (Pretty.str (Binding.name_of x) :: |
28079
955c42c8a5e4
explicit type Name.binding for higher-specification elements;
wenzelm
parents:
27865
diff
changeset
|
177 |
Pretty.brk 1 :: prt_mixfix mx); |
28965 | 178 |
fun prt_constrain (x, T) = prt_fix (Binding.name x, SOME T, NoSyn); |
18894 | 179 |
|
19259 | 180 |
fun prt_asm (a, ts) = |
181 |
Pretty.block (Pretty.breaks (prt_name_atts a ":" @ map (prt_term o fst) ts)); |
|
182 |
fun prt_def (a, (t, _)) = |
|
183 |
Pretty.block (Pretty.breaks (prt_name_atts a ":" @ [prt_term t])); |
|
184 |
||
185 |
fun prt_fact (ths, []) = map prt_thm ths |
|
186 |
| prt_fact (ths, atts) = Pretty.enclose "(" ")" |
|
21032 | 187 |
(Pretty.breaks (map prt_thm ths)) :: Attrib.pretty_attribs ctxt atts; |
19259 | 188 |
fun prt_note (a, ths) = |
19482
9f11af8f7ef9
tuned basic list operators (flat, maps, map_filter);
wenzelm
parents:
19466
diff
changeset
|
189 |
Pretty.block (Pretty.breaks (flat (prt_name_atts a "=" :: map prt_fact ths))); |
19259 | 190 |
in |
19267 | 191 |
fn Fixes fixes => pretty_items "fixes" "and" (map prt_fix fixes) |
192 |
| Constrains xs => pretty_items "constrains" "and" (map prt_constrain xs) |
|
193 |
| Assumes asms => pretty_items "assumes" "and" (map prt_asm asms) |
|
194 |
| Defines defs => pretty_items "defines" "and" (map prt_def defs) |
|
21440 | 195 |
| Notes ("", facts) => pretty_items "notes" "and" (map prt_note facts) |
196 |
| Notes (kind, facts) => pretty_items ("notes " ^ kind) "and" (map prt_note facts) |
|
19259 | 197 |
end; |
18894 | 198 |
|
19267 | 199 |
|
200 |
(* pretty_statement *) |
|
201 |
||
202 |
local |
|
203 |
||
204 |
fun thm_name kind th prts = |
|
205 |
let val head = |
|
27865
27a8ad9612a3
moved basic thm operations from structure PureThy to Thm (cf. more_thm.ML);
wenzelm
parents:
26721
diff
changeset
|
206 |
if Thm.has_name_hint th then |
21965
7120ef5bc378
pretty_statement: more careful handling of name_hint;
wenzelm
parents:
21646
diff
changeset
|
207 |
Pretty.block [Pretty.command kind, |
30364
577edc39b501
moved basic algebra of long names from structure NameSpace to Long_Name;
wenzelm
parents:
30280
diff
changeset
|
208 |
Pretty.brk 1, Pretty.str (Long_Name.base_name (Thm.get_name_hint th) ^ ":")] |
21965
7120ef5bc378
pretty_statement: more careful handling of name_hint;
wenzelm
parents:
21646
diff
changeset
|
209 |
else Pretty.command kind |
19267 | 210 |
in Pretty.block (Pretty.fbreaks (head :: prts)) end; |
211 |
||
28965 | 212 |
fun fix (x, T) = (Binding.name x, SOME T); |
28079
955c42c8a5e4
explicit type Name.binding for higher-specification elements;
wenzelm
parents:
27865
diff
changeset
|
213 |
|
19267 | 214 |
fun obtain prop ctxt = |
215 |
let |
|
20150 | 216 |
val ((xs, prop'), ctxt') = Variable.focus prop ctxt; |
217 |
val As = Logic.strip_imp_prems (Thm.term_of prop'); |
|
32199 | 218 |
in ((Binding.empty, (map (fix o Term.dest_Free o Thm.term_of o #2) xs, As)), ctxt') end; |
19267 | 219 |
|
220 |
in |
|
221 |
||
222 |
fun pretty_statement ctxt kind raw_th = |
|
223 |
let |
|
224 |
val thy = ProofContext.theory_of ctxt; |
|
20150 | 225 |
val cert = Thm.cterm_of thy; |
226 |
||
41228
e1fce873b814
renamed structure MetaSimplifier to raw_Simplifer, to emphasize its meaning;
wenzelm
parents:
39557
diff
changeset
|
227 |
val th = Raw_Simplifier.norm_hhf raw_th; |
35625 | 228 |
val is_elim = Object_Logic.is_elim th; |
19267 | 229 |
|
31794
71af1fd6a5e4
renamed Variable.import_thms to Variable.import (back again cf. ed7aa5a350ef -- Alice is no longer supported);
wenzelm
parents:
30777
diff
changeset
|
230 |
val ((_, [th']), ctxt') = Variable.import true [th] (Variable.set_body false ctxt); |
20150 | 231 |
val prop = Thm.prop_of th'; |
232 |
val (prems, concl) = Logic.strip_horn prop; |
|
35625 | 233 |
val concl_term = Object_Logic.drop_judgment thy concl; |
19267 | 234 |
|
20150 | 235 |
val fixes = fold_aterms (fn v as Free (x, T) => |
236 |
if Variable.newly_fixed ctxt' ctxt x andalso not (v aconv concl_term) |
|
26716
8690e75e1395
print_statement: reset body mode, i.e. invent global frees (no need for revert_skolem);
wenzelm
parents:
26628
diff
changeset
|
237 |
then insert (op =) (x, T) else I | _ => I) prop [] |> rev; |
20150 | 238 |
val (assumes, cases) = take_suffix (fn prem => |
239 |
is_elim andalso concl aconv Logic.strip_assums_concl prem) prems; |
|
19267 | 240 |
in |
28965 | 241 |
pretty_ctxt ctxt' (Fixes (map (fn (x, T) => (Binding.name x, SOME T, NoSyn)) fixes)) @ |
242 |
pretty_ctxt ctxt' (Assumes (map (fn t => (Attrib.empty_binding, [(t, [])])) assumes)) @ |
|
243 |
(if null cases then pretty_stmt ctxt' (Shows [(Attrib.empty_binding, [(concl, [])])]) |
|
26716
8690e75e1395
print_statement: reset body mode, i.e. invent global frees (no need for revert_skolem);
wenzelm
parents:
26628
diff
changeset
|
244 |
else |
8690e75e1395
print_statement: reset body mode, i.e. invent global frees (no need for revert_skolem);
wenzelm
parents:
26628
diff
changeset
|
245 |
let val (clauses, ctxt'') = fold_map (obtain o cert) cases ctxt' |
8690e75e1395
print_statement: reset body mode, i.e. invent global frees (no need for revert_skolem);
wenzelm
parents:
26628
diff
changeset
|
246 |
in pretty_stmt ctxt'' (Obtains clauses) end) |
19267 | 247 |
end |> thm_name kind raw_th; |
248 |
||
18140
691c64d615a5
Explicit data structures for some Isar language elements.
wenzelm
parents:
diff
changeset
|
249 |
end; |
19267 | 250 |
|
19777 | 251 |
|
252 |
||
253 |
(** logical operations **) |
|
254 |
||
255 |
(* witnesses -- hypotheses as protected facts *) |
|
256 |
||
257 |
datatype witness = Witness of term * thm; |
|
258 |
||
29578 | 259 |
val mark_witness = Logic.protect; |
260 |
fun witness_prop (Witness (t, _)) = t; |
|
261 |
fun witness_hyps (Witness (_, th)) = #hyps (Thm.rep_thm th); |
|
19777 | 262 |
fun map_witness f (Witness witn) = Witness (f witn); |
263 |
||
21481 | 264 |
fun morph_witness phi = map_witness (fn (t, th) => (Morphism.term phi t, Morphism.thm phi th)); |
265 |
||
20058 | 266 |
fun prove_witness ctxt t tac = |
29578 | 267 |
Witness (t, Thm.close_derivation (Goal.prove ctxt [] [] (mark_witness t) (fn _ => |
25202
3a539d9995fb
proven witness: proper Goal.close_result save huge amounts of resources when using proof terms;
wenzelm
parents:
24920
diff
changeset
|
268 |
Tactic.rtac Drule.protectI 1 THEN tac))); |
19777 | 269 |
|
29603 | 270 |
|
29578 | 271 |
local |
272 |
||
273 |
val refine_witness = |
|
30510
4120fc59dd85
unified type Proof.method and pervasive METHOD combinators;
wenzelm
parents:
30438
diff
changeset
|
274 |
Proof.refine (Method.Basic (K (RAW_METHOD |
29578 | 275 |
(K (ALLGOALS |
276 |
(CONJUNCTS (ALLGOALS |
|
32194 | 277 |
(CONJUNCTS (TRYALL (Tactic.rtac Drule.protectI)))))))))); |
25624 | 278 |
|
29578 | 279 |
fun gen_witness_proof proof after_qed wit_propss eq_props = |
280 |
let |
|
281 |
val propss = (map o map) (fn prop => (mark_witness prop, [])) wit_propss |
|
282 |
@ [map (rpair []) eq_props]; |
|
283 |
fun after_qed' thmss = |
|
29603 | 284 |
let val (wits, eqs) = split_last ((map o map) Thm.close_derivation thmss); |
29578 | 285 |
in after_qed ((map2 o map2) (curry Witness) wit_propss wits) eqs end; |
286 |
in proof after_qed' propss #> refine_witness #> Seq.hd end; |
|
287 |
||
38108 | 288 |
fun proof_local cmd goal_ctxt int after_qed' propss = |
289 |
Proof.map_context (K goal_ctxt) |
|
290 |
#> Proof.local_goal (Proof_Display.print_results int) (K I) ProofContext.bind_propp_i |
|
291 |
cmd NONE after_qed' (map (pair Thm.empty_binding) propss); |
|
29578 | 292 |
in |
293 |
||
294 |
fun witness_proof after_qed wit_propss = |
|
36323
655e2d74de3a
modernized naming conventions of main Isar proof elements;
wenzelm
parents:
35767
diff
changeset
|
295 |
gen_witness_proof (Proof.theorem NONE) (fn wits => fn _ => after_qed wits) |
29578 | 296 |
wit_propss []; |
297 |
||
36323
655e2d74de3a
modernized naming conventions of main Isar proof elements;
wenzelm
parents:
35767
diff
changeset
|
298 |
val witness_proof_eqs = gen_witness_proof (Proof.theorem NONE); |
29578 | 299 |
|
300 |
fun witness_local_proof after_qed cmd wit_propss goal_ctxt int = |
|
38108 | 301 |
gen_witness_proof (proof_local cmd goal_ctxt int) |
29578 | 302 |
(fn wits => fn _ => after_qed wits) wit_propss []; |
303 |
||
38108 | 304 |
fun witness_local_proof_eqs after_qed cmd wit_propss eq_props goal_ctxt int = |
305 |
gen_witness_proof (proof_local cmd goal_ctxt int) after_qed wit_propss eq_props; |
|
29603 | 306 |
end; |
307 |
||
19777 | 308 |
|
25302 | 309 |
fun compose_witness (Witness (_, th)) r = |
310 |
let |
|
311 |
val th' = Goal.conclude th; |
|
312 |
val A = Thm.cprem_of r 1; |
|
25739 | 313 |
in |
314 |
Thm.implies_elim |
|
315 |
(Conv.gconv_rule Drule.beta_eta_conversion 1 r) |
|
316 |
(Conv.fconv_rule Drule.beta_eta_conversion |
|
317 |
(Thm.instantiate (Thm.match (Thm.cprop_of th', A)) th')) |
|
318 |
end; |
|
25302 | 319 |
|
29578 | 320 |
fun conclude_witness (Witness (_, th)) = |
41228
e1fce873b814
renamed structure MetaSimplifier to raw_Simplifer, to emphasize its meaning;
wenzelm
parents:
39557
diff
changeset
|
321 |
Thm.close_derivation (Raw_Simplifier.norm_hhf_protect (Goal.conclude th)); |
19777 | 322 |
|
22658
263d42253f53
Experimental interpretation code for definitions.
ballarin
parents:
22568
diff
changeset
|
323 |
fun pretty_witness ctxt witn = |
24920 | 324 |
let val prt_term = Pretty.quote o Syntax.pretty_term ctxt in |
22658
263d42253f53
Experimental interpretation code for definitions.
ballarin
parents:
22568
diff
changeset
|
325 |
Pretty.block (prt_term (witness_prop witn) :: |
39166
19efc2af3e6c
turned show_hyps and show_tags into proper configuration option;
wenzelm
parents:
38709
diff
changeset
|
326 |
(if Config.get ctxt show_hyps then [Pretty.brk 2, Pretty.list "[" "]" |
22658
263d42253f53
Experimental interpretation code for definitions.
ballarin
parents:
22568
diff
changeset
|
327 |
(map prt_term (witness_hyps witn))] else [])) |
263d42253f53
Experimental interpretation code for definitions.
ballarin
parents:
22568
diff
changeset
|
328 |
end; |
263d42253f53
Experimental interpretation code for definitions.
ballarin
parents:
22568
diff
changeset
|
329 |
|
19777 | 330 |
|
331 |
(* derived rules *) |
|
332 |
||
20007 | 333 |
fun instantiate_tfrees thy subst th = |
19777 | 334 |
let |
335 |
val certT = Thm.ctyp_of thy; |
|
20007 | 336 |
val idx = Thm.maxidx_of th + 1; |
337 |
fun cert_inst (a, (S, T)) = (certT (TVar ((a, idx), S)), certT T); |
|
338 |
||
339 |
fun add_inst (a, S) insts = |
|
340 |
if AList.defined (op =) insts a then insts |
|
341 |
else (case AList.lookup (op =) subst a of NONE => insts | SOME T => (a, (S, T)) :: insts); |
|
342 |
val insts = |
|
343 |
Term.fold_types (Term.fold_atyps (fn TFree v => add_inst v | _ => I)) |
|
344 |
(Thm.full_prop_of th) []; |
|
19777 | 345 |
in |
20007 | 346 |
th |
347 |
|> Thm.generalize (map fst insts, []) idx |
|
348 |
|> Thm.instantiate (map cert_inst insts, []) |
|
19777 | 349 |
end; |
350 |
||
351 |
fun instantiate_frees thy subst = |
|
352 |
let val cert = Thm.cterm_of thy in |
|
353 |
Drule.forall_intr_list (map (cert o Free o fst) subst) #> |
|
354 |
Drule.forall_elim_list (map (cert o snd) subst) |
|
355 |
end; |
|
356 |
||
357 |
fun hyps_rule rule th = |
|
21521 | 358 |
let val {hyps, ...} = Thm.crep_thm th in |
19777 | 359 |
Drule.implies_elim_list |
360 |
(rule (Drule.implies_intr_list hyps th)) |
|
21521 | 361 |
(map (Thm.assume o Drule.cterm_rule rule) hyps) |
19777 | 362 |
end; |
363 |
||
364 |
||
365 |
(* instantiate types *) |
|
366 |
||
367 |
fun instT_type env = |
|
368 |
if Symtab.is_empty env then I |
|
369 |
else Term.map_type_tfree (fn (x, S) => the_default (TFree (x, S)) (Symtab.lookup env x)); |
|
370 |
||
371 |
fun instT_term env = |
|
372 |
if Symtab.is_empty env then I |
|
20548
8ef25fe585a8
renamed Term.map_term_types to Term.map_types (cf. Term.fold_types);
wenzelm
parents:
20304
diff
changeset
|
373 |
else Term.map_types (instT_type env); |
19777 | 374 |
|
22691 | 375 |
fun instT_subst env th = (Thm.fold_terms o Term.fold_types o Term.fold_atyps) |
20304 | 376 |
(fn T as TFree (a, _) => |
377 |
let val T' = the_default T (Symtab.lookup env a) |
|
378 |
in if T = T' then I else insert (op =) (a, T') end |
|
379 |
| _ => I) th []; |
|
19777 | 380 |
|
381 |
fun instT_thm thy env th = |
|
382 |
if Symtab.is_empty env then th |
|
383 |
else |
|
384 |
let val subst = instT_subst env th |
|
385 |
in if null subst then th else th |> hyps_rule (instantiate_tfrees thy subst) end; |
|
386 |
||
22672
777af26d5713
inst(T)_morphism: avoid reference to static theory value;
wenzelm
parents:
22658
diff
changeset
|
387 |
fun instT_morphism thy env = |
24137
8d7896398147
replaced Theory.self_ref by Theory.check_thy, which now produces a checked ref;
wenzelm
parents:
23414
diff
changeset
|
388 |
let val thy_ref = Theory.check_thy thy in |
22672
777af26d5713
inst(T)_morphism: avoid reference to static theory value;
wenzelm
parents:
22658
diff
changeset
|
389 |
Morphism.morphism |
29603 | 390 |
{binding = I, |
22672
777af26d5713
inst(T)_morphism: avoid reference to static theory value;
wenzelm
parents:
22658
diff
changeset
|
391 |
typ = instT_type env, |
777af26d5713
inst(T)_morphism: avoid reference to static theory value;
wenzelm
parents:
22658
diff
changeset
|
392 |
term = instT_term env, |
777af26d5713
inst(T)_morphism: avoid reference to static theory value;
wenzelm
parents:
22658
diff
changeset
|
393 |
fact = map (fn th => instT_thm (Theory.deref thy_ref) env th)} |
777af26d5713
inst(T)_morphism: avoid reference to static theory value;
wenzelm
parents:
22658
diff
changeset
|
394 |
end; |
19777 | 395 |
|
396 |
||
397 |
(* instantiate types and terms *) |
|
398 |
||
399 |
fun inst_term (envT, env) = |
|
400 |
if Symtab.is_empty env then instT_term envT |
|
401 |
else |
|
402 |
let |
|
403 |
val instT = instT_type envT; |
|
404 |
fun inst (Const (x, T)) = Const (x, instT T) |
|
405 |
| inst (Free (x, T)) = |
|
406 |
(case Symtab.lookup env x of |
|
407 |
NONE => Free (x, instT T) |
|
408 |
| SOME t => t) |
|
409 |
| inst (Var (xi, T)) = Var (xi, instT T) |
|
410 |
| inst (b as Bound _) = b |
|
411 |
| inst (Abs (x, T, t)) = Abs (x, instT T, inst t) |
|
412 |
| inst (t $ u) = inst t $ inst u; |
|
413 |
in Envir.beta_norm o inst end; |
|
414 |
||
415 |
fun inst_thm thy (envT, env) th = |
|
416 |
if Symtab.is_empty env then instT_thm thy envT th |
|
417 |
else |
|
418 |
let |
|
419 |
val substT = instT_subst envT th; |
|
22691 | 420 |
val subst = (Thm.fold_terms o Term.fold_aterms) |
20304 | 421 |
(fn Free (x, T) => |
19777 | 422 |
let |
423 |
val T' = instT_type envT T; |
|
424 |
val t = Free (x, T'); |
|
425 |
val t' = the_default t (Symtab.lookup env x); |
|
20304 | 426 |
in if t aconv t' then I else insert (eq_fst (op =)) ((x, T'), t') end |
427 |
| _ => I) th []; |
|
19777 | 428 |
in |
429 |
if null substT andalso null subst then th |
|
430 |
else th |> hyps_rule |
|
431 |
(instantiate_tfrees thy substT #> |
|
432 |
instantiate_frees thy subst #> |
|
22900 | 433 |
Conv.fconv_rule (Thm.beta_conversion true)) |
19777 | 434 |
end; |
435 |
||
22672
777af26d5713
inst(T)_morphism: avoid reference to static theory value;
wenzelm
parents:
22658
diff
changeset
|
436 |
fun inst_morphism thy envs = |
24137
8d7896398147
replaced Theory.self_ref by Theory.check_thy, which now produces a checked ref;
wenzelm
parents:
23414
diff
changeset
|
437 |
let val thy_ref = Theory.check_thy thy in |
22672
777af26d5713
inst(T)_morphism: avoid reference to static theory value;
wenzelm
parents:
22658
diff
changeset
|
438 |
Morphism.morphism |
29603 | 439 |
{binding = I, |
22672
777af26d5713
inst(T)_morphism: avoid reference to static theory value;
wenzelm
parents:
22658
diff
changeset
|
440 |
typ = instT_type (#1 envs), |
777af26d5713
inst(T)_morphism: avoid reference to static theory value;
wenzelm
parents:
22658
diff
changeset
|
441 |
term = inst_term envs, |
777af26d5713
inst(T)_morphism: avoid reference to static theory value;
wenzelm
parents:
22658
diff
changeset
|
442 |
fact = map (fn th => inst_thm (Theory.deref thy_ref) envs th)} |
777af26d5713
inst(T)_morphism: avoid reference to static theory value;
wenzelm
parents:
22658
diff
changeset
|
443 |
end; |
19777 | 444 |
|
445 |
||
446 |
(* satisfy hypotheses *) |
|
447 |
||
448 |
fun satisfy_thm witns thm = thm |> fold (fn hyp => |
|
449 |
(case find_first (fn Witness (t, _) => Thm.term_of hyp aconv t) witns of |
|
450 |
NONE => I |
|
25302 | 451 |
| SOME w => Thm.implies_intr hyp #> compose_witness w)) (#hyps (Thm.crep_thm thm)); |
19777 | 452 |
|
29603 | 453 |
val satisfy_morphism = Morphism.thm_morphism o satisfy_thm; |
454 |
val satisfy_facts = facts_map o morph_ctxt o satisfy_morphism; |
|
20264 | 455 |
|
456 |
||
29525 | 457 |
(* rewriting with equalities *) |
458 |
||
36674
d95f39448121
eq_morphism is always optional: avoid trivial morphism for empty list of equations
haftmann
parents:
36323
diff
changeset
|
459 |
fun eq_morphism thy thms = if null thms then NONE else SOME (Morphism.morphism |
29603 | 460 |
{binding = I, |
461 |
typ = I, |
|
41228
e1fce873b814
renamed structure MetaSimplifier to raw_Simplifer, to emphasize its meaning;
wenzelm
parents:
39557
diff
changeset
|
462 |
term = Raw_Simplifier.rewrite_term thy thms [], |
e1fce873b814
renamed structure MetaSimplifier to raw_Simplifer, to emphasize its meaning;
wenzelm
parents:
39557
diff
changeset
|
463 |
fact = map (Raw_Simplifier.rewrite_rule thms)}); |
29525 | 464 |
|
465 |
||
29218 | 466 |
(* transfer to theory using closure *) |
467 |
||
468 |
fun transfer_morphism thy = |
|
29603 | 469 |
let val thy_ref = Theory.check_thy thy |
38709 | 470 |
in Morphism.thm_morphism (fn th => Thm.transfer (Theory.deref thy_ref) th) end; |
29603 | 471 |
|
29218 | 472 |
|
473 |
||
30775
71f777103225
added Element.init, which unifies former activate_elem in element.ML and init_elem in locale.ML;
wenzelm
parents:
30763
diff
changeset
|
474 |
(** activate in context **) |
28832 | 475 |
|
30775
71f777103225
added Element.init, which unifies former activate_elem in element.ML and init_elem in locale.ML;
wenzelm
parents:
30763
diff
changeset
|
476 |
(* init *) |
28832 | 477 |
|
38108 | 478 |
fun generic_note_thmss kind facts context = |
479 |
let |
|
480 |
val facts' = Attrib.map_facts (Attrib.attribute_i (Context.theory_of context)) facts; |
|
481 |
in |
|
482 |
context |> Context.mapping_result |
|
39557
fe5722fce758
renamed structure PureThy to Pure_Thy and moved most content to Global_Theory, to emphasize that this is global-only;
wenzelm
parents:
39166
diff
changeset
|
483 |
(Global_Theory.note_thmss kind facts') |
38108 | 484 |
(ProofContext.note_thmss kind facts') |
485 |
end; |
|
486 |
||
30775
71f777103225
added Element.init, which unifies former activate_elem in element.ML and init_elem in locale.ML;
wenzelm
parents:
30763
diff
changeset
|
487 |
fun init (Fixes fixes) = Context.map_proof (ProofContext.add_fixes fixes #> #2) |
71f777103225
added Element.init, which unifies former activate_elem in element.ML and init_elem in locale.ML;
wenzelm
parents:
30763
diff
changeset
|
488 |
| init (Constrains _) = I |
71f777103225
added Element.init, which unifies former activate_elem in element.ML and init_elem in locale.ML;
wenzelm
parents:
30763
diff
changeset
|
489 |
| init (Assumes asms) = Context.map_proof (fn ctxt => |
28832 | 490 |
let |
491 |
val asms' = Attrib.map_specs (Attrib.attribute_i (ProofContext.theory_of ctxt)) asms; |
|
30775
71f777103225
added Element.init, which unifies former activate_elem in element.ML and init_elem in locale.ML;
wenzelm
parents:
30763
diff
changeset
|
492 |
val (_, ctxt') = ctxt |
71f777103225
added Element.init, which unifies former activate_elem in element.ML and init_elem in locale.ML;
wenzelm
parents:
30763
diff
changeset
|
493 |
|> fold Variable.auto_fixes (maps (map #1 o #2) asms') |
71f777103225
added Element.init, which unifies former activate_elem in element.ML and init_elem in locale.ML;
wenzelm
parents:
30763
diff
changeset
|
494 |
|> ProofContext.add_assms_i Assumption.assume_export asms'; |
71f777103225
added Element.init, which unifies former activate_elem in element.ML and init_elem in locale.ML;
wenzelm
parents:
30763
diff
changeset
|
495 |
in ctxt' end) |
71f777103225
added Element.init, which unifies former activate_elem in element.ML and init_elem in locale.ML;
wenzelm
parents:
30763
diff
changeset
|
496 |
| init (Defines defs) = Context.map_proof (fn ctxt => |
28832 | 497 |
let |
498 |
val defs' = Attrib.map_specs (Attrib.attribute_i (ProofContext.theory_of ctxt)) defs; |
|
499 |
val asms = defs' |> map (fn ((name, atts), (t, ps)) => |
|
35624 | 500 |
let val ((c, _), t') = Local_Defs.cert_def ctxt t (* FIXME adapt ps? *) |
30434 | 501 |
in (t', ((Thm.def_binding_optional (Binding.name c) name, atts), [(t', ps)])) end); |
30775
71f777103225
added Element.init, which unifies former activate_elem in element.ML and init_elem in locale.ML;
wenzelm
parents:
30763
diff
changeset
|
502 |
val (_, ctxt') = ctxt |
71f777103225
added Element.init, which unifies former activate_elem in element.ML and init_elem in locale.ML;
wenzelm
parents:
30763
diff
changeset
|
503 |
|> fold Variable.auto_fixes (map #1 asms) |
35624 | 504 |
|> ProofContext.add_assms_i Local_Defs.def_export (map #2 asms); |
30775
71f777103225
added Element.init, which unifies former activate_elem in element.ML and init_elem in locale.ML;
wenzelm
parents:
30763
diff
changeset
|
505 |
in ctxt' end) |
38108 | 506 |
| init (Notes (kind, facts)) = generic_note_thmss kind facts #> #2; |
30775
71f777103225
added Element.init, which unifies former activate_elem in element.ML and init_elem in locale.ML;
wenzelm
parents:
30763
diff
changeset
|
507 |
|
71f777103225
added Element.init, which unifies former activate_elem in element.ML and init_elem in locale.ML;
wenzelm
parents:
30763
diff
changeset
|
508 |
|
71f777103225
added Element.init, which unifies former activate_elem in element.ML and init_elem in locale.ML;
wenzelm
parents:
30763
diff
changeset
|
509 |
(* activate *) |
71f777103225
added Element.init, which unifies former activate_elem in element.ML and init_elem in locale.ML;
wenzelm
parents:
30763
diff
changeset
|
510 |
|
30777
9960ff945c52
simplified Element.activate(_i): singleton version;
wenzelm
parents:
30775
diff
changeset
|
511 |
fun activate_i elem ctxt = |
28832 | 512 |
let |
30777
9960ff945c52
simplified Element.activate(_i): singleton version;
wenzelm
parents:
30775
diff
changeset
|
513 |
val elem' = map_ctxt_attrib Args.assignable elem; |
9960ff945c52
simplified Element.activate(_i): singleton version;
wenzelm
parents:
30775
diff
changeset
|
514 |
val ctxt' = Context.proof_map (init elem') ctxt; |
9960ff945c52
simplified Element.activate(_i): singleton version;
wenzelm
parents:
30775
diff
changeset
|
515 |
in (map_ctxt_attrib Args.closure elem', ctxt') end; |
28832 | 516 |
|
30777
9960ff945c52
simplified Element.activate(_i): singleton version;
wenzelm
parents:
30775
diff
changeset
|
517 |
fun activate raw_elem ctxt = |
9960ff945c52
simplified Element.activate(_i): singleton version;
wenzelm
parents:
30775
diff
changeset
|
518 |
let val elem = raw_elem |> map_ctxt |
30775
71f777103225
added Element.init, which unifies former activate_elem in element.ML and init_elem in locale.ML;
wenzelm
parents:
30763
diff
changeset
|
519 |
{binding = tap Name.of_binding, |
29603 | 520 |
typ = I, |
521 |
term = I, |
|
522 |
pattern = I, |
|
30775
71f777103225
added Element.init, which unifies former activate_elem in element.ML and init_elem in locale.ML;
wenzelm
parents:
30763
diff
changeset
|
523 |
fact = ProofContext.get_fact ctxt, |
30777
9960ff945c52
simplified Element.activate(_i): singleton version;
wenzelm
parents:
30775
diff
changeset
|
524 |
attrib = Attrib.intern_src (ProofContext.theory_of ctxt)} |
9960ff945c52
simplified Element.activate(_i): singleton version;
wenzelm
parents:
30775
diff
changeset
|
525 |
in activate_i elem ctxt end; |
28832 | 526 |
|
19267 | 527 |
end; |