src/Pure/Isar/element.ML
changeset 20218 be3bfb0699ba
parent 20150 baa589c574ff
child 20233 ece639738db3
equal deleted inserted replaced
20217:25b068a99d2b 20218:be3bfb0699ba
   217 fun obtain prop ctxt =
   217 fun obtain prop ctxt =
   218   let
   218   let
   219     val ((xs, prop'), ctxt') = Variable.focus prop ctxt;
   219     val ((xs, prop'), ctxt') = Variable.focus prop ctxt;
   220     val As = Logic.strip_imp_prems (Thm.term_of prop');
   220     val As = Logic.strip_imp_prems (Thm.term_of prop');
   221     fun var (x, T) = (ProofContext.revert_skolem ctxt' x, SOME T);
   221     fun var (x, T) = (ProofContext.revert_skolem ctxt' x, SOME T);
   222   in (("", (map var xs, As)), ctxt') end;
   222   in (("", (map (var o Term.dest_Free o Thm.term_of) xs, As)), ctxt') end;
   223 
   223 
   224 in
   224 in
   225 
   225 
   226 fun pretty_statement ctxt kind raw_th =
   226 fun pretty_statement ctxt kind raw_th =
   227   let
   227   let
   229     val cert = Thm.cterm_of thy;
   229     val cert = Thm.cterm_of thy;
   230 
   230 
   231     val th = Goal.norm_hhf raw_th;
   231     val th = Goal.norm_hhf raw_th;
   232     val is_elim = ObjectLogic.is_elim th;
   232     val is_elim = ObjectLogic.is_elim th;
   233 
   233 
   234     val ([th'], ctxt') = Variable.import true [th] ctxt;
   234     val ((_, [th']), ctxt') = Variable.import true [th] ctxt;
   235     val prop = Thm.prop_of th';
   235     val prop = Thm.prop_of th';
   236     val (prems, concl) = Logic.strip_horn prop;
   236     val (prems, concl) = Logic.strip_horn prop;
   237     val concl_term = ObjectLogic.drop_judgment thy concl;
   237     val concl_term = ObjectLogic.drop_judgment thy concl;
   238 
   238 
   239     val fixes = fold_aterms (fn v as Free (x, T) =>
   239     val fixes = fold_aterms (fn v as Free (x, T) =>