fixed subgoal_tac; fails on non-existent subgoal;
authorwenzelm
Thu, 24 Jan 2002 22:42:14 +0100
changeset 12847 afa356dbcb15
parent 12846 0fce95478e19
child 12848 ac191fb20ff1
fixed subgoal_tac; fails on non-existent subgoal;
src/Pure/tactic.ML
--- a/src/Pure/tactic.ML	Thu Jan 24 22:41:44 2002 +0100
+++ b/src/Pure/tactic.ML	Thu Jan 24 22:42:14 2002 +0100
@@ -351,14 +351,13 @@
     EVERY (map (fn th => metacut_tac th i) (filter is_fact ths));
 
 (*Introduce the given proposition as a lemma and subgoal*)
-fun subgoal_tac sprop i st =
-  let val st'    = Seq.hd (res_inst_tac [("psi", sprop)] cut_rl i st)
-      val concl' = Logic.strip_assums_concl (List.nth(prems_of st', i))
-  in
+fun subgoal_tac sprop =
+  DETERM o res_inst_tac [("psi", sprop)] cut_rl THEN' SUBGOAL (fn (prop, _) =>
+    let val concl' = Logic.strip_assums_concl prop in
       if null (term_tvars concl') then ()
       else warning"Type variables in new subgoal: add a type constraint?";
-      Seq.single st'
-  end;
+      all_tac
+  end);
 
 (*Introduce a list of lemmas and subgoals*)
 fun subgoals_tac sprops = EVERY' (map subgoal_tac sprops);