Skip to content

Commit 97f6a2b

Browse files
committed
Add support for passive free variables
1 parent 6bcd55d commit 97f6a2b

File tree

6 files changed

+172
-112
lines changed

6 files changed

+172
-112
lines changed

Tools/binder_sugar.ML

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ type binder_sugar = {
1111
tvsubst_permute: thm option,
1212
bsetss: term option list list,
1313
bset_bounds: thm list,
14+
pset_ctors: thm list,
1415
mrbnf: MRBNF_Def.mrbnf,
1516
strong_induct: thm option,
1617
distinct: thm list,
@@ -38,6 +39,7 @@ type binder_sugar = {
3839
tvsubst_permute: thm option,
3940
bsetss: term option list list,
4041
bset_bounds: thm list,
42+
pset_ctors: thm list,
4143
mrbnf: MRBNF_Def.mrbnf,
4244
strong_induct: thm option,
4345
distinct: thm list,
@@ -47,7 +49,7 @@ type binder_sugar = {
4749

4850
fun morph_binder_sugar phi { map_simps, permute_simps, map_permute, set_simpss, subst_simps, mrbnf,
4951
strong_induct, distinct, inject, ctors, bsetss, bset_bounds, IImsupp_permute_commutes, IImsupp_Diffs,
50-
tvsubst_permute
52+
tvsubst_permute, pset_ctors
5153
} = {
5254
map_simps = map (Morphism.thm phi) map_simps,
5355
permute_simps = map (Morphism.thm phi) permute_simps,
@@ -59,6 +61,7 @@ fun morph_binder_sugar phi { map_simps, permute_simps, map_permute, set_simpss,
5961
tvsubst_permute = Option.map (Morphism.thm phi) tvsubst_permute,
6062
bsetss = map (map (Option.map (Morphism.term phi))) bsetss,
6163
bset_bounds = map (Morphism.thm phi) bset_bounds,
64+
pset_ctors = map (Morphism.thm phi) pset_ctors,
6265
mrbnf = MRBNF_Def.morph_mrbnf phi mrbnf,
6366
strong_induct = Option.map (Morphism.thm phi) strong_induct,
6467
distinct = map (Morphism.thm phi) distinct,

Tools/bmv_monad_def.ML

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,6 @@ fun note_bmv_monad_thms fact_policy qualify bmv_b_opt bmv lthy =
796796
val facts = facts_of_bmv_monad bmv;
797797
val params = params_of_bmv_monad bmv;
798798
val unfolds = unfolds_of_bmv_monad bmv;
799-
val _ = @{print} unfolds
800799

801800
fun note_unless_dont_note (noted, lthy) =
802801
let val notes =

Tools/mrbnf_sugar.ML

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1121,14 +1121,17 @@ fun create_binder_datatype co (spec : spec) lthy =
11211121

11221122
val (lthy, tvsubst_opt) = if not (null (map_filter I (#etas tvsubst_model))) andalso not co then
11231123
let
1124+
val _ = @{print} "before tvsubst"
11241125
val recursor_result = #recursor_result (the vvsubst_res_opt);
11251126
val rec_mrbnf = #rec_mrbnf (the vvsubst_res_opt);
11261127
val vvsubst_res = #vvsubst_res (the vvsubst_res_opt);
11271128

11281129
val (tvsubst_res, lthy) = TVSubst.create_tvsubst_of_mrsbnf (Binding.prefix_name "tv") res mrsbnf
1129-
rec_mrbnf (#vvsubst_ctor vvsubst_res) (#vvsubst_permute vvsubst_res) (#tvsubst_b spec)
1130+
rec_mrbnf (#vvsubst_ctor vvsubst_res) (#vvsubst_permute vvsubst_res) (#pset_ctors (#vvsubst_res (the vvsubst_res_opt))) (#tvsubst_b spec)
11301131
(#etas tvsubst_model) (#QREC_fixed recursor_result) lthy;
11311132

1133+
val _ = @{print} "after tvsubst"
1134+
11321135
val lthy = BMV_Monad_Def.register_pbmv_monad (fst (dest_Type qT))
11331136
(MRSBNF_Def.bmv_monad_of_mrsbnf (#mrsbnf tvsubst_res)) lthy;
11341137
val lthy = MRSBNF_Def.register_mrsbnf (fst (dest_Type qT)) (#mrsbnf tvsubst_res) lthy;
@@ -1261,6 +1264,7 @@ fun create_binder_datatype co (spec : spec) lthy =
12611264
tvsubst_permute = Option.map (#tvsubst_permute o fst) tvsubst_opt,
12621265
bsetss = [],
12631266
bset_bounds = [],
1267+
pset_ctors = [],
12641268
mrbnf = mrbnf,
12651269
distinct = [],
12661270
inject = [],
@@ -1281,6 +1285,7 @@ fun create_binder_datatype co (spec : spec) lthy =
12811285
tvsubst_permute = Option.map (#tvsubst_permute o fst) tvsubst_opt,
12821286
bsetss = bset_optss,
12831287
bset_bounds = [],
1288+
pset_ctors = #pset_ctors (#vvsubst_res (the vvsubst_res_opt)),
12841289
mrbnf = mrbnf,
12851290
distinct = distinct,
12861291
inject = injects,

0 commit comments

Comments
 (0)