src/HOL/Tools/BNF/bnf_gfp_grec.ML
changeset 63845 61a03e429cbd
parent 63824 24c4fa81f81c
child 63859 dca6fabd8060
equal deleted inserted replaced
63844:9c22a97b7674 63845:61a03e429cbd
   503 
   503 
   504     fun flatten_tyargs Ass =
   504     fun flatten_tyargs Ass =
   505       map dest_TFree live_As
   505       map dest_TFree live_As
   506       |> filter (fn T => exists (fn Ts => member (op =) Ts T) Ass);
   506       |> filter (fn T => exists (fn Ts => member (op =) Ts T) Ass);
   507 
   507 
   508      val ((bnf, _), (_, lthy)) =
   508     val ((bnf, _), (_, lthy)) =
   509       bnf_of_typ false Do_Inline I flatten_tyargs [Term.dest_TFree Y]
   509       bnf_of_typ false Do_Inline I flatten_tyargs [Term.dest_TFree Y] (map Term.dest_TFree dead_Es)
   510         (map Term.dest_TFree dead_Es) T ((empty_comp_cache, empty_unfolds), lthy)
   510         T ((empty_comp_cache, empty_unfolds), lthy)
   511       handle BAD_DEAD (Y, Y_backdrop) =>
   511       handle BAD_DEAD (Y, Y_backdrop) =>
   512         (case Y_backdrop of
   512         (case Y_backdrop of
   513           Type (bad_tc, _) =>
   513           Type (bad_tc, _) =>
   514           let
   514           let
   515             val T = qsoty (unfreeze_fp Y);
   515             val T = qsoty (unfreeze_fp Y);
  1666     dtor_unfold_unique sig_map_thm ssig_induct ssig_map_thms Oper_map_thm VLeaf_map_thm
  1666     dtor_unfold_unique sig_map_thm ssig_induct ssig_map_thms Oper_map_thm VLeaf_map_thm
  1667     CLeaf_map_thm Lam_transfer flat_simps flat_transfer eval_core_simps eval_core_transfer eval_def
  1667     CLeaf_map_thm Lam_transfer flat_simps flat_transfer eval_core_simps eval_core_transfer eval_def
  1668     cutSsig_def algLam_def corecU_def live_pre_bnf pre_bnf dead_pre_bnf fp_bnf sig_bnf ssig_bnf
  1668     cutSsig_def algLam_def corecU_def live_pre_bnf pre_bnf dead_pre_bnf fp_bnf sig_bnf ssig_bnf
  1669     dead_ssig_bnf =
  1669     dead_ssig_bnf =
  1670   let
  1670   let
  1671     val SOME prod_fp_sugar = fp_sugar_of ctxt @{type_name prod};
  1671     val SOME prod_bnf = bnf_of ctxt @{type_name prod};
  1672     val prod_bnf = #fp_bnf prod_fp_sugar;
       
  1673 
  1672 
  1674     val f' = substT Z fpT f;
  1673     val f' = substT Z fpT f;
  1675     val dead_ssig_map' = substT Z fpT dead_ssig_map;
  1674     val dead_ssig_map' = substT Z fpT dead_ssig_map;
  1676     val extdd = Term.lambda f' (HOLogic.mk_comp (eval, dead_ssig_map' $ f'));
  1675     val extdd = Term.lambda f' (HOLogic.mk_comp (eval, dead_ssig_map' $ f'));
  1677 
  1676