method "goals" ignores facts;
authorwenzelm
Sun, 13 Sep 2015 14:44:03 +0200
changeset 61164 2a03ae772c60
parent 61163 c94c65f35d01
child 61165 8020249565fb
method "goals" ignores facts;
src/Doc/Isar_Ref/Proof.thy
src/Pure/Isar/method.ML
--- a/src/Doc/Isar_Ref/Proof.thy	Sun Sep 13 14:42:34 2015 +0200
+++ b/src/Doc/Isar_Ref/Proof.thy	Sun Sep 13 14:44:03 2015 +0200
@@ -886,10 +886,10 @@
   method; thus a plain \emph{do-nothing} proof step would be ``@{command
   "proof"}~@{text "-"}'' rather than @{command "proof"} alone.
 
-  \item @{method "goals"}~@{text "a\<^sub>1 \<dots> a\<^sub>n"} is like ``@{method "-"}'', but
-  the current subgoals are turned into cases within the context (see also
-  \secref{sec:cases-induct}). The specified case names are used if present;
-  otherwise cases are numbered starting from 1.
+  \item @{method "goals"}~@{text "a\<^sub>1 \<dots> a\<^sub>n"} turns the current subgoals
+  into cases within the context (see also \secref{sec:cases-induct}). The
+  specified case names are used if present; otherwise cases are numbered
+  starting from 1.
 
   Invoking cases in the subsequent proof body via the @{command_ref case}
   command will @{command fix} goal parameters, @{command assume} goal
--- a/src/Pure/Isar/method.ML	Sun Sep 13 14:42:34 2015 +0200
+++ b/src/Pure/Isar/method.ML	Sun Sep 13 14:44:03 2015 +0200
@@ -694,20 +694,19 @@
   setup @{binding "-"} (Scan.succeed (K insert_facts))
     "insert current facts, nothing else" #>
   setup @{binding goals} (Scan.lift (Scan.repeat Args.name_token) >> (fn names => fn ctxt =>
-    METHOD_CASES (fn facts =>
-      Seq.THEN (ALLGOALS (insert_tac facts), fn st =>
-        let
-          val _ =
-            (case drop (Thm.nprems_of st) names of
-              [] => ()
-            | bad =>
-                if detect_closure_state st then ()
-                else
-                  (* FIXME Seq.Error *)
-                  error ("Excessive case names: " ^ commas_quote (map Token.content_of bad) ^
-                    Position.here (Position.set_range (Token.range_of bad))));
-        in goals_tac ctxt (map Token.content_of names) st end))))
-    "insert facts and bind cases for goals" #>
+    METHOD_CASES (fn facts => fn st =>
+      let
+        val _ =
+          (case drop (Thm.nprems_of st) names of
+            [] => ()
+          | bad =>
+              if detect_closure_state st then ()
+              else
+                (* FIXME Seq.Error *)
+                error ("Excessive case names: " ^ commas_quote (map Token.content_of bad) ^
+                  Position.here (Position.set_range (Token.range_of bad))));
+      in goals_tac ctxt (map Token.content_of names) st end)))
+    "bind cases for goals" #>
   setup @{binding insert} (Attrib.thms >> (K o insert))
     "insert theorems, ignoring facts" #>
   setup @{binding intro} (Attrib.thms >> (fn ths => fn ctxt => intro ctxt ths))