equal
deleted
inserted
replaced
329 |> Local_Theory.raw_theory register_interpret |
329 |> Local_Theory.raw_theory register_interpret |
330 |> Local_Theory.notes all_notes |
330 |> Local_Theory.notes all_notes |
331 |> snd |
331 |> snd |
332 end; |
332 end; |
333 |
333 |
334 fun datatype_compat_global fpT_names = |
334 val datatype_compat_global = map_local_theory o datatype_compat; |
335 Named_Target.theory_init |
|
336 #> datatype_compat fpT_names |
|
337 #> Named_Target.exit; |
|
338 |
335 |
339 fun datatype_compat_cmd raw_fpT_names lthy = |
336 fun datatype_compat_cmd raw_fpT_names lthy = |
340 let |
337 let |
341 val fpT_names = |
338 val fpT_names = |
342 map (fst o dest_Type o Proof_Context.read_type_name {proper = true, strict = false} lthy) |
339 map (fst o dest_Type o Proof_Context.read_type_name {proper = true, strict = false} lthy) |
358 |
355 |
359 val new_specs = map new_spec_of old_specs; |
356 val new_specs = map new_spec_of old_specs; |
360 in |
357 in |
361 (fpT_names, |
358 (fpT_names, |
362 thy |
359 thy |
363 |> Named_Target.theory_init |
360 |> map_local_theory (co_datatypes Least_FP construct_lfp ((false, false), new_specs)) |
364 |> co_datatypes Least_FP construct_lfp ((false, false), new_specs) |
|
365 |> Named_Target.exit |
|
366 |> nesting_pref = Unfold_Nesting ? perhaps (try (datatype_compat_global fpT_names))) |
361 |> nesting_pref = Unfold_Nesting ? perhaps (try (datatype_compat_global fpT_names))) |
367 end; |
362 end; |
368 |
363 |
369 val add_primrec = apfst (apsnd flat) ooo BNF_LFP_Rec_Sugar.add_primrec; |
364 val add_primrec = apfst (apsnd flat) ooo BNF_LFP_Rec_Sugar.add_primrec; |
370 val add_primrec_global = apfst (apsnd flat) ooo BNF_LFP_Rec_Sugar.add_primrec_global; |
365 val add_primrec_global = apfst (apsnd flat) ooo BNF_LFP_Rec_Sugar.add_primrec_global; |