Deleted obsolete proofs. But option_case_tac will be obsolete too
--- a/src/HOL/Option.ML Thu May 22 15:08:14 1997 +0200
+++ b/src/HOL/Option.ML Thu May 22 15:09:09 1997 +0200
@@ -8,20 +8,23 @@
open Option;
-val [prem] = goal Option.thy "P(opt) ==> P(None) | (? x. P(Some(x)))";
- br (prem RS rev_mp) 1;
- by (option.induct_tac "opt" 1);
- by (ALLGOALS Blast_tac);
-bind_thm("optionE", standard(result() RS disjE));
-(*
-goal Option.thy "opt=None | (? x.opt=Some(x))";
-by (option.induct_tac "opt" 1);
-by (Simp_tac 1);
-by (rtac disjI2 1);
-by (rtac exI 1);
-by (Asm_full_simp_tac 1);
-qed"option_cases";
-*)
+val opt_exhaustion = #nchotomy (the (datatype_info Option.thy "option"))
+ RS spec;
+
+(*---------------------------------------------------------------------------
+ * Do a case analysis on something of type 'a option.
+ *---------------------------------------------------------------------------*)
+
+fun option_case_tac t =
+ (cut_inst_tac [("x",t)] opt_exhaustion
+ THEN' etac disjE
+ THEN' rotate_tac ~1
+ THEN' Asm_full_simp_tac
+ THEN' etac exE
+ THEN' rotate_tac ~1
+ THEN' Asm_full_simp_tac);
+
+
goal Option.thy "P(case opt of None => a | Some(x) => b(x)) = \
\ ((opt = None --> P a) & (!x. opt = Some x --> P(b(x))))";
by (option.induct_tac "opt" 1);