src/HOL/Tools/Predicate_Compile/core_data.ML
changeset 59621 291934bac95e
parent 59582 0fbed69ff081
child 59636 9f44d053b972
equal deleted inserted replaced
59620:92d7d8e4f1bf 59621:291934bac95e
   233     fun instantiate i n ({context = ctxt2, prems, ...}: Subgoal.focus) =
   233     fun instantiate i n ({context = ctxt2, prems, ...}: Subgoal.focus) =
   234       let
   234       let
   235         fun term_pair_of (ix, (ty, t)) = (Var (ix, ty), t)
   235         fun term_pair_of (ix, (ty, t)) = (Var (ix, ty), t)
   236         fun inst_of_matches tts =
   236         fun inst_of_matches tts =
   237           fold (Pattern.match thy) tts (Vartab.empty, Vartab.empty)
   237           fold (Pattern.match thy) tts (Vartab.empty, Vartab.empty)
   238           |> snd |> Vartab.dest |> map (apply2 (Thm.cterm_of thy) o term_pair_of)
   238           |> snd |> Vartab.dest |> map (apply2 (Thm.global_cterm_of thy) o term_pair_of)
   239         val (cases, (eqs, prems1)) = apsnd (chop (nargs - nparams)) (chop n prems)
   239         val (cases, (eqs, prems1)) = apsnd (chop (nargs - nparams)) (chop n prems)
   240         val case_th =
   240         val case_th =
   241           rewrite_rule ctxt2 (@{thm Predicate.eq_is_eq} :: map meta_eq_of eqs) (nth cases (i - 1))
   241           rewrite_rule ctxt2 (@{thm Predicate.eq_is_eq} :: map meta_eq_of eqs) (nth cases (i - 1))
   242         val prems2 = maps (dest_conjunct_prem o rewrite_rule ctxt2 tuple_rew_rules) prems1
   242         val prems2 = maps (dest_conjunct_prem o rewrite_rule ctxt2 tuple_rew_rules) prems1
   243         val pats =
   243         val pats =