src/HOL/Tools/BNF/bnf_fp_def_sugar.ML
changeset 58337 568fb4e382c9
parent 58335 a5a3b576fcfb
child 58345 3d64590d9752
equal deleted inserted replaced
58336:a7add8066122 58337:568fb4e382c9
  1351     val dtors = map (mk_dtor As) dtors0;
  1351     val dtors = map (mk_dtor As) dtors0;
  1352 
  1352 
  1353     val fpTs = map (domain_type o fastype_of) dtors;
  1353     val fpTs = map (domain_type o fastype_of) dtors;
  1354     val fpBTs = map B_ify fpTs;
  1354     val fpBTs = map B_ify fpTs;
  1355 
  1355 
       
  1356     val code_attrs = if plugins code_plugin then [Code.add_default_eqn_attrib] else [];
       
  1357 
  1356     fun massage_simple_notes base =
  1358     fun massage_simple_notes base =
  1357       filter_out (null o #2)
  1359       filter_out (null o #2)
  1358       #> map (fn (thmN, thms, f_attrs) =>
  1360       #> map (fn (thmN, thms, f_attrs) =>
  1359         ((Binding.qualify true base (Binding.name thmN), []), map_index (fn (i, thm) => ([thm], f_attrs i)) thms));
  1361         ((Binding.qualify true base (Binding.name thmN), []),
       
  1362          map_index (fn (i, thm) => ([thm], f_attrs i)) thms));
  1360 
  1363 
  1361     val massage_multi_notes =
  1364     val massage_multi_notes =
  1362       maps (fn (thmN, thmss, attrs) =>
  1365       maps (fn (thmN, thmss, attrs) =>
  1363         map3 (fn fp_b_name => fn Type (T_name, _) => fn thms =>
  1366         map3 (fn fp_b_name => fn Type (T_name, _) => fn thms =>
  1364             ((Binding.qualify true fp_b_name (Binding.name thmN), attrs T_name), [(thms, [])]))
  1367             ((Binding.qualify true fp_b_name (Binding.name thmN), attrs T_name), [(thms, [])]))
  1365           fp_b_names fpTs thmss)
  1368           fp_b_names fpTs thmss)
  1366       #> filter_out (null o fst o hd o snd);
  1369       #> filter_out (null o fst o hd o snd);
  1367 
       
  1368     val code_attrs = if plugins code_plugin then [Code.add_default_eqn_attrib] else [];
       
  1369 
  1370 
  1370     val ctr_Tsss = map (map (map (Term.typ_subst_atomic (Xs ~~ fpTs)))) ctrXs_Tsss;
  1371     val ctr_Tsss = map (map (map (Term.typ_subst_atomic (Xs ~~ fpTs)))) ctrXs_Tsss;
  1371     val ns = map length ctr_Tsss;
  1372     val ns = map length ctr_Tsss;
  1372     val kss = map (fn n => 1 upto n) ns;
  1373     val kss = map (fn n => 1 upto n) ns;
  1373     val mss = map (map length) ctr_Tsss;
  1374     val mss = map (map length) ctr_Tsss;