src/HOL/Tools/BNF/bnf_gfp.ML
changeset 57700 a2c4adb839a9
parent 57631 959caab43a3d
child 57726 18b8a8f10313
equal deleted inserted replaced
57699:a6cf197c1f1e 57700:a2c4adb839a9
  1657           (unfold_thms_tac ctxt @{thms le_fun_def le_bool_def all_simps(1,2)[symmetric]} THEN
  1657           (unfold_thms_tac ctxt @{thms le_fun_def le_bool_def all_simps(1,2)[symmetric]} THEN
  1658           REPEAT_DETERM (rtac allI 1) THEN rtac (dtor_coinduct_thm OF prems) 1)) lthy;
  1658           REPEAT_DETERM (rtac allI 1) THEN rtac (dtor_coinduct_thm OF prems) 1)) lthy;
  1659 
  1659 
  1660     (*register new codatatypes as BNFs*)
  1660     (*register new codatatypes as BNFs*)
  1661     val (timer, Jbnfs, (dtor_Jmap_o_thms, dtor_Jmap_thms), dtor_Jset_thmss',
  1661     val (timer, Jbnfs, (dtor_Jmap_o_thms, dtor_Jmap_thms), dtor_Jset_thmss',
  1662       dtor_Jrel_thms, Jrel_coinduct_thm, Jbnf_notes, lthy) =
  1662       dtor_Jrel_thms, Jrel_coinduct_thm, Jbnf_notes, dtor_Jset_induct_thms, lthy) =
  1663       if m = 0 then
  1663       if m = 0 then
  1664         (timer, replicate n DEADID_bnf,
  1664         (timer, replicate n DEADID_bnf,
  1665         map_split (`(mk_pointfree lthy)) (map2 mk_dtor_map_DEADID_thm dtor_inject_thms map_ids),
  1665         map_split (`(mk_pointfree lthy)) (map2 mk_dtor_map_DEADID_thm dtor_inject_thms map_ids),
  1666         replicate n [], map2 mk_dtor_Jrel_DEADID_thm dtor_inject_thms bnfs,
  1666         replicate n [], map2 mk_dtor_Jrel_DEADID_thm dtor_inject_thms bnfs,
  1667         mk_Jrel_DEADID_coinduct_thm (), [], lthy)
  1667         mk_Jrel_DEADID_coinduct_thm (), [], [], lthy)
  1668       else let
  1668       else let
  1669         val fTs = map2 (curry op -->) passiveAs passiveBs;
  1669         val fTs = map2 (curry op -->) passiveAs passiveBs;
  1670         val gTs = map2 (curry op -->) passiveBs passiveCs;
  1670         val gTs = map2 (curry op -->) passiveBs passiveCs;
  1671         val uTs = map2 (curry op -->) Ts Ts';
  1671         val uTs = map2 (curry op -->) Ts Ts';
  1672 
  1672 
  2462             map2 (fn b => fn thms =>
  2462             map2 (fn b => fn thms =>
  2463               ((Binding.qualify true (Binding.name_of b) (Binding.name thmN), []), [(thms, [])]))
  2463               ((Binding.qualify true (Binding.name_of b) (Binding.name thmN), []), [(thms, [])]))
  2464             bs thmss)
  2464             bs thmss)
  2465       in
  2465       in
  2466         (timer, Jbnfs, (Jmap_thms, dtor_Jmap_thms), dtor_Jset_thmss',
  2466         (timer, Jbnfs, (Jmap_thms, dtor_Jmap_thms), dtor_Jset_thmss',
  2467           dtor_Jrel_thms, Jrel_coinduct_thm, Jbnf_common_notes @ Jbnf_notes, lthy)
  2467           dtor_Jrel_thms, Jrel_coinduct_thm, Jbnf_common_notes @ Jbnf_notes, dtor_Jset_induct_thms,
       
  2468           lthy)
  2468       end;
  2469       end;
  2469 
  2470 
  2470     val dtor_unfold_o_Jmap_thms = mk_xtor_un_fold_o_map_thms Greatest_FP false m
  2471     val dtor_unfold_o_Jmap_thms = mk_xtor_un_fold_o_map_thms Greatest_FP false m
  2471       dtor_unfold_unique_thm dtor_Jmap_o_thms (map (mk_pointfree lthy) dtor_unfold_thms)
  2472       dtor_unfold_unique_thm dtor_Jmap_o_thms (map (mk_pointfree lthy) dtor_unfold_thms)
  2472       sym_map_comps map_cong0s;
  2473       sym_map_comps map_cong0s;
  2524       {Ts = Ts, bnfs = Jbnfs, ctors = ctors, dtors = dtors, xtor_co_recs = corecs,
  2525       {Ts = Ts, bnfs = Jbnfs, ctors = ctors, dtors = dtors, xtor_co_recs = corecs,
  2525        xtor_co_induct = dtor_coinduct_thm, dtor_ctors = dtor_ctor_thms, ctor_dtors = ctor_dtor_thms,
  2526        xtor_co_induct = dtor_coinduct_thm, dtor_ctors = dtor_ctor_thms, ctor_dtors = ctor_dtor_thms,
  2526        ctor_injects = ctor_inject_thms, dtor_injects = dtor_inject_thms,
  2527        ctor_injects = ctor_inject_thms, dtor_injects = dtor_inject_thms,
  2527        xtor_map_thms = dtor_Jmap_thms, xtor_set_thmss = dtor_Jset_thmss',
  2528        xtor_map_thms = dtor_Jmap_thms, xtor_set_thmss = dtor_Jset_thmss',
  2528        xtor_rel_thms = dtor_Jrel_thms, xtor_co_rec_thms = dtor_corec_thms,
  2529        xtor_rel_thms = dtor_Jrel_thms, xtor_co_rec_thms = dtor_corec_thms,
  2529        xtor_co_rec_o_map_thms = dtor_corec_o_Jmap_thms, rel_xtor_co_induct_thm = Jrel_coinduct_thm}
  2530        xtor_co_rec_o_map_thms = dtor_corec_o_Jmap_thms, rel_xtor_co_induct_thm = Jrel_coinduct_thm,
       
  2531        dtor_set_induct_thms = dtor_Jset_induct_thms}
  2530       |> morph_fp_result (substitute_noted_thm noted);
  2532       |> morph_fp_result (substitute_noted_thm noted);
  2531   in
  2533   in
  2532     timer; (fp_res, lthy')
  2534     timer; (fp_res, lthy')
  2533   end;
  2535   end;
  2534 
  2536