src/HOL/BNF/Tools/bnf_gfp_rec_sugar.ML
changeset 54954 a4ef9253a0b8
parent 54951 e25b4d22082b
child 54955 cf8d429dc24e
equal deleted inserted replaced
54953:a2f4cf3387fc 54954:a4ef9253a0b8
  1110                 |> curry Logic.list_all (map dest_Free fun_args);
  1110                 |> curry Logic.list_all (map dest_Free fun_args);
  1111               val disc_thm_opt = AList.lookup (op =) disc_alist disc;
  1111               val disc_thm_opt = AList.lookup (op =) disc_alist disc;
  1112               val sel_thms = map snd (filter (member (op =) sels o fst) sel_alist);
  1112               val sel_thms = map snd (filter (member (op =) sels o fst) sel_alist);
  1113             in
  1113             in
  1114               if prems = [@{term False}] then [] else
  1114               if prems = [@{term False}] then [] else
  1115                 mk_primcorec_ctr_of_dtr_tac lthy m collapse disc_thm_opt sel_thms
  1115                 mk_primcorec_ctr_tac lthy m collapse disc_thm_opt sel_thms
  1116                 |> K |> Goal.prove_sorry lthy [] [] goal
  1116                 |> K |> Goal.prove_sorry lthy [] [] goal
  1117                 |> Thm.close_derivation
  1117                 |> Thm.close_derivation
  1118                 |> pair ctr
  1118                 |> pair ctr
  1119                 |> pair eqn_pos
  1119                 |> pair eqn_pos
  1120                 |> single
  1120                 |> single
  1209         val disc_alistss = map3 (map oo prove_disc) corec_specs excludessss disc_eqnss;
  1209         val disc_alistss = map3 (map oo prove_disc) corec_specs excludessss disc_eqnss;
  1210         val disc_alists = map (map snd o flat) disc_alistss;
  1210         val disc_alists = map (map snd o flat) disc_alistss;
  1211         val sel_alists = map4 (map ooo prove_sel) corec_specs disc_eqnss excludessss sel_eqnss;
  1211         val sel_alists = map4 (map ooo prove_sel) corec_specs disc_eqnss excludessss sel_eqnss;
  1212         val disc_thmss = map (map snd o order_list_duplicates o flat) disc_alistss;
  1212         val disc_thmss = map (map snd o order_list_duplicates o flat) disc_alistss;
  1213         val disc_thmsss' = map (map (map (snd o snd))) disc_alistss;
  1213         val disc_thmsss' = map (map (map (snd o snd))) disc_alistss;
  1214         val disc_thmss' = map flat disc_thmsss';
       
  1215         val sel_thmss = map (map snd o order_list_duplicates) sel_alists;
  1214         val sel_thmss = map (map snd o order_list_duplicates) sel_alists;
  1216 
  1215 
  1217         fun prove_disc_iff ({ctr_specs, ...} : corec_spec) exhaust_thms disc_thmss' disc_thms
  1216         fun prove_disc_iff ({ctr_specs, ...} : corec_spec) exhaust_thms disc_thmss' disc_thms
  1218             ({fun_name, fun_T, fun_args, ctr_no, prems, eqn_pos, ...} : coeqn_data_disc) =
  1217             ({fun_name, fun_T, fun_args, ctr_no, prems, eqn_pos, ...} : coeqn_data_disc) =
  1219           if null disc_thms orelse null exhaust_thms then
  1218           if null disc_thms orelse null exhaust_thms then