src/Tools/Code/code_thingol.ML
changeset 74411 20b0b27bc6c7
parent 69645 e4e5bc6ac214
child 74446 2fdf37577f7b
equal deleted inserted replaced
74410:254de9de2cd7 74411:20b0b27bc6c7
   744 and translate_app_case ctxt algbr eqngr permissive some_thm (case_schema as (num_args, _)) ((c, ty), ts) =
   744 and translate_app_case ctxt algbr eqngr permissive some_thm (case_schema as (num_args, _)) ((c, ty), ts) =
   745   if length ts < num_args then
   745   if length ts < num_args then
   746     let
   746     let
   747       val k = length ts;
   747       val k = length ts;
   748       val tys = (take (num_args - k) o drop k o fst o strip_type) ty;
   748       val tys = (take (num_args - k) o drop k o fst o strip_type) ty;
   749       val names = (fold o fold_aterms) Term.declare_term_frees ts Name.context;
   749       val names = Name.build_context (ts |> (fold o fold_aterms) Term.declare_term_frees);
   750       val vs = Name.invent_names names "a" tys;
   750       val vs = Name.invent_names names "a" tys;
   751     in
   751     in
   752       fold_map (translate_typ ctxt algbr eqngr permissive) tys
   752       fold_map (translate_typ ctxt algbr eqngr permissive) tys
   753       ##>> translate_case ctxt algbr eqngr permissive some_thm case_schema ((c, ty), ts @ map Free vs)
   753       ##>> translate_case ctxt algbr eqngr permissive some_thm case_schema ((c, ty), ts @ map Free vs)
   754       #>> (fn (tys, t) => map2 (fn (v, _) => pair (SOME v)) vs tys `|==> t)
   754       #>> (fn (tys, t) => map2 (fn (v, _) => pair (SOME v)) vs tys `|==> t)