@@ -184,17 +184,29 @@ fun build_set_for _ aT x (TFree (s, _)) = if s = fst (dest_TFree aT) then SOME (
184184 end
185185 ) (mr_bnf_of lthy false C);
186186
187+ fun message quiet_mode s = if quiet_mode then () else writeln s;
188+ fun clean_message ctxt quiet_mode s =
189+ if Config.get ctxt quick_and_dirty then () else message quiet_mode s;
190+
187191fun create_binder_datatype co (spec : spec) lthy =
188192 let
189193 val fp_kind = if co then MRBNF_Util.Greatest_FP else MRBNF_Util.Least_FP;
194+ val quiet_mode = false ;
195+
196+ val _ = clean_message lthy quiet_mode " Creating quotient type ..." ;
197+
190198 val ((res, fp_pre_T, mrsbnf, absinfo), lthy) = create_binder_type fp_kind spec lthy;
191199 val mrbnf = hd (MRSBNF_Def.mrbnfs_of_mrsbnf mrsbnf);
192200 val bmv = MRSBNF_Def.bmv_monad_of_mrsbnf mrsbnf;
193201
194202 val (vvsubst_res_opt, lthy) = if co then (NONE , lthy) else (* TODO: Automate renaming for codatatypes *)
195203 let
204+ val _ = clean_message lthy quiet_mode " Creating recursor locale ..." ;
205+
196206 val (recursor_result, lthy) = MRBNF_Recursor.create_binding_recursor I res lthy;
197207
208+ val _ = clean_message lthy quiet_mode " Creating renaming function and proving MRBNF axioms ..." ;
209+
198210 val ([(rec_mrbnf, vvsubst_res)], lthy) = MRBNF_VVSubst.mrbnf_of_quotient_fixpoint [#map_b spec] I res (#QREC_fixed recursor_result) lthy;
199211 val lthy = MRBNF_Def.register_mrbnf_raw (fst (dest_Type (#T (hd (#quotient_fps res))))) rec_mrbnf lthy;
200212 in (SOME {
@@ -220,6 +232,8 @@ fun create_binder_datatype co (spec : spec) lthy =
220232
221233 val (_, lthy) = Local_Theory.begin_nested lthy;
222234
235+ val _ = clean_message lthy quiet_mode " Defining high-level constructors and lifting theorems ..." ;
236+
223237 val (ctors, (_, lthy)) = fold_map (fn ((name, syn), Ts) => fn (i, lthy) =>
224238 let
225239 val Ts' = map (Term.typ_subst_atomic replace) Ts;
@@ -1126,6 +1140,8 @@ fun create_binder_datatype co (spec : spec) lthy =
11261140 val rec_mrbnf = #rec_mrbnf (the vvsubst_res_opt);
11271141 val vvsubst_res = #vvsubst_res (the vvsubst_res_opt);
11281142
1143+ val _ = clean_message lthy quiet_mode " Creating substition function ..." ;
1144+
11291145 val (tvsubst_res, lthy) = TVSubst.create_tvsubst_of_mrsbnf (Binding.prefix_name " tv" ) res mrsbnf
11301146 rec_mrbnf (#vvsubst_ctor vvsubst_res) (#vvsubst_permute vvsubst_res) (#pset_ctors (#vvsubst_res (the vvsubst_res_opt))) (#tvsubst_b spec)
11311147 (#etas tvsubst_model) (#QREC_fixed recursor_result) lthy;
@@ -1139,7 +1155,6 @@ fun create_binder_datatype co (spec : spec) lthy =
11391155 MRSBNF_Def.bmv_monad_of_mrsbnf (#mrsbnf tvsubst_res)
11401156 ) lthy;
11411157
1142-
11431158 val tvsubst_simps =
11441159 let
11451160 val T = range_type (fastype_of quotient_ctor);
@@ -1215,6 +1230,7 @@ fun create_binder_datatype co (spec : spec) lthy =
12151230 )),
12161231 K (Local_Defs.unfold0_tac ctxt (@{thms comp_def map_sum.simps map_prod_simp sum.inject}
12171232 @ map MRBNF_Def.map_id_of_mrbnf fp_nesting_mrbnfs
1233+ @ map MRBNF_Def.map_id0_of_mrbnf fp_nesting_mrbnfs
12181234 @ BMV_Monad_Def.unfolds_of_bmv_monad (MRSBNF_Def.bmv_monad_of_mrsbnf mrsbnf)
12191235 @ BMV_Monad_Def.defs_of_bmv_monad (MRSBNF_Def.bmv_monad_of_mrsbnf mrsbnf)
12201236 @ map (BNF_Def.map_id_of_bnf o snd) bnfs
0 commit comments