1261
853abc14c5c6
added IsaMakefile...but so far included only a test for the parser
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1
theory Parser
1494
923413256cbb
Clean 'Lift', start working only on exported things in Parser.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 2
imports "Nominal2_Atoms" "Nominal2_Eqvt" "Nominal2_Supp" "Perm" "Fv" "Rsp" "Lift"
954
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 3
begin
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 4
1194
+ − 5
section{* Interface for nominal_datatype *}
+ − 6
+ − 7
text {*
+ − 8
+ − 9
Nominal-Datatype-part:
+ − 10
+ − 11
1266
+ − 12
1nd Arg: (string list * binding * mixfix * (binding * typ list * mixfix) list) list
1194
+ − 13
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ − 14
type(s) to be defined constructors list
+ − 15
(ty args, name, syn) (name, typs, syn)
+ − 16
+ − 17
Binder-Function-part:
+ − 18
1266
+ − 19
2rd Arg: (binding * typ option * mixfix) list
1223
160343d86a6f
"raw"-ified the term-constructors and types given in the specification
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 20
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1194
+ − 21
binding function(s)
+ − 22
to be defined
+ − 23
(name, type, syn)
+ − 24
1266
+ − 25
3th Arg: term list
1223
160343d86a6f
"raw"-ified the term-constructors and types given in the specification
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 26
^^^^^^^^^
1194
+ − 27
the equations of the binding functions
+ − 28
(Trueprop equations)
954
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 29
*}
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 30
1283
6a133abb7633
generated the "binding list" from the input; at the moment it is only printed out as tracing; does not yet include the "bind itself binders"
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 31
ML {*
6a133abb7633
generated the "binding list" from the input; at the moment it is only printed out as tracing; does not yet include the "bind itself binders"
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 32
6a133abb7633
generated the "binding list" from the input; at the moment it is only printed out as tracing; does not yet include the "bind itself binders"
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 33
*}
6a133abb7633
generated the "binding list" from the input; at the moment it is only printed out as tracing; does not yet include the "bind itself binders"
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 34
1194
+ − 35
text {*****************************************************}
+ − 36
ML {*
+ − 37
(* nominal datatype parser *)
+ − 38
local
+ − 39
structure P = OuterParse
1266
+ − 40
+ − 41
fun tuple ((x, y, z), u) = (x, y, z, u)
1283
6a133abb7633
generated the "binding list" from the input; at the moment it is only printed out as tracing; does not yet include the "bind itself binders"
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 42
fun tswap (((x, y), z), u) = (x, y, u, z)
1194
+ − 43
in
+ − 44
+ − 45
val _ = OuterKeyword.keyword "bind"
+ − 46
val anno_typ = Scan.option (P.name --| P.$$$ "::") -- P.typ
954
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 47
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 48
(* binding specification *)
1266
+ − 49
(* maybe use and_list *)
954
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 50
val bind_parser =
1283
6a133abb7633
generated the "binding list" from the input; at the moment it is only printed out as tracing; does not yet include the "bind itself binders"
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 51
P.enum "," ((P.$$$ "bind" |-- P.term) -- (P.$$$ "in" |-- P.name) >> swap)
954
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 52
1223
160343d86a6f
"raw"-ified the term-constructors and types given in the specification
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 53
val constr_parser =
160343d86a6f
"raw"-ified the term-constructors and types given in the specification
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 54
P.binding -- Scan.repeat anno_typ
160343d86a6f
"raw"-ified the term-constructors and types given in the specification
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 55
954
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 56
(* datatype parser *)
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 57
val dt_parser =
1283
6a133abb7633
generated the "binding list" from the input; at the moment it is only printed out as tracing; does not yet include the "bind itself binders"
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 58
(P.type_args -- P.binding -- P.opt_mixfix >> P.triple1) --
6a133abb7633
generated the "binding list" from the input; at the moment it is only printed out as tracing; does not yet include the "bind itself binders"
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 59
(P.$$$ "=" |-- P.enum1 "|" (constr_parser -- bind_parser -- P.opt_mixfix >> tswap)) >> tuple
954
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 60
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 61
(* function equation parser *)
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 62
val fun_parser =
1194
+ − 63
Scan.optional (P.$$$ "binder" |-- P.fixes -- SpecParse.where_alt_specs) ([],[])
+ − 64
+ − 65
(* main parser *)
1223
160343d86a6f
"raw"-ified the term-constructors and types given in the specification
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 66
val main_parser =
1266
+ − 67
(P.and_list1 dt_parser) -- fun_parser >> P.triple2
1194
+ − 68
+ − 69
end
954
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 70
*}
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 71
1223
160343d86a6f
"raw"-ified the term-constructors and types given in the specification
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 72
(* adds "_raw" to the end of constants and types *)
160343d86a6f
"raw"-ified the term-constructors and types given in the specification
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 73
ML {*
160343d86a6f
"raw"-ified the term-constructors and types given in the specification
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 74
fun add_raw s = s ^ "_raw"
1251
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 75
fun add_raws ss = map add_raw ss
1223
160343d86a6f
"raw"-ified the term-constructors and types given in the specification
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 76
fun raw_bind bn = Binding.suffix_name "_raw" bn
160343d86a6f
"raw"-ified the term-constructors and types given in the specification
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 77
1251
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 78
fun replace_str ss s =
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 79
case (AList.lookup (op=) ss s) of
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 80
SOME s' => s'
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 81
| NONE => s
1223
160343d86a6f
"raw"-ified the term-constructors and types given in the specification
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 82
1251
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 83
fun replace_typ ty_ss (Type (a, Ts)) = Type (replace_str ty_ss a, map (replace_typ ty_ss) Ts)
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 84
| replace_typ ty_ss T = T
1223
160343d86a6f
"raw"-ified the term-constructors and types given in the specification
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 85
1251
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 86
fun raw_dts ty_ss dts =
1223
160343d86a6f
"raw"-ified the term-constructors and types given in the specification
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 87
let
1251
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 88
1223
160343d86a6f
"raw"-ified the term-constructors and types given in the specification
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 89
fun raw_dts_aux1 (bind, tys, mx) =
1289
+ − 90
(raw_bind bind, map (replace_typ ty_ss) tys, mx)
1223
160343d86a6f
"raw"-ified the term-constructors and types given in the specification
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 91
160343d86a6f
"raw"-ified the term-constructors and types given in the specification
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 92
fun raw_dts_aux2 (ty_args, bind, mx, constrs) =
160343d86a6f
"raw"-ified the term-constructors and types given in the specification
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 93
(ty_args, raw_bind bind, mx, map raw_dts_aux1 constrs)
160343d86a6f
"raw"-ified the term-constructors and types given in the specification
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 94
in
160343d86a6f
"raw"-ified the term-constructors and types given in the specification
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 95
map raw_dts_aux2 dts
160343d86a6f
"raw"-ified the term-constructors and types given in the specification
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 96
end
160343d86a6f
"raw"-ified the term-constructors and types given in the specification
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 97
1251
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 98
fun replace_aterm trm_ss (Const (a, T)) = Const (replace_str trm_ss a, T)
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 99
| replace_aterm trm_ss (Free (a, T)) = Free (replace_str trm_ss a, T)
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 100
| replace_aterm trm_ss trm = trm
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 101
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 102
fun replace_term trm_ss ty_ss trm =
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 103
trm |> Term.map_aterms (replace_aterm trm_ss) |> map_types (replace_typ ty_ss)
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 104
*}
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 105
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 106
ML {*
1289
+ − 107
fun get_cnstrs dts =
1290
+ − 108
map (fn (_, _, _, constrs) => constrs) dts
1251
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 109
1289
+ − 110
fun get_typed_cnstrs dts =
1251
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 111
flat (map (fn (_, bn, _, constrs) =>
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 112
(map (fn (bn', _, _) => (Binding.name_of bn, Binding.name_of bn')) constrs)) dts)
1232
35bc8f7b66f8
parsing of function definitions almost works now; still an error with undefined constants
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 113
1289
+ − 114
fun get_cnstr_strs dts =
1290
+ − 115
map (fn (bn, _, _) => Binding.name_of bn) (flat (get_cnstrs dts))
1232
35bc8f7b66f8
parsing of function definitions almost works now; still an error with undefined constants
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 116
1223
160343d86a6f
"raw"-ified the term-constructors and types given in the specification
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 117
fun get_bn_fun_strs bn_funs =
160343d86a6f
"raw"-ified the term-constructors and types given in the specification
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 118
map (fn (bn_fun, _, _) => Binding.name_of bn_fun) bn_funs
160343d86a6f
"raw"-ified the term-constructors and types given in the specification
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 119
*}
160343d86a6f
"raw"-ified the term-constructors and types given in the specification
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 120
160343d86a6f
"raw"-ified the term-constructors and types given in the specification
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 121
ML {*
1289
+ − 122
fun rawify_dts dt_names dts dts_env =
1223
160343d86a6f
"raw"-ified the term-constructors and types given in the specification
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 123
let
1289
+ − 124
val raw_dts = raw_dts dts_env dts
1287
+ − 125
val raw_dt_names = add_raws dt_names
1228
c179ad9d2446
declarartion of the raw datatype already works; raw binding functions throw an exception about mutual recursive types
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 126
in
1287
+ − 127
(raw_dt_names, raw_dts)
1228
c179ad9d2446
declarartion of the raw datatype already works; raw binding functions throw an exception about mutual recursive types
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 128
end
c179ad9d2446
declarartion of the raw datatype already works; raw binding functions throw an exception about mutual recursive types
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 129
*}
c179ad9d2446
declarartion of the raw datatype already works; raw binding functions throw an exception about mutual recursive types
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 130
c179ad9d2446
declarartion of the raw datatype already works; raw binding functions throw an exception about mutual recursive types
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 131
ML {*
1289
+ − 132
fun rawify_bn_funs dts_env cnstrs_env bn_fun_env bn_funs bn_eqs =
+ − 133
let
+ − 134
val bn_funs' = map (fn (bn, ty, mx) =>
+ − 135
(raw_bind bn, replace_typ dts_env ty, mx)) bn_funs
+ − 136
+ − 137
val bn_eqs' = map (fn (attr, trm) =>
+ − 138
(attr, replace_term (cnstrs_env @ bn_fun_env) dts_env trm)) bn_eqs
+ − 139
in
+ − 140
(bn_funs', bn_eqs')
+ − 141
end
+ − 142
*}
+ − 143
+ − 144
ML {*
1293
+ − 145
fun rawify_binds dts_env cnstrs_env bn_fun_env binds =
+ − 146
map (map (map (map (fn (opt_trm, i, j) =>
1375
aa787c9b6955
A version of Fv that takes into account recursive and non-recursive bindings.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 147
(Option.map (apfst (replace_term (cnstrs_env @ bn_fun_env) dts_env)) opt_trm, i, j))))) binds
1293
+ − 148
*}
+ − 149
1380
dab8d99b37c1
added bn-information, but it is not yet ordered according to the dts
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 150
ML {*
1392
+ − 151
fun find [] _ = error ("cannot find element")
+ − 152
| find ((x, z)::xs) y = if (Long_Name.base_name x) = y then z else find xs y
+ − 153
*}
+ − 154
+ − 155
ML {*
1403
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 156
fun prep_bn dt_names dts eqs =
1380
dab8d99b37c1
added bn-information, but it is not yet ordered according to the dts
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 157
let
dab8d99b37c1
added bn-information, but it is not yet ordered according to the dts
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 158
fun aux eq =
dab8d99b37c1
added bn-information, but it is not yet ordered according to the dts
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 159
let
dab8d99b37c1
added bn-information, but it is not yet ordered according to the dts
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 160
val (lhs, rhs) = eq
dab8d99b37c1
added bn-information, but it is not yet ordered according to the dts
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 161
|> strip_qnt_body "all"
dab8d99b37c1
added bn-information, but it is not yet ordered according to the dts
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 162
|> HOLogic.dest_Trueprop
dab8d99b37c1
added bn-information, but it is not yet ordered according to the dts
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 163
|> HOLogic.dest_eq
1392
+ − 164
val (bn_fun, [cnstr]) = strip_comb lhs
+ − 165
val (_, ty) = dest_Free bn_fun
1380
dab8d99b37c1
added bn-information, but it is not yet ordered according to the dts
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 166
val (ty_name, _) = dest_Type (domain_type ty)
dab8d99b37c1
added bn-information, but it is not yet ordered according to the dts
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 167
val dt_index = find_index (fn x => x = ty_name) dt_names
1392
+ − 168
val (cnstr_head, cnstr_args) = strip_comb cnstr
1380
dab8d99b37c1
added bn-information, but it is not yet ordered according to the dts
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 169
val included = map (fn i => length (cnstr_args) - i - 1) (loose_bnos rhs)
dab8d99b37c1
added bn-information, but it is not yet ordered according to the dts
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 170
in
1392
+ − 171
(dt_index, (bn_fun, (cnstr_head, included)))
+ − 172
end
+ − 173
+ − 174
fun order dts i ts =
+ − 175
let
+ − 176
val dt = nth dts i
+ − 177
val cts = map (fn (x, _, _) => Binding.name_of x) ((fn (_, _, _, x) => x) dt)
+ − 178
val ts' = map (fn (x, y) => (fst (dest_Const x), y)) ts
+ − 179
in
+ − 180
map (find ts') cts
+ − 181
end
+ − 182
+ − 183
val unordered = AList.group (op=) (map aux eqs)
+ − 184
val unordered' = map (fn (x, y) => (x, AList.group (op=) y)) unordered
+ − 185
val ordered = map (fn (x, y) => (x, map (fn (v, z) => (v, order dts x z)) y)) unordered'
1380
dab8d99b37c1
added bn-information, but it is not yet ordered according to the dts
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 186
in
1392
+ − 187
ordered
1380
dab8d99b37c1
added bn-information, but it is not yet ordered according to the dts
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 188
end
dab8d99b37c1
added bn-information, but it is not yet ordered according to the dts
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 189
*}
dab8d99b37c1
added bn-information, but it is not yet ordered according to the dts
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 190
1293
+ − 191
ML {*
1289
+ − 192
fun add_primrec_wrapper funs eqs lthy =
+ − 193
if null funs then (([], []), lthy)
+ − 194
else
+ − 195
let
+ − 196
val eqs' = map (fn (_, eq) => (Attrib.empty_binding, eq)) eqs
+ − 197
val funs' = map (fn (bn, ty, mx) => (bn, SOME ty, mx)) funs
+ − 198
in
+ − 199
Primrec.add_primrec funs' eqs' lthy
+ − 200
end
+ − 201
*}
+ − 202
1293
+ − 203
ML {*
+ − 204
fun add_datatype_wrapper dt_names dts =
+ − 205
let
+ − 206
val conf = Datatype.default_config
+ − 207
in
+ − 208
Local_Theory.theory_result (Datatype.add_datatype conf dt_names dts)
+ − 209
end
+ − 210
*}
1289
+ − 211
+ − 212
ML {*
1293
+ − 213
fun raw_nominal_decls dts bn_funs bn_eqs binds lthy =
1228
c179ad9d2446
declarartion of the raw datatype already works; raw binding functions throw an exception about mutual recursive types
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 214
let
1251
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 215
val thy = ProofContext.theory_of lthy
1289
+ − 216
val thy_name = Context.theory_name thy
1251
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 217
1289
+ − 218
val dt_names = map (fn (_, s, _, _) => Binding.name_of s) dts
+ − 219
val dt_full_names = map (Long_Name.qualify thy_name) dt_names
+ − 220
val dt_full_names' = add_raws dt_full_names
+ − 221
val dts_env = dt_full_names ~~ dt_full_names'
+ − 222
+ − 223
val cnstrs = get_cnstr_strs dts
+ − 224
val cnstrs_ty = get_typed_cnstrs dts
+ − 225
val cnstrs_full_names = map (Long_Name.qualify thy_name) cnstrs
+ − 226
val cnstrs_full_names' = map (fn (x, y) => Long_Name.qualify thy_name
+ − 227
(Long_Name.qualify (add_raw x) (add_raw y))) cnstrs_ty
+ − 228
val cnstrs_env = cnstrs_full_names ~~ cnstrs_full_names'
1251
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 229
1223
160343d86a6f
"raw"-ified the term-constructors and types given in the specification
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 230
val bn_fun_strs = get_bn_fun_strs bn_funs
1251
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 231
val bn_fun_strs' = add_raws bn_fun_strs
1266
+ − 232
val bn_fun_env = bn_fun_strs ~~ bn_fun_strs'
1293
+ − 233
val bn_fun_full_env = map (pairself (Long_Name.qualify thy_name))
+ − 234
(bn_fun_strs ~~ bn_fun_strs')
+ − 235
1289
+ − 236
val (raw_dt_names, raw_dts) = rawify_dts dt_names dts dts_env
1223
160343d86a6f
"raw"-ified the term-constructors and types given in the specification
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 237
1289
+ − 238
val (raw_bn_funs, raw_bn_eqs) = rawify_bn_funs dts_env cnstrs_env bn_fun_env bn_funs bn_eqs
1293
+ − 239
+ − 240
val raw_binds = rawify_binds dts_env cnstrs_env bn_fun_full_env binds
1380
dab8d99b37c1
added bn-information, but it is not yet ordered according to the dts
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 241
1403
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 242
val raw_bns = prep_bn dt_full_names' raw_dts (map snd raw_bn_eqs)
1380
dab8d99b37c1
added bn-information, but it is not yet ordered according to the dts
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 243
1480
21cbb5b0e321
cheat_alpha_eqvt no longer needed. Cleaned the tracing messages.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 244
(*val _ = tracing (cat_lines (map PolyML.makestring raw_bns))*)
1223
160343d86a6f
"raw"-ified the term-constructors and types given in the specification
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 245
in
1289
+ − 246
lthy
1293
+ − 247
|> add_datatype_wrapper raw_dt_names raw_dts
1289
+ − 248
||>> add_primrec_wrapper raw_bn_funs raw_bn_eqs
1293
+ − 249
||>> pair raw_binds
1380
dab8d99b37c1
added bn-information, but it is not yet ordered according to the dts
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 250
||>> pair raw_bns
1293
+ − 251
end
+ − 252
*}
+ − 253
1341
c25f797c7e6e
Added lifting of pseudo-injectivity, commented out the code again and enabled the weird examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 254
lemma equivp_hack: "equivp x"
c25f797c7e6e
Added lifting of pseudo-injectivity, commented out the code again and enabled the weird examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 255
sorry
c25f797c7e6e
Added lifting of pseudo-injectivity, commented out the code again and enabled the weird examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 256
ML {*
c25f797c7e6e
Added lifting of pseudo-injectivity, commented out the code again and enabled the weird examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 257
fun equivp_hack ctxt rel =
c25f797c7e6e
Added lifting of pseudo-injectivity, commented out the code again and enabled the weird examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 258
let
c25f797c7e6e
Added lifting of pseudo-injectivity, commented out the code again and enabled the weird examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 259
val thy = ProofContext.theory_of ctxt
c25f797c7e6e
Added lifting of pseudo-injectivity, commented out the code again and enabled the weird examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 260
val ty = domain_type (fastype_of rel)
c25f797c7e6e
Added lifting of pseudo-injectivity, commented out the code again and enabled the weird examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 261
val cty = ctyp_of thy ty
c25f797c7e6e
Added lifting of pseudo-injectivity, commented out the code again and enabled the weird examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 262
val ct = cterm_of thy rel
c25f797c7e6e
Added lifting of pseudo-injectivity, commented out the code again and enabled the weird examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 263
in
c25f797c7e6e
Added lifting of pseudo-injectivity, commented out the code again and enabled the weird examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 264
Drule.instantiate' [SOME cty] [SOME ct] @{thm equivp_hack}
c25f797c7e6e
Added lifting of pseudo-injectivity, commented out the code again and enabled the weird examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 265
end
c25f797c7e6e
Added lifting of pseudo-injectivity, commented out the code again and enabled the weird examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 266
*}
c25f797c7e6e
Added lifting of pseudo-injectivity, commented out the code again and enabled the weird examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 267
1484
+ − 268
ML {* val cheat_equivp = Unsynchronized.ref true *}
1443
+ − 269
1576
+ − 270
(* These 4 are not needed any more *)
1573
+ − 271
ML {* val cheat_fv_rsp = Unsynchronized.ref false *}
1547
57f7af5d7564
Use fs typeclass in showing finite support + some cheat cleaning.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 272
ML {* val cheat_fv_eqvt = Unsynchronized.ref false *}
57f7af5d7564
Use fs typeclass in showing finite support + some cheat cleaning.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 273
ML {* val cheat_alpha_eqvt = Unsynchronized.ref false *}
1576
+ − 274
ML {* val cheat_alpha_bn_rsp = Unsynchronized.ref false *}
1341
c25f797c7e6e
Added lifting of pseudo-injectivity, commented out the code again and enabled the weird examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 275
1428
+ − 276
1346
+ − 277
ML {*
1293
+ − 278
fun nominal_datatype2 dts bn_funs bn_eqs binds lthy =
+ − 279
let
1480
21cbb5b0e321
cheat_alpha_eqvt no longer needed. Cleaned the tracing messages.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 280
val _ = tracing "Raw declarations";
1340
+ − 281
val thy = ProofContext.theory_of lthy
+ − 282
val thy_name = Context.theory_name thy
1380
dab8d99b37c1
added bn-information, but it is not yet ordered according to the dts
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 283
val ((((raw_dt_names, (raw_bn_funs_loc, raw_bn_eqs_loc)), raw_binds), raw_bns), lthy2) =
1293
+ − 284
raw_nominal_decls dts bn_funs bn_eqs binds lthy
1396
+ − 285
val morphism_2_1 = ProofContext.export_morphism lthy2 lthy
+ − 286
val raw_bns_exp = map (apsnd (map (apfst (Morphism.term morphism_2_1)))) raw_bns;
+ − 287
val bn_funs_decls = flat (map (fn (ith, l) => map (fn (bn, data) => (bn, ith, data)) l) raw_bns_exp);
1316
0577afdb1732
Porting from Lift to Parser; until defining the Quotient type.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 288
val raw_bn_funs = map (Morphism.term morphism_2_1) raw_bn_funs_loc
0577afdb1732
Porting from Lift to Parser; until defining the Quotient type.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 289
val raw_bn_eqs = ProofContext.export lthy2 lthy raw_bn_eqs_loc
1497
+ − 290
1295
0ecc775e5fce
Link calls to Raw permutations, FV definition and alpha_definition into the parser.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 291
val dtinfo = Datatype.the_info (ProofContext.theory_of lthy2) (hd raw_dt_names);
1309
+ − 292
val descr = #descr dtinfo;
1316
0577afdb1732
Porting from Lift to Parser; until defining the Quotient type.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 293
val sorts = #sorts dtinfo;
0577afdb1732
Porting from Lift to Parser; until defining the Quotient type.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 294
val all_typs = map (fn i => typ_of_dtyp descr sorts (DtRec i)) (map fst descr)
1309
+ − 295
val all_full_tnames = map (fn (_, (n, _, _)) => n) descr;
+ − 296
val dtinfos = map (Datatype.the_info (ProofContext.theory_of lthy2)) all_full_tnames;
1342
+ − 297
val rel_dtinfos = List.take (dtinfos, (length dts));
1309
+ − 298
val inject = flat (map #inject dtinfos);
1428
+ − 299
val distincts = flat (map #distinct dtinfos);
1342
+ − 300
val rel_distinct = map #distinct rel_dtinfos;
1316
0577afdb1732
Porting from Lift to Parser; until defining the Quotient type.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 301
val induct = #induct dtinfo;
1309
+ − 302
val inducts = #inducts dtinfo;
1576
+ − 303
val exhausts = map #exhaust dtinfos;
1480
21cbb5b0e321
cheat_alpha_eqvt no longer needed. Cleaned the tracing messages.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 304
val _ = tracing "Defining permutations, fv and alpha";
1295
0ecc775e5fce
Link calls to Raw permutations, FV definition and alpha_definition into the parser.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 305
val ((raw_perm_def, raw_perm_simps, perms), lthy3) =
0ecc775e5fce
Link calls to Raw permutations, FV definition and alpha_definition into the parser.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 306
Local_Theory.theory_result (define_raw_perms dtinfo (length dts)) lthy2;
0ecc775e5fce
Link calls to Raw permutations, FV definition and alpha_definition into the parser.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 307
val raw_binds_flat = map (map flat) raw_binds;
1553
4355eb3b7161
Automatically derive support for datatypes with at-most one binding per constructor.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 308
val ((((fv_ts, ordered_fv_ts), fv_def), ((alpha_ts, alpha_intros), (alpha_cases, alpha_induct))), lthy4) =
1497
+ − 309
define_fv_alpha_export dtinfo raw_binds_flat bn_funs_decls lthy3;
1448
+ − 310
val (fv_ts_nobn, fv_ts_bn) = chop (length perms) fv_ts;
1416
+ − 311
val (alpha_ts_nobn, alpha_ts_bn) = chop (length perms) alpha_ts
1576
+ − 312
val alpha_inducts = Project_Rule.projects lthy4 (1 upto (length dts)) alpha_induct;
1309
+ − 313
val dts_names = map (fn (i, (s, _, _)) => (s, i)) (#descr dtinfo);
+ − 314
val bn_tys = map (domain_type o fastype_of) raw_bn_funs;
+ − 315
val bn_nos = map (dtyp_no_of_typ dts_names) bn_tys;
1497
+ − 316
val bns = raw_bn_funs ~~ bn_nos;
1576
+ − 317
val rel_dists = flat (map (distinct_rel lthy4 alpha_cases)
+ − 318
(rel_distinct ~~ alpha_ts_nobn));
+ − 319
val rel_dists_bn = flat (map (distinct_rel lthy4 alpha_cases)
+ − 320
((map (fn i => nth rel_distinct i) bn_nos) ~~ alpha_ts_bn))
1496
fd483d8f486b
Prove pseudo-inject (eq-iff) on the exported level and rename appropriately.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 321
val alpha_eq_iff = build_alpha_inj alpha_intros (inject @ distincts) alpha_cases lthy4
1480
21cbb5b0e321
cheat_alpha_eqvt no longer needed. Cleaned the tracing messages.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 322
val _ = tracing "Proving equivariance";
1409
+ − 323
val (bv_eqvts, lthy5) = fold_map (build_bv_eqvt (raw_bn_eqs @ raw_perm_def) inducts) bns lthy4;
1411
+ − 324
val fv_eqvt_tac =
+ − 325
if !cheat_fv_eqvt then (fn _ => fn _ => Skip_Proof.cheat_tac thy)
1495
+ − 326
else build_eqvts_tac induct ((flat (map snd bv_eqvts)) @ fv_def @ raw_perm_def) lthy5
+ − 327
val (fv_eqvts, lthy6) = build_eqvts Binding.empty fv_ts_nobn fv_eqvt_tac lthy5;
+ − 328
val (fv_bn_eqvts, lthy6a) =
+ − 329
if fv_ts_bn = [] then ([], lthy6) else
+ − 330
fold_map (build_bv_eqvt ((flat (map snd bv_eqvts)) @ fv_def @ raw_perm_def) inducts)
1553
4355eb3b7161
Automatically derive support for datatypes with at-most one binding per constructor.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 331
(fv_ts_bn ~~ bn_nos) lthy6;
1495
+ − 332
val raw_fv_bv_eqvt = flat (map snd bv_eqvts) @ (snd fv_eqvts) @ flat (map snd fv_bn_eqvts)
1454
7c8cd6eae8e2
FV_bn generated for recursive functions as well, and used in main fv for bindings.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 333
fun alpha_eqvt_tac' _ =
7c8cd6eae8e2
FV_bn generated for recursive functions as well, and used in main fv for bindings.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 334
if !cheat_alpha_eqvt then Skip_Proof.cheat_tac thy
1496
fd483d8f486b
Prove pseudo-inject (eq-iff) on the exported level and rename appropriately.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 335
else alpha_eqvt_tac alpha_induct (raw_perm_def @ alpha_eq_iff @ raw_fv_bv_eqvt) lthy6a 1
1495
+ − 336
val alpha_eqvt = build_alpha_eqvts alpha_ts alpha_eqvt_tac' lthy6a;
1480
21cbb5b0e321
cheat_alpha_eqvt no longer needed. Cleaned the tracing messages.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 337
val _ = tracing "Proving equivalence";
1573
+ − 338
val (rfv_ts_nobn, rfv_ts_bn) = chop (length perms) ordered_fv_ts;
+ − 339
val fv_alpha_all = combine_fv_alpha_bns (rfv_ts_nobn, rfv_ts_bn) (alpha_ts_nobn, alpha_ts_bn) bn_nos;
1581
6b1eea8dcdc0
equivp_cheat can be removed for all one-permutation examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 340
val reflps = build_alpha_refl fv_alpha_all alpha_ts induct alpha_eq_iff lthy6a;
1494
923413256cbb
Clean 'Lift', start working only on exported things in Parser.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 341
val alpha_equivp =
1495
+ − 342
if !cheat_equivp then map (equivp_hack lthy6a) alpha_ts_nobn
1559
+ − 343
else build_equivps alpha_ts reflps alpha_induct
1496
fd483d8f486b
Prove pseudo-inject (eq-iff) on the exported level and rename appropriately.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 344
inject alpha_eq_iff distincts alpha_cases alpha_eqvt lthy6a;
1412
+ − 345
val qty_binds = map (fn (_, b, _, _) => b) dts;
+ − 346
val qty_names = map Name.of_binding qty_binds;
+ − 347
val qty_full_names = map (Long_Name.qualify thy_name) qty_names
1316
0577afdb1732
Porting from Lift to Parser; until defining the Quotient type.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 348
val lthy7 = define_quotient_type
1414
+ − 349
(map (fn ((b, t), alpha) => (([], b, NoSyn), (t, alpha))) ((qty_binds ~~ all_typs) ~~ alpha_ts_nobn))
1495
+ − 350
(ALLGOALS (resolve_tac alpha_equivp)) lthy6a;
1340
+ − 351
val const_names = map Name.of_binding (flat (map (fn (_, _, _, t) => map (fn (b, _, _) => b) t) dts));
+ − 352
val raw_consts =
+ − 353
flat (map (fn (i, (_, _, l)) =>
+ − 354
map (fn (cname, dts) =>
+ − 355
Const (cname, map (typ_of_dtyp descr sorts) dts --->
+ − 356
typ_of_dtyp descr sorts (DtRec i))) l) descr);
1494
923413256cbb
Clean 'Lift', start working only on exported things in Parser.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 357
val (consts, const_defs, lthy8) = quotient_lift_consts_export (const_names ~~ raw_consts) lthy7;
1428
+ − 358
(* Could be done nicer *)
+ − 359
val q_tys = distinct (op =) (map (snd o strip_type o fastype_of) consts);
1480
21cbb5b0e321
cheat_alpha_eqvt no longer needed. Cleaned the tracing messages.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 360
val _ = tracing "Proving respects";
1340
+ − 361
val (bns_rsp_pre, lthy9) = fold_map (
+ − 362
fn (bn_t, i) => prove_const_rsp Binding.empty [bn_t]
1573
+ − 363
(fn _ => fvbv_rsp_tac (nth alpha_inducts i) raw_bn_eqs lthy8 1)) bns lthy8;
1340
+ − 364
val bns_rsp = flat (map snd bns_rsp_pre);
1416
+ − 365
fun fv_rsp_tac _ = if !cheat_fv_rsp then Skip_Proof.cheat_tac thy
1573
+ − 366
else fvbv_rsp_tac alpha_induct fv_def lthy8 1;
+ − 367
val fv_rsps = prove_fv_rsp fv_alpha_all alpha_ts fv_rsp_tac lthy9;
+ − 368
val (fv_rsp_pre, lthy10) = fold_map
+ − 369
(fn fv => fn ctxt => prove_const_rsp Binding.empty [fv]
+ − 370
(fn _ => asm_simp_tac (HOL_ss addsimps fv_rsps) 1) ctxt) fv_ts lthy9;
+ − 371
val fv_rsp = flat (map snd fv_rsp_pre);
1416
+ − 372
val (perms_rsp, lthy11) = prove_const_rsp Binding.empty perms
+ − 373
(fn _ => asm_simp_tac (HOL_ss addsimps alpha_eqvt) 1) lthy10;
1561
+ − 374
val alpha_alphabn = build_alpha_alphabn fv_alpha_all alpha_inducts alpha_eq_iff lthy11;
+ − 375
fun const_rsp_tac _ = constr_rsp_tac alpha_eq_iff (fv_rsp @ bns_rsp @ reflps @ alpha_alphabn) 1
+ − 376
val (const_rsps, lthy11a) = fold_map (fn cnst => prove_const_rsp Binding.empty [cnst]
+ − 377
const_rsp_tac) raw_consts lthy11
1576
+ − 378
val alpha_bn_rsp_pre = flat (map (prove_alpha_bn_rsp alpha_ts_nobn alpha_inducts exhausts (alpha_eq_iff @ rel_dists @ rel_dists_bn) (alpha_equivp) lthy11a) (alpha_ts_bn ~~ bn_nos))
1561
+ − 379
val (alpha_bn_rsps, lthy12) = fold_map (fn cnst => prove_const_rsp Binding.empty [cnst]
1576
+ − 380
(fn _ => asm_simp_tac (HOL_ss addsimps alpha_bn_rsp_pre) 1)) alpha_ts_bn lthy11a
1553
4355eb3b7161
Automatically derive support for datatypes with at-most one binding per constructor.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 381
val qfv_names = map (unsuffix "_raw" o Long_Name.base_name o fst o dest_Const) ordered_fv_ts
4355eb3b7161
Automatically derive support for datatypes with at-most one binding per constructor.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 382
val (qfv_ts, qfv_defs, lthy12a) = quotient_lift_consts_export (qfv_names ~~ ordered_fv_ts) lthy12;
4355eb3b7161
Automatically derive support for datatypes with at-most one binding per constructor.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 383
val (qfv_ts_nobn, qfv_ts_bn) = chop (length perms) qfv_ts;
1340
+ − 384
val qbn_names = map (fn (b, _ , _) => Name.of_binding b) bn_funs
+ − 385
val (qbn_defs, lthy12b) = fold_map Quotient_Def.quotient_lift_const (qbn_names ~~ raw_bn_funs) lthy12a;
1417
+ − 386
val qalpha_bn_names = map (unsuffix "_raw" o Long_Name.base_name o fst o dest_Const) alpha_ts_bn
1553
4355eb3b7161
Automatically derive support for datatypes with at-most one binding per constructor.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 387
val (qalpha_ts_bn, qbn_defs, lthy12c) = quotient_lift_consts_export (qalpha_bn_names ~~ alpha_ts_bn) lthy12b;
1480
21cbb5b0e321
cheat_alpha_eqvt no longer needed. Cleaned the tracing messages.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 388
val _ = tracing "Lifting permutations";
1417
+ − 389
val thy = Local_Theory.exit_global lthy12c;
1340
+ − 390
val perm_names = map (fn x => "permute_" ^ x) qty_names
+ − 391
val thy' = define_lifted_perms qty_full_names (perm_names ~~ perms) raw_perm_simps thy;
+ − 392
val lthy13 = Theory_Target.init NONE thy';
+ − 393
val q_name = space_implode "_" qty_names;
1515
+ − 394
fun suffix_bind s = Binding.qualify true q_name (Binding.name s);
1480
21cbb5b0e321
cheat_alpha_eqvt no longer needed. Cleaned the tracing messages.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 395
val _ = tracing "Lifting induction";
1511
+ − 396
val constr_names = map (Long_Name.base_name o fst o dest_Const) consts;
+ − 397
val q_induct = Rule_Cases.name constr_names (lift_thm lthy13 induct);
1553
4355eb3b7161
Automatically derive support for datatypes with at-most one binding per constructor.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 398
fun note_suffix s th ctxt =
4355eb3b7161
Automatically derive support for datatypes with at-most one binding per constructor.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 399
snd (Local_Theory.note ((suffix_bind s, []), th) ctxt);
1510
+ − 400
fun note_simp_suffix s th ctxt =
1515
+ − 401
snd (Local_Theory.note ((suffix_bind s, [Attrib.internal (K Simplifier.simp_add)]), th) ctxt);
+ − 402
val (_, lthy14) = Local_Theory.note ((suffix_bind "induct",
1512
+ − 403
[Attrib.internal (K (Rule_Cases.case_names constr_names))]), [Rule_Cases.name constr_names q_induct]) lthy13;
1447
378b8c791de8
derive "inducts" from "induct" instead of lifting again is much faster.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 404
val q_inducts = Project_Rule.projects lthy13 (1 upto (length alpha_inducts)) q_induct
1515
+ − 405
val (_, lthy14a) = Local_Theory.note ((suffix_bind "inducts", []), q_inducts) lthy14;
1511
+ − 406
val q_perm = map (lift_thm lthy14) raw_perm_def;
1510
+ − 407
val lthy15 = note_simp_suffix "perm" q_perm lthy14a;
1422
+ − 408
val q_fv = map (lift_thm lthy15) fv_def;
1510
+ − 409
val lthy16 = note_simp_suffix "fv" q_fv lthy15;
1422
+ − 410
val q_bn = map (lift_thm lthy16) raw_bn_eqs;
1510
+ − 411
val lthy17 = note_simp_suffix "bn" q_bn lthy16;
1496
fd483d8f486b
Prove pseudo-inject (eq-iff) on the exported level and rename appropriately.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 412
val _ = tracing "Lifting eq-iff";
fd483d8f486b
Prove pseudo-inject (eq-iff) on the exported level and rename appropriately.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 413
val eq_iff_unfolded1 = map (Local_Defs.unfold lthy17 @{thms alpha_gen2}) alpha_eq_iff
fd483d8f486b
Prove pseudo-inject (eq-iff) on the exported level and rename appropriately.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 414
val eq_iff_unfolded2 = map (Local_Defs.unfold lthy17 @{thms alpha_gen}) eq_iff_unfolded1
fd483d8f486b
Prove pseudo-inject (eq-iff) on the exported level and rename appropriately.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 415
val q_eq_iff_pre1 = map (lift_thm lthy17) eq_iff_unfolded2;
fd483d8f486b
Prove pseudo-inject (eq-iff) on the exported level and rename appropriately.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 416
val q_eq_iff_pre2 = map (Local_Defs.fold lthy17 @{thms alpha_gen2}) q_eq_iff_pre1
fd483d8f486b
Prove pseudo-inject (eq-iff) on the exported level and rename appropriately.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 417
val q_eq_iff = map (Local_Defs.fold lthy17 @{thms alpha_gen}) q_eq_iff_pre2
1515
+ − 418
val (_, lthy18) = Local_Theory.note ((suffix_bind "eq_iff", []), q_eq_iff) lthy17;
1422
+ − 419
val q_dis = map (lift_thm lthy18) rel_dists;
1510
+ − 420
val lthy19 = note_simp_suffix "distinct" q_dis lthy18;
1422
+ − 421
val q_eqvt = map (lift_thm lthy19) raw_fv_bv_eqvt;
1346
+ − 422
val (_, lthy20) = Local_Theory.note ((Binding.empty,
+ − 423
[Attrib.internal (fn _ => Nominal_ThmDecls.eqvt_add)]), q_eqvt) lthy19;
1480
21cbb5b0e321
cheat_alpha_eqvt no longer needed. Cleaned the tracing messages.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 424
val _ = tracing "Finite Support";
1547
57f7af5d7564
Use fs typeclass in showing finite support + some cheat cleaning.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 425
val supports = map (prove_supports lthy20 q_perm) consts;
57f7af5d7564
Use fs typeclass in showing finite support + some cheat cleaning.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 426
val fin_supp = HOLogic.conj_elims (prove_fs lthy20 q_induct supports q_tys);
1428
+ − 427
val thy3 = Local_Theory.exit_global lthy20;
+ − 428
val lthy21 = Theory_Target.instantiation (qty_full_names, [], @{sort fs}) thy3;
+ − 429
fun tac _ = Class.intro_classes_tac [] THEN (ALLGOALS (resolve_tac fin_supp))
1553
4355eb3b7161
Automatically derive support for datatypes with at-most one binding per constructor.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 430
val lthy22 = Class.prove_instantiation_instance tac lthy21
4355eb3b7161
Automatically derive support for datatypes with at-most one binding per constructor.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 431
val fv_alpha_all = combine_fv_alpha_bns (qfv_ts_nobn, qfv_ts_bn) (alpha_ts_nobn, qalpha_ts_bn) bn_nos;
4355eb3b7161
Automatically derive support for datatypes with at-most one binding per constructor.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 432
val (names, supp_eq_t) = supp_eq fv_alpha_all;
4355eb3b7161
Automatically derive support for datatypes with at-most one binding per constructor.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 433
val q_supp = HOLogic.conj_elims (Goal.prove lthy22 names [] supp_eq_t (fn _ => supp_eq_tac q_induct q_fv q_perm q_eq_iff lthy22 1)) handle _ => [];
4355eb3b7161
Automatically derive support for datatypes with at-most one binding per constructor.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 434
val lthy23 = note_suffix "supp" q_supp lthy22;
1293
+ − 435
in
1553
4355eb3b7161
Automatically derive support for datatypes with at-most one binding per constructor.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 436
((raw_dt_names, raw_bn_funs, raw_bn_eqs, raw_binds), lthy23)
1346
+ − 437
end
978
b44592adf235
Improper interface for datatype and function packages and proper interface lateron.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 438
*}
1340
+ − 439
1422
+ − 440
1284
+ − 441
ML {*
+ − 442
(* parsing the datatypes and declaring *)
+ − 443
(* constructors in the local theory *)
+ − 444
fun prepare_dts dt_strs lthy =
1251
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 445
let
1283
6a133abb7633
generated the "binding list" from the input; at the moment it is only printed out as tracing; does not yet include the "bind itself binders"
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 446
val thy = ProofContext.theory_of lthy
1284
+ − 447
+ − 448
fun mk_type full_tname tvrs =
+ − 449
Type (full_tname, map (fn a => TVar ((a, 0), [])) tvrs)
1283
6a133abb7633
generated the "binding list" from the input; at the moment it is only printed out as tracing; does not yet include the "bind itself binders"
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 450
1284
+ − 451
fun prep_cnstr lthy full_tname tvs (cname, anno_tys, mx, _) =
+ − 452
let
+ − 453
val tys = map (Syntax.read_typ lthy o snd) anno_tys
+ − 454
val ty = mk_type full_tname tvs
+ − 455
in
+ − 456
((cname, tys ---> ty, mx), (cname, tys, mx))
+ − 457
end
+ − 458
+ − 459
fun prep_dt lthy (tvs, tname, mx, cnstrs) =
+ − 460
let
+ − 461
val full_tname = Sign.full_name thy tname
+ − 462
val (cnstrs', cnstrs'') =
+ − 463
split_list (map (prep_cnstr lthy full_tname tvs) cnstrs)
+ − 464
in
+ − 465
(cnstrs', (tvs, tname, mx, cnstrs''))
+ − 466
end
1266
+ − 467
1284
+ − 468
val (cnstrs, dts) =
+ − 469
split_list (map (prep_dt lthy) dt_strs)
1251
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 470
in
1284
+ − 471
lthy
+ − 472
|> Local_Theory.theory (Sign.add_consts_i (flat cnstrs))
+ − 473
|> pair dts
1251
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 474
end
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 475
*}
1232
35bc8f7b66f8
parsing of function definitions almost works now; still an error with undefined constants
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 476
1284
+ − 477
ML {*
1285
+ − 478
(* parsing the binding function specification and *)
+ − 479
(* declaring the functions in the local theory *)
1284
+ − 480
fun prepare_bn_funs bn_fun_strs bn_eq_strs lthy =
+ − 481
let
+ − 482
val ((bn_funs, bn_eqs), _) =
+ − 483
Specification.read_spec bn_fun_strs bn_eq_strs lthy
+ − 484
1380
dab8d99b37c1
added bn-information, but it is not yet ordered according to the dts
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 485
fun prep_bn_fun ((bn, T), mx) = (bn, T, mx)
1284
+ − 486
val bn_funs' = map prep_bn_fun bn_funs
+ − 487
in
+ − 488
lthy
+ − 489
|> Local_Theory.theory (Sign.add_consts_i bn_funs')
+ − 490
|> pair (bn_funs', bn_eqs)
+ − 491
end
1283
6a133abb7633
generated the "binding list" from the input; at the moment it is only printed out as tracing; does not yet include the "bind itself binders"
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 492
*}
6a133abb7633
generated the "binding list" from the input; at the moment it is only printed out as tracing; does not yet include the "bind itself binders"
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 493
6a133abb7633
generated the "binding list" from the input; at the moment it is only printed out as tracing; does not yet include the "bind itself binders"
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 494
ML {*
1290
+ − 495
fun find_all eq xs (k',i) =
+ − 496
maps (fn (k, (v1, v2)) => if eq (k, k') then [(v1, v2, i)] else []) xs
1285
+ − 497
*}
1284
+ − 498
1285
+ − 499
ML {*
1290
+ − 500
(* associates every SOME with the index in the list; drops NONEs *)
1283
6a133abb7633
generated the "binding list" from the input; at the moment it is only printed out as tracing; does not yet include the "bind itself binders"
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 501
fun mk_env xs =
6a133abb7633
generated the "binding list" from the input; at the moment it is only printed out as tracing; does not yet include the "bind itself binders"
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 502
let
6a133abb7633
generated the "binding list" from the input; at the moment it is only printed out as tracing; does not yet include the "bind itself binders"
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 503
fun mapp (_: int) [] = []
1285
+ − 504
| mapp i (a :: xs) =
1283
6a133abb7633
generated the "binding list" from the input; at the moment it is only printed out as tracing; does not yet include the "bind itself binders"
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 505
case a of
6a133abb7633
generated the "binding list" from the input; at the moment it is only printed out as tracing; does not yet include the "bind itself binders"
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 506
NONE => mapp (i + 1) xs
6a133abb7633
generated the "binding list" from the input; at the moment it is only printed out as tracing; does not yet include the "bind itself binders"
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 507
| SOME x => (x, i) :: mapp (i + 1) xs
6a133abb7633
generated the "binding list" from the input; at the moment it is only printed out as tracing; does not yet include the "bind itself binders"
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 508
in mapp 0 xs end
1285
+ − 509
*}
1283
6a133abb7633
generated the "binding list" from the input; at the moment it is only printed out as tracing; does not yet include the "bind itself binders"
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 510
1285
+ − 511
ML {*
1283
6a133abb7633
generated the "binding list" from the input; at the moment it is only printed out as tracing; does not yet include the "bind itself binders"
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 512
fun env_lookup xs x =
6a133abb7633
generated the "binding list" from the input; at the moment it is only printed out as tracing; does not yet include the "bind itself binders"
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 513
case AList.lookup (op =) xs x of
6a133abb7633
generated the "binding list" from the input; at the moment it is only printed out as tracing; does not yet include the "bind itself binders"
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 514
SOME x => x
1287
+ − 515
| NONE => error ("cannot find " ^ x ^ " in the binding specification.");
1283
6a133abb7633
generated the "binding list" from the input; at the moment it is only printed out as tracing; does not yet include the "bind itself binders"
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 516
*}
6a133abb7633
generated the "binding list" from the input; at the moment it is only printed out as tracing; does not yet include the "bind itself binders"
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 517
978
b44592adf235
Improper interface for datatype and function packages and proper interface lateron.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 518
ML {*
1484
+ − 519
val recursive = Unsynchronized.ref false
1436
+ − 520
*}
+ − 521
+ − 522
ML {*
1284
+ − 523
fun prepare_binds dt_strs lthy =
954
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 524
let
1287
+ − 525
fun extract_annos_binds dt_strs =
1290
+ − 526
map (map (fn (_, antys, _, bns) => (map fst antys, bns))) dt_strs
1285
+ − 527
+ − 528
fun prep_bn env bn_str =
+ − 529
case (Syntax.read_term lthy bn_str) of
1290
+ − 530
Free (x, _) => (NONE, env_lookup env x)
1436
+ − 531
| Const (a, T) $ Free (x, _) => (SOME (Const (a, T), !recursive), env_lookup env x)
1285
+ − 532
| _ => error (bn_str ^ " not allowed as binding specification.");
1283
6a133abb7633
generated the "binding list" from the input; at the moment it is only printed out as tracing; does not yet include the "bind itself binders"
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 533
1290
+ − 534
fun prep_typ env (i, opt_name) =
1285
+ − 535
case opt_name of
+ − 536
NONE => []
1290
+ − 537
| SOME x => find_all (op=) env (x,i);
1283
6a133abb7633
generated the "binding list" from the input; at the moment it is only printed out as tracing; does not yet include the "bind itself binders"
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 538
1287
+ − 539
(* annos - list of annotation for each type (either NONE or SOME fo a type *)
+ − 540
+ − 541
fun prep_binds (annos, bind_strs) =
1284
+ − 542
let
1290
+ − 543
val env = mk_env annos (* for every label the index *)
1284
+ − 544
val binds = map (fn (x, y) => (x, prep_bn env y)) bind_strs
+ − 545
in
1290
+ − 546
map_index (prep_typ binds) annos
1284
+ − 547
end
1287
+ − 548
969
cc5d18c78446
Parsing of the input as terms and types, and passing them as such to the function package.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 549
in
1290
+ − 550
map (map prep_binds) (extract_annos_binds (get_cnstrs dt_strs))
969
cc5d18c78446
Parsing of the input as terms and types, and passing them as such to the function package.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 551
end
966
+ − 552
*}
954
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 553
1284
+ − 554
ML {*
+ − 555
fun nominal_datatype2_cmd (dt_strs, bn_fun_strs, bn_eq_strs) lthy =
+ − 556
let
+ − 557
fun prep_typ (tvs, tname, mx, _) = (tname, length tvs, mx)
+ − 558
1380
dab8d99b37c1
added bn-information, but it is not yet ordered according to the dts
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 559
val lthy0 =
dab8d99b37c1
added bn-information, but it is not yet ordered according to the dts
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 560
Local_Theory.theory (Sign.add_types (map prep_typ dt_strs)) lthy
dab8d99b37c1
added bn-information, but it is not yet ordered according to the dts
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 561
val (dts, lthy1) =
dab8d99b37c1
added bn-information, but it is not yet ordered according to the dts
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 562
prepare_dts dt_strs lthy0
dab8d99b37c1
added bn-information, but it is not yet ordered according to the dts
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 563
val ((bn_funs, bn_eqs), lthy2) =
dab8d99b37c1
added bn-information, but it is not yet ordered according to the dts
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 564
prepare_bn_funs bn_fun_strs bn_eq_strs lthy1
dab8d99b37c1
added bn-information, but it is not yet ordered according to the dts
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 565
val binds = prepare_binds dt_strs lthy2
1284
+ − 566
in
1380
dab8d99b37c1
added bn-information, but it is not yet ordered according to the dts
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 567
nominal_datatype2 dts bn_funs bn_eqs binds lthy |> snd
1284
+ − 568
end
+ − 569
*}
+ − 570
+ − 571
954
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 572
(* Command Keyword *)
1283
6a133abb7633
generated the "binding list" from the input; at the moment it is only printed out as tracing; does not yet include the "bind itself binders"
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 573
954
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 574
ML {*
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 575
let
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 576
val kind = OuterKeyword.thy_decl
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 577
in
1228
c179ad9d2446
declarartion of the raw datatype already works; raw binding functions throw an exception about mutual recursive types
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 578
OuterSyntax.local_theory "nominal_datatype" "test" kind
c179ad9d2446
declarartion of the raw datatype already works; raw binding functions throw an exception about mutual recursive types
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 579
(main_parser >> nominal_datatype2_cmd)
954
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 580
end
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 581
*}
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 582
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 583
961
+ − 584
end
1223
160343d86a6f
"raw"-ified the term-constructors and types given in the specification
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 585
160343d86a6f
"raw"-ified the term-constructors and types given in the specification
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 586
1228
c179ad9d2446
declarartion of the raw datatype already works; raw binding functions throw an exception about mutual recursive types
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 587