Skip to content

Commit 3f17a44

Browse files
authored
Allow to change the names of all the constants (#122)
Also change the defaults to align more with datatypes
1 parent 1a1d851 commit 3f17a44

File tree

14 files changed

+107
-67
lines changed

14 files changed

+107
-67
lines changed

Tools/mrbnf_sugar.ML

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ type spec = {
99
ctors: ((string * mixfix) * typ list) list,
1010
map_b: binding,
1111
tvsubst_b: binding,
12+
rel_b: binding,
1213
permute_b: binding option,
13-
FVars_bs: binding option list
14+
set_bs: binding option list
1415
};
1516

1617
type mr_bnf = (MRBNF_Def.mrbnf, (BNF_Def.bnf, MRBNF_FP_Def_Sugar.quotient_result MRBNF_FP_Def_Sugar.fp_result_T) MRBNF_Util.either) MRBNF_Util.either
@@ -43,8 +44,9 @@ type spec = {
4344
ctors: ((string * mixfix) * typ list) list,
4445
map_b: binding,
4546
tvsubst_b: binding,
47+
rel_b: binding,
4648
permute_b: binding option,
47-
FVars_bs: binding option list
49+
set_bs: binding option list
4850
};
4951

5052
fun add_nesting_mrbnf_names Us =
@@ -80,13 +82,19 @@ fun create_binder_type (fp : MRBNF_Util.fp_kind) (spec : spec) lthy =
8082

8183
val mrbnf = hd (MRSBNF_Def.mrbnfs_of_mrsbnf mrsbnf);
8284

85+
val FVars_names = case #set_bs spec of
86+
[x] => [SOME (the_default ("set_" ^ name) (Option.map Binding.name_of x))]
87+
| _ => map_index (fn (i, b_opt) =>
88+
SOME (the_default ("set" ^ string_of_int i ^ "_" ^ name) (Option.map Binding.name_of b_opt))
89+
) (take (length (#binding_rel spec)) (#set_bs spec));
90+
8391
val (bnf, lthy) = MRBNF_Def.register_mrbnf_as_bnf mrbnf lthy
8492
val (res, lthy) = MRBNF_FP.construct_binder_fp fp [{
8593
T_name = name,
8694
pre_mrbnf = mrbnf,
8795
nrecs = #rec_vars spec,
8896
permute = Option.map Binding.name_of (#permute_b spec),
89-
FVars = map (Option.map Binding.name_of) (take (length (#binding_rel spec)) (#FVars_bs spec))
97+
FVars = FVars_names
9098
}] (map single (#binding_rel spec)) lthy;
9199
in ((res, fp_pre_T, mrsbnf, absinfo), lthy) end
92100

@@ -207,7 +215,11 @@ fun create_binder_datatype co (spec : spec) lthy =
207215

208216
val _ = clean_message lthy quiet_mode " Creating renaming function and proving MRBNF axioms ...";
209217

210-
val ([(rec_mrbnf, vvsubst_res)], lthy) = MRBNF_VVSubst.mrbnf_of_quotient_fixpoint [#map_b spec] I res (#QREC_fixed recursor_result) lthy;
218+
val ((rec_mrbnf, vvsubst_res), lthy) = apfst hd (MRBNF_VVSubst.mrbnf_of_quotient_fixpoint [{
219+
vvsubst = SOME (#map_b spec),
220+
rel = SOME (#rel_b spec),
221+
psets = drop (length (#binding_rel spec)) (#set_bs spec)
222+
}] I res (#QREC_fixed recursor_result) lthy);
211223
val lthy = MRBNF_Def.register_mrbnf_raw (fst (dest_Type (#T (hd (#quotient_fps res))))) rec_mrbnf lthy;
212224
in (SOME {
213225
recursor_result = recursor_result,

Tools/mrbnf_vvsubst.ML

Lines changed: 36 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,16 @@ sig
77
pset_ctors: thm list
88
};
99

10+
type vvsubst_bs = {
11+
vvsubst: binding option,
12+
rel: binding option,
13+
psets: binding option list
14+
};
15+
1016
val vvsubst_result_of: local_theory -> string -> vvsubst_result option
1117
val register_vvsubst_result: string -> vvsubst_result -> local_theory -> local_theory
1218

13-
val mrbnf_of_quotient_fixpoint: binding list -> (binding -> binding) -> MRBNF_FP_Def_Sugar.fp_result
19+
val mrbnf_of_quotient_fixpoint: vvsubst_bs list -> (binding -> binding) -> MRBNF_FP_Def_Sugar.fp_result
1420
-> string -> local_theory -> (MRBNF_Def.mrbnf * vvsubst_result) list * local_theory
1521
end
1622

@@ -29,6 +35,12 @@ type vvsubst_result = {
2935
pset_ctors: thm list
3036
};
3137

38+
type vvsubst_bs = {
39+
vvsubst: binding option,
40+
rel: binding option,
41+
psets: binding option list
42+
};
43+
3244
fun morph_vvsubst_result phi { vvsubst_ctor, vvsubst_permute, psets, pset_ctors } = {
3345
vvsubst_ctor = Morphism.thm phi vvsubst_ctor,
3446
vvsubst_permute = Morphism.thm phi vvsubst_permute,
@@ -55,7 +67,7 @@ val vvsubst_result_of = vvsubst_result_of_generic o Context.Proof;
5567
fun mk_supp_bound f = mk_ordLess (mk_card_of (mk_supp f))
5668
(mk_card_of (HOLogic.mk_UNIV (fst (dest_funT (fastype_of f)))));
5769

58-
fun define_vvsubst_consts qualify names (fp_res : MRBNF_FP_Def_Sugar.fp_result) vars deadss (plives, plives', pbounds, pfrees) old_lthy =
70+
fun define_vvsubst_consts qualify vvsubst_bss (fp_res : MRBNF_FP_Def_Sugar.fp_result) vars deadss (plives, plives', pbounds, pfrees) old_lthy =
5971
let
6072
val subst = Term.typ_subst_atomic (plives ~~ plives');
6173

@@ -78,9 +90,13 @@ fun define_vvsubst_consts qualify names (fp_res : MRBNF_FP_Def_Sugar.fp_result)
7890
val Ts = map #T (#quotient_fps fp_res);
7991
fun replicate_rec xs = flat (map2 replicate (#rec_vars fp_res) xs);
8092

81-
fun mk_pset_names (fps:'a MRBNF_FP_Def_Sugar.fp_result_T list) = map (fn raw => map (fn i =>
82-
"set" ^ string_of_int (i + nvars) ^ "_" ^ short_type_name (fst (dest_Type (#T raw)))
83-
) (1 upto npassive)) fps;
93+
fun mk_pset_names public (fps:'a MRBNF_FP_Def_Sugar.fp_result_T list) = map2 (fn raw => fn vvsubst_bs => map2 (fn i => fn b =>
94+
let val def = "set" ^ string_of_int (i + nvars) ^ "_" ^ short_type_name (fst (dest_Type (#T raw)));
95+
in if public then case b of
96+
SOME b => Binding.name_of b
97+
| NONE => def
98+
else def end
99+
) (1 upto npassive) (#psets vvsubst_bs)) fps vvsubst_bss;
84100
val ms = map (fn mrbnf => MRBNF_Def.free_of_mrbnf mrbnf + MRBNF_Def.bound_of_mrbnf mrbnf + MRBNF_Def.live_of_mrbnf mrbnf) mrbnfs;
85101
val mrbnf_setss = @{map 3} (fn m => fn deads =>
86102
MRBNF_Def.mk_sets_of_mrbnf (replicate m deads)
@@ -97,7 +113,7 @@ fun define_vvsubst_consts qualify names (fp_res : MRBNF_FP_Def_Sugar.fp_result)
97113

98114
val (raw_psetss, lthy) =
99115
let
100-
val namess = mk_pset_names (#raw_fps fp_res);
116+
val namess = mk_pset_names false (#raw_fps fp_res);
101117
val setss = map2 (fn raw => map2 (fn var => fn n =>
102118
Free (n, #T raw --> HOLogic.mk_setT var)
103119
) (pfrees @ plives @ pbounds)) (#raw_fps fp_res) namess;
@@ -137,7 +153,7 @@ fun define_vvsubst_consts qualify names (fp_res : MRBNF_FP_Def_Sugar.fp_result)
137153
mk_def_t false Binding.empty qualify name 1 (Term.absfree (dest_Free v) (
138154
fst raw_pset $ (#rep (#inner quot) $ v)
139155
))
140-
)) (#quotient_fps fp_res) vs (mk_pset_names (#quotient_fps fp_res)) raw_psetss lthy;
156+
)) (#quotient_fps fp_res) vs (mk_pset_names true (#quotient_fps fp_res)) raw_psetss lthy;
141157

142158
val (rels_opt, lthy) = if length plives = 0 then (NONE, lthy) else
143159
let
@@ -163,10 +179,12 @@ fun define_vvsubst_consts qualify names (fp_res : MRBNF_FP_Def_Sugar.fp_result)
163179
||>> apply2 transpose o chop (length (#bfree_vars fp_res));
164180
val bfree_setss = if null bfree_setss then replicate (length mrbnfs) [] else bfree_setss;
165181

166-
val rels = map (fn quot => Free ("rel_" ^ short_type_name (fst (dest_Type (#T quot))),
182+
val rels = map2 (fn quot => fn vvsubst_bs =>
183+
let val def = "rel_" ^ short_type_name (fst (dest_Type (#T quot)));
184+
in Free (the_default def (Option.map Binding.name_of (#rel vvsubst_bs)),
167185
fold_rev (curry (op-->)) (map2 (fn a => fn b => a --> b --> @{typ bool}) plives plives')
168-
(#T quot --> subst (#T quot) --> @{typ bool})
169-
)) (#quotient_fps fp_res);
186+
(#T quot --> subst (#T quot) --> @{typ bool})) end
187+
) (#quotient_fps fp_res) vvsubst_bss;
170188

171189
val f_premss = @{map 4} (fn rec_sets => fn x => fn bfree_sets =>
172190
flat o @{map 5} (fn i => fn FVarss => fn f => fn rel => fn bset =>
@@ -237,7 +255,7 @@ fun define_vvsubst_consts qualify names (fp_res : MRBNF_FP_Def_Sugar.fp_result)
237255
lthy
238256
) end;
239257

240-
fun mrbnf_of_quotient_fixpoint vvsubst_bs qualify (fp_result : MRBNF_FP_Def_Sugar.fp_result) QREC_fixed_name lthy =
258+
fun mrbnf_of_quotient_fixpoint vvsubst_bss qualify (fp_result : MRBNF_FP_Def_Sugar.fp_result) QREC_fixed_name lthy =
241259
let
242260
val mrbnfs = #pre_mrbnfs fp_result;
243261

@@ -266,7 +284,7 @@ fun mrbnf_of_quotient_fixpoint vvsubst_bs qualify (fp_result : MRBNF_FP_Def_Suga
266284
in map (Envir.subst_type tyenv) (MRBNF_Def.deads_of_mrbnf mrbnf) end
267285
) (#pre_mrbnfs fp_res) (#raw_fps fp_res);
268286

269-
val ((raw_psetss, psetss, rels_opt), lthy) = define_vvsubst_consts qualify names fp_res vars deadss passives lthy;
287+
val ((raw_psetss, psetss, rels_opt), lthy) = define_vvsubst_consts qualify vvsubst_bss fp_res vars deadss passives lthy;
270288

271289
val live = MRBNF_Def.live_of_mrbnf (hd mrbnfs);
272290
val frees = vars @ pfrees;
@@ -405,9 +423,9 @@ fun mrbnf_of_quotient_fixpoint vvsubst_bs qualify (fp_result : MRBNF_FP_Def_Suga
405423
])) ctxt
406424
])), Position.no_range), NONE) state;
407425

408-
val (vvsubsts, lthy) = @{fold_map 2} (fn b =>
409-
mk_def_t true Binding.empty qualify (Binding.name_of b) 0
410-
) vvsubst_bs (MRBNF_Recursor.get_RECs true "vvsubst" lthy) lthy;
426+
val (vvsubsts, lthy) = @{fold_map 3} (fn b => fn T =>
427+
mk_def_t true Binding.empty qualify (the_default ("map_" ^ short_type_name (fst (dest_Type T))) (Option.map Binding.name_of b)) 0
428+
) (map #vvsubst vvsubst_bss) (map #T (#quotient_fps fp_res)) (MRBNF_Recursor.get_RECs true "vvsubst" lthy) lthy;
411429

412430
val vvsubst_cctors = @{map 6} (fn vvsubst => fn quot => fn bsets => fn mrbnf => fn x => fn deads =>
413431
let
@@ -451,7 +469,7 @@ fun mrbnf_of_quotient_fixpoint vvsubst_bs qualify (fp_result : MRBNF_FP_Def_Suga
451469
let
452470
val (_, lthy) = Local_Theory.begin_nested lthy;
453471
val (picks, lthy) =
454-
@{fold_map 4} (fn quot => fn psets => fn vvsubst => fn b => fn lthy =>
472+
@{fold_map 3} (fn quot => fn psets => fn vvsubst => fn lthy =>
455473
let
456474
fun mk_Eps f =
457475
let val f_T = fastype_of f;
@@ -487,8 +505,8 @@ fun mrbnf_of_quotient_fixpoint vvsubst_bs qualify (fp_result : MRBNF_FP_Def_Suga
487505
))
488506
)
489507
);
490-
in mk_def_t false b qualify "pick" (length fs + 1) rhs lthy end
491-
) (#quotient_fps fp_res) psetss vvsubsts vvsubst_bs lthy;
508+
in mk_def_t false (Binding.name ("vvsubst_" ^ short_type_name (fst (dest_Type (#T quot))))) qualify "pick" (length fs + 1) rhs lthy end
509+
) (#quotient_fps fp_res) psetss vvsubsts lthy;
492510

493511
val (lthy, old_lthy) = `Local_Theory.end_nested lthy;
494512
val phi = Proof_Context.export_morphism old_lthy lthy;

Tools/parser.ML

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,16 @@ val parse_type_args_named_constrained =
3636

3737
val parse_subst_binding = Parse.name --| \<^keyword>\<open>:\<close> -- Parse.binding;
3838

39-
fun extract_map_rel_pred ("vvsubst", m) = (fn (_, r, p) => (m, r, p))
40-
| extract_map_rel_pred ("tvsubst", r) = (fn (m, _, p) => (m, r, p))
41-
| extract_map_rel_pred ("permute", p) = (fn (m, r, _) => (m, r, p))
39+
fun extract_map_rel_pred ("map", m) = (fn (_, r, p, rel) => (m, r, p, rel))
40+
| extract_map_rel_pred ("subst", r) = (fn (m, _, p, rel) => (m, r, p, rel))
41+
| extract_map_rel_pred ("permute", p) = (fn (m, r, _, rel) => (m, r, p, rel))
42+
| extract_map_rel_pred ("rel", rel) = (fn (m, r, p, _) => (m, r, p, rel))
4243
| extract_map_rel_pred (s, _) = error ("Unknown label " ^ quote s ^ " (expected \"vvsubst\" or \"tvsubst\")");
4344

4445
val parse_subst_bindings =
4546
@{keyword for} |-- Scan.repeat parse_subst_binding
46-
>> (fn ps => fold extract_map_rel_pred ps (Binding.empty, Binding.empty, Binding.empty))
47-
|| Scan.succeed (Binding.empty, Binding.empty, Binding.empty);
47+
>> (fn ps => fold extract_map_rel_pred ps (Binding.empty, Binding.empty, Binding.empty, Binding.empty))
48+
|| Scan.succeed (Binding.empty, Binding.empty, Binding.empty, Binding.empty);
4849

4950
val parse_binder_datatype = Parse.and_list1 (
5051
parse_type_args_named_constrained -- Parse.binding -- Parse.opt_mixfix --
@@ -149,7 +150,7 @@ fun create_ctor_spec T_names ((((sel, name), xs), mixfix), binds) (lthy, params)
149150
val spec = ((Binding.name_of name, mixfix), Ts)
150151
in (spec, (lthy, params)) end
151152

152-
fun create_binder_spec T_names ((((params, b), mixfix), ctors), (vvsubst_b, tvsubst_b, permute_b)) lthy =
153+
fun create_binder_spec T_names ((((params, b), mixfix), ctors), (vvsubst_b, tvsubst_b, permute_b, rel_b)) lthy =
153154
let
154155
fun prepare_type_arg (T, sort) =
155156
let val TFree (s, _) = Syntax.parse_typ lthy T
@@ -161,7 +162,7 @@ fun create_binder_spec T_names ((((params, b), mixfix), ctors), (vvsubst_b, tvsu
161162

162163
val lthy = fold (Variable.declare_typ o snd) Ts lthy;
163164

164-
val FVars_bs = map (snd o fst) Ts;
165+
val set_bs = map (snd o fst) Ts;
165166
val params = fold (fn ((ann, _), T) => Symtab.map_entry (case ann of
166167
NONE => "plive" | SOME MRBNF_Def.Free_Var => "pfree"
167168
| SOME MRBNF_Def.Bound_Var => "pbound" | _ => "dead"
@@ -211,10 +212,11 @@ fun create_binder_spec T_names ((((params, b), mixfix), ctors), (vvsubst_b, tvsu
211212
in (bfree, (0 upto length brecs - 1)) end
212213
) frees,
213214
rec_vars = length brecs + length recs,
214-
map_b = with_def vvsubst_b @{binding vvsubst},
215-
tvsubst_b = with_def tvsubst_b @{binding tvsubst},
215+
map_b = with_def vvsubst_b @{binding map},
216+
tvsubst_b = with_def tvsubst_b @{binding subst},
217+
rel_b = with_def rel_b @{binding rel},
216218
permute_b = without_def permute_b,
217-
FVars_bs = map without_def FVars_bs
219+
set_bs = map without_def set_bs
218220
} : MRBNF_Sugar.spec;
219221
in (spec, lthy) end
220222

case_studies/Infinitary_FOL/InfFOL.thy

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ type_synonym var = k
219219
type_synonym ifol = "var ifol'"
220220

221221
abbreviation (input) subst :: "ifol \<Rightarrow> (var \<Rightarrow> var) \<Rightarrow> ifol" ("_\<lbrakk>_\<rbrakk>" [600, 600] 400) where
222-
"subst t \<rho> \<equiv> vvsubst_ifol' \<rho> t"
222+
"subst t \<rho> \<equiv> map_ifol' \<rho> t"
223223

224224
lift_definition kmember :: "'a \<Rightarrow> 'a set\<^sub>k \<Rightarrow> bool" (infix "\<in>\<^sub>k" 200) is "bmember" .
225225
lift_definition k1member :: "'a \<Rightarrow> 'a set\<^sub>k\<^sub>1 \<Rightarrow> bool" (infix "\<in>\<^sub>k\<^sub>1" 200) is "bmember" .
@@ -310,13 +310,13 @@ inductive deduct :: "ifol set\<^sub>k \<Rightarrow> ifol \<Rightarrow> bool" (in
310310
| ConjE: "\<lbrakk> \<Delta> \<turnstile> Conj F ; f \<in>\<^sub>k\<^sub>1 F \<rbrakk> \<Longrightarrow> \<Delta> \<turnstile> f"
311311
| NegI: "\<Delta>,f \<turnstile> \<bottom> \<Longrightarrow> \<Delta> \<turnstile> Neg f"
312312
| NegE: "\<lbrakk> \<Delta> \<turnstile> Neg f ; \<Delta> \<turnstile> f \<rbrakk> \<Longrightarrow> \<Delta> \<turnstile> \<bottom>"
313-
| AllI: "\<lbrakk> \<Delta> \<turnstile> f ; set\<^sub>k\<^sub>2 V \<inter> \<Union>(FVars_ifol' ` set\<^sub>k \<Delta>) = {} \<rbrakk> \<Longrightarrow> \<Delta> \<turnstile> All V f"
313+
| AllI: "\<lbrakk> \<Delta> \<turnstile> f ; set\<^sub>k\<^sub>2 V \<inter> \<Union>(set_ifol' ` set\<^sub>k \<Delta>) = {} \<rbrakk> \<Longrightarrow> \<Delta> \<turnstile> All V f"
314314
| AllE: "\<lbrakk> \<Delta> \<turnstile> All V f ; supp \<rho> \<subseteq> set\<^sub>k\<^sub>2 V \<rbrakk> \<Longrightarrow> \<Delta> \<turnstile> f\<lbrakk>\<rho>\<rbrakk>"
315315

316316
lemma permute_vvsubst[equiv]:
317317
fixes f \<rho>::"k \<Rightarrow> k"
318318
assumes "bij f" "|supp f| <o |UNIV::k set|" "|supp \<rho>| <o |UNIV::k set|"
319-
shows "permute_ifol' f (vvsubst_ifol' \<rho> x) = vvsubst_ifol' (\<lambda>x. f (\<rho> (inv f x))) (permute_ifol' f x)"
319+
shows "permute_ifol' f (map_ifol' \<rho> x) = map_ifol' (\<lambda>x. f (\<rho> (inv f x))) (permute_ifol' f x)"
320320
proof -
321321
have "|supp (f \<circ> \<rho> \<circ> inv f)| <o |UNIV::k set|"
322322
using assms by (meson ifol'_pre.supp_comp_bound supp_inv_bound)
@@ -363,7 +363,7 @@ binder_inductive deduct
363363
apply (elim exE conjE)
364364
apply simp
365365
subgoal for \<Delta> f V
366-
apply (rule exE[OF refresh[of V "\<Union>(FVars_ifol' ` set\<^sub>k \<Delta>) \<union> FVars_ifol' (All V f)", unfolded ifol'.set
366+
apply (rule exE[OF refresh[of V "\<Union>(set_ifol' ` set\<^sub>k \<Delta>) \<union> set_ifol' (All V f)", unfolded ifol'.set
367367
Un_Diff Diff_idemp
368368
]])
369369
apply blast
@@ -432,7 +432,7 @@ binder_inductive deduct
432432
subgoal premises prems for V f \<rho>
433433
proof -
434434
define X where "X \<equiv> set\<^sub>k\<^sub>2 V"
435-
let ?O = "\<Union> (FVars_ifol' ` set\<^sub>k \<Delta>) \<union> \<rho> ` FVars_ifol' f \<union> imsupp \<rho> \<union> X \<union> (FVars_ifol' f - set\<^sub>k\<^sub>2 V)"
435+
let ?O = "\<Union> (set_ifol' ` set\<^sub>k \<Delta>) \<union> \<rho> ` set_ifol' f \<union> imsupp \<rho> \<union> X \<union> (set_ifol' f - set\<^sub>k\<^sub>2 V)"
436436
have osmall: "|?O| <o |UNIV::var set|"
437437
apply (intro infinite_class.Un_bound)
438438
apply (meson ifol'.set_bd_UNIV set\<^sub>k.set_bd var_class.UN_bound)
@@ -475,7 +475,7 @@ binder_inductive deduct
475475
moreover have "supp \<sigma> \<subseteq> X \<union> W'" using \<sigma>(2) unfolding id_on_def by (meson UnI1 UnI2 \<sigma>_def not_in_supp_alt subsetI)
476476
ultimately have \<sigma>_small: "|supp \<sigma>| <o |UNIV::var set|" using card_of_subset_bound by blast
477477

478-
define \<rho>' where "\<rho>' \<equiv> \<lambda>x. if x \<in> \<sigma> ` FVars_ifol' f then (\<rho> \<circ> \<sigma>) x else x"
478+
define \<rho>' where "\<rho>' \<equiv> \<lambda>x. if x \<in> \<sigma> ` set_ifol' f then (\<rho> \<circ> \<sigma>) x else x"
479479
have "supp \<rho>' \<subseteq> supp (\<rho> \<circ> \<sigma>)" unfolding \<rho>'_def supp_def by auto
480480
then have \<rho>'_small: "|supp \<rho>'| <o |UNIV::var set|"
481481
by (meson \<sigma>_small card_of_subset_bound ifol'_pre.supp_comp_bound prems(3) ordLess_ordLeq_trans[OF set\<^sub>k\<^sub>2.set_bd] var_set\<^sub>k\<^sub>2_class.large')
@@ -527,7 +527,7 @@ binder_inductive deduct
527527
apply (rule refl)
528528

529529
apply (unfold set\<^sub>k\<^sub>2.set_map)
530-
apply (subgoal_tac "supp (\<rho> \<circ> \<sigma>) \<inter> \<sigma> ` FVars_ifol' f \<subseteq> \<sigma> ` set\<^sub>k\<^sub>2 V")
530+
apply (subgoal_tac "supp (\<rho> \<circ> \<sigma>) \<inter> \<sigma> ` set_ifol' f \<subseteq> \<sigma> ` set\<^sub>k\<^sub>2 V")
531531
apply (smt (verit, best) IntI \<rho>'_def not_in_supp_alt subset_iff)
532532
apply (unfold supp_def imsupp_def)
533533
using X_def \<sigma>_def apply auto[1]

case_studies/Infinitary_Lambda_Calculus/ILC.thy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ binder_datatype (FFVars: 'a) iterm
4949
| iApp "'a iterm" "'a iterm stream"
5050
| iLam "(xs::'a) dstream" t::"'a iterm" binds xs in t
5151
for
52-
vvsubst: ivvsubst
53-
tvsubst: itvsubst
52+
map: ivvsubst
53+
subst: itvsubst
5454

5555
lemma ex_inj_infinite_regular_var_iterm:
5656
"\<exists>f :: 'a :: countable \<Rightarrow> 'b :: var_iterm. inj f"

case_studies/POPLmark/POPLmark_2B.thy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ print_theorems
1515

1616
thm trm.subst
1717

18-
abbreviation "tvsubst f1 f2 \<equiv> tvsubst_trm f2 f1"
18+
abbreviation "tvsubst f1 f2 \<equiv> subst_trm f2 f1"
1919

2020
inductive "value" where
2121
"value (Abs x T t)"

case_studies/POPLmark/SystemFSub.thy

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,15 @@ declare supp_id_bound[simp]
1111
type_synonym label = string
1212

1313
declare [[mrbnf_internals]]
14-
binder_datatype 'a "typ" =
14+
binder_datatype (FVars_typ: 'a) "typ" =
1515
TyVar 'a
1616
| Top
1717
| Fun "'a typ" "'a typ"
1818
| Forall \<alpha>::'a "'a typ" t::"'a typ" binds \<alpha> in t
1919
| TRec "(label, 'a typ) lfset"
20+
for
21+
map: vvsubst_typ
22+
subst: tvsubst_typ
2023

2124
declare supp_swap_bound[OF cinfinite_imp_infinite[OF typ.UNIV_cinfinite], simp]
2225
declare typ.permute_id[simp] typ.permute_id0[simp]

case_studies/Pi_Calculus/Commitment.thy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ theory Commitment
22
imports Pi
33
begin
44

5-
binder_datatype 'var commit =
5+
binder_datatype (FVars_commit: 'var) commit =
66
Finp 'var 'var "'var term"
77
| Fout 'var 'var "'var term"
88
| Bout 'var x::'var "(t::'var) term" binds x in t

case_studies/Pi_Calculus/Pi.thy

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ begin
77
(* DATATYPE DECLARTION *)
88

99
declare [[mrbnf_internals]]
10-
binder_datatype 'a "term" =
10+
binder_datatype (FVars_term: 'a) "term" =
1111
Zero
1212
| Sum "'a term" "'a term"
1313
| Par "'a term" "'a term" (infixl "\<parallel>" 300)
@@ -17,8 +17,8 @@ binder_datatype 'a "term" =
1717
| Inp 'a x::'a t::"'a term" binds x in t
1818
| Res x::'a t::"'a term" binds x in t
1919
for
20-
vvsubst: vvsubst
21-
tvsubst: tvsubst
20+
map: vvsubst
21+
subst: tvsubst
2222

2323
(****************************)
2424
(* DATATYPE-SPECIFIC CUSTOMIZATION *)

case_studies/STLC/STLC.thy

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ datatype \<tau> = Unit | Arrow \<tau> \<tau> (infixr "\<rightarrow>" 40)
66

77
declare [[mrbnf_internals]]
88

9-
binder_datatype 'a terms =
9+
binder_datatype (FVars_terms: 'a) terms =
1010
Var 'a
1111
| App "'a terms" "'a terms"
1212
| Abs x::'a \<tau> t::"'a terms" binds x in t
1313
for
14-
vvsubst: vvsubst
15-
tvsubst: tvsubst
14+
map: vvsubst
15+
subst: tvsubst
1616

1717
print_theorems
1818

0 commit comments

Comments
 (0)