src/Pure/Isar/overloading.ML
changeset 26597 ff250dde68d6
parent 26520 9e7b7c478cb1
child 26730 bbb5e6904d78
equal deleted inserted replaced
26596:07d7d0a6d5fd 26597:ff250dde68d6
    64   let
    64   let
    65     val { primary_constraints, secondary_constraints, improve, subst, passed, ... } =
    65     val { primary_constraints, secondary_constraints, improve, subst, passed, ... } =
    66       ImprovableSyntax.get ctxt;
    66       ImprovableSyntax.get ctxt;
    67     val tsig = (Sign.tsig_of o ProofContext.theory_of) ctxt;
    67     val tsig = (Sign.tsig_of o ProofContext.theory_of) ctxt;
    68     fun accumulate_improvements (Const (c, ty)) = (case improve (c, ty)
    68     fun accumulate_improvements (Const (c, ty)) = (case improve (c, ty)
    69          of SOME ty_ty' => (perhaps o try o Type.typ_match tsig) ty_ty'
    69          of SOME ty_ty' => Type.typ_match tsig ty_ty'
    70           | _ => I)
    70           | _ => I)
    71       | accumulate_improvements _ = I;
    71       | accumulate_improvements _ = I;
    72     val improvements = (fold o fold_aterms) accumulate_improvements ts Vartab.empty;
    72     val improvements = (fold o fold_aterms) accumulate_improvements ts Vartab.empty;
    73     val ts' = (map o map_types) (Envir.typ_subst_TVars improvements) ts;
    73     val ts' = (map o map_types) (Envir.typ_subst_TVars improvements) ts;
    74     fun apply_subst t = Envir.expand_term (fn Const (c, ty) => (case subst (c, ty)
    74     fun apply_subst t = Envir.expand_term (fn Const (c, ty) => (case subst (c, ty)