src/Pure/Isar/code.ML
changeset 28672 0baf1d9c6780
parent 28562 4e74209f113e
child 28673 d746a8c12c43
equal deleted inserted replaced
28671:ed6681dd35d8 28672:0baf1d9c6780
   116 (** logical and syntactical specification of executable code **)
   116 (** logical and syntactical specification of executable code **)
   117 
   117 
   118 (* defining equations with linear flag, default flag and lazy theorems *)
   118 (* defining equations with linear flag, default flag and lazy theorems *)
   119 
   119 
   120 fun pretty_lthms ctxt r = case Susp.peek r
   120 fun pretty_lthms ctxt r = case Susp.peek r
   121  of SOME thms => map (ProofContext.pretty_thm ctxt o fst) thms
   121  of SOME thms => map (ProofContext.pretty_thm ctxt o fst) (Exn.release thms)
   122   | NONE => [Pretty.str "[...]"];
   122   | NONE => [Pretty.str "[...]"];
   123 
   123 
   124 fun certificate thy f r =
   124 fun certificate thy f r =
   125   case Susp.peek r
   125   case Susp.peek r
   126    of SOME thms => (Susp.value o f thy) thms
   126    of SOME thms => (Susp.value o f thy) (Exn.release thms)
   127     | NONE => let
   127     | NONE => let
   128         val thy_ref = Theory.check_thy thy;
   128         val thy_ref = Theory.check_thy thy;
   129       in Susp.delay (fn () => (f (Theory.deref thy_ref) o Susp.force) r) end;
   129       in Susp.delay (fn () => (f (Theory.deref thy_ref) o Susp.force) r) end;
   130 
   130 
   131 fun add_drop_redundant thy (thm, linear) thms =
   131 fun add_drop_redundant thy (thm, linear) thms =