equal
deleted
inserted
replaced
713 @{const_name Zero_Rep}, @{const_name Suc_Rep}] s orelse |
713 @{const_name Zero_Rep}, @{const_name Suc_Rep}] s orelse |
714 let |
714 let |
715 val thy = ProofContext.theory_of ctxt |
715 val thy = ProofContext.theory_of ctxt |
716 val (x as (_, T)) = (s, unarize_unbox_etc_type T) |
716 val (x as (_, T)) = (s, unarize_unbox_etc_type T) |
717 in |
717 in |
718 Refute.is_IDT_constructor thy x orelse is_record_constr x orelse |
718 is_real_constr thy x orelse is_record_constr x orelse |
719 (is_abs_fun ctxt x andalso is_pure_typedef ctxt (range_type T)) orelse |
719 (is_abs_fun ctxt x andalso is_pure_typedef ctxt (range_type T)) orelse |
720 is_coconstr thy x |
720 is_coconstr thy x |
721 end |
721 end |
722 fun is_stale_constr ctxt (x as (_, T)) = |
722 fun is_stale_constr ctxt (x as (_, T)) = |
723 let val thy = ProofContext.theory_of ctxt in |
723 let val thy = ProofContext.theory_of ctxt in |
859 case Datatype.get_info thy s of |
859 case Datatype.get_info thy s of |
860 SOME {index, descr, ...} => |
860 SOME {index, descr, ...} => |
861 let |
861 let |
862 val (_, dtyps, constrs) = AList.lookup (op =) descr index |> the |
862 val (_, dtyps, constrs) = AList.lookup (op =) descr index |> the |
863 in |
863 in |
864 map (fn (s', Us) => |
864 map (apsnd (fn Us => |
865 (s', map (Refute.typ_of_dtyp descr (dtyps ~~ Ts)) Us |
865 map (typ_of_dtyp descr (dtyps ~~ Ts)) Us ---> T)) |
866 ---> T)) constrs |
866 constrs |
867 end |
867 end |
868 | NONE => |
868 | NONE => |
869 if is_record_type T then |
869 if is_record_type T then |
870 let |
870 let |
871 val s' = unsuffix Record.ext_typeN s ^ Record.extN |
871 val s' = unsuffix Record.ext_typeN s ^ Record.extN |