src/HOL/Nominal/nominal_fresh_fun.ML
changeset 59621 291934bac95e
parent 59586 ddf6deaadfe8
child 59635 025f70f35daf
equal deleted inserted replaced
59620:92d7d8e4f1bf 59621:291934bac95e
    21     val Ts = map snd ps;
    21     val Ts = map snd ps;
    22     val tinst' = map (fn (t, u) =>
    22     val tinst' = map (fn (t, u) =>
    23       (head_of (Logic.incr_indexes (Ts, j) t),
    23       (head_of (Logic.incr_indexes (Ts, j) t),
    24        fold_rev Term.abs ps u)) tinst;
    24        fold_rev Term.abs ps u)) tinst;
    25     val th' = instf
    25     val th' = instf
    26       (map (apply2 (Thm.ctyp_of thy)) tyinst')
    26       (map (apply2 (Thm.global_ctyp_of thy)) tyinst')
    27       (map (apply2 (Thm.cterm_of thy)) tinst')
    27       (map (apply2 (Thm.global_cterm_of thy)) tinst')
    28       (Thm.lift_rule cgoal th)
    28       (Thm.lift_rule cgoal th)
    29   in
    29   in
    30     compose_tac ctxt (elim, th', Thm.nprems_of th) i st
    30     compose_tac ctxt (elim, th', Thm.nprems_of th) i st
    31   end handle General.Subscript => Seq.empty;
    31   end handle General.Subscript => Seq.empty;
    32 (* FIXME proper SUBGOAL/CSUBGOAL instead of cprems_of etc. *)
    32 (* FIXME proper SUBGOAL/CSUBGOAL instead of cprems_of etc. *)
   147     fun inst_fresh vars params i st =
   147     fun inst_fresh vars params i st =
   148    let val vars' = Misc_Legacy.term_vars (Thm.prop_of st);
   148    let val vars' = Misc_Legacy.term_vars (Thm.prop_of st);
   149        val thy = Thm.theory_of_thm st;
   149        val thy = Thm.theory_of_thm st;
   150    in case subtract (op =) vars vars' of
   150    in case subtract (op =) vars vars' of
   151      [x] =>
   151      [x] =>
   152       Seq.single (Thm.instantiate ([], [(Thm.cterm_of thy x, Thm.cterm_of thy (fold_rev Term.abs params (Bound 0)))]) st)
   152       Seq.single (Thm.instantiate ([], [(Thm.global_cterm_of thy x, Thm.global_cterm_of thy (fold_rev Term.abs params (Bound 0)))]) st)
   153     | _ => error "fresh_fun_simp: Too many variables, please report."
   153     | _ => error "fresh_fun_simp: Too many variables, please report."
   154    end
   154    end
   155   in
   155   in
   156   ((fn st =>
   156   ((fn st =>
   157   let
   157   let