author | Christian Urban <urbanc@in.tum.de> |
Sat, 02 Jul 2011 00:27:47 +0100 | |
changeset 2931 | aaef9dec5e1d |
parent 2927 | 116f9ba4f59f |
child 2957 | 01ff621599bc |
permissions | -rw-r--r-- |
2890 | 1 |
(* Author: Christian Urban |
2 |
||
3 |
data about nominal datatypes |
|
4 |
*) |
|
5 |
||
6 |
signature NOMINAL_DT_DATA = |
|
7 |
sig |
|
8 |
type info = |
|
9 |
{inject : thm list, |
|
10 |
distinct : thm list, |
|
11 |
strong_inducts : thm list, |
|
12 |
strong_exhaust : thm list} |
|
13 |
||
14 |
val get_all_info: Proof.context -> (string * info) list |
|
15 |
val get_info: Proof.context -> string -> info option |
|
16 |
val the_info: Proof.context -> string -> info |
|
17 |
val register_info: (string * info) -> Context.generic -> Context.generic |
|
18 |
val mk_infos: string list -> thm list -> thm list -> thm list -> thm list -> (string * info) list |
|
2927
116f9ba4f59f
combined distributed data for alpha in alpha_result (partially done)
Christian Urban <urbanc@in.tum.de>
parents:
2890
diff
changeset
|
19 |
|
116f9ba4f59f
combined distributed data for alpha in alpha_result (partially done)
Christian Urban <urbanc@in.tum.de>
parents:
2890
diff
changeset
|
20 |
datatype alpha_result = AlphaResult of |
116f9ba4f59f
combined distributed data for alpha in alpha_result (partially done)
Christian Urban <urbanc@in.tum.de>
parents:
2890
diff
changeset
|
21 |
{alpha_names : string list, |
116f9ba4f59f
combined distributed data for alpha in alpha_result (partially done)
Christian Urban <urbanc@in.tum.de>
parents:
2890
diff
changeset
|
22 |
alpha_trms : term list, |
116f9ba4f59f
combined distributed data for alpha in alpha_result (partially done)
Christian Urban <urbanc@in.tum.de>
parents:
2890
diff
changeset
|
23 |
alpha_tys : typ list, |
116f9ba4f59f
combined distributed data for alpha in alpha_result (partially done)
Christian Urban <urbanc@in.tum.de>
parents:
2890
diff
changeset
|
24 |
alpha_bn_names : string list, |
116f9ba4f59f
combined distributed data for alpha in alpha_result (partially done)
Christian Urban <urbanc@in.tum.de>
parents:
2890
diff
changeset
|
25 |
alpha_bn_trms : term list, |
116f9ba4f59f
combined distributed data for alpha in alpha_result (partially done)
Christian Urban <urbanc@in.tum.de>
parents:
2890
diff
changeset
|
26 |
alpha_bn_tys : typ list, |
116f9ba4f59f
combined distributed data for alpha in alpha_result (partially done)
Christian Urban <urbanc@in.tum.de>
parents:
2890
diff
changeset
|
27 |
alpha_intros : thm list, |
116f9ba4f59f
combined distributed data for alpha in alpha_result (partially done)
Christian Urban <urbanc@in.tum.de>
parents:
2890
diff
changeset
|
28 |
alpha_cases : thm list, |
116f9ba4f59f
combined distributed data for alpha in alpha_result (partially done)
Christian Urban <urbanc@in.tum.de>
parents:
2890
diff
changeset
|
29 |
alpha_raw_induct : thm} |
116f9ba4f59f
combined distributed data for alpha in alpha_result (partially done)
Christian Urban <urbanc@in.tum.de>
parents:
2890
diff
changeset
|
30 |
|
2890 | 31 |
end |
32 |
||
33 |
structure Nominal_Dt_Data: NOMINAL_DT_DATA = |
|
34 |
struct |
|
35 |
||
2927
116f9ba4f59f
combined distributed data for alpha in alpha_result (partially done)
Christian Urban <urbanc@in.tum.de>
parents:
2890
diff
changeset
|
36 |
|
2890 | 37 |
(* information generated by nominal_datatype *) |
38 |
type info = |
|
39 |
{inject : thm list, |
|
40 |
distinct : thm list, |
|
41 |
strong_inducts : thm list, |
|
42 |
strong_exhaust : thm list} |
|
43 |
||
44 |
structure NominalData = Generic_Data |
|
45 |
(type T = info Symtab.table |
|
46 |
val empty = Symtab.empty |
|
47 |
val extend = I |
|
48 |
val merge = Symtab.merge (K true)) |
|
49 |
||
50 |
val get_all_info = Symtab.dest o NominalData.get o Context.Proof |
|
51 |
val get_info = Symtab.lookup o NominalData.get o Context.Proof |
|
52 |
val register_info = NominalData.map o Symtab.update |
|
53 |
||
54 |
fun the_info thy name = |
|
55 |
(case get_info thy name of |
|
56 |
SOME info => info |
|
57 |
| NONE => error ("Unknown nominal datatype " ^ quote name)) |
|
58 |
||
59 |
fun mk_infos ty_names inject distinct strong_inducts strong_exhaust = |
|
60 |
let |
|
61 |
fun aux ty_name = |
|
62 |
(ty_name, {inject = inject, |
|
63 |
distinct = distinct, |
|
64 |
strong_inducts = strong_inducts, |
|
65 |
strong_exhaust = strong_exhaust |
|
66 |
}) |
|
67 |
in |
|
68 |
map aux ty_names |
|
69 |
end |
|
70 |
||
2927
116f9ba4f59f
combined distributed data for alpha in alpha_result (partially done)
Christian Urban <urbanc@in.tum.de>
parents:
2890
diff
changeset
|
71 |
datatype alpha_result = AlphaResult of |
116f9ba4f59f
combined distributed data for alpha in alpha_result (partially done)
Christian Urban <urbanc@in.tum.de>
parents:
2890
diff
changeset
|
72 |
{alpha_names : string list, |
116f9ba4f59f
combined distributed data for alpha in alpha_result (partially done)
Christian Urban <urbanc@in.tum.de>
parents:
2890
diff
changeset
|
73 |
alpha_trms : term list, |
116f9ba4f59f
combined distributed data for alpha in alpha_result (partially done)
Christian Urban <urbanc@in.tum.de>
parents:
2890
diff
changeset
|
74 |
alpha_tys : typ list, |
116f9ba4f59f
combined distributed data for alpha in alpha_result (partially done)
Christian Urban <urbanc@in.tum.de>
parents:
2890
diff
changeset
|
75 |
alpha_bn_names : string list, |
116f9ba4f59f
combined distributed data for alpha in alpha_result (partially done)
Christian Urban <urbanc@in.tum.de>
parents:
2890
diff
changeset
|
76 |
alpha_bn_trms : term list, |
116f9ba4f59f
combined distributed data for alpha in alpha_result (partially done)
Christian Urban <urbanc@in.tum.de>
parents:
2890
diff
changeset
|
77 |
alpha_bn_tys : typ list, |
116f9ba4f59f
combined distributed data for alpha in alpha_result (partially done)
Christian Urban <urbanc@in.tum.de>
parents:
2890
diff
changeset
|
78 |
alpha_intros : thm list, |
116f9ba4f59f
combined distributed data for alpha in alpha_result (partially done)
Christian Urban <urbanc@in.tum.de>
parents:
2890
diff
changeset
|
79 |
alpha_cases : thm list, |
116f9ba4f59f
combined distributed data for alpha in alpha_result (partially done)
Christian Urban <urbanc@in.tum.de>
parents:
2890
diff
changeset
|
80 |
alpha_raw_induct : thm} |
116f9ba4f59f
combined distributed data for alpha in alpha_result (partially done)
Christian Urban <urbanc@in.tum.de>
parents:
2890
diff
changeset
|
81 |
|
2890 | 82 |
|
83 |
end |