author | Christian Urban <christian dot urban at kcl dot ac dot uk> |
Thu, 13 Mar 2014 09:21:31 +0000 | |
changeset 3229 | b52e8651591f |
parent 3228 | 040519ec99e9 |
child 3231 | 188826f1ccdb |
permissions | -rw-r--r-- |
2454
9ffee4eb1ae1
renamed NewParser to Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
2451
diff
changeset
|
1 |
theory Nominal2 |
2435
3772bb3bd7ce
cleaning of unused files and code
Christian Urban <urbanc@in.tum.de>
parents:
2434
diff
changeset
|
2 |
imports |
2943
09834ba7ce59
exported various FCB-lemmas to a separate file
Christian Urban <urbanc@in.tum.de>
parents:
2928
diff
changeset
|
3 |
Nominal2_Base Nominal2_Abs Nominal2_FCB |
3134
301b74fcd614
updated to new Isabelle (declared keywords)
Christian Urban <urbanc@in.tum.de>
parents:
3091
diff
changeset
|
4 |
keywords |
301b74fcd614
updated to new Isabelle (declared keywords)
Christian Urban <urbanc@in.tum.de>
parents:
3091
diff
changeset
|
5 |
"nominal_datatype" :: thy_decl and |
301b74fcd614
updated to new Isabelle (declared keywords)
Christian Urban <urbanc@in.tum.de>
parents:
3091
diff
changeset
|
6 |
"nominal_primrec" "nominal_inductive" :: thy_goal and |
301b74fcd614
updated to new Isabelle (declared keywords)
Christian Urban <urbanc@in.tum.de>
parents:
3091
diff
changeset
|
7 |
"avoids" "binds" |
1941 | 8 |
begin |
9 |
||
3201
3e6f4320669f
removed "use" - replaced by "ML_file"
Christian Urban <urbanc@in.tum.de>
parents:
3190
diff
changeset
|
10 |
ML_file "nominal_dt_data.ML" |
2885
1264f2a21ea9
some rudimentary infrastructure for storing data about nominal datatypes
Christian Urban <urbanc@in.tum.de>
parents:
2868
diff
changeset
|
11 |
ML {* open Nominal_Dt_Data *} |
1264f2a21ea9
some rudimentary infrastructure for storing data about nominal datatypes
Christian Urban <urbanc@in.tum.de>
parents:
2868
diff
changeset
|
12 |
|
3201
3e6f4320669f
removed "use" - replaced by "ML_file"
Christian Urban <urbanc@in.tum.de>
parents:
3190
diff
changeset
|
13 |
ML_file "nominal_dt_rawfuns.ML" |
2435
3772bb3bd7ce
cleaning of unused files and code
Christian Urban <urbanc@in.tum.de>
parents:
2434
diff
changeset
|
14 |
ML {* open Nominal_Dt_RawFuns *} |
3772bb3bd7ce
cleaning of unused files and code
Christian Urban <urbanc@in.tum.de>
parents:
2434
diff
changeset
|
15 |
|
3201
3e6f4320669f
removed "use" - replaced by "ML_file"
Christian Urban <urbanc@in.tum.de>
parents:
3190
diff
changeset
|
16 |
ML_file "nominal_dt_alpha.ML" |
2435
3772bb3bd7ce
cleaning of unused files and code
Christian Urban <urbanc@in.tum.de>
parents:
2434
diff
changeset
|
17 |
ML {* open Nominal_Dt_Alpha *} |
3772bb3bd7ce
cleaning of unused files and code
Christian Urban <urbanc@in.tum.de>
parents:
2434
diff
changeset
|
18 |
|
3201
3e6f4320669f
removed "use" - replaced by "ML_file"
Christian Urban <urbanc@in.tum.de>
parents:
3190
diff
changeset
|
19 |
ML_file "nominal_dt_quot.ML" |
2435
3772bb3bd7ce
cleaning of unused files and code
Christian Urban <urbanc@in.tum.de>
parents:
2434
diff
changeset
|
20 |
ML {* open Nominal_Dt_Quot *} |
3772bb3bd7ce
cleaning of unused files and code
Christian Urban <urbanc@in.tum.de>
parents:
2434
diff
changeset
|
21 |
|
2631
e73bd379e839
removed local fix for bug in induction_schema; added setup method for strong inductions
Christian Urban <urbanc@in.tum.de>
parents:
2630
diff
changeset
|
22 |
(*****************************************) |
e73bd379e839
removed local fix for bug in induction_schema; added setup method for strong inductions
Christian Urban <urbanc@in.tum.de>
parents:
2630
diff
changeset
|
23 |
(* setup for induction principles method *) |
3201
3e6f4320669f
removed "use" - replaced by "ML_file"
Christian Urban <urbanc@in.tum.de>
parents:
3190
diff
changeset
|
24 |
ML_file "nominal_induct.ML" |
2631
e73bd379e839
removed local fix for bug in induction_schema; added setup method for strong inductions
Christian Urban <urbanc@in.tum.de>
parents:
2630
diff
changeset
|
25 |
method_setup nominal_induct = |
e73bd379e839
removed local fix for bug in induction_schema; added setup method for strong inductions
Christian Urban <urbanc@in.tum.de>
parents:
2630
diff
changeset
|
26 |
{* NominalInduct.nominal_induct_method *} |
e73bd379e839
removed local fix for bug in induction_schema; added setup method for strong inductions
Christian Urban <urbanc@in.tum.de>
parents:
2630
diff
changeset
|
27 |
{* nominal induction *} |
2609
666ffc8a92a9
freshness theorem in strong exhausts; (temporarily includes a cheat_tac to make all tests go through)
Christian Urban <urbanc@in.tum.de>
parents:
2608
diff
changeset
|
28 |
|
2639
a8fc346deda3
exported the code into a separate file
Christian Urban <urbanc@in.tum.de>
parents:
2634
diff
changeset
|
29 |
(****************************************************) |
a8fc346deda3
exported the code into a separate file
Christian Urban <urbanc@in.tum.de>
parents:
2634
diff
changeset
|
30 |
(* inductive definition involving nominal datatypes *) |
3218
89158f401b07
updated to simplifier changes
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
3214
diff
changeset
|
31 |
ML_file "nominal_inductive.ML" |
2639
a8fc346deda3
exported the code into a separate file
Christian Urban <urbanc@in.tum.de>
parents:
2634
diff
changeset
|
32 |
|
a8fc346deda3
exported the code into a separate file
Christian Urban <urbanc@in.tum.de>
parents:
2634
diff
changeset
|
33 |
|
2665
16b5a67ee279
exported nominal function code to external file
Christian Urban <urbanc@in.tum.de>
parents:
2650
diff
changeset
|
34 |
(***************************************) |
16b5a67ee279
exported nominal function code to external file
Christian Urban <urbanc@in.tum.de>
parents:
2650
diff
changeset
|
35 |
(* forked code of the function package *) |
16b5a67ee279
exported nominal function code to external file
Christian Urban <urbanc@in.tum.de>
parents:
2650
diff
changeset
|
36 |
(* for defining nominal functions *) |
3201
3e6f4320669f
removed "use" - replaced by "ML_file"
Christian Urban <urbanc@in.tum.de>
parents:
3190
diff
changeset
|
37 |
ML_file "nominal_function_common.ML" |
3e6f4320669f
removed "use" - replaced by "ML_file"
Christian Urban <urbanc@in.tum.de>
parents:
3190
diff
changeset
|
38 |
ML_file "nominal_function_core.ML" |
3e6f4320669f
removed "use" - replaced by "ML_file"
Christian Urban <urbanc@in.tum.de>
parents:
3190
diff
changeset
|
39 |
ML_file "nominal_mutual.ML" |
3e6f4320669f
removed "use" - replaced by "ML_file"
Christian Urban <urbanc@in.tum.de>
parents:
3190
diff
changeset
|
40 |
ML_file "nominal_function.ML" |
3e6f4320669f
removed "use" - replaced by "ML_file"
Christian Urban <urbanc@in.tum.de>
parents:
3190
diff
changeset
|
41 |
ML_file "nominal_termination.ML" |
2665
16b5a67ee279
exported nominal function code to external file
Christian Urban <urbanc@in.tum.de>
parents:
2650
diff
changeset
|
42 |
|
2603
90779aefbf1a
first tests about exhaust
Christian Urban <urbanc@in.tum.de>
parents:
2602
diff
changeset
|
43 |
ML {* |
90779aefbf1a
first tests about exhaust
Christian Urban <urbanc@in.tum.de>
parents:
2602
diff
changeset
|
44 |
val eqvt_attr = Attrib.internal (K Nominal_ThmDecls.eqvt_add) |
90779aefbf1a
first tests about exhaust
Christian Urban <urbanc@in.tum.de>
parents:
2602
diff
changeset
|
45 |
val simp_attr = Attrib.internal (K Simplifier.simp_add) |
2787
1a6593bc494d
added eq_iff and distinct lemmas of nominal datatypes to the simplifier
Christian Urban <urbanc@in.tum.de>
parents:
2781
diff
changeset
|
46 |
val induct_attr = Attrib.internal (K Induct.induct_simp_add) |
2603
90779aefbf1a
first tests about exhaust
Christian Urban <urbanc@in.tum.de>
parents:
2602
diff
changeset
|
47 |
*} |
2288
3b83960f9544
new fv/fv_bn function (supp breaks now); exported raw perms and raw funs into separate ML-files
Christian Urban <urbanc@in.tum.de>
parents:
2146
diff
changeset
|
48 |
|
1941 | 49 |
section{* Interface for nominal_datatype *} |
50 |
||
51 |
ML {* |
|
52 |
fun get_cnstrs dts = |
|
3065
51ef8a3cb6ef
updated to lates changes in the datatype package
Christian Urban <urbanc@in.tum.de>
parents:
3063
diff
changeset
|
53 |
map snd dts |
1941 | 54 |
|
55 |
fun get_typed_cnstrs dts = |
|
3065
51ef8a3cb6ef
updated to lates changes in the datatype package
Christian Urban <urbanc@in.tum.de>
parents:
3063
diff
changeset
|
56 |
flat (map (fn ((bn, _, _), constrs) => |
1941 | 57 |
(map (fn (bn', _, _) => (Binding.name_of bn, Binding.name_of bn')) constrs)) dts) |
58 |
||
59 |
fun get_cnstr_strs dts = |
|
60 |
map (fn (bn, _, _) => Binding.name_of bn) (flat (get_cnstrs dts)) |
|
61 |
||
62 |
fun get_bn_fun_strs bn_funs = |
|
63 |
map (fn (bn_fun, _, _) => Binding.name_of bn_fun) bn_funs |
|
64 |
*} |
|
65 |
||
2106
409ecb7284dd
properly exported defined bn-functions
Christian Urban <urbanc@in.tum.de>
parents:
2105
diff
changeset
|
66 |
|
1944 | 67 |
text {* Infrastructure for adding "_raw" to types and terms *} |
68 |
||
1941 | 69 |
ML {* |
70 |
fun add_raw s = s ^ "_raw" |
|
71 |
fun add_raws ss = map add_raw ss |
|
72 |
fun raw_bind bn = Binding.suffix_name "_raw" bn |
|
73 |
||
74 |
fun replace_str ss s = |
|
75 |
case (AList.lookup (op=) ss s) of |
|
76 |
SOME s' => s' |
|
77 |
| NONE => s |
|
78 |
||
79 |
fun replace_typ ty_ss (Type (a, Ts)) = Type (replace_str ty_ss a, map (replace_typ ty_ss) Ts) |
|
80 |
| replace_typ ty_ss T = T |
|
81 |
||
82 |
fun raw_dts ty_ss dts = |
|
83 |
let |
|
2640
75d353e8e60e
made sure the raw datatypes and raw functions do not get any mixfix syntax
Christian Urban <urbanc@in.tum.de>
parents:
2639
diff
changeset
|
84 |
fun raw_dts_aux1 (bind, tys, _) = |
75d353e8e60e
made sure the raw datatypes and raw functions do not get any mixfix syntax
Christian Urban <urbanc@in.tum.de>
parents:
2639
diff
changeset
|
85 |
(raw_bind bind, map (replace_typ ty_ss) tys, NoSyn) |
1941 | 86 |
|
3065
51ef8a3cb6ef
updated to lates changes in the datatype package
Christian Urban <urbanc@in.tum.de>
parents:
3063
diff
changeset
|
87 |
fun raw_dts_aux2 ((bind, ty_args, _), constrs) = |
51ef8a3cb6ef
updated to lates changes in the datatype package
Christian Urban <urbanc@in.tum.de>
parents:
3063
diff
changeset
|
88 |
((raw_bind bind, ty_args, NoSyn), map raw_dts_aux1 constrs) |
1941 | 89 |
in |
90 |
map raw_dts_aux2 dts |
|
91 |
end |
|
92 |
||
93 |
fun replace_aterm trm_ss (Const (a, T)) = Const (replace_str trm_ss a, T) |
|
94 |
| replace_aterm trm_ss (Free (a, T)) = Free (replace_str trm_ss a, T) |
|
95 |
| replace_aterm trm_ss trm = trm |
|
96 |
||
97 |
fun replace_term trm_ss ty_ss trm = |
|
98 |
trm |> Term.map_aterms (replace_aterm trm_ss) |> map_types (replace_typ ty_ss) |
|
99 |
*} |
|
100 |
||
101 |
ML {* |
|
3061
cfc795473656
updated to Isabelle 6 Dec (thanks to Odrej Kuncar)
Christian Urban <urbanc@in.tum.de>
parents:
3045
diff
changeset
|
102 |
fun rawify_dts dts dts_env = raw_dts dts_env dts |
1941 | 103 |
*} |
104 |
||
105 |
ML {* |
|
106 |
fun rawify_bn_funs dts_env cnstrs_env bn_fun_env bn_funs bn_eqs = |
|
107 |
let |
|
2640
75d353e8e60e
made sure the raw datatypes and raw functions do not get any mixfix syntax
Christian Urban <urbanc@in.tum.de>
parents:
2639
diff
changeset
|
108 |
val bn_funs' = map (fn (bn, ty, _) => |
75d353e8e60e
made sure the raw datatypes and raw functions do not get any mixfix syntax
Christian Urban <urbanc@in.tum.de>
parents:
2639
diff
changeset
|
109 |
(raw_bind bn, SOME (replace_typ dts_env ty), NoSyn)) bn_funs |
1941 | 110 |
|
111 |
val bn_eqs' = map (fn (attr, trm) => |
|
112 |
(attr, replace_term (cnstrs_env @ bn_fun_env) dts_env trm)) bn_eqs |
|
113 |
in |
|
114 |
(bn_funs', bn_eqs') |
|
115 |
end |
|
116 |
*} |
|
117 |
||
118 |
ML {* |
|
119 |
fun rawify_bclauses dts_env cnstrs_env bn_fun_env bclauses = |
|
120 |
let |
|
121 |
fun rawify_bnds bnds = |
|
122 |
map (apfst (Option.map (replace_term (cnstrs_env @ bn_fun_env) dts_env))) bnds |
|
123 |
||
2288
3b83960f9544
new fv/fv_bn function (supp breaks now); exported raw perms and raw funs into separate ML-files
Christian Urban <urbanc@in.tum.de>
parents:
2146
diff
changeset
|
124 |
fun rawify_bclause (BC (mode, bnds, bdys)) = BC (mode, rawify_bnds bnds, bdys) |
1941 | 125 |
in |
2612 | 126 |
(map o map o map) rawify_bclause bclauses |
1941 | 127 |
end |
128 |
*} |
|
129 |
||
130 |
||
131 |
ML {* |
|
2885
1264f2a21ea9
some rudimentary infrastructure for storing data about nominal datatypes
Christian Urban <urbanc@in.tum.de>
parents:
2868
diff
changeset
|
132 |
(* definition of the raw datatype *) |
1264f2a21ea9
some rudimentary infrastructure for storing data about nominal datatypes
Christian Urban <urbanc@in.tum.de>
parents:
2868
diff
changeset
|
133 |
|
2957
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
134 |
fun define_raw_dts dts cnstr_names cnstr_tys bn_funs bn_eqs bclauses lthy = |
1941 | 135 |
let |
2431
331873ebc5cd
can now deal with type variables in nominal datatype definitions
Christian Urban <urbanc@in.tum.de>
parents:
2430
diff
changeset
|
136 |
val thy = Local_Theory.exit_global lthy |
1941 | 137 |
val thy_name = Context.theory_name thy |
138 |
||
3065
51ef8a3cb6ef
updated to lates changes in the datatype package
Christian Urban <urbanc@in.tum.de>
parents:
3063
diff
changeset
|
139 |
val dt_names = map (fn ((s, _, _), _) => Binding.name_of s) dts |
1941 | 140 |
val dt_full_names = map (Long_Name.qualify thy_name) dt_names |
141 |
val dt_full_names' = add_raws dt_full_names |
|
142 |
val dts_env = dt_full_names ~~ dt_full_names' |
|
143 |
||
2633
d1d09177ec89
added proper case names for all induct and exhaust theorems
Christian Urban <urbanc@in.tum.de>
parents:
2631
diff
changeset
|
144 |
val cnstr_full_names = map (Long_Name.qualify thy_name) cnstr_names |
d1d09177ec89
added proper case names for all induct and exhaust theorems
Christian Urban <urbanc@in.tum.de>
parents:
2631
diff
changeset
|
145 |
val cnstr_full_names' = map (fn (x, y) => Long_Name.qualify thy_name |
d1d09177ec89
added proper case names for all induct and exhaust theorems
Christian Urban <urbanc@in.tum.de>
parents:
2631
diff
changeset
|
146 |
(Long_Name.qualify (add_raw x) (add_raw y))) cnstr_tys |
d1d09177ec89
added proper case names for all induct and exhaust theorems
Christian Urban <urbanc@in.tum.de>
parents:
2631
diff
changeset
|
147 |
val cnstrs_env = cnstr_full_names ~~ cnstr_full_names' |
1941 | 148 |
|
149 |
val bn_fun_strs = get_bn_fun_strs bn_funs |
|
150 |
val bn_fun_strs' = add_raws bn_fun_strs |
|
151 |
val bn_fun_env = bn_fun_strs ~~ bn_fun_strs' |
|
152 |
val bn_fun_full_env = map (pairself (Long_Name.qualify thy_name)) |
|
153 |
(bn_fun_strs ~~ bn_fun_strs') |
|
154 |
||
3061
cfc795473656
updated to Isabelle 6 Dec (thanks to Odrej Kuncar)
Christian Urban <urbanc@in.tum.de>
parents:
3045
diff
changeset
|
155 |
val raw_dts = rawify_dts dts dts_env |
1941 | 156 |
val (raw_bn_funs, raw_bn_eqs) = rawify_bn_funs dts_env cnstrs_env bn_fun_env bn_funs bn_eqs |
2600
ca6b4bc7a871
kept the nested structure of constructors (belonging to one datatype)
Christian Urban <urbanc@in.tum.de>
parents:
2598
diff
changeset
|
157 |
val raw_bclauses = rawify_bclauses dts_env cnstrs_env bn_fun_full_env bclauses |
1941 | 158 |
|
2957
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
159 |
val (raw_full_dt_names', thy1) = |
3061
cfc795473656
updated to Isabelle 6 Dec (thanks to Odrej Kuncar)
Christian Urban <urbanc@in.tum.de>
parents:
3045
diff
changeset
|
160 |
Datatype.add_datatype Datatype.default_config raw_dts thy |
2431
331873ebc5cd
can now deal with type variables in nominal datatype definitions
Christian Urban <urbanc@in.tum.de>
parents:
2430
diff
changeset
|
161 |
|
331873ebc5cd
can now deal with type variables in nominal datatype definitions
Christian Urban <urbanc@in.tum.de>
parents:
2430
diff
changeset
|
162 |
val lthy1 = Named_Target.theory_init thy1 |
2957
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
163 |
|
3045
d0ad264f8c4f
updated to Isabelle 3 Nov; it includes a hack to work around a bug in the localised version of the quotient package
Christian Urban <urbanc@in.tum.de>
parents:
2973
diff
changeset
|
164 |
val dtinfos = map (Datatype.the_info (Proof_Context.theory_of lthy1)) raw_full_dt_names' |
3062
b4b71c167e06
updated to Isabelle 13 Dec
Christian Urban <urbanc@in.tum.de>
parents:
3061
diff
changeset
|
165 |
val {descr, ...} = hd dtinfos |
2957
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
166 |
|
3062
b4b71c167e06
updated to Isabelle 13 Dec
Christian Urban <urbanc@in.tum.de>
parents:
3061
diff
changeset
|
167 |
val raw_tys = Datatype_Aux.get_rec_types descr |
2957
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
168 |
val raw_ty_args = hd raw_tys |
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
169 |
|> snd o dest_Type |
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
170 |
|> map dest_TFree |
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
171 |
|
3062
b4b71c167e06
updated to Isabelle 13 Dec
Christian Urban <urbanc@in.tum.de>
parents:
3061
diff
changeset
|
172 |
val raw_cns_info = all_dtyp_constrs_types descr |
2957
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
173 |
val raw_all_cns = (map o map) (fn (c, _, _, _) => c) raw_cns_info |
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
174 |
|
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
175 |
val raw_inject_thms = flat (map #inject dtinfos) |
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
176 |
val raw_distinct_thms = flat (map #distinct dtinfos) |
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
177 |
val raw_induct_thm = #induct (hd dtinfos) |
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
178 |
val raw_induct_thms = #inducts (hd dtinfos) |
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
179 |
val raw_exhaust_thms = map #exhaust dtinfos |
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
180 |
val raw_size_trms = map HOLogic.size_const raw_tys |
3045
d0ad264f8c4f
updated to Isabelle 3 Nov; it includes a hack to work around a bug in the localised version of the quotient package
Christian Urban <urbanc@in.tum.de>
parents:
2973
diff
changeset
|
181 |
val raw_size_thms = Size.size_thms (Proof_Context.theory_of lthy1) (hd raw_full_dt_names') |
2957
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
182 |
|> `(fn thms => (length thms) div 2) |
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
183 |
|> uncurry drop |
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
184 |
|
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
185 |
val raw_result = RawDtInfo |
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
186 |
{raw_dt_names = raw_full_dt_names', |
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
187 |
raw_dts = raw_dts, |
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
188 |
raw_tys = raw_tys, |
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
189 |
raw_ty_args = raw_ty_args, |
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
190 |
raw_cns_info = raw_cns_info, |
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
191 |
raw_all_cns = raw_all_cns, |
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
192 |
raw_inject_thms = raw_inject_thms, |
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
193 |
raw_distinct_thms = raw_distinct_thms, |
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
194 |
raw_induct_thm = raw_induct_thm, |
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
195 |
raw_induct_thms = raw_induct_thms, |
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
196 |
raw_exhaust_thms = raw_exhaust_thms, |
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
197 |
raw_size_trms = raw_size_trms, |
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
198 |
raw_size_thms = raw_size_thms} |
2304
8a98171ba1fc
all raw definitions are defined using function
Christian Urban <urbanc@in.tum.de>
parents:
2302
diff
changeset
|
199 |
in |
2957
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
200 |
(raw_bclauses, raw_bn_funs, raw_bn_eqs, raw_result, lthy1) |
2304
8a98171ba1fc
all raw definitions are defined using function
Christian Urban <urbanc@in.tum.de>
parents:
2302
diff
changeset
|
201 |
end |
8a98171ba1fc
all raw definitions are defined using function
Christian Urban <urbanc@in.tum.de>
parents:
2302
diff
changeset
|
202 |
*} |
8a98171ba1fc
all raw definitions are defined using function
Christian Urban <urbanc@in.tum.de>
parents:
2302
diff
changeset
|
203 |
|
2125
60ee289a8c63
made out of STEPS a configuration value so that it can be set individually in each file
Christian Urban <urbanc@in.tum.de>
parents:
2122
diff
changeset
|
204 |
|
1941 | 205 |
ML {* |
2436
3885dc2669f9
cleaned up (almost completely) the examples
Christian Urban <urbanc@in.tum.de>
parents:
2435
diff
changeset
|
206 |
fun nominal_datatype2 opt_thms_name dts bn_funs bn_eqs bclauses lthy = |
1941 | 207 |
let |
2957
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
208 |
val cnstr_names = get_cnstr_strs dts |
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
209 |
val cnstr_tys = get_typed_cnstrs dts |
1941 | 210 |
|
2957
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
211 |
val _ = trace_msg (K "Defining raw datatypes...") |
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
212 |
val (raw_bclauses, raw_bn_funs, raw_bn_eqs, raw_dt_info, lthy0) = |
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
213 |
define_raw_dts dts cnstr_names cnstr_tys bn_funs bn_eqs bclauses lthy |
2431
331873ebc5cd
can now deal with type variables in nominal datatype definitions
Christian Urban <urbanc@in.tum.de>
parents:
2430
diff
changeset
|
214 |
|
2957
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
215 |
val RawDtInfo |
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
216 |
{raw_dt_names, |
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
217 |
raw_tys, |
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
218 |
raw_ty_args, |
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
219 |
raw_all_cns, |
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
220 |
raw_inject_thms, |
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
221 |
raw_distinct_thms, |
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
222 |
raw_induct_thm, |
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
223 |
raw_induct_thms, |
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
224 |
raw_exhaust_thms, |
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
225 |
raw_size_trms, |
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
226 |
raw_size_thms, ...} = raw_dt_info |
2388 | 227 |
|
2647
5e95387bef45
removed debugging code abd introduced a guarded tracing function
Christian Urban <urbanc@in.tum.de>
parents:
2643
diff
changeset
|
228 |
val _ = trace_msg (K "Defining raw permutations...") |
2957
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
229 |
val ((raw_perm_funs, raw_perm_simps, raw_perm_laws), lthy2a) = define_raw_perms raw_dt_info lthy0 |
2144 | 230 |
|
231 |
(* noting the raw permutations as eqvt theorems *) |
|
2959 | 232 |
val lthy3 = snd (Local_Theory.note ((Binding.empty, [eqvt_attr]), raw_perm_simps) lthy2a) |
2011
12ce87b55f97
tried to add some comments in the huge(!) nominal2_cmd function
Christian Urban <urbanc@in.tum.de>
parents:
2008
diff
changeset
|
233 |
|
2647
5e95387bef45
removed debugging code abd introduced a guarded tracing function
Christian Urban <urbanc@in.tum.de>
parents:
2643
diff
changeset
|
234 |
val _ = trace_msg (K "Defining raw fv- and bn-functions...") |
2922 | 235 |
val (raw_bns, raw_bn_defs, raw_bn_info, raw_bn_inducts, lthy3a) = |
2957
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
236 |
define_raw_bns raw_dt_info raw_bn_funs raw_bn_eqs lthy3 |
2647
5e95387bef45
removed debugging code abd introduced a guarded tracing function
Christian Urban <urbanc@in.tum.de>
parents:
2643
diff
changeset
|
237 |
|
2560
82e37a4595c7
automated permute_bn functions (raw ones first)
Christian Urban <urbanc@in.tum.de>
parents:
2559
diff
changeset
|
238 |
(* defining the permute_bn functions *) |
2561
7926f1cb45eb
respectfulness for permute_bn functions
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
239 |
val (raw_perm_bns, raw_perm_bn_simps, lthy3b) = |
2957
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
240 |
define_raw_bn_perms raw_dt_info raw_bn_info lthy3a |
2647
5e95387bef45
removed debugging code abd introduced a guarded tracing function
Christian Urban <urbanc@in.tum.de>
parents:
2643
diff
changeset
|
241 |
|
2560
82e37a4595c7
automated permute_bn functions (raw ones first)
Christian Urban <urbanc@in.tum.de>
parents:
2559
diff
changeset
|
242 |
val (raw_fvs, raw_fv_bns, raw_fv_defs, raw_fv_bns_induct, lthy3c) = |
2957
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
243 |
define_raw_fvs raw_dt_info raw_bn_info raw_bclauses lthy3b |
2647
5e95387bef45
removed debugging code abd introduced a guarded tracing function
Christian Urban <urbanc@in.tum.de>
parents:
2643
diff
changeset
|
244 |
|
5e95387bef45
removed debugging code abd introduced a guarded tracing function
Christian Urban <urbanc@in.tum.de>
parents:
2643
diff
changeset
|
245 |
val _ = trace_msg (K "Defining alpha relations...") |
2928 | 246 |
val (alpha_result, lthy4) = |
2957
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
247 |
define_raw_alpha raw_dt_info raw_bn_info raw_bclauses raw_fvs lthy3c |
2647
5e95387bef45
removed debugging code abd introduced a guarded tracing function
Christian Urban <urbanc@in.tum.de>
parents:
2643
diff
changeset
|
248 |
|
5e95387bef45
removed debugging code abd introduced a guarded tracing function
Christian Urban <urbanc@in.tum.de>
parents:
2643
diff
changeset
|
249 |
val _ = trace_msg (K "Proving distinct theorems...") |
2957
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
250 |
val alpha_distincts = raw_prove_alpha_distincts lthy4 alpha_result raw_dt_info |
2300
9fb315392493
added FSet to the correct paper
Christian Urban <urbanc@in.tum.de>
parents:
2299
diff
changeset
|
251 |
|
2647
5e95387bef45
removed debugging code abd introduced a guarded tracing function
Christian Urban <urbanc@in.tum.de>
parents:
2643
diff
changeset
|
252 |
val _ = trace_msg (K "Proving eq-iff theorems...") |
2957
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
253 |
val alpha_eq_iff = raw_prove_alpha_eq_iff lthy4 alpha_result raw_dt_info |
2647
5e95387bef45
removed debugging code abd introduced a guarded tracing function
Christian Urban <urbanc@in.tum.de>
parents:
2643
diff
changeset
|
254 |
|
5e95387bef45
removed debugging code abd introduced a guarded tracing function
Christian Urban <urbanc@in.tum.de>
parents:
2643
diff
changeset
|
255 |
val _ = trace_msg (K "Proving equivariance of bns, fvs, size and alpha...") |
2406
428d9cb9a243
can also lift the various eqvt lemmas for bn, fv, fv_bn and size
Christian Urban <urbanc@in.tum.de>
parents:
2405
diff
changeset
|
256 |
val raw_bn_eqvt = |
2922 | 257 |
raw_prove_eqvt raw_bns raw_bn_inducts (raw_bn_defs @ raw_perm_simps) lthy4 |
2647
5e95387bef45
removed debugging code abd introduced a guarded tracing function
Christian Urban <urbanc@in.tum.de>
parents:
2643
diff
changeset
|
258 |
|
2406
428d9cb9a243
can also lift the various eqvt lemmas for bn, fv, fv_bn and size
Christian Urban <urbanc@in.tum.de>
parents:
2405
diff
changeset
|
259 |
(* noting the raw_bn_eqvt lemmas in a temprorary theory *) |
2448 | 260 |
val lthy_tmp = snd (Local_Theory.note ((Binding.empty, [eqvt_attr]), raw_bn_eqvt) lthy4) |
2305
93ab397f5980
smaller code for raw-eqvt proofs
Christian Urban <urbanc@in.tum.de>
parents:
2304
diff
changeset
|
261 |
|
2406
428d9cb9a243
can also lift the various eqvt lemmas for bn, fv, fv_bn and size
Christian Urban <urbanc@in.tum.de>
parents:
2405
diff
changeset
|
262 |
val raw_fv_eqvt = |
2647
5e95387bef45
removed debugging code abd introduced a guarded tracing function
Christian Urban <urbanc@in.tum.de>
parents:
2643
diff
changeset
|
263 |
raw_prove_eqvt (raw_fvs @ raw_fv_bns) raw_fv_bns_induct (raw_fv_defs @ raw_perm_simps) |
2388 | 264 |
(Local_Theory.restore lthy_tmp) |
2647
5e95387bef45
removed debugging code abd introduced a guarded tracing function
Christian Urban <urbanc@in.tum.de>
parents:
2643
diff
changeset
|
265 |
|
2957
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
266 |
val raw_size_eqvt = |
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
267 |
let |
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
268 |
val RawDtInfo {raw_size_trms, raw_size_thms, raw_induct_thms, ...} = raw_dt_info |
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
269 |
in |
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
270 |
raw_prove_eqvt raw_size_trms raw_induct_thms (raw_size_thms @ raw_perm_simps) |
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
271 |
(Local_Theory.restore lthy_tmp) |
3226
780b7a2c50b6
updated to changes in Isabelle
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
3218
diff
changeset
|
272 |
|> map (rewrite_rule (Local_Theory.restore lthy_tmp) |
780b7a2c50b6
updated to changes in Isabelle
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
3218
diff
changeset
|
273 |
@{thms permute_nat_def[THEN eq_reflection]}) |
2957
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
274 |
|> map (fn thm => thm RS @{thm sym}) |
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
275 |
end |
2647
5e95387bef45
removed debugging code abd introduced a guarded tracing function
Christian Urban <urbanc@in.tum.de>
parents:
2643
diff
changeset
|
276 |
|
2448 | 277 |
val lthy5 = snd (Local_Theory.note ((Binding.empty, [eqvt_attr]), raw_fv_eqvt) lthy_tmp) |
2306 | 278 |
|
2868
2b8e387d2dfc
got rid of the boolean flag in the raw_equivariance function
Christian Urban <urbanc@in.tum.de>
parents:
2858
diff
changeset
|
279 |
val alpha_eqvt = |
2928 | 280 |
let |
281 |
val AlphaResult {alpha_trms, alpha_bn_trms, alpha_raw_induct, alpha_intros, ...} = alpha_result |
|
282 |
in |
|
3214
13ab4f0a0b0e
Various changes to support Nominal2 commands in local contexts.
webertj
parents:
3201
diff
changeset
|
283 |
Nominal_Eqvt.raw_equivariance lthy5 (alpha_trms @ alpha_bn_trms) alpha_raw_induct alpha_intros |
2928 | 284 |
end |
2868
2b8e387d2dfc
got rid of the boolean flag in the raw_equivariance function
Christian Urban <urbanc@in.tum.de>
parents:
2858
diff
changeset
|
285 |
|
2b8e387d2dfc
got rid of the boolean flag in the raw_equivariance function
Christian Urban <urbanc@in.tum.de>
parents:
2858
diff
changeset
|
286 |
val alpha_eqvt_norm = map (Nominal_ThmDecls.eqvt_transform lthy5) alpha_eqvt |
2311
4da5c5c29009
work on transitivity proof
Christian Urban <urbanc@in.tum.de>
parents:
2309
diff
changeset
|
287 |
|
2647
5e95387bef45
removed debugging code abd introduced a guarded tracing function
Christian Urban <urbanc@in.tum.de>
parents:
2643
diff
changeset
|
288 |
val _ = trace_msg (K "Proving equivalence of alpha...") |
2927
116f9ba4f59f
combined distributed data for alpha in alpha_result (partially done)
Christian Urban <urbanc@in.tum.de>
parents:
2922
diff
changeset
|
289 |
val alpha_refl_thms = raw_prove_refl lthy5 alpha_result raw_induct_thm |
116f9ba4f59f
combined distributed data for alpha in alpha_result (partially done)
Christian Urban <urbanc@in.tum.de>
parents:
2922
diff
changeset
|
290 |
val alpha_sym_thms = raw_prove_sym lthy5 alpha_result alpha_eqvt_norm |
116f9ba4f59f
combined distributed data for alpha in alpha_result (partially done)
Christian Urban <urbanc@in.tum.de>
parents:
2922
diff
changeset
|
291 |
val alpha_trans_thms = |
116f9ba4f59f
combined distributed data for alpha in alpha_result (partially done)
Christian Urban <urbanc@in.tum.de>
parents:
2922
diff
changeset
|
292 |
raw_prove_trans lthy5 alpha_result (raw_distinct_thms @ raw_inject_thms) alpha_eqvt_norm |
2311
4da5c5c29009
work on transitivity proof
Christian Urban <urbanc@in.tum.de>
parents:
2309
diff
changeset
|
293 |
|
2404
66ae73fd66c0
added rsp-lemmas for alpha_bns
Christian Urban <urbanc@in.tum.de>
parents:
2401
diff
changeset
|
294 |
val (alpha_equivp_thms, alpha_bn_equivp_thms) = |
2927
116f9ba4f59f
combined distributed data for alpha in alpha_result (partially done)
Christian Urban <urbanc@in.tum.de>
parents:
2922
diff
changeset
|
295 |
raw_prove_equivp lthy5 alpha_result alpha_refl_thms alpha_sym_thms alpha_trans_thms |
2322
24de7e548094
proved eqvip theorems for alphas
Christian Urban <urbanc@in.tum.de>
parents:
2321
diff
changeset
|
296 |
|
2647
5e95387bef45
removed debugging code abd introduced a guarded tracing function
Christian Urban <urbanc@in.tum.de>
parents:
2643
diff
changeset
|
297 |
val _ = trace_msg (K "Proving alpha implies bn...") |
2928 | 298 |
val alpha_bn_imp_thms = raw_prove_bn_imp lthy5 alpha_result |
2922 | 299 |
|
2647
5e95387bef45
removed debugging code abd introduced a guarded tracing function
Christian Urban <urbanc@in.tum.de>
parents:
2643
diff
changeset
|
300 |
val _ = trace_msg (K "Proving respectfulness...") |
2438
abafea9b39bb
corrected bug with fv-function generation (that was the problem with recursive binders)
Christian Urban <urbanc@in.tum.de>
parents:
2436
diff
changeset
|
301 |
val raw_funs_rsp_aux = |
2928 | 302 |
raw_fv_bn_rsp_aux lthy5 alpha_result raw_fvs raw_bns raw_fv_bns (raw_bn_defs @ raw_fv_defs) |
3164
25c61cc06ae2
Find remaining rsp theorems and provide them with the quotient definitions
Cezary Kaliszyk <cezarykaliszyk@gmail.com>
parents:
3163
diff
changeset
|
303 |
|
3226
780b7a2c50b6
updated to changes in Isabelle
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
3218
diff
changeset
|
304 |
val raw_funs_rsp = map (Drule.eta_contraction_rule o mk_funs_rsp lthy5) raw_funs_rsp_aux |
3164
25c61cc06ae2
Find remaining rsp theorems and provide them with the quotient definitions
Cezary Kaliszyk <cezarykaliszyk@gmail.com>
parents:
3163
diff
changeset
|
305 |
|
25c61cc06ae2
Find remaining rsp theorems and provide them with the quotient definitions
Cezary Kaliszyk <cezarykaliszyk@gmail.com>
parents:
3163
diff
changeset
|
306 |
fun match_const cnst th = |
25c61cc06ae2
Find remaining rsp theorems and provide them with the quotient definitions
Cezary Kaliszyk <cezarykaliszyk@gmail.com>
parents:
3163
diff
changeset
|
307 |
(fst o dest_Const o snd o dest_comb o HOLogic.dest_Trueprop o prop_of) th = |
25c61cc06ae2
Find remaining rsp theorems and provide them with the quotient definitions
Cezary Kaliszyk <cezarykaliszyk@gmail.com>
parents:
3163
diff
changeset
|
308 |
fst (dest_Const cnst); |
25c61cc06ae2
Find remaining rsp theorems and provide them with the quotient definitions
Cezary Kaliszyk <cezarykaliszyk@gmail.com>
parents:
3163
diff
changeset
|
309 |
fun find_matching_rsp cnst = |
25c61cc06ae2
Find remaining rsp theorems and provide them with the quotient definitions
Cezary Kaliszyk <cezarykaliszyk@gmail.com>
parents:
3163
diff
changeset
|
310 |
hd (filter (fn th => match_const cnst th) raw_funs_rsp); |
25c61cc06ae2
Find remaining rsp theorems and provide them with the quotient definitions
Cezary Kaliszyk <cezarykaliszyk@gmail.com>
parents:
3163
diff
changeset
|
311 |
val raw_fv_rsp = map find_matching_rsp raw_fvs; |
25c61cc06ae2
Find remaining rsp theorems and provide them with the quotient definitions
Cezary Kaliszyk <cezarykaliszyk@gmail.com>
parents:
3163
diff
changeset
|
312 |
val raw_bn_rsp = map find_matching_rsp raw_bns; |
25c61cc06ae2
Find remaining rsp theorems and provide them with the quotient definitions
Cezary Kaliszyk <cezarykaliszyk@gmail.com>
parents:
3163
diff
changeset
|
313 |
val raw_fv_bn_rsp = map find_matching_rsp raw_fv_bns; |
2388 | 314 |
|
2438
abafea9b39bb
corrected bug with fv-function generation (that was the problem with recursive binders)
Christian Urban <urbanc@in.tum.de>
parents:
2436
diff
changeset
|
315 |
val raw_size_rsp = |
2928 | 316 |
raw_size_rsp_aux lthy5 alpha_result (raw_size_thms @ raw_size_eqvt) |
3226
780b7a2c50b6
updated to changes in Isabelle
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
3218
diff
changeset
|
317 |
|> map (mk_funs_rsp lthy5) |
2392
9294d7cec5e2
proved rsp-helper lemmas of size functions
Christian Urban <urbanc@in.tum.de>
parents:
2389
diff
changeset
|
318 |
|
2438
abafea9b39bb
corrected bug with fv-function generation (that was the problem with recursive binders)
Christian Urban <urbanc@in.tum.de>
parents:
2436
diff
changeset
|
319 |
val raw_constrs_rsp = |
3161
aa1ba91ed1ff
Pass proper rsp theorems for constructors and for size
Cezary Kaliszyk <cezarykaliszyk@gmail.com>
parents:
3157
diff
changeset
|
320 |
raw_constrs_rsp lthy5 alpha_result raw_all_cns (alpha_bn_imp_thms @ raw_funs_rsp_aux) |
2647
5e95387bef45
removed debugging code abd introduced a guarded tracing function
Christian Urban <urbanc@in.tum.de>
parents:
2643
diff
changeset
|
321 |
|
3226
780b7a2c50b6
updated to changes in Isabelle
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
3218
diff
changeset
|
322 |
val alpha_permute_rsp = map (mk_alpha_permute_rsp lthy5) alpha_eqvt |
2384
841b7e34e70a
fixed order of fold_union to make alpha and fv agree
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
323 |
|
2438
abafea9b39bb
corrected bug with fv-function generation (that was the problem with recursive binders)
Christian Urban <urbanc@in.tum.de>
parents:
2436
diff
changeset
|
324 |
val alpha_bn_rsp = |
2928 | 325 |
raw_alpha_bn_rsp alpha_result alpha_bn_equivp_thms alpha_bn_imp_thms |
2404
66ae73fd66c0
added rsp-lemmas for alpha_bns
Christian Urban <urbanc@in.tum.de>
parents:
2401
diff
changeset
|
326 |
|
2966 | 327 |
val raw_perm_bn_rsp = raw_perm_bn_rsp lthy5 alpha_result raw_perm_bns raw_perm_bn_simps |
2561
7926f1cb45eb
respectfulness for permute_bn functions
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
328 |
|
2647
5e95387bef45
removed debugging code abd introduced a guarded tracing function
Christian Urban <urbanc@in.tum.de>
parents:
2643
diff
changeset
|
329 |
val _ = trace_msg (K "Defining the quotient types...") |
3065
51ef8a3cb6ef
updated to lates changes in the datatype package
Christian Urban <urbanc@in.tum.de>
parents:
3063
diff
changeset
|
330 |
val qty_descr = map (fn ((bind, vs, mx), _) => (map fst vs, bind, mx)) dts |
3164
25c61cc06ae2
Find remaining rsp theorems and provide them with the quotient definitions
Cezary Kaliszyk <cezarykaliszyk@gmail.com>
parents:
3163
diff
changeset
|
331 |
|
25c61cc06ae2
Find remaining rsp theorems and provide them with the quotient definitions
Cezary Kaliszyk <cezarykaliszyk@gmail.com>
parents:
3163
diff
changeset
|
332 |
val (qty_infos, lthy7) = |
2928 | 333 |
let |
334 |
val AlphaResult {alpha_trms, alpha_tys, ...} = alpha_result |
|
335 |
in |
|
3164
25c61cc06ae2
Find remaining rsp theorems and provide them with the quotient definitions
Cezary Kaliszyk <cezarykaliszyk@gmail.com>
parents:
3163
diff
changeset
|
336 |
define_qtypes qty_descr alpha_tys alpha_trms alpha_equivp_thms lthy5 |
2928 | 337 |
end |
2336
f2d545b77b31
added definition of the quotient types
Christian Urban <urbanc@in.tum.de>
parents:
2324
diff
changeset
|
338 |
|
f2d545b77b31
added definition of the quotient types
Christian Urban <urbanc@in.tum.de>
parents:
2324
diff
changeset
|
339 |
val qtys = map #qtyp qty_infos |
2400
c6d30d5f5ba1
defined qperms and qsizes
Christian Urban <urbanc@in.tum.de>
parents:
2399
diff
changeset
|
340 |
val qty_full_names = map (fst o dest_Type) qtys |
3161
aa1ba91ed1ff
Pass proper rsp theorems for constructors and for size
Cezary Kaliszyk <cezarykaliszyk@gmail.com>
parents:
3157
diff
changeset
|
341 |
val qty_names = map Long_Name.base_name qty_full_names |
2400
c6d30d5f5ba1
defined qperms and qsizes
Christian Urban <urbanc@in.tum.de>
parents:
2399
diff
changeset
|
342 |
|
2647
5e95387bef45
removed debugging code abd introduced a guarded tracing function
Christian Urban <urbanc@in.tum.de>
parents:
2643
diff
changeset
|
343 |
val _ = trace_msg (K "Defining the quotient constants...") |
2600
ca6b4bc7a871
kept the nested structure of constructors (belonging to one datatype)
Christian Urban <urbanc@in.tum.de>
parents:
2598
diff
changeset
|
344 |
val qconstrs_descrs = |
3161
aa1ba91ed1ff
Pass proper rsp theorems for constructors and for size
Cezary Kaliszyk <cezarykaliszyk@gmail.com>
parents:
3157
diff
changeset
|
345 |
(map2 o map2) (fn (b, _, mx) => fn (t, th) => (Variable.check_name b, t, mx, th)) |
aa1ba91ed1ff
Pass proper rsp theorems for constructors and for size
Cezary Kaliszyk <cezarykaliszyk@gmail.com>
parents:
3157
diff
changeset
|
346 |
(get_cnstrs dts) (map (op ~~) (raw_all_cns ~~ raw_constrs_rsp)) |
2338 | 347 |
|
2339
1e0b3992189c
more quotient-definitions
Christian Urban <urbanc@in.tum.de>
parents:
2338
diff
changeset
|
348 |
val qbns_descr = |
3164
25c61cc06ae2
Find remaining rsp theorems and provide them with the quotient definitions
Cezary Kaliszyk <cezarykaliszyk@gmail.com>
parents:
3163
diff
changeset
|
349 |
map2 (fn (b, _, mx) => fn (t, th) => (Variable.check_name b, t, mx, th)) bn_funs (raw_bns ~~ raw_bn_rsp) |
2339
1e0b3992189c
more quotient-definitions
Christian Urban <urbanc@in.tum.de>
parents:
2338
diff
changeset
|
350 |
|
3164
25c61cc06ae2
Find remaining rsp theorems and provide them with the quotient definitions
Cezary Kaliszyk <cezarykaliszyk@gmail.com>
parents:
3163
diff
changeset
|
351 |
val qfvs_descr = |
25c61cc06ae2
Find remaining rsp theorems and provide them with the quotient definitions
Cezary Kaliszyk <cezarykaliszyk@gmail.com>
parents:
3163
diff
changeset
|
352 |
map2 (fn n => fn (t, th) => ("fv_" ^ n, t, NoSyn, th)) qty_names (raw_fvs ~~ raw_fv_rsp) |
2339
1e0b3992189c
more quotient-definitions
Christian Urban <urbanc@in.tum.de>
parents:
2338
diff
changeset
|
353 |
|
3164
25c61cc06ae2
Find remaining rsp theorems and provide them with the quotient definitions
Cezary Kaliszyk <cezarykaliszyk@gmail.com>
parents:
3163
diff
changeset
|
354 |
val qfv_bns_descr = |
25c61cc06ae2
Find remaining rsp theorems and provide them with the quotient definitions
Cezary Kaliszyk <cezarykaliszyk@gmail.com>
parents:
3163
diff
changeset
|
355 |
map2 (fn (b, _, _) => fn (t, th) => ("fv_" ^ Variable.check_name b, t, NoSyn, th)) |
25c61cc06ae2
Find remaining rsp theorems and provide them with the quotient definitions
Cezary Kaliszyk <cezarykaliszyk@gmail.com>
parents:
3163
diff
changeset
|
356 |
bn_funs (raw_fv_bns ~~ raw_fv_bn_rsp) |
2339
1e0b3992189c
more quotient-definitions
Christian Urban <urbanc@in.tum.de>
parents:
2338
diff
changeset
|
357 |
|
2384
841b7e34e70a
fixed order of fold_union to make alpha and fv agree
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
358 |
val qalpha_bns_descr = |
2928 | 359 |
let |
360 |
val AlphaResult {alpha_bn_trms, ...} = alpha_result |
|
361 |
in |
|
3163
a29b35442d1c
Declare rsp for permute, permute_bn, alpha_bn together with their definitions instead of TrueI
Cezary Kaliszyk <cezarykaliszyk@gmail.com>
parents:
3161
diff
changeset
|
362 |
map2 (fn (b, _, _) => fn (t, th) => ("alpha_" ^ Variable.check_name b, t, NoSyn, th)) |
a29b35442d1c
Declare rsp for permute, permute_bn, alpha_bn together with their definitions instead of TrueI
Cezary Kaliszyk <cezarykaliszyk@gmail.com>
parents:
3161
diff
changeset
|
363 |
bn_funs (alpha_bn_trms ~~ alpha_bn_rsp) |
2928 | 364 |
end |
2384
841b7e34e70a
fixed order of fold_union to make alpha and fv agree
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
365 |
|
2398 | 366 |
val qperm_descr = |
3163
a29b35442d1c
Declare rsp for permute, permute_bn, alpha_bn together with their definitions instead of TrueI
Cezary Kaliszyk <cezarykaliszyk@gmail.com>
parents:
3161
diff
changeset
|
367 |
map2 (fn n => fn (t, th) => ("permute_" ^ n, Type.legacy_freeze t, NoSyn, th)) |
a29b35442d1c
Declare rsp for permute, permute_bn, alpha_bn together with their definitions instead of TrueI
Cezary Kaliszyk <cezarykaliszyk@gmail.com>
parents:
3161
diff
changeset
|
368 |
qty_names (raw_perm_funs ~~ (take (length raw_perm_funs) alpha_permute_rsp)) |
2398 | 369 |
|
2400
c6d30d5f5ba1
defined qperms and qsizes
Christian Urban <urbanc@in.tum.de>
parents:
2399
diff
changeset
|
370 |
val qsize_descr = |
3161
aa1ba91ed1ff
Pass proper rsp theorems for constructors and for size
Cezary Kaliszyk <cezarykaliszyk@gmail.com>
parents:
3157
diff
changeset
|
371 |
map2 (fn n => fn (t, th) => ("size_" ^ n, t, NoSyn, th)) qty_names |
aa1ba91ed1ff
Pass proper rsp theorems for constructors and for size
Cezary Kaliszyk <cezarykaliszyk@gmail.com>
parents:
3157
diff
changeset
|
372 |
(raw_size_trms ~~ (take (length raw_size_trms) raw_size_rsp)) |
2400
c6d30d5f5ba1
defined qperms and qsizes
Christian Urban <urbanc@in.tum.de>
parents:
2399
diff
changeset
|
373 |
|
2562
e8ec504dddf2
lifted permute_bn constants
Christian Urban <urbanc@in.tum.de>
parents:
2561
diff
changeset
|
374 |
val qperm_bn_descr = |
3163
a29b35442d1c
Declare rsp for permute, permute_bn, alpha_bn together with their definitions instead of TrueI
Cezary Kaliszyk <cezarykaliszyk@gmail.com>
parents:
3161
diff
changeset
|
375 |
map2 (fn (b, _, _) => fn (t, th) => ("permute_" ^ Variable.check_name b, t, NoSyn, th)) |
a29b35442d1c
Declare rsp for permute, permute_bn, alpha_bn together with their definitions instead of TrueI
Cezary Kaliszyk <cezarykaliszyk@gmail.com>
parents:
3161
diff
changeset
|
376 |
bn_funs (raw_perm_bns ~~ raw_perm_bn_rsp) |
3157
de89c95c5377
updated to latest changes (10 April) to quotient package (lift_raw_const only takes dummy theorem TrueI....in the future this will not work anymore)
Christian Urban <urbanc@in.tum.de>
parents:
3135
diff
changeset
|
377 |
|
2600
ca6b4bc7a871
kept the nested structure of constructors (belonging to one datatype)
Christian Urban <urbanc@in.tum.de>
parents:
2598
diff
changeset
|
378 |
val ((((((qconstrs_infos, qbns_info), qfvs_info), qfv_bns_info), qalpha_bns_info), qperm_bns_info), |
ca6b4bc7a871
kept the nested structure of constructors (belonging to one datatype)
Christian Urban <urbanc@in.tum.de>
parents:
2598
diff
changeset
|
379 |
lthy8) = |
2346 | 380 |
lthy7 |
2600
ca6b4bc7a871
kept the nested structure of constructors (belonging to one datatype)
Christian Urban <urbanc@in.tum.de>
parents:
2598
diff
changeset
|
381 |
|> fold_map (define_qconsts qtys) qconstrs_descrs |
2400
c6d30d5f5ba1
defined qperms and qsizes
Christian Urban <urbanc@in.tum.de>
parents:
2399
diff
changeset
|
382 |
||>> define_qconsts qtys qbns_descr |
c6d30d5f5ba1
defined qperms and qsizes
Christian Urban <urbanc@in.tum.de>
parents:
2399
diff
changeset
|
383 |
||>> define_qconsts qtys qfvs_descr |
c6d30d5f5ba1
defined qperms and qsizes
Christian Urban <urbanc@in.tum.de>
parents:
2399
diff
changeset
|
384 |
||>> define_qconsts qtys qfv_bns_descr |
c6d30d5f5ba1
defined qperms and qsizes
Christian Urban <urbanc@in.tum.de>
parents:
2399
diff
changeset
|
385 |
||>> define_qconsts qtys qalpha_bns_descr |
2562
e8ec504dddf2
lifted permute_bn constants
Christian Urban <urbanc@in.tum.de>
parents:
2561
diff
changeset
|
386 |
||>> define_qconsts qtys qperm_bn_descr |
2338 | 387 |
|
2400
c6d30d5f5ba1
defined qperms and qsizes
Christian Urban <urbanc@in.tum.de>
parents:
2399
diff
changeset
|
388 |
val lthy9 = |
2957
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
389 |
define_qperms qtys qty_full_names raw_ty_args qperm_descr raw_perm_laws lthy8 |
2400
c6d30d5f5ba1
defined qperms and qsizes
Christian Urban <urbanc@in.tum.de>
parents:
2399
diff
changeset
|
390 |
|
2401
7645e18e8b19
modified the code for class instantiations (with help from Florian)
Christian Urban <urbanc@in.tum.de>
parents:
2400
diff
changeset
|
391 |
val lthy9a = |
2957
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
392 |
define_qsizes qtys qty_full_names raw_ty_args qsize_descr lthy9 |
2398 | 393 |
|
2612 | 394 |
val qtrms = (map o map) #qconst qconstrs_infos |
2346 | 395 |
val qbns = map #qconst qbns_info |
396 |
val qfvs = map #qconst qfvs_info |
|
397 |
val qfv_bns = map #qconst qfv_bns_info |
|
2384
841b7e34e70a
fixed order of fold_union to make alpha and fv agree
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
398 |
val qalpha_bns = map #qconst qalpha_bns_info |
2593
25dcb2b1329e
ordered raw_bn_info to agree with the order of the raw_bn_functions; started alpha_bn proof
Christian Urban <urbanc@in.tum.de>
parents:
2571
diff
changeset
|
399 |
val qperm_bns = map #qconst qperm_bns_info |
2434 | 400 |
|
2649
a8ebcb368a15
a modified function package where, as a test, True has been injected into the compatibility condictions
Christian Urban <urbanc@in.tum.de>
parents:
2647
diff
changeset
|
401 |
val _ = trace_msg (K "Lifting of theorems...") |
3229
b52e8651591f
updated to Isabelle changes
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
3228
diff
changeset
|
402 |
val eq_iff_simps = @{thms alphas permute_prod.simps prod_fv.simps prod_alpha_def rel_prod_def |
b52e8651591f
updated to Isabelle changes
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
3228
diff
changeset
|
403 |
prod.case} |
2434 | 404 |
|
2959 | 405 |
val ([ qdistincts, qeq_iffs, qfv_defs, qbn_defs, qperm_simps, qfv_qbn_eqvts, |
406 |
qbn_inducts, qsize_eqvt, [qinduct], qexhausts, qsize_simps, qperm_bn_simps, |
|
2966 | 407 |
qalpha_refl_thms, qalpha_sym_thms, qalpha_trans_thms ], lthyB) = |
2647
5e95387bef45
removed debugging code abd introduced a guarded tracing function
Christian Urban <urbanc@in.tum.de>
parents:
2643
diff
changeset
|
408 |
lthy9a |
2959 | 409 |
|>>> lift_thms qtys [] alpha_distincts |
410 |
||>>> lift_thms qtys eq_iff_simps alpha_eq_iff |
|
411 |
||>>> lift_thms qtys [] raw_fv_defs |
|
412 |
||>>> lift_thms qtys [] raw_bn_defs |
|
413 |
||>>> lift_thms qtys [] raw_perm_simps |
|
414 |
||>>> lift_thms qtys [] (raw_fv_eqvt @ raw_bn_eqvt) |
|
415 |
||>>> lift_thms qtys [] raw_bn_inducts |
|
416 |
||>>> lift_thms qtys [] raw_size_eqvt |
|
417 |
||>>> lift_thms qtys [] [raw_induct_thm] |
|
418 |
||>>> lift_thms qtys [] raw_exhaust_thms |
|
419 |
||>>> lift_thms qtys [] raw_size_thms |
|
420 |
||>>> lift_thms qtys [] raw_perm_bn_simps |
|
421 |
||>>> lift_thms qtys [] alpha_refl_thms |
|
2966 | 422 |
||>>> lift_thms qtys [] alpha_sym_thms |
423 |
||>>> lift_thms qtys [] alpha_trans_thms |
|
2434 | 424 |
|
2922 | 425 |
val qinducts = Project_Rule.projections lthyB qinduct |
2474
6e37bfb62474
generated inducts rule by Project_Rule.projections
Christian Urban <urbanc@in.tum.de>
parents:
2471
diff
changeset
|
426 |
|
2647
5e95387bef45
removed debugging code abd introduced a guarded tracing function
Christian Urban <urbanc@in.tum.de>
parents:
2643
diff
changeset
|
427 |
val _ = trace_msg (K "Proving supp lemmas and fs-instances...") |
2959 | 428 |
val qsupports_thms = prove_supports lthyB qperm_simps (flat qtrms) |
2448 | 429 |
|
2451
d2e929f51fa9
added fs-instance proofs
Christian Urban <urbanc@in.tum.de>
parents:
2450
diff
changeset
|
430 |
(* finite supp lemmas *) |
2647
5e95387bef45
removed debugging code abd introduced a guarded tracing function
Christian Urban <urbanc@in.tum.de>
parents:
2643
diff
changeset
|
431 |
val qfsupp_thms = prove_fsupp lthyB qtys qinduct qsupports_thms |
2450
217ef3e4282e
added proofs for fsupp properties
Christian Urban <urbanc@in.tum.de>
parents:
2448
diff
changeset
|
432 |
|
2451
d2e929f51fa9
added fs-instance proofs
Christian Urban <urbanc@in.tum.de>
parents:
2450
diff
changeset
|
433 |
(* fs instances *) |
2957
01ff621599bc
code refactoring; introduced a record for raw_dt_info
Christian Urban <urbanc@in.tum.de>
parents:
2950
diff
changeset
|
434 |
val lthyC = fs_instance qtys qty_full_names raw_ty_args qfsupp_thms lthyB |
2448 | 435 |
|
2647
5e95387bef45
removed debugging code abd introduced a guarded tracing function
Christian Urban <urbanc@in.tum.de>
parents:
2643
diff
changeset
|
436 |
val _ = trace_msg (K "Proving equality between fv and supp...") |
2475
486d4647bb37
supp-proofs work except for CoreHaskell and Modules (induct is probably not finding the correct instance)
Christian Urban <urbanc@in.tum.de>
parents:
2474
diff
changeset
|
437 |
val qfv_supp_thms = |
2647
5e95387bef45
removed debugging code abd introduced a guarded tracing function
Christian Urban <urbanc@in.tum.de>
parents:
2643
diff
changeset
|
438 |
prove_fv_supp qtys (flat qtrms) qfvs qfv_bns qalpha_bns qfv_defs qeq_iffs |
2481
3a5ebb2fcdbf
made supp proofs more robust by not using the standard induction; renamed some example files
Christian Urban <urbanc@in.tum.de>
parents:
2475
diff
changeset
|
439 |
qperm_simps qfv_qbn_eqvts qinduct (flat raw_bclauses) lthyC |
3063
32abaea424bd
generated the correct thm-list for showing that qfv are equal to support
Christian Urban <urbanc@in.tum.de>
parents:
3062
diff
changeset
|
440 |
|> map Drule.eta_contraction_rule |
2475
486d4647bb37
supp-proofs work except for CoreHaskell and Modules (induct is probably not finding the correct instance)
Christian Urban <urbanc@in.tum.de>
parents:
2474
diff
changeset
|
441 |
|
2492
5ac9a74d22fd
post-processed eq_iff and supp threormes according to the fv-supp equality
Christian Urban <urbanc@in.tum.de>
parents:
2487
diff
changeset
|
442 |
(* postprocessing of eq and fv theorems *) |
5ac9a74d22fd
post-processed eq_iff and supp threormes according to the fv-supp equality
Christian Urban <urbanc@in.tum.de>
parents:
2487
diff
changeset
|
443 |
val qeq_iffs' = qeq_iffs |
3218
89158f401b07
updated to simplifier changes
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
3214
diff
changeset
|
444 |
|> map (simplify (put_simpset HOL_basic_ss lthyC addsimps qfv_supp_thms)) |
89158f401b07
updated to simplifier changes
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
3214
diff
changeset
|
445 |
|> map (simplify (put_simpset HOL_basic_ss lthyC |
89158f401b07
updated to simplifier changes
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
3214
diff
changeset
|
446 |
addsimps @{thms prod_fv_supp prod_alpha_eq Abs_eq_iff[symmetric]})) |
2492
5ac9a74d22fd
post-processed eq_iff and supp threormes according to the fv-supp equality
Christian Urban <urbanc@in.tum.de>
parents:
2487
diff
changeset
|
447 |
|
3214
13ab4f0a0b0e
Various changes to support Nominal2 commands in local contexts.
webertj
parents:
3201
diff
changeset
|
448 |
(* filters the theorems that are of the form "qfv = supp" *) |
3228
040519ec99e9
fixed bug with support and freshness lemmas not being simplified properly
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
3227
diff
changeset
|
449 |
val qfv_names = map (fst o dest_Const) qfvs |
040519ec99e9
fixed bug with support and freshness lemmas not being simplified properly
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
3227
diff
changeset
|
450 |
fun is_qfv_thm (@{term Trueprop} $ (Const (@{const_name HOL.eq}, _) $ Const (lhs, _) $ _)) = |
040519ec99e9
fixed bug with support and freshness lemmas not being simplified properly
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
3227
diff
changeset
|
451 |
member (op=) qfv_names lhs |
3063
32abaea424bd
generated the correct thm-list for showing that qfv are equal to support
Christian Urban <urbanc@in.tum.de>
parents:
3062
diff
changeset
|
452 |
| is_qfv_thm _ = false |
32abaea424bd
generated the correct thm-list for showing that qfv are equal to support
Christian Urban <urbanc@in.tum.de>
parents:
3062
diff
changeset
|
453 |
|
2492
5ac9a74d22fd
post-processed eq_iff and supp threormes according to the fv-supp equality
Christian Urban <urbanc@in.tum.de>
parents:
2487
diff
changeset
|
454 |
val qsupp_constrs = qfv_defs |
3218
89158f401b07
updated to simplifier changes
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
3214
diff
changeset
|
455 |
|> map (simplify (put_simpset HOL_basic_ss lthyC |
89158f401b07
updated to simplifier changes
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
3214
diff
changeset
|
456 |
addsimps (filter (is_qfv_thm o prop_of) qfv_supp_thms))) |
2492
5ac9a74d22fd
post-processed eq_iff and supp threormes according to the fv-supp equality
Christian Urban <urbanc@in.tum.de>
parents:
2487
diff
changeset
|
457 |
|
2493
2e174807c891
added postprocessed fresh-lemmas for constructors
Christian Urban <urbanc@in.tum.de>
parents:
2492
diff
changeset
|
458 |
val transform_thm = @{lemma "x = y \<Longrightarrow> a \<notin> x \<longleftrightarrow> a \<notin> y" by simp} |
2e174807c891
added postprocessed fresh-lemmas for constructors
Christian Urban <urbanc@in.tum.de>
parents:
2492
diff
changeset
|
459 |
val transform_thms = |
2e174807c891
added postprocessed fresh-lemmas for constructors
Christian Urban <urbanc@in.tum.de>
parents:
2492
diff
changeset
|
460 |
[ @{lemma "a \<notin> (S \<union> T) \<longleftrightarrow> a \<notin> S \<and> a \<notin> T" by simp}, |
2e174807c891
added postprocessed fresh-lemmas for constructors
Christian Urban <urbanc@in.tum.de>
parents:
2492
diff
changeset
|
461 |
@{lemma "a \<notin> (S - T) \<longleftrightarrow> a \<notin> S \<or> a \<in> T" by simp}, |
2e174807c891
added postprocessed fresh-lemmas for constructors
Christian Urban <urbanc@in.tum.de>
parents:
2492
diff
changeset
|
462 |
@{lemma "(lhs = (a \<notin> {})) \<longleftrightarrow> lhs" by simp}, |
2e174807c891
added postprocessed fresh-lemmas for constructors
Christian Urban <urbanc@in.tum.de>
parents:
2492
diff
changeset
|
463 |
@{thm fresh_def[symmetric]}] |
2e174807c891
added postprocessed fresh-lemmas for constructors
Christian Urban <urbanc@in.tum.de>
parents:
2492
diff
changeset
|
464 |
|
2e174807c891
added postprocessed fresh-lemmas for constructors
Christian Urban <urbanc@in.tum.de>
parents:
2492
diff
changeset
|
465 |
val qfresh_constrs = qsupp_constrs |
2e174807c891
added postprocessed fresh-lemmas for constructors
Christian Urban <urbanc@in.tum.de>
parents:
2492
diff
changeset
|
466 |
|> map (fn thm => thm RS transform_thm) |
3218
89158f401b07
updated to simplifier changes
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
3214
diff
changeset
|
467 |
|> map (simplify (put_simpset HOL_basic_ss lthyC addsimps transform_thms)) |
2493
2e174807c891
added postprocessed fresh-lemmas for constructors
Christian Urban <urbanc@in.tum.de>
parents:
2492
diff
changeset
|
468 |
|
2593
25dcb2b1329e
ordered raw_bn_info to agree with the order of the raw_bn_functions; started alpha_bn proof
Christian Urban <urbanc@in.tum.de>
parents:
2571
diff
changeset
|
469 |
(* proving that the qbn result is finite *) |
2647
5e95387bef45
removed debugging code abd introduced a guarded tracing function
Christian Urban <urbanc@in.tum.de>
parents:
2643
diff
changeset
|
470 |
val qbn_finite_thms = prove_bns_finite qtys qbns qinduct qbn_defs lthyC |
2593
25dcb2b1329e
ordered raw_bn_info to agree with the order of the raw_bn_functions; started alpha_bn proof
Christian Urban <urbanc@in.tum.de>
parents:
2571
diff
changeset
|
471 |
|
25dcb2b1329e
ordered raw_bn_info to agree with the order of the raw_bn_functions; started alpha_bn proof
Christian Urban <urbanc@in.tum.de>
parents:
2571
diff
changeset
|
472 |
(* proving that perm_bns preserve alpha *) |
2594
515e5496171c
automated alpha_perm_bn theorems
Christian Urban <urbanc@in.tum.de>
parents:
2593
diff
changeset
|
473 |
val qperm_bn_alpha_thms = |
2647
5e95387bef45
removed debugging code abd introduced a guarded tracing function
Christian Urban <urbanc@in.tum.de>
parents:
2643
diff
changeset
|
474 |
prove_perm_bn_alpha_thms qtys qperm_bns qalpha_bns qinduct qperm_bn_simps qeq_iffs' |
2594
515e5496171c
automated alpha_perm_bn theorems
Christian Urban <urbanc@in.tum.de>
parents:
2593
diff
changeset
|
475 |
qalpha_refl_thms lthyC |
2493
2e174807c891
added postprocessed fresh-lemmas for constructors
Christian Urban <urbanc@in.tum.de>
parents:
2492
diff
changeset
|
476 |
|
2598
b136721eedb2
automated permute_bn theorems
Christian Urban <urbanc@in.tum.de>
parents:
2595
diff
changeset
|
477 |
(* proving the relationship of bn and permute_bn *) |
b136721eedb2
automated permute_bn theorems
Christian Urban <urbanc@in.tum.de>
parents:
2595
diff
changeset
|
478 |
val qpermute_bn_thms = |
2647
5e95387bef45
removed debugging code abd introduced a guarded tracing function
Christian Urban <urbanc@in.tum.de>
parents:
2643
diff
changeset
|
479 |
prove_permute_bn_thms qtys qbns qperm_bns qinduct qperm_bn_simps qbn_defs qfv_qbn_eqvts lthyC |
2598
b136721eedb2
automated permute_bn theorems
Christian Urban <urbanc@in.tum.de>
parents:
2595
diff
changeset
|
480 |
|
2647
5e95387bef45
removed debugging code abd introduced a guarded tracing function
Christian Urban <urbanc@in.tum.de>
parents:
2643
diff
changeset
|
481 |
val _ = trace_msg (K "Proving strong exhaust lemmas...") |
2619 | 482 |
val qstrong_exhaust_thms = prove_strong_exhausts lthyC qexhausts bclauses qbn_finite_thms qeq_iffs' |
2616
dd7490fdd998
all examples for strong exhausts work; recursive binders need to be treated differently; still unclean version with lots of diagnostic code
Christian Urban <urbanc@in.tum.de>
parents:
2613
diff
changeset
|
483 |
qfv_qbn_eqvts qpermute_bn_thms qperm_bn_alpha_thms |
dd7490fdd998
all examples for strong exhausts work; recursive binders need to be treated differently; still unclean version with lots of diagnostic code
Christian Urban <urbanc@in.tum.de>
parents:
2613
diff
changeset
|
484 |
|
2647
5e95387bef45
removed debugging code abd introduced a guarded tracing function
Christian Urban <urbanc@in.tum.de>
parents:
2643
diff
changeset
|
485 |
val _ = trace_msg (K "Proving strong induct lemmas...") |
2633
d1d09177ec89
added proper case names for all induct and exhaust theorems
Christian Urban <urbanc@in.tum.de>
parents:
2631
diff
changeset
|
486 |
val qstrong_induct_thms = prove_strong_induct lthyC qinduct qstrong_exhaust_thms qsize_simps bclauses |
2628
16ffbc8442ca
generated goals for strong induction theorems.
Christian Urban <urbanc@in.tum.de>
parents:
2626
diff
changeset
|
487 |
|
2436
3885dc2669f9
cleaned up (almost completely) the examples
Christian Urban <urbanc@in.tum.de>
parents:
2435
diff
changeset
|
488 |
(* noting the theorems *) |
3885dc2669f9
cleaned up (almost completely) the examples
Christian Urban <urbanc@in.tum.de>
parents:
2435
diff
changeset
|
489 |
|
3885dc2669f9
cleaned up (almost completely) the examples
Christian Urban <urbanc@in.tum.de>
parents:
2435
diff
changeset
|
490 |
(* generating the prefix for the theorem names *) |
3885dc2669f9
cleaned up (almost completely) the examples
Christian Urban <urbanc@in.tum.de>
parents:
2435
diff
changeset
|
491 |
val thms_name = |
3885dc2669f9
cleaned up (almost completely) the examples
Christian Urban <urbanc@in.tum.de>
parents:
2435
diff
changeset
|
492 |
the_default (Binding.name (space_implode "_" qty_names)) opt_thms_name |
3885dc2669f9
cleaned up (almost completely) the examples
Christian Urban <urbanc@in.tum.de>
parents:
2435
diff
changeset
|
493 |
fun thms_suffix s = Binding.qualified true s thms_name |
2633
d1d09177ec89
added proper case names for all induct and exhaust theorems
Christian Urban <urbanc@in.tum.de>
parents:
2631
diff
changeset
|
494 |
val case_names_attr = Attrib.internal (K (Rule_Cases.case_names cnstr_names)) |
2436
3885dc2669f9
cleaned up (almost completely) the examples
Christian Urban <urbanc@in.tum.de>
parents:
2435
diff
changeset
|
495 |
|
2885
1264f2a21ea9
some rudimentary infrastructure for storing data about nominal datatypes
Christian Urban <urbanc@in.tum.de>
parents:
2868
diff
changeset
|
496 |
val infos = mk_infos qty_full_names qeq_iffs' qdistincts qstrong_exhaust_thms qstrong_induct_thms |
1264f2a21ea9
some rudimentary infrastructure for storing data about nominal datatypes
Christian Urban <urbanc@in.tum.de>
parents:
2868
diff
changeset
|
497 |
|
2451
d2e929f51fa9
added fs-instance proofs
Christian Urban <urbanc@in.tum.de>
parents:
2450
diff
changeset
|
498 |
val (_, lthy9') = lthyC |
3045
d0ad264f8c4f
updated to Isabelle 3 Nov; it includes a hack to work around a bug in the localised version of the quotient package
Christian Urban <urbanc@in.tum.de>
parents:
2973
diff
changeset
|
499 |
|> Local_Theory.declaration {syntax = false, pervasive = false} (K (fold register_info infos)) |
2787
1a6593bc494d
added eq_iff and distinct lemmas of nominal datatypes to the simplifier
Christian Urban <urbanc@in.tum.de>
parents:
2781
diff
changeset
|
500 |
|> Local_Theory.note ((thms_suffix "distinct", [induct_attr, simp_attr]), qdistincts) |
1a6593bc494d
added eq_iff and distinct lemmas of nominal datatypes to the simplifier
Christian Urban <urbanc@in.tum.de>
parents:
2781
diff
changeset
|
501 |
||>> Local_Theory.note ((thms_suffix "eq_iff", [induct_attr, simp_attr]), qeq_iffs') |
2436
3885dc2669f9
cleaned up (almost completely) the examples
Christian Urban <urbanc@in.tum.de>
parents:
2435
diff
changeset
|
502 |
||>> Local_Theory.note ((thms_suffix "fv_defs", []), qfv_defs) |
3885dc2669f9
cleaned up (almost completely) the examples
Christian Urban <urbanc@in.tum.de>
parents:
2435
diff
changeset
|
503 |
||>> Local_Theory.note ((thms_suffix "bn_defs", []), qbn_defs) |
2922 | 504 |
||>> Local_Theory.note ((thms_suffix "bn_inducts", []), qbn_inducts) |
2448 | 505 |
||>> Local_Theory.note ((thms_suffix "perm_simps", [eqvt_attr, simp_attr]), qperm_simps) |
2922 | 506 |
||>> Local_Theory.note ((thms_suffix "fv_bn_eqvt", [eqvt_attr]), qfv_qbn_eqvts) |
2858
de6b601c8d3d
added size-lemmas to simplifier; as a result termination can be proved by the standard lexicographic_order method
Christian Urban <urbanc@in.tum.de>
parents:
2822
diff
changeset
|
507 |
||>> Local_Theory.note ((thms_suffix "size", [simp_attr]), qsize_simps) |
2436
3885dc2669f9
cleaned up (almost completely) the examples
Christian Urban <urbanc@in.tum.de>
parents:
2435
diff
changeset
|
508 |
||>> Local_Theory.note ((thms_suffix "size_eqvt", []), qsize_eqvt) |
2633
d1d09177ec89
added proper case names for all induct and exhaust theorems
Christian Urban <urbanc@in.tum.de>
parents:
2631
diff
changeset
|
509 |
||>> Local_Theory.note ((thms_suffix "induct", [case_names_attr]), [qinduct]) |
d1d09177ec89
added proper case names for all induct and exhaust theorems
Christian Urban <urbanc@in.tum.de>
parents:
2631
diff
changeset
|
510 |
||>> Local_Theory.note ((thms_suffix "inducts", [case_names_attr]), qinducts) |
d1d09177ec89
added proper case names for all induct and exhaust theorems
Christian Urban <urbanc@in.tum.de>
parents:
2631
diff
changeset
|
511 |
||>> Local_Theory.note ((thms_suffix "exhaust", [case_names_attr]), qexhausts) |
d1d09177ec89
added proper case names for all induct and exhaust theorems
Christian Urban <urbanc@in.tum.de>
parents:
2631
diff
changeset
|
512 |
||>> Local_Theory.note ((thms_suffix "strong_exhaust", [case_names_attr]), qstrong_exhaust_thms) |
d1d09177ec89
added proper case names for all induct and exhaust theorems
Christian Urban <urbanc@in.tum.de>
parents:
2631
diff
changeset
|
513 |
||>> Local_Theory.note ((thms_suffix "strong_induct", [case_names_attr]), qstrong_induct_thms) |
2448 | 514 |
||>> Local_Theory.note ((thms_suffix "supports", []), qsupports_thms) |
2450
217ef3e4282e
added proofs for fsupp properties
Christian Urban <urbanc@in.tum.de>
parents:
2448
diff
changeset
|
515 |
||>> Local_Theory.note ((thms_suffix "fsupp", []), qfsupp_thms) |
2492
5ac9a74d22fd
post-processed eq_iff and supp threormes according to the fv-supp equality
Christian Urban <urbanc@in.tum.de>
parents:
2487
diff
changeset
|
516 |
||>> Local_Theory.note ((thms_suffix "supp", []), qsupp_constrs) |
3181
ca162f0a7957
added to the simplifier nominal_datatype.fresh lemmas
Christian Urban <urbanc@in.tum.de>
parents:
3164
diff
changeset
|
517 |
||>> Local_Theory.note ((thms_suffix "fresh", [simp_attr]), qfresh_constrs) |
2563
7c8bfc35663a
lifted permute_bn simp rules
Christian Urban <urbanc@in.tum.de>
parents:
2562
diff
changeset
|
518 |
||>> Local_Theory.note ((thms_suffix "perm_bn_simps", []), qperm_bn_simps) |
2571
f0252365936c
proved that bn functions return a finite set
Christian Urban <urbanc@in.tum.de>
parents:
2568
diff
changeset
|
519 |
||>> Local_Theory.note ((thms_suffix "bn_finite", []), qbn_finite_thms) |
2593
25dcb2b1329e
ordered raw_bn_info to agree with the order of the raw_bn_functions; started alpha_bn proof
Christian Urban <urbanc@in.tum.de>
parents:
2571
diff
changeset
|
520 |
||>> Local_Theory.note ((thms_suffix "perm_bn_alpha", []), qperm_bn_alpha_thms) |
2598
b136721eedb2
automated permute_bn theorems
Christian Urban <urbanc@in.tum.de>
parents:
2595
diff
changeset
|
521 |
||>> Local_Theory.note ((thms_suffix "permute_bn", []), qpermute_bn_thms) |
2966 | 522 |
||>> Local_Theory.note ((thms_suffix "alpha_refl", []), qalpha_refl_thms) |
523 |
||>> Local_Theory.note ((thms_suffix "alpha_sym", []), qalpha_sym_thms) |
|
524 |
||>> Local_Theory.note ((thms_suffix "alpha_trans", []), qalpha_trans_thms) |
|
525 |
||
1941 | 526 |
in |
2601
89c55d36980f
moved definition of raw bn-functions into nominal_dt_rawfuns
Christian Urban <urbanc@in.tum.de>
parents:
2600
diff
changeset
|
527 |
lthy9' |
2647
5e95387bef45
removed debugging code abd introduced a guarded tracing function
Christian Urban <urbanc@in.tum.de>
parents:
2643
diff
changeset
|
528 |
end |
1941 | 529 |
*} |
530 |
||
2475
486d4647bb37
supp-proofs work except for CoreHaskell and Modules (induct is probably not finding the correct instance)
Christian Urban <urbanc@in.tum.de>
parents:
2474
diff
changeset
|
531 |
|
1941 | 532 |
section {* Preparing and parsing of the specification *} |
3091
578e0265b235
the default sort for type-variables in nominal specifications is fs; it is automatically addded
Christian Urban <urbanc@in.tum.de>
parents:
3076
diff
changeset
|
533 |
|
578e0265b235
the default sort for type-variables in nominal specifications is fs; it is automatically addded
Christian Urban <urbanc@in.tum.de>
parents:
3076
diff
changeset
|
534 |
ML {* |
578e0265b235
the default sort for type-variables in nominal specifications is fs; it is automatically addded
Christian Urban <urbanc@in.tum.de>
parents:
3076
diff
changeset
|
535 |
(* adds the default sort @{sort fs} to nominal specifications *) |
578e0265b235
the default sort for type-variables in nominal specifications is fs; it is automatically addded
Christian Urban <urbanc@in.tum.de>
parents:
3076
diff
changeset
|
536 |
|
578e0265b235
the default sort for type-variables in nominal specifications is fs; it is automatically addded
Christian Urban <urbanc@in.tum.de>
parents:
3076
diff
changeset
|
537 |
fun augment_sort thy S = Sign.inter_sort thy (@{sort fs}, S) |
578e0265b235
the default sort for type-variables in nominal specifications is fs; it is automatically addded
Christian Urban <urbanc@in.tum.de>
parents:
3076
diff
changeset
|
538 |
|
578e0265b235
the default sort for type-variables in nominal specifications is fs; it is automatically addded
Christian Urban <urbanc@in.tum.de>
parents:
3076
diff
changeset
|
539 |
fun augment_sort_typ thy = |
578e0265b235
the default sort for type-variables in nominal specifications is fs; it is automatically addded
Christian Urban <urbanc@in.tum.de>
parents:
3076
diff
changeset
|
540 |
map_type_tfree (fn (s, S) => TFree (s, augment_sort thy S)) |
578e0265b235
the default sort for type-variables in nominal specifications is fs; it is automatically addded
Christian Urban <urbanc@in.tum.de>
parents:
3076
diff
changeset
|
541 |
*} |
578e0265b235
the default sort for type-variables in nominal specifications is fs; it is automatically addded
Christian Urban <urbanc@in.tum.de>
parents:
3076
diff
changeset
|
542 |
|
1941 | 543 |
ML {* |
3091
578e0265b235
the default sort for type-variables in nominal specifications is fs; it is automatically addded
Christian Urban <urbanc@in.tum.de>
parents:
3076
diff
changeset
|
544 |
(* generates the parsed datatypes and declares the constructors *) |
3076
2b1b8404fe0d
partially localised the parsing process using functions fron Datatype
Christian Urban <urbanc@in.tum.de>
parents:
3065
diff
changeset
|
545 |
|
2431
331873ebc5cd
can now deal with type variables in nominal datatype definitions
Christian Urban <urbanc@in.tum.de>
parents:
2430
diff
changeset
|
546 |
fun prepare_dts dt_strs thy = |
1941 | 547 |
let |
3076
2b1b8404fe0d
partially localised the parsing process using functions fron Datatype
Christian Urban <urbanc@in.tum.de>
parents:
3065
diff
changeset
|
548 |
fun prep_spec ((tname, tvs, mx), constrs) = |
3091
578e0265b235
the default sort for type-variables in nominal specifications is fs; it is automatically addded
Christian Urban <urbanc@in.tum.de>
parents:
3076
diff
changeset
|
549 |
((tname, tvs, mx), constrs |> map (fn (c, atys, mx', _) => (c, map snd atys, mx'))) |
2431
331873ebc5cd
can now deal with type variables in nominal datatype definitions
Christian Urban <urbanc@in.tum.de>
parents:
2430
diff
changeset
|
550 |
|
3076
2b1b8404fe0d
partially localised the parsing process using functions fron Datatype
Christian Urban <urbanc@in.tum.de>
parents:
3065
diff
changeset
|
551 |
val (dts, spec_ctxt) = |
2b1b8404fe0d
partially localised the parsing process using functions fron Datatype
Christian Urban <urbanc@in.tum.de>
parents:
3065
diff
changeset
|
552 |
Datatype.read_specs (map prep_spec dt_strs) thy |
2b1b8404fe0d
partially localised the parsing process using functions fron Datatype
Christian Urban <urbanc@in.tum.de>
parents:
3065
diff
changeset
|
553 |
|
3091
578e0265b235
the default sort for type-variables in nominal specifications is fs; it is automatically addded
Christian Urban <urbanc@in.tum.de>
parents:
3076
diff
changeset
|
554 |
fun augment ((tname, tvs, mx), constrs) = |
578e0265b235
the default sort for type-variables in nominal specifications is fs; it is automatically addded
Christian Urban <urbanc@in.tum.de>
parents:
3076
diff
changeset
|
555 |
((tname, map (apsnd (augment_sort thy)) tvs, mx), |
578e0265b235
the default sort for type-variables in nominal specifications is fs; it is automatically addded
Christian Urban <urbanc@in.tum.de>
parents:
3076
diff
changeset
|
556 |
constrs |> map (fn (c, tys, mx') => (c, map (augment_sort_typ thy) tys, mx'))) |
578e0265b235
the default sort for type-variables in nominal specifications is fs; it is automatically addded
Christian Urban <urbanc@in.tum.de>
parents:
3076
diff
changeset
|
557 |
|
578e0265b235
the default sort for type-variables in nominal specifications is fs; it is automatically addded
Christian Urban <urbanc@in.tum.de>
parents:
3076
diff
changeset
|
558 |
val dts' = map augment dts |
578e0265b235
the default sort for type-variables in nominal specifications is fs; it is automatically addded
Christian Urban <urbanc@in.tum.de>
parents:
3076
diff
changeset
|
559 |
|
578e0265b235
the default sort for type-variables in nominal specifications is fs; it is automatically addded
Christian Urban <urbanc@in.tum.de>
parents:
3076
diff
changeset
|
560 |
fun mk_constr_trms ((tname, tvs, _), constrs) = |
578e0265b235
the default sort for type-variables in nominal specifications is fs; it is automatically addded
Christian Urban <urbanc@in.tum.de>
parents:
3076
diff
changeset
|
561 |
let |
578e0265b235
the default sort for type-variables in nominal specifications is fs; it is automatically addded
Christian Urban <urbanc@in.tum.de>
parents:
3076
diff
changeset
|
562 |
val ty = Type (Sign.full_name thy tname, map TFree tvs) |
578e0265b235
the default sort for type-variables in nominal specifications is fs; it is automatically addded
Christian Urban <urbanc@in.tum.de>
parents:
3076
diff
changeset
|
563 |
in |
578e0265b235
the default sort for type-variables in nominal specifications is fs; it is automatically addded
Christian Urban <urbanc@in.tum.de>
parents:
3076
diff
changeset
|
564 |
map (fn (c, tys, mx) => (c, (tys ---> ty), mx)) constrs |
578e0265b235
the default sort for type-variables in nominal specifications is fs; it is automatically addded
Christian Urban <urbanc@in.tum.de>
parents:
3076
diff
changeset
|
565 |
end |
578e0265b235
the default sort for type-variables in nominal specifications is fs; it is automatically addded
Christian Urban <urbanc@in.tum.de>
parents:
3076
diff
changeset
|
566 |
|
578e0265b235
the default sort for type-variables in nominal specifications is fs; it is automatically addded
Christian Urban <urbanc@in.tum.de>
parents:
3076
diff
changeset
|
567 |
val constr_trms = flat (map mk_constr_trms dts') |
578e0265b235
the default sort for type-variables in nominal specifications is fs; it is automatically addded
Christian Urban <urbanc@in.tum.de>
parents:
3076
diff
changeset
|
568 |
|
578e0265b235
the default sort for type-variables in nominal specifications is fs; it is automatically addded
Christian Urban <urbanc@in.tum.de>
parents:
3076
diff
changeset
|
569 |
(* FIXME: local version *) |
3076
2b1b8404fe0d
partially localised the parsing process using functions fron Datatype
Christian Urban <urbanc@in.tum.de>
parents:
3065
diff
changeset
|
570 |
(* val (_, spec_ctxt') = Proof_Context.add_fixes constr_trms spec_ctxt *) |
3091
578e0265b235
the default sort for type-variables in nominal specifications is fs; it is automatically addded
Christian Urban <urbanc@in.tum.de>
parents:
3076
diff
changeset
|
571 |
|
3076
2b1b8404fe0d
partially localised the parsing process using functions fron Datatype
Christian Urban <urbanc@in.tum.de>
parents:
3065
diff
changeset
|
572 |
val thy' = Sign.add_consts_i constr_trms (Proof_Context.theory_of spec_ctxt) |
1941 | 573 |
in |
3091
578e0265b235
the default sort for type-variables in nominal specifications is fs; it is automatically addded
Christian Urban <urbanc@in.tum.de>
parents:
3076
diff
changeset
|
574 |
(dts', thy') |
1941 | 575 |
end |
576 |
*} |
|
577 |
||
578 |
ML {* |
|
3091
578e0265b235
the default sort for type-variables in nominal specifications is fs; it is automatically addded
Christian Urban <urbanc@in.tum.de>
parents:
3076
diff
changeset
|
579 |
(* parsing the binding function specifications and *) |
578e0265b235
the default sort for type-variables in nominal specifications is fs; it is automatically addded
Christian Urban <urbanc@in.tum.de>
parents:
3076
diff
changeset
|
580 |
(* declaring the function constants *) |
2431
331873ebc5cd
can now deal with type variables in nominal datatype definitions
Christian Urban <urbanc@in.tum.de>
parents:
2430
diff
changeset
|
581 |
fun prepare_bn_funs bn_fun_strs bn_eq_strs thy = |
1941 | 582 |
let |
2431
331873ebc5cd
can now deal with type variables in nominal datatype definitions
Christian Urban <urbanc@in.tum.de>
parents:
2430
diff
changeset
|
583 |
val lthy = Named_Target.theory_init thy |
331873ebc5cd
can now deal with type variables in nominal datatype definitions
Christian Urban <urbanc@in.tum.de>
parents:
2430
diff
changeset
|
584 |
|
331873ebc5cd
can now deal with type variables in nominal datatype definitions
Christian Urban <urbanc@in.tum.de>
parents:
2430
diff
changeset
|
585 |
val ((bn_funs, bn_eqs), lthy') = |
1941 | 586 |
Specification.read_spec bn_fun_strs bn_eq_strs lthy |
587 |
||
588 |
fun prep_bn_fun ((bn, T), mx) = (bn, T, mx) |
|
589 |
||
590 |
val bn_funs' = map prep_bn_fun bn_funs |
|
3076
2b1b8404fe0d
partially localised the parsing process using functions fron Datatype
Christian Urban <urbanc@in.tum.de>
parents:
3065
diff
changeset
|
591 |
|
1941 | 592 |
in |
2431
331873ebc5cd
can now deal with type variables in nominal datatype definitions
Christian Urban <urbanc@in.tum.de>
parents:
2430
diff
changeset
|
593 |
(Local_Theory.exit_global lthy') |
331873ebc5cd
can now deal with type variables in nominal datatype definitions
Christian Urban <urbanc@in.tum.de>
parents:
2430
diff
changeset
|
594 |
|> Sign.add_consts_i bn_funs' |
1941 | 595 |
|> pair (bn_funs', bn_eqs) |
596 |
end |
|
597 |
*} |
|
598 |
||
599 |
text {* associates every SOME with the index in the list; drops NONEs *} |
|
600 |
ML {* |
|
601 |
fun indexify xs = |
|
602 |
let |
|
603 |
fun mapp _ [] = [] |
|
604 |
| mapp i (NONE :: xs) = mapp (i + 1) xs |
|
605 |
| mapp i (SOME x :: xs) = (x, i) :: mapp (i + 1) xs |
|
606 |
in |
|
607 |
mapp 0 xs |
|
608 |
end |
|
609 |
||
610 |
fun index_lookup xs x = |
|
611 |
case AList.lookup (op=) xs x of |
|
612 |
SOME x => x |
|
613 |
| NONE => error ("Cannot find " ^ x ^ " as argument annotation."); |
|
614 |
*} |
|
615 |
||
616 |
ML {* |
|
2431
331873ebc5cd
can now deal with type variables in nominal datatype definitions
Christian Urban <urbanc@in.tum.de>
parents:
2430
diff
changeset
|
617 |
fun prepare_bclauses dt_strs thy = |
1941 | 618 |
let |
619 |
val annos_bclauses = |
|
620 |
get_cnstrs dt_strs |
|
2612 | 621 |
|> (map o map) (fn (_, antys, _, bns) => (map fst antys, bns)) |
1941 | 622 |
|
623 |
fun prep_binder env bn_str = |
|
2431
331873ebc5cd
can now deal with type variables in nominal datatype definitions
Christian Urban <urbanc@in.tum.de>
parents:
2430
diff
changeset
|
624 |
case (Syntax.read_term_global thy bn_str) of |
1941 | 625 |
Free (x, _) => (NONE, index_lookup env x) |
626 |
| Const (a, T) $ Free (x, _) => (SOME (Const (a, T)), index_lookup env x) |
|
627 |
| _ => error ("The term " ^ bn_str ^ " is not allowed as binding function.") |
|
628 |
||
629 |
fun prep_body env bn_str = index_lookup env bn_str |
|
630 |
||
631 |
fun prep_bclause env (mode, binders, bodies) = |
|
632 |
let |
|
633 |
val binders' = map (prep_binder env) binders |
|
634 |
val bodies' = map (prep_body env) bodies |
|
635 |
in |
|
2424
621ebd8b13c4
changed parser so that the binding mode is indicated as "bind (list)", "bind (set)" or "bind (res)"; if only "bind" is given, then bind (list) is assumed as default
Christian Urban <urbanc@in.tum.de>
parents:
2411
diff
changeset
|
636 |
BC (mode, binders', bodies') |
1941 | 637 |
end |
638 |
||
639 |
fun prep_bclauses (annos, bclause_strs) = |
|
640 |
let |
|
641 |
val env = indexify annos (* for every label, associate the index *) |
|
642 |
in |
|
643 |
map (prep_bclause env) bclause_strs |
|
644 |
end |
|
645 |
in |
|
2612 | 646 |
((map o map) prep_bclauses annos_bclauses, thy) |
1941 | 647 |
end |
648 |
*} |
|
649 |
||
1943 | 650 |
text {* |
651 |
adds an empty binding clause for every argument |
|
652 |
that is not already part of a binding clause |
|
653 |
*} |
|
654 |
||
1941 | 655 |
ML {* |
656 |
fun included i bcs = |
|
657 |
let |
|
2431
331873ebc5cd
can now deal with type variables in nominal datatype definitions
Christian Urban <urbanc@in.tum.de>
parents:
2430
diff
changeset
|
658 |
fun incl (BC (_, bns, bds)) = |
331873ebc5cd
can now deal with type variables in nominal datatype definitions
Christian Urban <urbanc@in.tum.de>
parents:
2430
diff
changeset
|
659 |
member (op =) (map snd bns) i orelse member (op =) bds i |
1941 | 660 |
in |
661 |
exists incl bcs |
|
662 |
end |
|
663 |
*} |
|
664 |
||
665 |
ML {* |
|
666 |
fun complete dt_strs bclauses = |
|
667 |
let |
|
668 |
val args = |
|
669 |
get_cnstrs dt_strs |
|
2612 | 670 |
|> (map o map) (fn (_, antys, _, _) => length antys) |
1941 | 671 |
|
672 |
fun complt n bcs = |
|
673 |
let |
|
2288
3b83960f9544
new fv/fv_bn function (supp breaks now); exported raw perms and raw funs into separate ML-files
Christian Urban <urbanc@in.tum.de>
parents:
2146
diff
changeset
|
674 |
fun add bcs i = (if included i bcs then [] else [BC (Lst, [], [i])]) |
1941 | 675 |
in |
676 |
bcs @ (flat (map_range (add bcs) n)) |
|
677 |
end |
|
678 |
in |
|
2616
dd7490fdd998
all examples for strong exhausts work; recursive binders need to be treated differently; still unclean version with lots of diagnostic code
Christian Urban <urbanc@in.tum.de>
parents:
2613
diff
changeset
|
679 |
(map2 o map2) complt args bclauses |
1941 | 680 |
end |
681 |
*} |
|
682 |
||
683 |
ML {* |
|
2436
3885dc2669f9
cleaned up (almost completely) the examples
Christian Urban <urbanc@in.tum.de>
parents:
2435
diff
changeset
|
684 |
fun nominal_datatype2_cmd (opt_thms_name, dt_strs, bn_fun_strs, bn_eq_strs) lthy = |
1941 | 685 |
let |
2431
331873ebc5cd
can now deal with type variables in nominal datatype definitions
Christian Urban <urbanc@in.tum.de>
parents:
2430
diff
changeset
|
686 |
(* this theory is used just for parsing *) |
3045
d0ad264f8c4f
updated to Isabelle 3 Nov; it includes a hack to work around a bug in the localised version of the quotient package
Christian Urban <urbanc@in.tum.de>
parents:
2973
diff
changeset
|
687 |
val thy = Proof_Context.theory_of lthy |
2431
331873ebc5cd
can now deal with type variables in nominal datatype definitions
Christian Urban <urbanc@in.tum.de>
parents:
2430
diff
changeset
|
688 |
|
3091
578e0265b235
the default sort for type-variables in nominal specifications is fs; it is automatically addded
Christian Urban <urbanc@in.tum.de>
parents:
3076
diff
changeset
|
689 |
val (((dts, (bn_funs, bn_eqs)), bclauses), _) = |
3076
2b1b8404fe0d
partially localised the parsing process using functions fron Datatype
Christian Urban <urbanc@in.tum.de>
parents:
3065
diff
changeset
|
690 |
thy |
2431
331873ebc5cd
can now deal with type variables in nominal datatype definitions
Christian Urban <urbanc@in.tum.de>
parents:
2430
diff
changeset
|
691 |
|> prepare_dts dt_strs |
331873ebc5cd
can now deal with type variables in nominal datatype definitions
Christian Urban <urbanc@in.tum.de>
parents:
2430
diff
changeset
|
692 |
||>> prepare_bn_funs bn_fun_strs bn_eq_strs |
3076
2b1b8404fe0d
partially localised the parsing process using functions fron Datatype
Christian Urban <urbanc@in.tum.de>
parents:
3065
diff
changeset
|
693 |
||>> prepare_bclauses dt_strs |
2431
331873ebc5cd
can now deal with type variables in nominal datatype definitions
Christian Urban <urbanc@in.tum.de>
parents:
2430
diff
changeset
|
694 |
|
331873ebc5cd
can now deal with type variables in nominal datatype definitions
Christian Urban <urbanc@in.tum.de>
parents:
2430
diff
changeset
|
695 |
val bclauses' = complete dt_strs bclauses |
1941 | 696 |
in |
3076
2b1b8404fe0d
partially localised the parsing process using functions fron Datatype
Christian Urban <urbanc@in.tum.de>
parents:
3065
diff
changeset
|
697 |
nominal_datatype2 opt_thms_name dts bn_funs bn_eqs bclauses' lthy |
1941 | 698 |
end |
2424
621ebd8b13c4
changed parser so that the binding mode is indicated as "bind (list)", "bind (set)" or "bind (res)"; if only "bind" is given, then bind (list) is assumed as default
Christian Urban <urbanc@in.tum.de>
parents:
2411
diff
changeset
|
699 |
*} |
1941 | 700 |
|
2424
621ebd8b13c4
changed parser so that the binding mode is indicated as "bind (list)", "bind (set)" or "bind (res)"; if only "bind" is given, then bind (list) is assumed as default
Christian Urban <urbanc@in.tum.de>
parents:
2411
diff
changeset
|
701 |
ML {* |
621ebd8b13c4
changed parser so that the binding mode is indicated as "bind (list)", "bind (set)" or "bind (res)"; if only "bind" is given, then bind (list) is assumed as default
Christian Urban <urbanc@in.tum.de>
parents:
2411
diff
changeset
|
702 |
(* nominal datatype parser *) |
621ebd8b13c4
changed parser so that the binding mode is indicated as "bind (list)", "bind (set)" or "bind (res)"; if only "bind" is given, then bind (list) is assumed as default
Christian Urban <urbanc@in.tum.de>
parents:
2411
diff
changeset
|
703 |
local |
621ebd8b13c4
changed parser so that the binding mode is indicated as "bind (list)", "bind (set)" or "bind (res)"; if only "bind" is given, then bind (list) is assumed as default
Christian Urban <urbanc@in.tum.de>
parents:
2411
diff
changeset
|
704 |
structure P = Parse; |
621ebd8b13c4
changed parser so that the binding mode is indicated as "bind (list)", "bind (set)" or "bind (res)"; if only "bind" is given, then bind (list) is assumed as default
Christian Urban <urbanc@in.tum.de>
parents:
2411
diff
changeset
|
705 |
structure S = Scan |
621ebd8b13c4
changed parser so that the binding mode is indicated as "bind (list)", "bind (set)" or "bind (res)"; if only "bind" is given, then bind (list) is assumed as default
Christian Urban <urbanc@in.tum.de>
parents:
2411
diff
changeset
|
706 |
|
3076
2b1b8404fe0d
partially localised the parsing process using functions fron Datatype
Christian Urban <urbanc@in.tum.de>
parents:
3065
diff
changeset
|
707 |
fun triple1 ((x, y), z) = (x, y, z) |
3065
51ef8a3cb6ef
updated to lates changes in the datatype package
Christian Urban <urbanc@in.tum.de>
parents:
3063
diff
changeset
|
708 |
fun triple2 ((x, y), z) = (y, x, z) |
2431
331873ebc5cd
can now deal with type variables in nominal datatype definitions
Christian Urban <urbanc@in.tum.de>
parents:
2430
diff
changeset
|
709 |
fun tuple2 (((x, y), z), u) = (x, y, u, z) |
331873ebc5cd
can now deal with type variables in nominal datatype definitions
Christian Urban <urbanc@in.tum.de>
parents:
2430
diff
changeset
|
710 |
fun tuple3 ((x, y), (z, u)) = (x, y, z, u) |
2424
621ebd8b13c4
changed parser so that the binding mode is indicated as "bind (list)", "bind (set)" or "bind (res)"; if only "bind" is given, then bind (list) is assumed as default
Christian Urban <urbanc@in.tum.de>
parents:
2411
diff
changeset
|
711 |
in |
621ebd8b13c4
changed parser so that the binding mode is indicated as "bind (list)", "bind (set)" or "bind (res)"; if only "bind" is given, then bind (list) is assumed as default
Christian Urban <urbanc@in.tum.de>
parents:
2411
diff
changeset
|
712 |
|
2431
331873ebc5cd
can now deal with type variables in nominal datatype definitions
Christian Urban <urbanc@in.tum.de>
parents:
2430
diff
changeset
|
713 |
val opt_name = Scan.option (P.binding --| Args.colon) |
2424
621ebd8b13c4
changed parser so that the binding mode is indicated as "bind (list)", "bind (set)" or "bind (res)"; if only "bind" is given, then bind (list) is assumed as default
Christian Urban <urbanc@in.tum.de>
parents:
2411
diff
changeset
|
714 |
|
3134
301b74fcd614
updated to new Isabelle (declared keywords)
Christian Urban <urbanc@in.tum.de>
parents:
3091
diff
changeset
|
715 |
val anno_typ = S.option (P.name --| @{keyword "::"}) -- P.typ |
2424
621ebd8b13c4
changed parser so that the binding mode is indicated as "bind (list)", "bind (set)" or "bind (res)"; if only "bind" is given, then bind (list) is assumed as default
Christian Urban <urbanc@in.tum.de>
parents:
2411
diff
changeset
|
716 |
|
3134
301b74fcd614
updated to new Isabelle (declared keywords)
Christian Urban <urbanc@in.tum.de>
parents:
3091
diff
changeset
|
717 |
val bind_mode = @{keyword "binds"} |-- |
2424
621ebd8b13c4
changed parser so that the binding mode is indicated as "bind (list)", "bind (set)" or "bind (res)"; if only "bind" is given, then bind (list) is assumed as default
Christian Urban <urbanc@in.tum.de>
parents:
2411
diff
changeset
|
718 |
S.optional (Args.parens |
2634
3ce1089cdbf3
changed res keyword to set+ for restrictions; comment by a referee
Christian Urban <urbanc@in.tum.de>
parents:
2633
diff
changeset
|
719 |
(Args.$$$ "list" >> K Lst || (Args.$$$ "set" -- Args.$$$ "+") >> K Res || Args.$$$ "set" >> K Set)) Lst |
2424
621ebd8b13c4
changed parser so that the binding mode is indicated as "bind (list)", "bind (set)" or "bind (res)"; if only "bind" is given, then bind (list) is assumed as default
Christian Urban <urbanc@in.tum.de>
parents:
2411
diff
changeset
|
720 |
|
621ebd8b13c4
changed parser so that the binding mode is indicated as "bind (list)", "bind (set)" or "bind (res)"; if only "bind" is given, then bind (list) is assumed as default
Christian Urban <urbanc@in.tum.de>
parents:
2411
diff
changeset
|
721 |
val bind_clauses = |
3134
301b74fcd614
updated to new Isabelle (declared keywords)
Christian Urban <urbanc@in.tum.de>
parents:
3091
diff
changeset
|
722 |
P.enum "," (bind_mode -- S.repeat1 P.term -- (@{keyword "in"} |-- S.repeat1 P.name) >> triple1) |
2424
621ebd8b13c4
changed parser so that the binding mode is indicated as "bind (list)", "bind (set)" or "bind (res)"; if only "bind" is given, then bind (list) is assumed as default
Christian Urban <urbanc@in.tum.de>
parents:
2411
diff
changeset
|
723 |
|
621ebd8b13c4
changed parser so that the binding mode is indicated as "bind (list)", "bind (set)" or "bind (res)"; if only "bind" is given, then bind (list) is assumed as default
Christian Urban <urbanc@in.tum.de>
parents:
2411
diff
changeset
|
724 |
val cnstr_parser = |
2431
331873ebc5cd
can now deal with type variables in nominal datatype definitions
Christian Urban <urbanc@in.tum.de>
parents:
2430
diff
changeset
|
725 |
P.binding -- S.repeat anno_typ -- bind_clauses -- P.opt_mixfix >> tuple2 |
2424
621ebd8b13c4
changed parser so that the binding mode is indicated as "bind (list)", "bind (set)" or "bind (res)"; if only "bind" is given, then bind (list) is assumed as default
Christian Urban <urbanc@in.tum.de>
parents:
2411
diff
changeset
|
726 |
|
621ebd8b13c4
changed parser so that the binding mode is indicated as "bind (list)", "bind (set)" or "bind (res)"; if only "bind" is given, then bind (list) is assumed as default
Christian Urban <urbanc@in.tum.de>
parents:
2411
diff
changeset
|
727 |
(* datatype parser *) |
621ebd8b13c4
changed parser so that the binding mode is indicated as "bind (list)", "bind (set)" or "bind (res)"; if only "bind" is given, then bind (list) is assumed as default
Christian Urban <urbanc@in.tum.de>
parents:
2411
diff
changeset
|
728 |
val dt_parser = |
3065
51ef8a3cb6ef
updated to lates changes in the datatype package
Christian Urban <urbanc@in.tum.de>
parents:
3063
diff
changeset
|
729 |
(P.type_args_constrained -- P.binding -- P.opt_mixfix >> triple2) -- |
3134
301b74fcd614
updated to new Isabelle (declared keywords)
Christian Urban <urbanc@in.tum.de>
parents:
3091
diff
changeset
|
730 |
(@{keyword "="} |-- P.enum1 "|" cnstr_parser) |
2424
621ebd8b13c4
changed parser so that the binding mode is indicated as "bind (list)", "bind (set)" or "bind (res)"; if only "bind" is given, then bind (list) is assumed as default
Christian Urban <urbanc@in.tum.de>
parents:
2411
diff
changeset
|
731 |
|
621ebd8b13c4
changed parser so that the binding mode is indicated as "bind (list)", "bind (set)" or "bind (res)"; if only "bind" is given, then bind (list) is assumed as default
Christian Urban <urbanc@in.tum.de>
parents:
2411
diff
changeset
|
732 |
(* binding function parser *) |
621ebd8b13c4
changed parser so that the binding mode is indicated as "bind (list)", "bind (set)" or "bind (res)"; if only "bind" is given, then bind (list) is assumed as default
Christian Urban <urbanc@in.tum.de>
parents:
2411
diff
changeset
|
733 |
val bnfun_parser = |
3134
301b74fcd614
updated to new Isabelle (declared keywords)
Christian Urban <urbanc@in.tum.de>
parents:
3091
diff
changeset
|
734 |
S.optional (@{keyword "binder"} |-- P.fixes -- Parse_Spec.where_alt_specs) ([], []) |
2424
621ebd8b13c4
changed parser so that the binding mode is indicated as "bind (list)", "bind (set)" or "bind (res)"; if only "bind" is given, then bind (list) is assumed as default
Christian Urban <urbanc@in.tum.de>
parents:
2411
diff
changeset
|
735 |
|
621ebd8b13c4
changed parser so that the binding mode is indicated as "bind (list)", "bind (set)" or "bind (res)"; if only "bind" is given, then bind (list) is assumed as default
Christian Urban <urbanc@in.tum.de>
parents:
2411
diff
changeset
|
736 |
(* main parser *) |
621ebd8b13c4
changed parser so that the binding mode is indicated as "bind (list)", "bind (set)" or "bind (res)"; if only "bind" is given, then bind (list) is assumed as default
Christian Urban <urbanc@in.tum.de>
parents:
2411
diff
changeset
|
737 |
val main_parser = |
2431
331873ebc5cd
can now deal with type variables in nominal datatype definitions
Christian Urban <urbanc@in.tum.de>
parents:
2430
diff
changeset
|
738 |
opt_name -- P.and_list1 dt_parser -- bnfun_parser >> tuple3 |
2424
621ebd8b13c4
changed parser so that the binding mode is indicated as "bind (list)", "bind (set)" or "bind (res)"; if only "bind" is given, then bind (list) is assumed as default
Christian Urban <urbanc@in.tum.de>
parents:
2411
diff
changeset
|
739 |
|
621ebd8b13c4
changed parser so that the binding mode is indicated as "bind (list)", "bind (set)" or "bind (res)"; if only "bind" is given, then bind (list) is assumed as default
Christian Urban <urbanc@in.tum.de>
parents:
2411
diff
changeset
|
740 |
end |
1941 | 741 |
|
742 |
(* Command Keyword *) |
|
3190
1b7c034c9e9e
used ML-antiquotation command_spec for new commands
Christian Urban <urbanc@in.tum.de>
parents:
3181
diff
changeset
|
743 |
val _ = Outer_Syntax.local_theory @{command_spec "nominal_datatype"} |
3135
92b9b8d2888d
updated to new Isabelle (20 March)
Christian Urban <urbanc@in.tum.de>
parents:
3134
diff
changeset
|
744 |
"declaration of nominal datatypes" |
92b9b8d2888d
updated to new Isabelle (20 March)
Christian Urban <urbanc@in.tum.de>
parents:
3134
diff
changeset
|
745 |
(main_parser >> nominal_datatype2_cmd) |
1941 | 746 |
*} |
747 |
||
3226
780b7a2c50b6
updated to changes in Isabelle
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
3218
diff
changeset
|
748 |
|
1941 | 749 |
end |