re-tuned c9605a284fba, which impacts performance significantly (for unclear reasons) -- make AFP/Collections build again;
authorwenzelm
Fri, 29 Apr 2016 01:21:44 +0200
changeset 63069 f009347b9072
parent 63068 8b9401bfd9fd
child 63070 952714a20087
re-tuned c9605a284fba, which impacts performance significantly (for unclear reasons) -- make AFP/Collections build again;
src/Pure/Isar/specification.ML
--- a/src/Pure/Isar/specification.ML	Thu Apr 28 15:42:52 2016 +0200
+++ b/src/Pure/Isar/specification.ML	Fri Apr 29 01:21:44 2016 +0200
@@ -101,14 +101,16 @@
 local
 
 fun close_forms ctxt auto_close i prems concls =
-  let
-    val xs =
-      if auto_close then rev (fold (Variable.add_free_names ctxt) (prems @ concls) [])
-      else [];
-    val types =
-      map (Type_Infer.param i o rpair []) (Name.invent Name.context Name.aT (length xs));
-    val uniform_typing = AList.lookup (op =) (xs ~~ types);
-  in map (Logic.close_prop_constraint uniform_typing (xs ~~ xs) prems) concls end;
+  if not auto_close andalso null prems then concls
+  else
+    let
+      val xs =
+        if auto_close then rev (fold (Variable.add_free_names ctxt) (prems @ concls) [])
+        else [];
+      val types =
+        map (Type_Infer.param i o rpair []) (Name.invent Name.context Name.aT (length xs));
+      val uniform_typing = AList.lookup (op =) (xs ~~ types);
+    in map (Logic.close_prop_constraint uniform_typing (xs ~~ xs) prems) concls end;
 
 fun get_positions ctxt x =
   let