2119 |
2119 |
2120 val ((_, [{cong_intro_pairs, coinduct, coinduct_attrs}]), lthy) = lthy |
2120 val ((_, [{cong_intro_pairs, coinduct, coinduct_attrs}]), lthy) = lthy |
2121 |> derive_and_update_coinduct_cong_intross [corec_info]; |
2121 |> derive_and_update_coinduct_cong_intross [corec_info]; |
2122 val cong_intros_pairs = AList.group (op =) cong_intro_pairs; |
2122 val cong_intros_pairs = AList.group (op =) cong_intro_pairs; |
2123 |
2123 |
2124 val code_attrs = if plugins code_plugin then [Code.add_default_eqn_attrib Code.Equation] else []; |
|
2125 |
|
2126 val anonymous_notes = []; |
2124 val anonymous_notes = []; |
2127 (* TODO: |
2125 (* TODO: |
2128 [(flat disc_iff_or_disc_thmss, simp_attrs)] |
2126 [(flat disc_iff_or_disc_thmss, simp_attrs)] |
2129 |> map (fn (thms, attrs) => ((Binding.empty, attrs), [(thms, [])])); |
2127 |> map (fn (thms, attrs) => ((Binding.empty, attrs), [(thms, [])])); |
2130 *) |
2128 *) |
2131 |
2129 |
2132 val notes = |
2130 val notes = |
2133 [(cong_introsN, maps snd cong_intros_pairs, []), |
2131 [(cong_introsN, maps snd cong_intros_pairs, []), |
2134 (codeN, [code_thm], code_attrs @ nitpicksimp_attrs), |
2132 (codeN, [code_thm], nitpicksimp_attrs), |
2135 (coinductN, [coinduct], coinduct_attrs), |
2133 (coinductN, [coinduct], coinduct_attrs), |
2136 (inner_inductN, inner_fp_inducts, []), |
2134 (inner_inductN, inner_fp_inducts, []), |
2137 (uniqueN, uniques, [])] @ |
2135 (uniqueN, uniques, [])] @ |
2138 map (fn (thmN, thms) => (thmN, thms, [])) cong_intros_pairs @ |
2136 map (fn (thmN, thms) => (thmN, thms, [])) cong_intros_pairs @ |
2139 (if Config.get lthy bnf_internals then |
2137 (if Config.get lthy bnf_internals then |
2158 (* TODO: |
2156 (* TODO: |
2159 |> Spec_Rules.add Spec_Rules.Equational ([fun_t0], flat sel_thmss) |
2157 |> Spec_Rules.add Spec_Rules.Equational ([fun_t0], flat sel_thmss) |
2160 |> Spec_Rules.add Spec_Rules.Equational ([fun_t0], flat ctr_thmss) |
2158 |> Spec_Rules.add Spec_Rules.Equational ([fun_t0], flat ctr_thmss) |
2161 *) |
2159 *) |
2162 |> Spec_Rules.add Spec_Rules.Equational ([fun_t0], [code_thm]) |
2160 |> Spec_Rules.add Spec_Rules.Equational ([fun_t0], [code_thm]) |
|
2161 |> plugins code_plugin ? Code.declare_default_eqns [(code_thm, true)] |
2163 |> Local_Theory.notes (anonymous_notes @ notes) |
2162 |> Local_Theory.notes (anonymous_notes @ notes) |
2164 |> snd |
2163 |> snd |
2165 end; |
2164 end; |
2166 |
2165 |
2167 fun prove_transfer_goal ctxt goal = |
2166 fun prove_transfer_goal ctxt goal = |