equal
deleted
inserted
replaced
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 = |