author | Cezary Kaliszyk <kaliszyk@in.tum.de> |
Mon, 11 Jan 2010 11:51:19 +0100 | |
changeset 835 | c4fa87dd0208 |
parent 805 | d193e2111811 |
child 836 | c2501b2b262a |
permissions | -rw-r--r-- |
264
d0581fbc096c
split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
1 |
signature QUOTIENT_INFO = |
d0581fbc096c
split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
2 |
sig |
549
f178958d3d81
not yet quite functional treatment of constants
Christian Urban <urbanc@in.tum.de>
parents:
506
diff
changeset
|
3 |
exception NotFound |
f178958d3d81
not yet quite functional treatment of constants
Christian Urban <urbanc@in.tum.de>
parents:
506
diff
changeset
|
4 |
|
784
da75568e7f12
renamed some fields in the info records
Christian Urban <urbanc@in.tum.de>
parents:
778
diff
changeset
|
5 |
type maps_info = {mapfun: string, relmap: string} |
805
d193e2111811
added a warning to the quotient_type definition, if a map function is missing
Christian Urban <urbanc@in.tum.de>
parents:
799
diff
changeset
|
6 |
val maps_exists: theory -> string -> bool |
784
da75568e7f12
renamed some fields in the info records
Christian Urban <urbanc@in.tum.de>
parents:
778
diff
changeset
|
7 |
val maps_lookup: theory -> string -> maps_info (* raises NotFound *) |
264
d0581fbc096c
split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
8 |
val maps_update_thy: string -> maps_info -> theory -> theory |
d0581fbc096c
split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
9 |
val maps_update: string -> maps_info -> Proof.context -> Proof.context |
699
aa157e957655
added maps-printout and tuned some comments
Christian Urban <urbanc@in.tum.de>
parents:
675
diff
changeset
|
10 |
val print_mapsinfo: Proof.context -> unit |
264
d0581fbc096c
split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
11 |
|
786
d6407afb913c
used Local_Theory.declaration for storing quotdata
Christian Urban <urbanc@in.tum.de>
parents:
784
diff
changeset
|
12 |
type quotdata_info = {qtyp: typ, rtyp: typ, equiv_rel: term, equiv_thm: thm} |
799
0755f8fd56b3
renamed transfer to transform (Markus)
Christian Urban <urbanc@in.tum.de>
parents:
798
diff
changeset
|
13 |
val transform_quotdata: morphism -> quotdata_info -> quotdata_info |
786
d6407afb913c
used Local_Theory.declaration for storing quotdata
Christian Urban <urbanc@in.tum.de>
parents:
784
diff
changeset
|
14 |
val quotdata_lookup: theory -> string -> quotdata_info (* raises NotFound *) |
835
c4fa87dd0208
Fix for testing matching constants in regularize.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
805
diff
changeset
|
15 |
val quotdata_lookup_type: theory -> typ -> quotdata_info (* raises NotFound *) |
786
d6407afb913c
used Local_Theory.declaration for storing quotdata
Christian Urban <urbanc@in.tum.de>
parents:
784
diff
changeset
|
16 |
val quotdata_update_thy: string -> quotdata_info -> theory -> theory |
d6407afb913c
used Local_Theory.declaration for storing quotdata
Christian Urban <urbanc@in.tum.de>
parents:
784
diff
changeset
|
17 |
val quotdata_update_gen: string -> quotdata_info -> Context.generic -> Context.generic |
699
aa157e957655
added maps-printout and tuned some comments
Christian Urban <urbanc@in.tum.de>
parents:
675
diff
changeset
|
18 |
val print_quotinfo: Proof.context -> unit |
268
4d58c02289ca
simplified the quotient_def code; type of the defined constant must now be given; for-part eliminated
Christian Urban <urbanc@in.tum.de>
parents:
264
diff
changeset
|
19 |
|
496
8f1bf5266ebc
Added the definition to quotient constant data.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
460
diff
changeset
|
20 |
type qconsts_info = {qconst: term, rconst: term, def: thm} |
799
0755f8fd56b3
renamed transfer to transform (Markus)
Christian Urban <urbanc@in.tum.de>
parents:
798
diff
changeset
|
21 |
val transform_qconsts: morphism -> qconsts_info -> qconsts_info |
784
da75568e7f12
renamed some fields in the info records
Christian Urban <urbanc@in.tum.de>
parents:
778
diff
changeset
|
22 |
val qconsts_lookup: theory -> term -> qconsts_info (* raises NotFound *) |
663
0dd10a900cae
Different syntax for definitions that allows overloading and retrieving of definitions by matching whole constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
643
diff
changeset
|
23 |
val qconsts_update_thy: string -> qconsts_info -> theory -> theory |
497
b663bc007d00
Added qoutient_consts dest for getting all the constant definitions in the cleaning step.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
496
diff
changeset
|
24 |
val qconsts_update_gen: string -> qconsts_info -> Context.generic -> Context.generic |
b663bc007d00
Added qoutient_consts dest for getting all the constant definitions in the cleaning step.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
496
diff
changeset
|
25 |
val qconsts_dest: theory -> qconsts_info list |
310
fec6301a1989
added a container for quotient constants (does not work yet though)
Christian Urban <urbanc@in.tum.de>
parents:
306
diff
changeset
|
26 |
val print_qconstinfo: Proof.context -> unit |
450
2dc708ddb93a
introduced a global list of respectfulness lemmas; the attribute is [quot_rsp]
Christian Urban <urbanc@in.tum.de>
parents:
406
diff
changeset
|
27 |
|
582
a082e2d138ab
added a theorem list for equivalence theorems
Christian Urban <urbanc@in.tum.de>
parents:
549
diff
changeset
|
28 |
val equiv_rules_get: Proof.context -> thm list |
a082e2d138ab
added a theorem list for equivalence theorems
Christian Urban <urbanc@in.tum.de>
parents:
549
diff
changeset
|
29 |
val equiv_rules_add: attribute |
450
2dc708ddb93a
introduced a global list of respectfulness lemmas; the attribute is [quot_rsp]
Christian Urban <urbanc@in.tum.de>
parents:
406
diff
changeset
|
30 |
val rsp_rules_get: Proof.context -> thm list |
636
520a4084d064
changed names of attributes
Christian Urban <urbanc@in.tum.de>
parents:
614
diff
changeset
|
31 |
val prs_rules_get: Proof.context -> thm list |
614
51a4208162ed
added a thm list for ids
Christian Urban <urbanc@in.tum.de>
parents:
613
diff
changeset
|
32 |
val id_simps_get: Proof.context -> thm list |
503
d2c9a72e52e0
first version of internalised quotient theorems; added FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
460
diff
changeset
|
33 |
val quotient_rules_get: Proof.context -> thm list |
d2c9a72e52e0
first version of internalised quotient theorems; added FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
460
diff
changeset
|
34 |
val quotient_rules_add: attribute |
264
d0581fbc096c
split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
35 |
end; |
d0581fbc096c
split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
36 |
|
798 | 37 |
|
38 |
functor Filtered_Named_Thms (val name: string val description: string val filter: thm -> thm): NAMED_THMS = |
|
797
35436401f00d
added a functor that allows checking what is added to the theorem lists
Christian Urban <urbanc@in.tum.de>
parents:
792
diff
changeset
|
39 |
struct |
35436401f00d
added a functor that allows checking what is added to the theorem lists
Christian Urban <urbanc@in.tum.de>
parents:
792
diff
changeset
|
40 |
|
35436401f00d
added a functor that allows checking what is added to the theorem lists
Christian Urban <urbanc@in.tum.de>
parents:
792
diff
changeset
|
41 |
structure Data = Generic_Data |
798 | 42 |
( type T = thm Item_Net.T; |
797
35436401f00d
added a functor that allows checking what is added to the theorem lists
Christian Urban <urbanc@in.tum.de>
parents:
792
diff
changeset
|
43 |
val empty = Thm.full_rules; |
35436401f00d
added a functor that allows checking what is added to the theorem lists
Christian Urban <urbanc@in.tum.de>
parents:
792
diff
changeset
|
44 |
val extend = I; |
798 | 45 |
val merge = Item_Net.merge); |
797
35436401f00d
added a functor that allows checking what is added to the theorem lists
Christian Urban <urbanc@in.tum.de>
parents:
792
diff
changeset
|
46 |
|
35436401f00d
added a functor that allows checking what is added to the theorem lists
Christian Urban <urbanc@in.tum.de>
parents:
792
diff
changeset
|
47 |
val content = Item_Net.content o Data.get; |
35436401f00d
added a functor that allows checking what is added to the theorem lists
Christian Urban <urbanc@in.tum.de>
parents:
792
diff
changeset
|
48 |
val get = content o Context.Proof; |
35436401f00d
added a functor that allows checking what is added to the theorem lists
Christian Urban <urbanc@in.tum.de>
parents:
792
diff
changeset
|
49 |
|
35436401f00d
added a functor that allows checking what is added to the theorem lists
Christian Urban <urbanc@in.tum.de>
parents:
792
diff
changeset
|
50 |
val add_thm = Data.map o Item_Net.update o filter; |
35436401f00d
added a functor that allows checking what is added to the theorem lists
Christian Urban <urbanc@in.tum.de>
parents:
792
diff
changeset
|
51 |
val del_thm = Data.map o Item_Net.remove; |
35436401f00d
added a functor that allows checking what is added to the theorem lists
Christian Urban <urbanc@in.tum.de>
parents:
792
diff
changeset
|
52 |
|
35436401f00d
added a functor that allows checking what is added to the theorem lists
Christian Urban <urbanc@in.tum.de>
parents:
792
diff
changeset
|
53 |
val add = Thm.declaration_attribute add_thm; |
35436401f00d
added a functor that allows checking what is added to the theorem lists
Christian Urban <urbanc@in.tum.de>
parents:
792
diff
changeset
|
54 |
val del = Thm.declaration_attribute del_thm; |
35436401f00d
added a functor that allows checking what is added to the theorem lists
Christian Urban <urbanc@in.tum.de>
parents:
792
diff
changeset
|
55 |
|
35436401f00d
added a functor that allows checking what is added to the theorem lists
Christian Urban <urbanc@in.tum.de>
parents:
792
diff
changeset
|
56 |
val setup = |
35436401f00d
added a functor that allows checking what is added to the theorem lists
Christian Urban <urbanc@in.tum.de>
parents:
792
diff
changeset
|
57 |
Attrib.setup (Binding.name name) (Attrib.add_del add del) ("declaration of " ^ description) #> |
35436401f00d
added a functor that allows checking what is added to the theorem lists
Christian Urban <urbanc@in.tum.de>
parents:
792
diff
changeset
|
58 |
PureThy.add_thms_dynamic (Binding.name name, content); |
35436401f00d
added a functor that allows checking what is added to the theorem lists
Christian Urban <urbanc@in.tum.de>
parents:
792
diff
changeset
|
59 |
|
35436401f00d
added a functor that allows checking what is added to the theorem lists
Christian Urban <urbanc@in.tum.de>
parents:
792
diff
changeset
|
60 |
end; |
35436401f00d
added a functor that allows checking what is added to the theorem lists
Christian Urban <urbanc@in.tum.de>
parents:
792
diff
changeset
|
61 |
|
35436401f00d
added a functor that allows checking what is added to the theorem lists
Christian Urban <urbanc@in.tum.de>
parents:
792
diff
changeset
|
62 |
|
35436401f00d
added a functor that allows checking what is added to the theorem lists
Christian Urban <urbanc@in.tum.de>
parents:
792
diff
changeset
|
63 |
|
264
d0581fbc096c
split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
64 |
structure Quotient_Info: QUOTIENT_INFO = |
d0581fbc096c
split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
65 |
struct |
d0581fbc096c
split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
66 |
|
549
f178958d3d81
not yet quite functional treatment of constants
Christian Urban <urbanc@in.tum.de>
parents:
506
diff
changeset
|
67 |
exception NotFound |
268
4d58c02289ca
simplified the quotient_def code; type of the defined constant must now be given; for-part eliminated
Christian Urban <urbanc@in.tum.de>
parents:
264
diff
changeset
|
68 |
|
777
2f72662d21f3
added a print_maps command; updated the keyword file accordingly
Christian Urban <urbanc@in.tum.de>
parents:
762
diff
changeset
|
69 |
(*******************) |
264
d0581fbc096c
split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
70 |
(* data containers *) |
d0581fbc096c
split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
71 |
(*******************) |
d0581fbc096c
split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
72 |
|
759 | 73 |
(* info about map- and rel-functions for a type *) |
784
da75568e7f12
renamed some fields in the info records
Christian Urban <urbanc@in.tum.de>
parents:
778
diff
changeset
|
74 |
type maps_info = {mapfun: string, relmap: string} |
264
d0581fbc096c
split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
75 |
|
306
e7279efbe3dd
updated to new Theory_Data and to new Isabelle
Christian Urban <urbanc@in.tum.de>
parents:
268
diff
changeset
|
76 |
structure MapsData = Theory_Data |
264
d0581fbc096c
split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
77 |
(type T = maps_info Symtab.table |
d0581fbc096c
split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
78 |
val empty = Symtab.empty |
d0581fbc096c
split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
79 |
val extend = I |
306
e7279efbe3dd
updated to new Theory_Data and to new Isabelle
Christian Urban <urbanc@in.tum.de>
parents:
268
diff
changeset
|
80 |
val merge = Symtab.merge (K true)) |
264
d0581fbc096c
split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
81 |
|
805
d193e2111811
added a warning to the quotient_type definition, if a map function is missing
Christian Urban <urbanc@in.tum.de>
parents:
799
diff
changeset
|
82 |
fun maps_exists thy s = |
d193e2111811
added a warning to the quotient_type definition, if a map function is missing
Christian Urban <urbanc@in.tum.de>
parents:
799
diff
changeset
|
83 |
case (Symtab.lookup (MapsData.get thy) s) of |
d193e2111811
added a warning to the quotient_type definition, if a map function is missing
Christian Urban <urbanc@in.tum.de>
parents:
799
diff
changeset
|
84 |
SOME _ => true |
d193e2111811
added a warning to the quotient_type definition, if a map function is missing
Christian Urban <urbanc@in.tum.de>
parents:
799
diff
changeset
|
85 |
| NONE => false |
d193e2111811
added a warning to the quotient_type definition, if a map function is missing
Christian Urban <urbanc@in.tum.de>
parents:
799
diff
changeset
|
86 |
|
760
c1989de100b4
various tunings; map_lookup now raises an exception; addition to FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
759
diff
changeset
|
87 |
fun maps_lookup thy s = |
c1989de100b4
various tunings; map_lookup now raises an exception; addition to FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
759
diff
changeset
|
88 |
case (Symtab.lookup (MapsData.get thy) s) of |
c1989de100b4
various tunings; map_lookup now raises an exception; addition to FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
759
diff
changeset
|
89 |
SOME map_fun => map_fun |
c1989de100b4
various tunings; map_lookup now raises an exception; addition to FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
759
diff
changeset
|
90 |
| NONE => raise NotFound |
264
d0581fbc096c
split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
91 |
|
d0581fbc096c
split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
92 |
fun maps_update_thy k minfo = MapsData.map (Symtab.update (k, minfo)) |
d0581fbc096c
split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
93 |
fun maps_update k minfo = ProofContext.theory (maps_update_thy k minfo) |
d0581fbc096c
split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
94 |
|
d0581fbc096c
split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
95 |
fun maps_attribute_aux s minfo = Thm.declaration_attribute |
786
d6407afb913c
used Local_Theory.declaration for storing quotdata
Christian Urban <urbanc@in.tum.de>
parents:
784
diff
changeset
|
96 |
(fn _ => Context.mapping (maps_update_thy s minfo) (maps_update s minfo)) |
264
d0581fbc096c
split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
97 |
|
d0581fbc096c
split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
98 |
(* attribute to be used in declare statements *) |
d0581fbc096c
split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
99 |
fun maps_attribute (ctxt, (tystr, (mapstr, relstr))) = |
d0581fbc096c
split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
100 |
let |
d0581fbc096c
split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
101 |
val thy = ProofContext.theory_of ctxt |
d0581fbc096c
split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
102 |
val tyname = Sign.intern_type thy tystr |
d0581fbc096c
split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
103 |
val mapname = Sign.intern_const thy mapstr |
d0581fbc096c
split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
104 |
val relname = Sign.intern_const thy relstr |
613
018aabbffd08
removed a fixme: map_info is now checked
Christian Urban <urbanc@in.tum.de>
parents:
598
diff
changeset
|
105 |
|
675 | 106 |
fun sanity_check s = (Const (s, dummyT) |> Syntax.check_term ctxt) |
107 |
val _ = map sanity_check [mapname, relname] |
|
264
d0581fbc096c
split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
108 |
in |
784
da75568e7f12
renamed some fields in the info records
Christian Urban <urbanc@in.tum.de>
parents:
778
diff
changeset
|
109 |
maps_attribute_aux tyname {mapfun = mapname, relmap = relname} |
264
d0581fbc096c
split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
110 |
end |
d0581fbc096c
split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
111 |
|
d0581fbc096c
split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
112 |
val maps_attr_parser = |
d0581fbc096c
split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
113 |
Args.context -- Scan.lift |
d0581fbc096c
split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
114 |
((Args.name --| OuterParse.$$$ "=") -- |
d0581fbc096c
split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
115 |
(OuterParse.$$$ "(" |-- Args.name --| OuterParse.$$$ "," -- |
d0581fbc096c
split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
116 |
Args.name --| OuterParse.$$$ ")")) |
d0581fbc096c
split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
117 |
|
d0581fbc096c
split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
118 |
val _ = Context.>> (Context.map_theory |
d0581fbc096c
split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
119 |
(Attrib.setup @{binding "map"} (maps_attr_parser >> maps_attribute) |
d0581fbc096c
split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
120 |
"declaration of map information")) |
d0581fbc096c
split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
121 |
|
699
aa157e957655
added maps-printout and tuned some comments
Christian Urban <urbanc@in.tum.de>
parents:
675
diff
changeset
|
122 |
fun print_mapsinfo ctxt = |
aa157e957655
added maps-printout and tuned some comments
Christian Urban <urbanc@in.tum.de>
parents:
675
diff
changeset
|
123 |
let |
784
da75568e7f12
renamed some fields in the info records
Christian Urban <urbanc@in.tum.de>
parents:
778
diff
changeset
|
124 |
fun prt_map (ty_name, {mapfun, relmap}) = |
699
aa157e957655
added maps-printout and tuned some comments
Christian Urban <urbanc@in.tum.de>
parents:
675
diff
changeset
|
125 |
Pretty.block (Library.separate (Pretty.brk 2) |
778
54f186bb5e3e
added "Highest Priority" category; and tuned slightly code
Christian Urban <urbanc@in.tum.de>
parents:
777
diff
changeset
|
126 |
(map Pretty.str |
54f186bb5e3e
added "Highest Priority" category; and tuned slightly code
Christian Urban <urbanc@in.tum.de>
parents:
777
diff
changeset
|
127 |
["type:", ty_name, |
784
da75568e7f12
renamed some fields in the info records
Christian Urban <urbanc@in.tum.de>
parents:
778
diff
changeset
|
128 |
"map:", mapfun, |
da75568e7f12
renamed some fields in the info records
Christian Urban <urbanc@in.tum.de>
parents:
778
diff
changeset
|
129 |
"relation map:", relmap])) |
699
aa157e957655
added maps-printout and tuned some comments
Christian Urban <urbanc@in.tum.de>
parents:
675
diff
changeset
|
130 |
in |
aa157e957655
added maps-printout and tuned some comments
Christian Urban <urbanc@in.tum.de>
parents:
675
diff
changeset
|
131 |
MapsData.get (ProofContext.theory_of ctxt) |
aa157e957655
added maps-printout and tuned some comments
Christian Urban <urbanc@in.tum.de>
parents:
675
diff
changeset
|
132 |
|> Symtab.dest |
aa157e957655
added maps-printout and tuned some comments
Christian Urban <urbanc@in.tum.de>
parents:
675
diff
changeset
|
133 |
|> map (prt_map) |
786
d6407afb913c
used Local_Theory.declaration for storing quotdata
Christian Urban <urbanc@in.tum.de>
parents:
784
diff
changeset
|
134 |
|> Pretty.big_list "maps for type constructors:" |
699
aa157e957655
added maps-printout and tuned some comments
Christian Urban <urbanc@in.tum.de>
parents:
675
diff
changeset
|
135 |
|> Pretty.writeln |
aa157e957655
added maps-printout and tuned some comments
Christian Urban <urbanc@in.tum.de>
parents:
675
diff
changeset
|
136 |
end |
aa157e957655
added maps-printout and tuned some comments
Christian Urban <urbanc@in.tum.de>
parents:
675
diff
changeset
|
137 |
|
778
54f186bb5e3e
added "Highest Priority" category; and tuned slightly code
Christian Urban <urbanc@in.tum.de>
parents:
777
diff
changeset
|
138 |
|
329 | 139 |
(* info about quotient types *) |
786
d6407afb913c
used Local_Theory.declaration for storing quotdata
Christian Urban <urbanc@in.tum.de>
parents:
784
diff
changeset
|
140 |
type quotdata_info = {qtyp: typ, rtyp: typ, equiv_rel: term, equiv_thm: thm} |
264
d0581fbc096c
split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
141 |
|
306
e7279efbe3dd
updated to new Theory_Data and to new Isabelle
Christian Urban <urbanc@in.tum.de>
parents:
268
diff
changeset
|
142 |
structure QuotData = Theory_Data |
786
d6407afb913c
used Local_Theory.declaration for storing quotdata
Christian Urban <urbanc@in.tum.de>
parents:
784
diff
changeset
|
143 |
(type T = quotdata_info Symtab.table |
311
77fc6f3c0343
changed the quotdata to be a symtab table (needs fixing)
Christian Urban <urbanc@in.tum.de>
parents:
310
diff
changeset
|
144 |
val empty = Symtab.empty |
264
d0581fbc096c
split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
145 |
val extend = I |
311
77fc6f3c0343
changed the quotdata to be a symtab table (needs fixing)
Christian Urban <urbanc@in.tum.de>
parents:
310
diff
changeset
|
146 |
val merge = Symtab.merge (K true)) |
264
d0581fbc096c
split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
147 |
|
799
0755f8fd56b3
renamed transfer to transform (Markus)
Christian Urban <urbanc@in.tum.de>
parents:
798
diff
changeset
|
148 |
fun transform_quotdata phi {qtyp, rtyp, equiv_rel, equiv_thm} = |
786
d6407afb913c
used Local_Theory.declaration for storing quotdata
Christian Urban <urbanc@in.tum.de>
parents:
784
diff
changeset
|
149 |
{qtyp = Morphism.typ phi qtyp, |
d6407afb913c
used Local_Theory.declaration for storing quotdata
Christian Urban <urbanc@in.tum.de>
parents:
784
diff
changeset
|
150 |
rtyp = Morphism.typ phi rtyp, |
d6407afb913c
used Local_Theory.declaration for storing quotdata
Christian Urban <urbanc@in.tum.de>
parents:
784
diff
changeset
|
151 |
equiv_rel = Morphism.term phi equiv_rel, |
d6407afb913c
used Local_Theory.declaration for storing quotdata
Christian Urban <urbanc@in.tum.de>
parents:
784
diff
changeset
|
152 |
equiv_thm = Morphism.thm phi equiv_thm} |
d6407afb913c
used Local_Theory.declaration for storing quotdata
Christian Urban <urbanc@in.tum.de>
parents:
784
diff
changeset
|
153 |
|
d6407afb913c
used Local_Theory.declaration for storing quotdata
Christian Urban <urbanc@in.tum.de>
parents:
784
diff
changeset
|
154 |
fun quotdata_lookup thy str = |
d6407afb913c
used Local_Theory.declaration for storing quotdata
Christian Urban <urbanc@in.tum.de>
parents:
784
diff
changeset
|
155 |
case Symtab.lookup (QuotData.get thy) str of |
784
da75568e7f12
renamed some fields in the info records
Christian Urban <urbanc@in.tum.de>
parents:
778
diff
changeset
|
156 |
SOME qinfo => qinfo |
da75568e7f12
renamed some fields in the info records
Christian Urban <urbanc@in.tum.de>
parents:
778
diff
changeset
|
157 |
| NONE => raise NotFound |
320
7d3d86beacd6
started regularize of rtrm/qtrm version; looks quite promising
Christian Urban <urbanc@in.tum.de>
parents:
318
diff
changeset
|
158 |
|
786
d6407afb913c
used Local_Theory.declaration for storing quotdata
Christian Urban <urbanc@in.tum.de>
parents:
784
diff
changeset
|
159 |
fun quotdata_update_thy str qinfo = QuotData.map (Symtab.update (str, qinfo)) |
d6407afb913c
used Local_Theory.declaration for storing quotdata
Christian Urban <urbanc@in.tum.de>
parents:
784
diff
changeset
|
160 |
fun quotdata_update_gen str qinfo = Context.mapping (quotdata_update_thy str qinfo) I |
264
d0581fbc096c
split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
161 |
|
835
c4fa87dd0208
Fix for testing matching constants in regularize.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
805
diff
changeset
|
162 |
fun quotdata_lookup_type thy qty = |
c4fa87dd0208
Fix for testing matching constants in regularize.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
805
diff
changeset
|
163 |
let |
c4fa87dd0208
Fix for testing matching constants in regularize.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
805
diff
changeset
|
164 |
val smt = Symtab.dest (QuotData.get thy); |
c4fa87dd0208
Fix for testing matching constants in regularize.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
805
diff
changeset
|
165 |
fun matches (_, x) = Sign.typ_instance thy (qty, (#qtyp x)) |
c4fa87dd0208
Fix for testing matching constants in regularize.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
805
diff
changeset
|
166 |
in |
c4fa87dd0208
Fix for testing matching constants in regularize.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
805
diff
changeset
|
167 |
case (find_first matches smt) of |
c4fa87dd0208
Fix for testing matching constants in regularize.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
805
diff
changeset
|
168 |
SOME (_, x) => x |
c4fa87dd0208
Fix for testing matching constants in regularize.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
805
diff
changeset
|
169 |
| _ => raise NotFound |
c4fa87dd0208
Fix for testing matching constants in regularize.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
805
diff
changeset
|
170 |
end |
460
3f8c7183ddac
added facilities to get all stored quotient data (equiv thms etc)
Christian Urban <urbanc@in.tum.de>
parents:
450
diff
changeset
|
171 |
|
310
fec6301a1989
added a container for quotient constants (does not work yet though)
Christian Urban <urbanc@in.tum.de>
parents:
306
diff
changeset
|
172 |
fun print_quotinfo ctxt = |
264
d0581fbc096c
split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
173 |
let |
784
da75568e7f12
renamed some fields in the info records
Christian Urban <urbanc@in.tum.de>
parents:
778
diff
changeset
|
174 |
fun prt_quot {qtyp, rtyp, equiv_rel, equiv_thm} = |
264
d0581fbc096c
split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
175 |
Pretty.block (Library.separate (Pretty.brk 2) |
324 | 176 |
[Pretty.str "quotient type:", |
264
d0581fbc096c
split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
177 |
Syntax.pretty_typ ctxt qtyp, |
324 | 178 |
Pretty.str "raw type:", |
264
d0581fbc096c
split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
179 |
Syntax.pretty_typ ctxt rtyp, |
324 | 180 |
Pretty.str "relation:", |
784
da75568e7f12
renamed some fields in the info records
Christian Urban <urbanc@in.tum.de>
parents:
778
diff
changeset
|
181 |
Syntax.pretty_term ctxt equiv_rel, |
324 | 182 |
Pretty.str "equiv. thm:", |
264
d0581fbc096c
split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
183 |
Syntax.pretty_term ctxt (prop_of equiv_thm)]) |
d0581fbc096c
split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
184 |
in |
d0581fbc096c
split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
185 |
QuotData.get (ProofContext.theory_of ctxt) |
311
77fc6f3c0343
changed the quotdata to be a symtab table (needs fixing)
Christian Urban <urbanc@in.tum.de>
parents:
310
diff
changeset
|
186 |
|> Symtab.dest |
77fc6f3c0343
changed the quotdata to be a symtab table (needs fixing)
Christian Urban <urbanc@in.tum.de>
parents:
310
diff
changeset
|
187 |
|> map (prt_quot o snd) |
264
d0581fbc096c
split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
188 |
|> Pretty.big_list "quotients:" |
d0581fbc096c
split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
189 |
|> Pretty.writeln |
d0581fbc096c
split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
190 |
end |
d0581fbc096c
split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
191 |
|
268
4d58c02289ca
simplified the quotient_def code; type of the defined constant must now be given; for-part eliminated
Christian Urban <urbanc@in.tum.de>
parents:
264
diff
changeset
|
192 |
|
450
2dc708ddb93a
introduced a global list of respectfulness lemmas; the attribute is [quot_rsp]
Christian Urban <urbanc@in.tum.de>
parents:
406
diff
changeset
|
193 |
(* info about quotient constants *) |
496
8f1bf5266ebc
Added the definition to quotient constant data.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
460
diff
changeset
|
194 |
type qconsts_info = {qconst: term, rconst: term, def: thm} |
310
fec6301a1989
added a container for quotient constants (does not work yet though)
Christian Urban <urbanc@in.tum.de>
parents:
306
diff
changeset
|
195 |
|
fec6301a1989
added a container for quotient constants (does not work yet though)
Christian Urban <urbanc@in.tum.de>
parents:
306
diff
changeset
|
196 |
structure QConstsData = Theory_Data |
fec6301a1989
added a container for quotient constants (does not work yet though)
Christian Urban <urbanc@in.tum.de>
parents:
306
diff
changeset
|
197 |
(type T = qconsts_info Symtab.table |
fec6301a1989
added a container for quotient constants (does not work yet though)
Christian Urban <urbanc@in.tum.de>
parents:
306
diff
changeset
|
198 |
val empty = Symtab.empty |
fec6301a1989
added a container for quotient constants (does not work yet though)
Christian Urban <urbanc@in.tum.de>
parents:
306
diff
changeset
|
199 |
val extend = I |
fec6301a1989
added a container for quotient constants (does not work yet though)
Christian Urban <urbanc@in.tum.de>
parents:
306
diff
changeset
|
200 |
val merge = Symtab.merge (K true)) |
fec6301a1989
added a container for quotient constants (does not work yet though)
Christian Urban <urbanc@in.tum.de>
parents:
306
diff
changeset
|
201 |
|
799
0755f8fd56b3
renamed transfer to transform (Markus)
Christian Urban <urbanc@in.tum.de>
parents:
798
diff
changeset
|
202 |
fun transform_qconsts phi {qconst, rconst, def} = |
318
746b17e1d6d8
fixed the storage of qconst definitions
Christian Urban <urbanc@in.tum.de>
parents:
314
diff
changeset
|
203 |
{qconst = Morphism.term phi qconst, |
496
8f1bf5266ebc
Added the definition to quotient constant data.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
460
diff
changeset
|
204 |
rconst = Morphism.term phi rconst, |
8f1bf5266ebc
Added the definition to quotient constant data.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
460
diff
changeset
|
205 |
def = Morphism.thm phi def} |
318
746b17e1d6d8
fixed the storage of qconst definitions
Christian Urban <urbanc@in.tum.de>
parents:
314
diff
changeset
|
206 |
|
786
d6407afb913c
used Local_Theory.declaration for storing quotdata
Christian Urban <urbanc@in.tum.de>
parents:
784
diff
changeset
|
207 |
fun qconsts_update_thy str qcinfo = QConstsData.map (Symtab.update (str, qcinfo)) |
d6407afb913c
used Local_Theory.declaration for storing quotdata
Christian Urban <urbanc@in.tum.de>
parents:
784
diff
changeset
|
208 |
fun qconsts_update_gen str qcinfo = Context.mapping (qconsts_update_thy str qcinfo) I |
310
fec6301a1989
added a container for quotient constants (does not work yet though)
Christian Urban <urbanc@in.tum.de>
parents:
306
diff
changeset
|
209 |
|
497
b663bc007d00
Added qoutient_consts dest for getting all the constant definitions in the cleaning step.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
496
diff
changeset
|
210 |
fun qconsts_dest thy = |
663
0dd10a900cae
Different syntax for definitions that allows overloading and retrieving of definitions by matching whole constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
643
diff
changeset
|
211 |
map snd (Symtab.dest (QConstsData.get thy)) |
0dd10a900cae
Different syntax for definitions that allows overloading and retrieving of definitions by matching whole constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
643
diff
changeset
|
212 |
|
751 | 213 |
(* FIXME / TODO : better implementation of the lookup datastructure *) |
214 |
(* for example symtabs to alist; or tables with string type key *) |
|
663
0dd10a900cae
Different syntax for definitions that allows overloading and retrieving of definitions by matching whole constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
643
diff
changeset
|
215 |
fun qconsts_lookup thy t = |
0dd10a900cae
Different syntax for definitions that allows overloading and retrieving of definitions by matching whole constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
643
diff
changeset
|
216 |
let |
0dd10a900cae
Different syntax for definitions that allows overloading and retrieving of definitions by matching whole constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
643
diff
changeset
|
217 |
val smt = Symtab.dest (QConstsData.get thy); |
0dd10a900cae
Different syntax for definitions that allows overloading and retrieving of definitions by matching whole constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
643
diff
changeset
|
218 |
val (name, qty) = dest_Const t |
0dd10a900cae
Different syntax for definitions that allows overloading and retrieving of definitions by matching whole constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
643
diff
changeset
|
219 |
fun matches (_, x) = |
0dd10a900cae
Different syntax for definitions that allows overloading and retrieving of definitions by matching whole constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
643
diff
changeset
|
220 |
let |
0dd10a900cae
Different syntax for definitions that allows overloading and retrieving of definitions by matching whole constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
643
diff
changeset
|
221 |
val (name', qty') = dest_Const (#qconst x); |
0dd10a900cae
Different syntax for definitions that allows overloading and retrieving of definitions by matching whole constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
643
diff
changeset
|
222 |
in |
0dd10a900cae
Different syntax for definitions that allows overloading and retrieving of definitions by matching whole constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
643
diff
changeset
|
223 |
name = name' andalso Sign.typ_instance thy (qty, qty') |
0dd10a900cae
Different syntax for definitions that allows overloading and retrieving of definitions by matching whole constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
643
diff
changeset
|
224 |
end |
0dd10a900cae
Different syntax for definitions that allows overloading and retrieving of definitions by matching whole constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
643
diff
changeset
|
225 |
in |
0dd10a900cae
Different syntax for definitions that allows overloading and retrieving of definitions by matching whole constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
643
diff
changeset
|
226 |
case (find_first matches smt) of |
0dd10a900cae
Different syntax for definitions that allows overloading and retrieving of definitions by matching whole constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
643
diff
changeset
|
227 |
SOME (_, x) => x |
0dd10a900cae
Different syntax for definitions that allows overloading and retrieving of definitions by matching whole constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
643
diff
changeset
|
228 |
| _ => raise NotFound |
0dd10a900cae
Different syntax for definitions that allows overloading and retrieving of definitions by matching whole constants.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
643
diff
changeset
|
229 |
end |
497
b663bc007d00
Added qoutient_consts dest for getting all the constant definitions in the cleaning step.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
496
diff
changeset
|
230 |
|
310
fec6301a1989
added a container for quotient constants (does not work yet though)
Christian Urban <urbanc@in.tum.de>
parents:
306
diff
changeset
|
231 |
fun print_qconstinfo ctxt = |
fec6301a1989
added a container for quotient constants (does not work yet though)
Christian Urban <urbanc@in.tum.de>
parents:
306
diff
changeset
|
232 |
let |
496
8f1bf5266ebc
Added the definition to quotient constant data.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
460
diff
changeset
|
233 |
fun prt_qconst {qconst, rconst, def} = |
318
746b17e1d6d8
fixed the storage of qconst definitions
Christian Urban <urbanc@in.tum.de>
parents:
314
diff
changeset
|
234 |
Pretty.block (separate (Pretty.brk 1) |
310
fec6301a1989
added a container for quotient constants (does not work yet though)
Christian Urban <urbanc@in.tum.de>
parents:
306
diff
changeset
|
235 |
[Syntax.pretty_term ctxt qconst, |
318
746b17e1d6d8
fixed the storage of qconst definitions
Christian Urban <urbanc@in.tum.de>
parents:
314
diff
changeset
|
236 |
Pretty.str ":=", |
760
c1989de100b4
various tunings; map_lookup now raises an exception; addition to FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
759
diff
changeset
|
237 |
Syntax.pretty_term ctxt rconst, |
c1989de100b4
various tunings; map_lookup now raises an exception; addition to FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
759
diff
changeset
|
238 |
Pretty.str "as", |
c1989de100b4
various tunings; map_lookup now raises an exception; addition to FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
759
diff
changeset
|
239 |
Syntax.pretty_term ctxt (prop_of def)]) |
310
fec6301a1989
added a container for quotient constants (does not work yet though)
Christian Urban <urbanc@in.tum.de>
parents:
306
diff
changeset
|
240 |
in |
fec6301a1989
added a container for quotient constants (does not work yet though)
Christian Urban <urbanc@in.tum.de>
parents:
306
diff
changeset
|
241 |
QConstsData.get (ProofContext.theory_of ctxt) |
fec6301a1989
added a container for quotient constants (does not work yet though)
Christian Urban <urbanc@in.tum.de>
parents:
306
diff
changeset
|
242 |
|> Symtab.dest |
fec6301a1989
added a container for quotient constants (does not work yet though)
Christian Urban <urbanc@in.tum.de>
parents:
306
diff
changeset
|
243 |
|> map (prt_qconst o snd) |
fec6301a1989
added a container for quotient constants (does not work yet though)
Christian Urban <urbanc@in.tum.de>
parents:
306
diff
changeset
|
244 |
|> Pretty.big_list "quotient constants:" |
fec6301a1989
added a container for quotient constants (does not work yet though)
Christian Urban <urbanc@in.tum.de>
parents:
306
diff
changeset
|
245 |
|> Pretty.writeln |
fec6301a1989
added a container for quotient constants (does not work yet though)
Christian Urban <urbanc@in.tum.de>
parents:
306
diff
changeset
|
246 |
end |
fec6301a1989
added a container for quotient constants (does not work yet though)
Christian Urban <urbanc@in.tum.de>
parents:
306
diff
changeset
|
247 |
|
614
51a4208162ed
added a thm list for ids
Christian Urban <urbanc@in.tum.de>
parents:
613
diff
changeset
|
248 |
(* FIXME/TODO: check the various lemmas conform *) |
51a4208162ed
added a thm list for ids
Christian Urban <urbanc@in.tum.de>
parents:
613
diff
changeset
|
249 |
(* with the required shape *) |
51a4208162ed
added a thm list for ids
Christian Urban <urbanc@in.tum.de>
parents:
613
diff
changeset
|
250 |
|
582
a082e2d138ab
added a theorem list for equivalence theorems
Christian Urban <urbanc@in.tum.de>
parents:
549
diff
changeset
|
251 |
(* equivalence relation theorems *) |
a082e2d138ab
added a theorem list for equivalence theorems
Christian Urban <urbanc@in.tum.de>
parents:
549
diff
changeset
|
252 |
structure EquivRules = Named_Thms |
636
520a4084d064
changed names of attributes
Christian Urban <urbanc@in.tum.de>
parents:
614
diff
changeset
|
253 |
(val name = "quot_equiv" |
582
a082e2d138ab
added a theorem list for equivalence theorems
Christian Urban <urbanc@in.tum.de>
parents:
549
diff
changeset
|
254 |
val description = "Equivalence relation theorems.") |
a082e2d138ab
added a theorem list for equivalence theorems
Christian Urban <urbanc@in.tum.de>
parents:
549
diff
changeset
|
255 |
|
a082e2d138ab
added a theorem list for equivalence theorems
Christian Urban <urbanc@in.tum.de>
parents:
549
diff
changeset
|
256 |
val equiv_rules_get = EquivRules.get |
a082e2d138ab
added a theorem list for equivalence theorems
Christian Urban <urbanc@in.tum.de>
parents:
549
diff
changeset
|
257 |
val equiv_rules_add = EquivRules.add |
a082e2d138ab
added a theorem list for equivalence theorems
Christian Urban <urbanc@in.tum.de>
parents:
549
diff
changeset
|
258 |
|
a082e2d138ab
added a theorem list for equivalence theorems
Christian Urban <urbanc@in.tum.de>
parents:
549
diff
changeset
|
259 |
(* respectfulness theorems *) |
798 | 260 |
structure RspRules = Filtered_Named_Thms |
636
520a4084d064
changed names of attributes
Christian Urban <urbanc@in.tum.de>
parents:
614
diff
changeset
|
261 |
(val name = "quot_respect" |
797
35436401f00d
added a functor that allows checking what is added to the theorem lists
Christian Urban <urbanc@in.tum.de>
parents:
792
diff
changeset
|
262 |
val description = "Respectfulness theorems." |
798 | 263 |
val filter = I) |
450
2dc708ddb93a
introduced a global list of respectfulness lemmas; the attribute is [quot_rsp]
Christian Urban <urbanc@in.tum.de>
parents:
406
diff
changeset
|
264 |
|
2dc708ddb93a
introduced a global list of respectfulness lemmas; the attribute is [quot_rsp]
Christian Urban <urbanc@in.tum.de>
parents:
406
diff
changeset
|
265 |
val rsp_rules_get = RspRules.get |
2dc708ddb93a
introduced a global list of respectfulness lemmas; the attribute is [quot_rsp]
Christian Urban <urbanc@in.tum.de>
parents:
406
diff
changeset
|
266 |
|
636
520a4084d064
changed names of attributes
Christian Urban <urbanc@in.tum.de>
parents:
614
diff
changeset
|
267 |
(* preservation theorems *) |
520a4084d064
changed names of attributes
Christian Urban <urbanc@in.tum.de>
parents:
614
diff
changeset
|
268 |
structure PrsRules = Named_Thms |
520a4084d064
changed names of attributes
Christian Urban <urbanc@in.tum.de>
parents:
614
diff
changeset
|
269 |
(val name = "quot_preserve" |
777
2f72662d21f3
added a print_maps command; updated the keyword file accordingly
Christian Urban <urbanc@in.tum.de>
parents:
762
diff
changeset
|
270 |
val description = "Preservation theorems.") |
636
520a4084d064
changed names of attributes
Christian Urban <urbanc@in.tum.de>
parents:
614
diff
changeset
|
271 |
|
520a4084d064
changed names of attributes
Christian Urban <urbanc@in.tum.de>
parents:
614
diff
changeset
|
272 |
val prs_rules_get = PrsRules.get |
520a4084d064
changed names of attributes
Christian Urban <urbanc@in.tum.de>
parents:
614
diff
changeset
|
273 |
|
759 | 274 |
(* id simplification theorems *) |
614
51a4208162ed
added a thm list for ids
Christian Urban <urbanc@in.tum.de>
parents:
613
diff
changeset
|
275 |
structure IdSimps = Named_Thms |
51a4208162ed
added a thm list for ids
Christian Urban <urbanc@in.tum.de>
parents:
613
diff
changeset
|
276 |
(val name = "id_simps" |
51a4208162ed
added a thm list for ids
Christian Urban <urbanc@in.tum.de>
parents:
613
diff
changeset
|
277 |
val description = "Identity simp rules for maps.") |
51a4208162ed
added a thm list for ids
Christian Urban <urbanc@in.tum.de>
parents:
613
diff
changeset
|
278 |
|
51a4208162ed
added a thm list for ids
Christian Urban <urbanc@in.tum.de>
parents:
613
diff
changeset
|
279 |
val id_simps_get = IdSimps.get |
51a4208162ed
added a thm list for ids
Christian Urban <urbanc@in.tum.de>
parents:
613
diff
changeset
|
280 |
|
582
a082e2d138ab
added a theorem list for equivalence theorems
Christian Urban <urbanc@in.tum.de>
parents:
549
diff
changeset
|
281 |
(* quotient theorems *) |
503
d2c9a72e52e0
first version of internalised quotient theorems; added FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
460
diff
changeset
|
282 |
structure QuotientRules = Named_Thms |
636
520a4084d064
changed names of attributes
Christian Urban <urbanc@in.tum.de>
parents:
614
diff
changeset
|
283 |
(val name = "quot_thm" |
503
d2c9a72e52e0
first version of internalised quotient theorems; added FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
460
diff
changeset
|
284 |
val description = "Quotient theorems.") |
d2c9a72e52e0
first version of internalised quotient theorems; added FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
460
diff
changeset
|
285 |
|
d2c9a72e52e0
first version of internalised quotient theorems; added FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
460
diff
changeset
|
286 |
val quotient_rules_get = QuotientRules.get |
582
a082e2d138ab
added a theorem list for equivalence theorems
Christian Urban <urbanc@in.tum.de>
parents:
549
diff
changeset
|
287 |
val quotient_rules_add = QuotientRules.add |
503
d2c9a72e52e0
first version of internalised quotient theorems; added FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
460
diff
changeset
|
288 |
|
d2c9a72e52e0
first version of internalised quotient theorems; added FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
460
diff
changeset
|
289 |
(* setup of the theorem lists *) |
778
54f186bb5e3e
added "Highest Priority" category; and tuned slightly code
Christian Urban <urbanc@in.tum.de>
parents:
777
diff
changeset
|
290 |
|
503
d2c9a72e52e0
first version of internalised quotient theorems; added FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
460
diff
changeset
|
291 |
val _ = Context.>> (Context.map_theory |
582
a082e2d138ab
added a theorem list for equivalence theorems
Christian Urban <urbanc@in.tum.de>
parents:
549
diff
changeset
|
292 |
(EquivRules.setup #> |
a082e2d138ab
added a theorem list for equivalence theorems
Christian Urban <urbanc@in.tum.de>
parents:
549
diff
changeset
|
293 |
RspRules.setup #> |
643
cd4226736c37
properly set up the prs_rules
Christian Urban <urbanc@in.tum.de>
parents:
636
diff
changeset
|
294 |
PrsRules.setup #> |
614
51a4208162ed
added a thm list for ids
Christian Urban <urbanc@in.tum.de>
parents:
613
diff
changeset
|
295 |
IdSimps.setup #> |
503
d2c9a72e52e0
first version of internalised quotient theorems; added FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
460
diff
changeset
|
296 |
QuotientRules.setup)) |
450
2dc708ddb93a
introduced a global list of respectfulness lemmas; the attribute is [quot_rsp]
Christian Urban <urbanc@in.tum.de>
parents:
406
diff
changeset
|
297 |
|
778
54f186bb5e3e
added "Highest Priority" category; and tuned slightly code
Christian Urban <urbanc@in.tum.de>
parents:
777
diff
changeset
|
298 |
(* setup of the printing commands *) |
54f186bb5e3e
added "Highest Priority" category; and tuned slightly code
Christian Urban <urbanc@in.tum.de>
parents:
777
diff
changeset
|
299 |
|
54f186bb5e3e
added "Highest Priority" category; and tuned slightly code
Christian Urban <urbanc@in.tum.de>
parents:
777
diff
changeset
|
300 |
fun improper_command (pp_fn, cmd_name, descr_str) = |
54f186bb5e3e
added "Highest Priority" category; and tuned slightly code
Christian Urban <urbanc@in.tum.de>
parents:
777
diff
changeset
|
301 |
OuterSyntax.improper_command cmd_name descr_str |
54f186bb5e3e
added "Highest Priority" category; and tuned slightly code
Christian Urban <urbanc@in.tum.de>
parents:
777
diff
changeset
|
302 |
OuterKeyword.diag (Scan.succeed (Toplevel.keep (pp_fn o Toplevel.context_of))) |
54f186bb5e3e
added "Highest Priority" category; and tuned slightly code
Christian Urban <urbanc@in.tum.de>
parents:
777
diff
changeset
|
303 |
|
54f186bb5e3e
added "Highest Priority" category; and tuned slightly code
Christian Urban <urbanc@in.tum.de>
parents:
777
diff
changeset
|
304 |
val _ = map improper_command |
54f186bb5e3e
added "Highest Priority" category; and tuned slightly code
Christian Urban <urbanc@in.tum.de>
parents:
777
diff
changeset
|
305 |
[(print_mapsinfo, "print_maps", "prints out all map functions"), |
54f186bb5e3e
added "Highest Priority" category; and tuned slightly code
Christian Urban <urbanc@in.tum.de>
parents:
777
diff
changeset
|
306 |
(print_quotinfo, "print_quotients", "prints out all quotients"), |
54f186bb5e3e
added "Highest Priority" category; and tuned slightly code
Christian Urban <urbanc@in.tum.de>
parents:
777
diff
changeset
|
307 |
(print_qconstinfo, "print_quotconsts", "prints out all quotient constants")] |
54f186bb5e3e
added "Highest Priority" category; and tuned slightly code
Christian Urban <urbanc@in.tum.de>
parents:
777
diff
changeset
|
308 |
|
54f186bb5e3e
added "Highest Priority" category; and tuned slightly code
Christian Urban <urbanc@in.tum.de>
parents:
777
diff
changeset
|
309 |
|
264
d0581fbc096c
split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
310 |
end; (* structure *) |
d0581fbc096c
split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
311 |