src/HOL/Tools/BNF/bnf_lfp_compat.ML
changeset 58126 3831312eb476
parent 58125 a2ba381607fb
child 58129 3ec65a7f2b50
equal deleted inserted replaced
58125:a2ba381607fb 58126:3831312eb476
    26   val datatype_compat: string list -> local_theory -> local_theory
    26   val datatype_compat: string list -> local_theory -> local_theory
    27   val datatype_compat_global: string list -> theory -> theory
    27   val datatype_compat_global: string list -> theory -> theory
    28   val datatype_compat_cmd: string list -> local_theory -> local_theory
    28   val datatype_compat_cmd: string list -> local_theory -> local_theory
    29   val add_datatype: nesting_preference -> Old_Datatype_Aux.spec list -> theory ->
    29   val add_datatype: nesting_preference -> Old_Datatype_Aux.spec list -> theory ->
    30     string list * theory
    30     string list * theory
       
    31   val add_primrec: (binding * typ option * mixfix) list -> (Attrib.binding * term) list ->
       
    32    local_theory -> (term list * thm list) * local_theory
    31 end;
    33 end;
    32 
    34 
    33 structure BNF_LFP_Compat : BNF_LFP_COMPAT =
    35 structure BNF_LFP_Compat : BNF_LFP_COMPAT =
    34 struct
    36 struct
    35 
    37 
   363      |> co_datatypes Least_FP construct_lfp ((false, false), new_specs)
   365      |> co_datatypes Least_FP construct_lfp ((false, false), new_specs)
   364      |> Named_Target.exit
   366      |> Named_Target.exit
   365      |> nesting_pref = Unfold_Nesting ? perhaps (try (datatype_compat_global fpT_names)))
   367      |> nesting_pref = Unfold_Nesting ? perhaps (try (datatype_compat_global fpT_names)))
   366   end;
   368   end;
   367 
   369 
       
   370 val add_primrec = apfst (apsnd flat) ooo BNF_LFP_Rec_Sugar.add_primrec;
       
   371 
   368 val _ =
   372 val _ =
   369   Outer_Syntax.local_theory @{command_spec "datatype_compat"}
   373   Outer_Syntax.local_theory @{command_spec "datatype_compat"}
   370     "register new-style datatypes as old-style datatypes"
   374     "register new-style datatypes as old-style datatypes"
   371     (Scan.repeat1 Parse.type_const >> datatype_compat_cmd);
   375     (Scan.repeat1 Parse.type_const >> datatype_compat_cmd);
   372 
   376