equal
deleted
inserted
replaced
39 val appgen_default: appgen; |
39 val appgen_default: appgen; |
40 val appgen_let: (int -> term -> term list * term) |
40 val appgen_let: (int -> term -> term list * term) |
41 -> appgen; |
41 -> appgen; |
42 val appgen_split: (int -> term -> term list * term) |
42 val appgen_split: (int -> term -> term list * term) |
43 -> appgen; |
43 -> appgen; |
44 val appgen_number_of: (term -> term) -> (term -> IntInf.int) -> string -> string |
44 val appgen_number_of: (term -> term) -> (theory -> term -> IntInf.int) -> string -> string |
45 -> appgen; |
45 -> appgen; |
46 val add_case_const: (theory -> string -> (string * int) list option) -> xstring |
46 val add_case_const: (theory -> string -> (string * int) list option) -> xstring |
47 -> theory -> theory; |
47 -> theory -> theory; |
48 val add_case_const_i: (theory -> string -> (string * int) list option) -> string |
48 val add_case_const_i: (theory -> string -> (string * int) list option) -> string |
49 -> theory -> theory; |
49 -> theory -> theory; |
902 fun appgen_number_of mk_int_to_nat bin_to_int tyco_int tyco_nat thy tabs ((_, |
902 fun appgen_number_of mk_int_to_nat bin_to_int tyco_int tyco_nat thy tabs ((_, |
903 Type (_, [_, ty as Type (tyco, [])])), [bin]) trns = |
903 Type (_, [_, ty as Type (tyco, [])])), [bin]) trns = |
904 if tyco = tyco_int then |
904 if tyco = tyco_int then |
905 trns |
905 trns |
906 |> exprgen_type thy tabs ty |
906 |> exprgen_type thy tabs ty |
907 |-> (fn ty => pair (CodegenThingol.IConst (((IntInf.toString o bin_to_int) bin, ty), []))) |
907 |-> (fn ty => pair (CodegenThingol.IConst (((IntInf.toString o bin_to_int thy) bin, ty), []))) |
908 else if tyco = tyco_nat then |
908 else if tyco = tyco_nat then |
909 trns |
909 trns |
910 |> exprgen_term thy tabs (mk_int_to_nat bin) |
910 |> exprgen_term thy tabs (mk_int_to_nat bin) |
911 else error ("invalid type constructor for numeral: " ^ quote tyco); |
911 else error ("invalid type constructor for numeral: " ^ quote tyco); |
912 |
912 |