src/HOL/Tools/BNF/bnf_gfp_grec_sugar.ML
changeset 63391 6840e808fe44
parent 63352 4eaf35781b23
child 63801 83841a5c0897
equal deleted inserted replaced
63390:c27edca2d827 63391:6840e808fe44
  1254           explore params t
  1254           explore params t
  1255         else
  1255         else
  1256           let val T = fastype_of1 (bound_Ts, hd args) in
  1256           let val T = fastype_of1 (bound_Ts, hd args) in
  1257             (case (Option.mapPartial (ctr_sugar_of lthy) (try (fst o dest_Type) T), T <> res_T) of
  1257             (case (Option.mapPartial (ctr_sugar_of lthy) (try (fst o dest_Type) T), T <> res_T) of
  1258               (SOME {selss, T = Type (_, Ts), ...}, true) =>
  1258               (SOME {selss, T = Type (_, Ts), ...}, true) =>
  1259               (case const_of (fold (curry op @) selss []) fun_t of
  1259               (case const_of (flat selss) fun_t of
  1260                 SOME sel =>
  1260                 SOME sel =>
  1261                 let
  1261                 let
  1262                   val args' = args |> map (typ_before explore params);
  1262                   val args' = args |> map (typ_before explore params);
  1263                   val Type (_, Us) = fastype_of1 (bound_Us, hd args');
  1263                   val Type (_, Us) = fastype_of1 (bound_Us, hd args');
  1264                   val sel' = sel |> Term.subst_TVars (map (fst o dest_TVar) Ts ~~ Us);
  1264                   val sel' = sel |> Term.subst_TVars (map (fst o dest_TVar) Ts ~~ Us);