added is_finished_thy;
authorwenzelm
Sat, 20 Jan 2007 14:09:16 +0100
changeset 22131 fa8960e165a6
parent 22130 0906fd95e0b5
child 22132 0f26cd597193
added is_finished_thy;
src/Pure/context.ML
--- a/src/Pure/context.ML	Sat Jan 20 14:09:14 2007 +0100
+++ b/src/Pure/context.ML	Sat Jan 20 14:09:16 2007 +0100
@@ -44,6 +44,7 @@
   val copy_thy: theory -> theory
   val checkpoint_thy: theory -> theory
   val finish_thy: theory -> theory
+  val is_finished_thy: theory -> bool
   val theory_data_of: theory -> string list
   val pre_pure_thy: theory
   val begin_thy: (theory -> Pretty.pp) -> string -> theory list -> theory
@@ -405,6 +406,9 @@
     val _ = List.app (fn r => r := thy'') rs;
   in thy'' end;
 
+fun is_finished_thy thy =
+  (check_thy thy; not (is_draft thy) andalso #version (history_of thy) = 0);
+
 
 (* theory data *)