966
|
1 |
(* Title: Option.ML
|
|
2 |
ID: $Id$
|
|
3 |
Author: Tobias Nipkow
|
|
4 |
Copyright 1994 TU Muenchen
|
|
5 |
|
|
6 |
Derived rules
|
|
7 |
*)
|
|
8 |
|
|
9 |
val option_rws = Let_def :: Option.option.simps;
|
|
10 |
val SS = arith_ss addsimps option_rws;
|
|
11 |
|
|
12 |
val [prem] = goal Option.thy "P(opt) ==> P(None) | (? x. P(Some(x)))";
|
|
13 |
br (prem RS rev_mp) 1;
|
|
14 |
by (Option.option.induct_tac "opt" 1);
|
|
15 |
by (ALLGOALS(fast_tac HOL_cs));
|
|
16 |
val optE = store_thm("optE", standard(result() RS disjE));
|
1052
|
17 |
|
|
18 |
goal Option.thy "x=None | (? y.x=Some(y))";
|
|
19 |
by (Option.option.induct_tac "x" 1);
|
|
20 |
by (asm_full_simp_tac list_ss 1);
|
|
21 |
by (rtac disjI2 1);
|
|
22 |
by (rtac exI 1);
|
|
23 |
by (asm_full_simp_tac list_ss 1);
|
|
24 |
qed"opt_cases"; |