src/Pure/Isar/generic_target.ML
changeset 47276 5e96bfb4a159
parent 47272 ca31cfa509b1
child 47279 4bab649dedf0
equal deleted inserted replaced
47275:fc95b8b6c260 47276:5e96bfb4a159
    59   let
    59   let
    60     val thy = Proof_Context.theory_of lthy;
    60     val thy = Proof_Context.theory_of lthy;
    61     val thy_ctxt = Proof_Context.init_global thy;
    61     val thy_ctxt = Proof_Context.init_global thy;
    62 
    62 
    63     (*term and type parameters*)
    63     (*term and type parameters*)
    64     val crhs = Thm.cterm_of thy rhs;
    64     val ((defs, _), rhs') = Thm.cterm_of thy rhs
    65     val ((defs, _), rhs') = Local_Defs.export_cterm lthy thy_ctxt crhs ||> Thm.term_of;
    65       |> Local_Defs.export_cterm lthy thy_ctxt ||> Thm.term_of;
    66 
    66 
    67     val xs = Variable.add_fixed lthy rhs' [];
    67     val xs = Variable.add_fixed lthy rhs' [];
    68     val T = Term.fastype_of rhs;
    68     val T = Term.fastype_of rhs;
    69     val tfreesT = Term.add_tfreesT T (fold (Term.add_tfreesT o #2) xs []);
    69     val tfreesT = Term.add_tfreesT T (fold (Term.add_tfreesT o #2) xs []);
    70     val extra_tfrees = rev (subtract (op =) tfreesT (Term.add_tfrees rhs []));
    70     val extra_tfrees = rev (subtract (op =) tfreesT (Term.add_tfrees rhs []));