equal
deleted
inserted
replaced
1026 let |
1026 let |
1027 val thy = ProofContext.theory_of background; |
1027 val thy = ProofContext.theory_of background; |
1028 val tyco = Sign.intern_type thy raw_tyco; |
1028 val tyco = Sign.intern_type thy raw_tyco; |
1029 val constrs = map (Code.check_const thy) raw_constrs; |
1029 val constrs = map (Code.check_const thy) raw_constrs; |
1030 val constrs' = (map fst o snd o Code.get_datatype thy) tyco; |
1030 val constrs' = (map fst o snd o Code.get_datatype thy) tyco; |
1031 val _ = if gen_eq_set (op =) (constrs, constrs') then () |
1031 val _ = if eq_set (op =) (constrs, constrs') then () |
1032 else error ("Type " ^ quote tyco ^ ": given constructors diverge from real constructors") |
1032 else error ("Type " ^ quote tyco ^ ": given constructors diverge from real constructors") |
1033 val is_first = is_first_occ background; |
1033 val is_first = is_first_occ background; |
1034 val background' = register_datatype tyco constrs background; |
1034 val background' = register_datatype tyco constrs background; |
1035 in (print_code struct_name is_first (print_datatype tyco constrs), background') end; |
1035 in (print_code struct_name is_first (print_datatype tyco constrs), background') end; |
1036 |
1036 |