refine now provides specific cases "goal1" ... "goaln" for addressing
authorberghofe
Tue, 15 Feb 2005 16:56:15 +0100
changeset 15533 accd51fdae3c
parent 15532 9712d41db5b8
child 15534 fad04f5f822f
refine now provides specific cases "goal1" ... "goaln" for addressing subgoals of a proof state.
src/Pure/Isar/proof.ML
--- a/src/Pure/Isar/proof.ML	Mon Feb 14 10:24:58 2005 +0100
+++ b/src/Pure/Isar/proof.ML	Tue Feb 15 16:56:15 2005 +0100
@@ -465,6 +465,10 @@
   if Sign.subsig (sg, sign_of state) then state
   else raise STATE ("Bad signature of result: " ^ Sign.str_of_sg sg, state);
 
+fun mk_goals_cases st =
+  RuleCases.make true NONE (sign_of_thm st, prop_of st)
+    (map (fn i => "goal" ^ string_of_int i) (1 upto nprems_of st));
+
 fun gen_refine current_context meth_fun state =
   let
     val (goal_ctxt, (_, ((result, (facts, thm)), x))) = find_goal state;
@@ -473,7 +477,8 @@
     fun refn (thm', cases) =
       state
       |> check_sign (Thm.sign_of_thm thm')
-      |> map_goal (ProofContext.add_cases cases) (K ((result, (facts, thm')), x));
+      |> map_goal (ProofContext.add_cases (cases @ mk_goals_cases thm'))
+           (K ((result, (facts, thm')), x));
   in Seq.map refn (meth facts thm) end;
 
 in