762
|
1 |
signature QUOTIENT_TYPE =
|
127
b054cf6bd179
the command "quotient" can now define more than one quotient at the same time; quotients need to be separated by and
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
2 |
sig
|
787
5cf83fa5b36c
made the quotient_type definition more like typedef; now type variables need to be explicitly given
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
3 |
val quotient_type: ((string list * binding * mixfix) * (typ * term)) list
|
5cf83fa5b36c
made the quotient_type definition more like typedef; now type variables need to be explicitly given
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
4 |
-> Proof.context -> Proof.state
|
789
|
5 |
|
787
5cf83fa5b36c
made the quotient_type definition more like typedef; now type variables need to be explicitly given
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
6 |
val quotient_type_cmd: ((((string list * binding) * mixfix) * string) * string) list
|
5cf83fa5b36c
made the quotient_type definition more like typedef; now type variables need to be explicitly given
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
7 |
-> Proof.context -> Proof.state
|
127
b054cf6bd179
the command "quotient" can now define more than one quotient at the same time; quotients need to be separated by and
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
8 |
end;
|
71
|
9 |
|
762
|
10 |
structure Quotient_Type: QUOTIENT_TYPE =
|
71
|
11 |
struct
|
|
12 |
|
762
|
13 |
open Quotient_Info;
|
|
14 |
|
760
c1989de100b4
various tunings; map_lookup now raises an exception; addition to FIXME-TODO
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
15 |
(* wrappers for define, note, Attrib.internal and theorem_i *)
|
135
|
16 |
fun define (name, mx, rhs) lthy =
|
|
17 |
let
|
|
18 |
val ((rhs, (_ , thm)), lthy') =
|
331
|
19 |
Local_Theory.define ((name, mx), (Attrib.empty_binding, rhs)) lthy
|
135
|
20 |
in
|
|
21 |
((rhs, thm), lthy')
|
|
22 |
end
|
|
23 |
|
503
d2c9a72e52e0
first version of internalised quotient theorems; added FIXME-TODO
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
24 |
fun note (name, thm, attrs) lthy =
|
135
|
25 |
let
|
503
d2c9a72e52e0
first version of internalised quotient theorems; added FIXME-TODO
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
26 |
val ((_,[thm']), lthy') = Local_Theory.note ((name, attrs), [thm]) lthy
|
135
|
27 |
in
|
|
28 |
(thm', lthy')
|
|
29 |
end
|
|
30 |
|
760
c1989de100b4
various tunings; map_lookup now raises an exception; addition to FIXME-TODO
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
31 |
fun intern_attr at = Attrib.internal (K at)
|
582
|
32 |
|
203
|
33 |
fun theorem after_qed goals ctxt =
|
|
34 |
let
|
|
35 |
val goals' = map (rpair []) goals
|
|
36 |
fun after_qed' thms = after_qed (the_single thms)
|
|
37 |
in
|
|
38 |
Proof.theorem_i NONE after_qed' [goals'] ctxt
|
|
39 |
end
|
135
|
40 |
|
130
|
41 |
|
838
|
42 |
|
|
43 |
(*** definition of quotient types ***)
|
130
|
44 |
|
780
a24e26f5488c
explicit handling of mem_def, avoiding the use of the simplifier; this fixes some quotient_type definitions
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
45 |
val mem_def1 = @{lemma "y : S ==> S y" by (simp add: mem_def)}
|
a24e26f5488c
explicit handling of mem_def, avoiding the use of the simplifier; this fixes some quotient_type definitions
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
46 |
val mem_def2 = @{lemma "S y ==> y : S" by (simp add: mem_def)}
|
a24e26f5488c
explicit handling of mem_def, avoiding the use of the simplifier; this fixes some quotient_type definitions
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
47 |
|
79
c0c41fefeb06
added quotient command (you need to update isar-keywords-prove.el)
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
48 |
(* constructs the term lambda (c::rty => bool). EX (x::rty). c = rel x *)
|
71
|
49 |
fun typedef_term rel rty lthy =
|
|
50 |
let
|
79
c0c41fefeb06
added quotient command (you need to update isar-keywords-prove.el)
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
51 |
val [x, c] = [("x", rty), ("c", HOLogic.mk_setT rty)]
|
71
|
52 |
|> Variable.variant_frees lthy [rel]
|
|
53 |
|> map Free
|
|
54 |
in
|
790
|
55 |
lambda c (HOLogic.exists_const rty $
|
|
56 |
lambda x (HOLogic.mk_eq (c, (rel $ x))))
|
71
|
57 |
end
|
|
58 |
|
790
|
59 |
|
788
|
60 |
(* makes the new type definitions and proves non-emptyness *)
|
787
5cf83fa5b36c
made the quotient_type definition more like typedef; now type variables need to be explicitly given
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
61 |
fun typedef_make (vs, qty_name, mx, rel, rty) lthy =
|
71
|
62 |
let
|
|
63 |
val typedef_tac =
|
792
|
64 |
EVERY1 (map rtac [@{thm exI}, mem_def2, @{thm exI}, @{thm refl}])
|
71
|
65 |
in
|
319
|
66 |
Local_Theory.theory_result
|
71
|
67 |
(Typedef.add_typedef false NONE
|
787
5cf83fa5b36c
made the quotient_type definition more like typedef; now type variables need to be explicitly given
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
68 |
(qty_name, vs, mx)
|
790
|
69 |
(typedef_term rel rty lthy)
|
|
70 |
NONE typedef_tac) lthy
|
71
|
71 |
end
|
|
72 |
|
790
|
73 |
|
781
|
74 |
(* tactic to prove the Quot_Type theorem for the new type *)
|
71
|
75 |
fun typedef_quot_type_tac equiv_thm (typedef_info: Typedef.info) =
|
|
76 |
let
|
885
|
77 |
val rep_thm = #Rep typedef_info RS mem_def1
|
71
|
78 |
val rep_inv = #Rep_inverse typedef_info
|
885
|
79 |
val abs_inv = mem_def2 RS #Abs_inverse typedef_info
|
71
|
80 |
val rep_inj = #Rep_inject typedef_info
|
|
81 |
in
|
781
|
82 |
(rtac @{thm Quot_Type.intro} THEN'
|
780
a24e26f5488c
explicit handling of mem_def, avoiding the use of the simplifier; this fixes some quotient_type definitions
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
83 |
RANGE [rtac equiv_thm,
|
71
|
84 |
rtac rep_thm,
|
|
85 |
rtac rep_inv,
|
792
|
86 |
EVERY' (map rtac [abs_inv, @{thm exI}, @{thm refl}]),
|
780
a24e26f5488c
explicit handling of mem_def, avoiding the use of the simplifier; this fixes some quotient_type definitions
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
87 |
rtac rep_inj]) 1
|
71
|
88 |
end
|
|
89 |
|
790
|
90 |
|
885
|
91 |
(* proves the Quot_Type theorem for the new type *)
|
71
|
92 |
fun typedef_quot_type_thm (rel, abs, rep, equiv_thm, typedef_info) lthy =
|
|
93 |
let
|
781
|
94 |
val quot_type_const = Const (@{const_name "Quot_Type"}, dummyT)
|
71
|
95 |
val goal = HOLogic.mk_Trueprop (quot_type_const $ rel $ abs $ rep)
|
|
96 |
|> Syntax.check_term lthy
|
|
97 |
in
|
|
98 |
Goal.prove lthy [] [] goal
|
|
99 |
(K (typedef_quot_type_tac equiv_thm typedef_info))
|
|
100 |
end
|
|
101 |
|
885
|
102 |
(* proves the quotient theorem for the new type *)
|
71
|
103 |
fun typedef_quotient_thm (rel, abs, rep, abs_def, rep_def, quot_type_thm) lthy =
|
|
104 |
let
|
529
|
105 |
val quotient_const = Const (@{const_name "Quotient"}, dummyT)
|
71
|
106 |
val goal = HOLogic.mk_Trueprop (quotient_const $ rel $ abs $ rep)
|
|
107 |
|> Syntax.check_term lthy
|
|
108 |
|
|
109 |
val typedef_quotient_thm_tac =
|
|
110 |
EVERY1 [K (rewrite_goals_tac [abs_def, rep_def]),
|
781
|
111 |
rtac @{thm Quot_Type.Quotient},
|
71
|
112 |
rtac quot_type_thm]
|
|
113 |
in
|
|
114 |
Goal.prove lthy [] [] goal
|
|
115 |
(K typedef_quotient_thm_tac)
|
|
116 |
end
|
|
117 |
|
790
|
118 |
|
760
c1989de100b4
various tunings; map_lookup now raises an exception; addition to FIXME-TODO
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
119 |
(* main function for constructing a quotient type *)
|
885
|
120 |
fun mk_quotient_type (((vs, qty_name, mx), (rty, rel)), equiv_thm) lthy =
|
71
|
121 |
let
|
760
c1989de100b4
various tunings; map_lookup now raises an exception; addition to FIXME-TODO
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
122 |
(* generates the typedef *)
|
787
5cf83fa5b36c
made the quotient_type definition more like typedef; now type variables need to be explicitly given
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
123 |
val ((qty_full_name, typedef_info), lthy1) = typedef_make (vs, qty_name, mx, rel, rty) lthy
|
71
|
124 |
|
760
c1989de100b4
various tunings; map_lookup now raises an exception; addition to FIXME-TODO
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
125 |
(* abs and rep functions from the typedef *)
|
782
|
126 |
val Abs_ty = #abs_type typedef_info
|
|
127 |
val Rep_ty = #rep_type typedef_info
|
|
128 |
val Abs_name = #Abs_name typedef_info
|
|
129 |
val Rep_name = #Rep_name typedef_info
|
|
130 |
val Abs_const = Const (Abs_name, Rep_ty --> Abs_ty)
|
|
131 |
val Rep_const = Const (Rep_name, Abs_ty --> Rep_ty)
|
71
|
132 |
|
792
|
133 |
(* more useful abs and rep definitions *)
|
782
|
134 |
val abs_const = Const (@{const_name "Quot_Type.abs"}, dummyT )
|
|
135 |
val rep_const = Const (@{const_name "Quot_Type.rep"}, dummyT )
|
|
136 |
val abs_trm = Syntax.check_term lthy1 (abs_const $ rel $ Abs_const)
|
|
137 |
val rep_trm = Syntax.check_term lthy1 (rep_const $ Rep_const)
|
|
138 |
val abs_name = Binding.prefix_name "abs_" qty_name
|
|
139 |
val rep_name = Binding.prefix_name "rep_" qty_name
|
781
|
140 |
|
782
|
141 |
val ((abs, abs_def), lthy2) = define (abs_name, NoSyn, abs_trm) lthy1
|
|
142 |
val ((rep, rep_def), lthy3) = define (rep_name, NoSyn, rep_trm) lthy2
|
71
|
143 |
|
885
|
144 |
(* quot_type theorem *)
|
782
|
145 |
val quot_thm = typedef_quot_type_thm (rel, Abs_const, Rep_const, equiv_thm, typedef_info) lthy3
|
71
|
146 |
|
780
a24e26f5488c
explicit handling of mem_def, avoiding the use of the simplifier; this fixes some quotient_type definitions
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
147 |
(* quotient theorem *)
|
782
|
148 |
val quotient_thm = typedef_quotient_thm (rel, abs, rep, abs_def, rep_def, quot_thm) lthy3
|
529
|
149 |
val quotient_thm_name = Binding.prefix_name "Quotient_" qty_name
|
71
|
150 |
|
782
|
151 |
(* name equivalence theorem *)
|
|
152 |
val equiv_thm_name = Binding.suffix_name "_equivp" qty_name
|
|
153 |
|
182
|
154 |
(* storing the quot-info *)
|
783
06e17083e90b
modified mk_resp_arg so that the user can give terms as equivalence relations, not just constants
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
155 |
(* FIXME: VarifyT should not be used - at the moment it allows matching against the types. *)
|
799
|
156 |
fun qinfo phi = transform_quotdata phi
|
786
|
157 |
{qtyp = Logic.varifyT Abs_ty, rtyp = Logic.varifyT rty,
|
|
158 |
equiv_rel = map_types Logic.varifyT rel, equiv_thm = equiv_thm}
|
|
159 |
val lthy4 = Local_Theory.declaration true
|
|
160 |
(fn phi => quotdata_update_gen qty_full_name (qinfo phi)) lthy3
|
71
|
161 |
in
|
781
|
162 |
lthy4
|
780
a24e26f5488c
explicit handling of mem_def, avoiding the use of the simplifier; this fixes some quotient_type definitions
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
163 |
|> note (quotient_thm_name, quotient_thm, [intern_attr quotient_rules_add])
|
782
|
164 |
||>> note (equiv_thm_name, equiv_thm, [intern_attr equiv_rules_add])
|
71
|
165 |
end
|
|
166 |
|
790
|
167 |
|
805
d193e2111811
added a warning to the quotient_type definition, if a map function is missing
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
168 |
(* sanity checks for the quotient type specifications *)
|
788
|
169 |
fun sanity_check ((vs, qty_name, _), (rty, rel)) =
|
|
170 |
let
|
|
171 |
val rty_tfreesT = map fst (Term.add_tfreesT rty [])
|
|
172 |
val rel_tfrees = map fst (Term.add_tfrees rel [])
|
|
173 |
val rel_frees = map fst (Term.add_frees rel [])
|
|
174 |
val rel_vars = Term.add_vars rel []
|
|
175 |
val rel_tvars = Term.add_tvars rel []
|
885
|
176 |
val qty_str = Binding.str_of qty_name ^ ": "
|
788
|
177 |
|
|
178 |
val illegal_rel_vars =
|
|
179 |
if null rel_vars andalso null rel_tvars then []
|
|
180 |
else [qty_str ^ "illegal schematic variable(s) in the relation."]
|
|
181 |
|
|
182 |
val dup_vs =
|
|
183 |
(case duplicates (op =) vs of
|
|
184 |
[] => []
|
|
185 |
| dups => [qty_str ^ "duplicate type variable(s) on the lhs: " ^ commas_quote dups])
|
|
186 |
|
|
187 |
val extra_rty_tfrees =
|
|
188 |
(case subtract (op =) vs rty_tfreesT of
|
|
189 |
[] => []
|
|
190 |
| extras => [qty_str ^ "extra type variable(s) on the lhs: " ^ commas_quote extras])
|
|
191 |
|
|
192 |
val extra_rel_tfrees =
|
|
193 |
(case subtract (op =) vs rel_tfrees of
|
|
194 |
[] => []
|
|
195 |
| extras => [qty_str ^ "extra type variable(s) in the relation: " ^ commas_quote extras])
|
|
196 |
|
|
197 |
val illegal_rel_frees =
|
|
198 |
(case rel_frees of
|
|
199 |
[] => []
|
|
200 |
| xs => [qty_str ^ "illegal variable(s) in the relation: " ^ commas_quote xs])
|
|
201 |
|
|
202 |
val errs = illegal_rel_vars @ dup_vs @ extra_rty_tfrees @ extra_rel_tfrees @ illegal_rel_frees
|
|
203 |
in
|
|
204 |
if null errs then () else error (cat_lines errs)
|
|
205 |
end
|
130
|
206 |
|
805
d193e2111811
added a warning to the quotient_type definition, if a map function is missing
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
207 |
(* check for existence of map functions *)
|
d193e2111811
added a warning to the quotient_type definition, if a map function is missing
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
208 |
fun map_check ctxt (_, (rty, _)) =
|
d193e2111811
added a warning to the quotient_type definition, if a map function is missing
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
209 |
let
|
d193e2111811
added a warning to the quotient_type definition, if a map function is missing
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
210 |
val thy = ProofContext.theory_of ctxt
|
d193e2111811
added a warning to the quotient_type definition, if a map function is missing
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
211 |
|
d193e2111811
added a warning to the quotient_type definition, if a map function is missing
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
212 |
fun map_check_aux rty warns =
|
d193e2111811
added a warning to the quotient_type definition, if a map function is missing
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
213 |
case rty of
|
d193e2111811
added a warning to the quotient_type definition, if a map function is missing
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
214 |
Type (_, []) => warns
|
885
|
215 |
| Type (s, _) => if maps_defined thy s then warns else s::warns
|
805
d193e2111811
added a warning to the quotient_type definition, if a map function is missing
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
216 |
| _ => warns
|
d193e2111811
added a warning to the quotient_type definition, if a map function is missing
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
217 |
|
d193e2111811
added a warning to the quotient_type definition, if a map function is missing
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
218 |
val warns = map_check_aux rty []
|
d193e2111811
added a warning to the quotient_type definition, if a map function is missing
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
219 |
in
|
d193e2111811
added a warning to the quotient_type definition, if a map function is missing
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
220 |
if null warns then ()
|
853
|
221 |
else warning ("No map function defined for " ^ commas warns ^
|
805
d193e2111811
added a warning to the quotient_type definition, if a map function is missing
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
222 |
". This will cause problems later on.")
|
d193e2111811
added a warning to the quotient_type definition, if a map function is missing
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
223 |
end
|
d193e2111811
added a warning to the quotient_type definition, if a map function is missing
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
224 |
|
790
|
225 |
|
838
|
226 |
|
|
227 |
(*** interface and syntax setup ***)
|
|
228 |
|
75
|
229 |
|
853
|
230 |
(* the ML-interface takes a list of 5-tuples consisting of:
|
|
231 |
|
|
232 |
- the name of the quotient type
|
|
233 |
- its free type variables (first argument)
|
|
234 |
- its mixfix annotation
|
|
235 |
- the type to be quotient
|
|
236 |
- the relation according to which the type is quotient
|
|
237 |
|
|
238 |
it opens a proof-state in which one has to show that the
|
|
239 |
relations are equivalence relations
|
838
|
240 |
*)
|
130
|
241 |
|
290
a0be84b0c707
removed typing information from get_fun in quotient_def; *potentially* dangerous
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
242 |
fun quotient_type quot_list lthy =
|
79
c0c41fefeb06
added quotient command (you need to update isar-keywords-prove.el)
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
243 |
let
|
800
|
244 |
(* sanity check *)
|
838
|
245 |
val _ = List.app sanity_check quot_list
|
|
246 |
val _ = List.app (map_check lthy) quot_list
|
800
|
247 |
|
185
|
248 |
fun mk_goal (rty, rel) =
|
127
b054cf6bd179
the command "quotient" can now define more than one quotient at the same time; quotients need to be separated by and
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
249 |
let
|
529
|
250 |
val equivp_ty = ([rty, rty] ---> @{typ bool}) --> @{typ bool}
|
127
b054cf6bd179
the command "quotient" can now define more than one quotient at the same time; quotients need to be separated by and
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
251 |
in
|
529
|
252 |
HOLogic.mk_Trueprop (Const (@{const_name equivp}, equivp_ty) $ rel)
|
127
b054cf6bd179
the command "quotient" can now define more than one quotient at the same time; quotients need to be separated by and
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
253 |
end
|
b054cf6bd179
the command "quotient" can now define more than one quotient at the same time; quotients need to be separated by and
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
254 |
|
185
|
255 |
val goals = map (mk_goal o snd) quot_list
|
127
b054cf6bd179
the command "quotient" can now define more than one quotient at the same time; quotients need to be separated by and
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
256 |
|
79
c0c41fefeb06
added quotient command (you need to update isar-keywords-prove.el)
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
257 |
fun after_qed thms lthy =
|
885
|
258 |
fold_map mk_quotient_type (quot_list ~~ thms) lthy |> snd
|
79
c0c41fefeb06
added quotient command (you need to update isar-keywords-prove.el)
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
259 |
in
|
203
|
260 |
theorem after_qed goals lthy
|
79
c0c41fefeb06
added quotient command (you need to update isar-keywords-prove.el)
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
261 |
end
|
205
|
262 |
|
800
|
263 |
fun quotient_type_cmd specs lthy =
|
205
|
264 |
let
|
787
5cf83fa5b36c
made the quotient_type definition more like typedef; now type variables need to be explicitly given
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
265 |
fun parse_spec ((((vs, qty_name), mx), rty_str), rel_str) =
|
205
|
266 |
let
|
293
|
267 |
val rty = Syntax.read_typ lthy rty_str
|
|
268 |
val rel = Syntax.read_term lthy rel_str
|
205
|
269 |
in
|
787
5cf83fa5b36c
made the quotient_type definition more like typedef; now type variables need to be explicitly given
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
270 |
((vs, qty_name, mx), (rty, rel))
|
205
|
271 |
end
|
|
272 |
in
|
800
|
273 |
quotient_type (map parse_spec specs) lthy
|
205
|
274 |
end
|
79
c0c41fefeb06
added quotient command (you need to update isar-keywords-prove.el)
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
275 |
|
127
b054cf6bd179
the command "quotient" can now define more than one quotient at the same time; quotients need to be separated by and
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
276 |
val quotspec_parser =
|
b054cf6bd179
the command "quotient" can now define more than one quotient at the same time; quotients need to be separated by and
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
277 |
OuterParse.and_list1
|
787
5cf83fa5b36c
made the quotient_type definition more like typedef; now type variables need to be explicitly given
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
278 |
((OuterParse.type_args -- OuterParse.binding) --
|
5cf83fa5b36c
made the quotient_type definition more like typedef; now type variables need to be explicitly given
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
279 |
OuterParse.opt_infix -- (OuterParse.$$$ "=" |-- OuterParse.typ) --
|
127
b054cf6bd179
the command "quotient" can now define more than one quotient at the same time; quotients need to be separated by and
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
280 |
(OuterParse.$$$ "/" |-- OuterParse.term))
|
75
|
281 |
|
79
c0c41fefeb06
added quotient command (you need to update isar-keywords-prove.el)
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
282 |
val _ = OuterKeyword.keyword "/"
|
75
|
283 |
|
79
c0c41fefeb06
added quotient command (you need to update isar-keywords-prove.el)
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
284 |
val _ =
|
766
df053507edba
renamed "quotient" command to "quotient_type"; needs new keyword file to be installed
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
285 |
OuterSyntax.local_theory_to_proof "quotient_type"
|
df053507edba
renamed "quotient" command to "quotient_type"; needs new keyword file to be installed
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
286 |
"quotient type definitions (require equivalence proofs)"
|
290
a0be84b0c707
removed typing information from get_fun in quotient_def; *potentially* dangerous
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
287 |
OuterKeyword.thy_goal (quotspec_parser >> quotient_type_cmd)
|
79
c0c41fefeb06
added quotient command (you need to update isar-keywords-prove.el)
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
288 |
|
c0c41fefeb06
added quotient command (you need to update isar-keywords-prove.el)
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
289 |
end; (* structure *)
|