35 val co_rec_thms = [map_id0_of_bnf fp_bnf RS @{thm ctor_rec}]; |
35 val co_rec_thms = [map_id0_of_bnf fp_bnf RS @{thm ctor_rec}]; |
36 in |
36 in |
37 {Ts = [fpT], bnfs = [fp_bnf], ctors = xtors, dtors = xtors, xtor_un_folds = co_recs, |
37 {Ts = [fpT], bnfs = [fp_bnf], ctors = xtors, dtors = xtors, xtor_un_folds = co_recs, |
38 xtor_co_recs = co_recs, xtor_co_induct = @{thm xtor_induct}, dtor_ctors = @{thms xtor_xtor}, |
38 xtor_co_recs = co_recs, xtor_co_induct = @{thm xtor_induct}, dtor_ctors = @{thms xtor_xtor}, |
39 ctor_dtors = @{thms xtor_xtor}, ctor_injects = @{thms xtor_inject}, |
39 ctor_dtors = @{thms xtor_xtor}, ctor_injects = @{thms xtor_inject}, |
40 dtor_injects = @{thms xtor_inject}, xtor_maps = [xtor_map], xtor_setss = [xtor_sets], |
40 dtor_injects = @{thms xtor_inject}, xtor_maps = [xtor_map], xtor_map_uniques = [], |
41 xtor_rels = [xtor_rel], xtor_un_fold_thms = co_rec_thms, xtor_co_rec_thms = co_rec_thms, |
41 xtor_setss = [xtor_sets], xtor_rels = [xtor_rel], xtor_un_fold_thms = co_rec_thms, |
42 xtor_co_rec_o_maps = [ctor_rec_o_map], xtor_rel_co_induct = xtor_rel_induct, |
42 xtor_co_rec_thms = co_rec_thms, xtor_un_fold_uniques = [], xtor_co_rec_uniques = [], |
43 dtor_set_inducts = [], xtor_co_rec_transfers = []} |
43 xtor_un_fold_o_maps = [ctor_rec_o_map], xtor_co_rec_o_maps = [ctor_rec_o_map], |
|
44 xtor_un_fold_transfers = [], xtor_co_rec_transfers = [], xtor_rel_co_induct = xtor_rel_induct, |
|
45 dtor_set_inducts = []} |
44 end; |
46 end; |
45 |
47 |
46 fun fp_sugar_of_sum ctxt = |
48 fun fp_sugar_of_sum ctxt = |
47 let |
49 let |
48 val fpT as Type (fpT_name, As) = @{typ "'a + 'b"}; |
50 val fpT as Type (fpT_name, As) = @{typ "'a + 'b"}; |