src/HOL/IOA/meta_theory/Option.ML
author paulson
Tue, 16 Jul 1996 15:49:46 +0200
changeset 1868 836950047d85
parent 1266 3ae9fe3c0f68
child 1894 c2c8279d40f0
permissions -rw-r--r--
Put in minimal simpset to avoid excessive simplification, just as in revision 1.9 of HOL/indrule.ML
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
966
3fd66f245ad7 converted IOA with curried function application
clasohm
parents:
diff changeset
     1
(*  Title:      Option.ML
3fd66f245ad7 converted IOA with curried function application
clasohm
parents:
diff changeset
     2
    ID:         $Id$
3fd66f245ad7 converted IOA with curried function application
clasohm
parents:
diff changeset
     3
    Author:     Tobias Nipkow
3fd66f245ad7 converted IOA with curried function application
clasohm
parents:
diff changeset
     4
    Copyright   1994  TU Muenchen
3fd66f245ad7 converted IOA with curried function application
clasohm
parents:
diff changeset
     5
3fd66f245ad7 converted IOA with curried function application
clasohm
parents:
diff changeset
     6
Derived rules
3fd66f245ad7 converted IOA with curried function application
clasohm
parents:
diff changeset
     7
*)
3fd66f245ad7 converted IOA with curried function application
clasohm
parents:
diff changeset
     8
1266
3ae9fe3c0f68 added local simpsets
clasohm
parents: 1052
diff changeset
     9
Addsimps [Let_def];
966
3fd66f245ad7 converted IOA with curried function application
clasohm
parents:
diff changeset
    10
3fd66f245ad7 converted IOA with curried function application
clasohm
parents:
diff changeset
    11
val [prem] = goal Option.thy "P(opt) ==> P(None) | (? x. P(Some(x)))";
3fd66f245ad7 converted IOA with curried function application
clasohm
parents:
diff changeset
    12
 br (prem RS rev_mp) 1;
3fd66f245ad7 converted IOA with curried function application
clasohm
parents:
diff changeset
    13
 by (Option.option.induct_tac "opt" 1);
3fd66f245ad7 converted IOA with curried function application
clasohm
parents:
diff changeset
    14
 by (ALLGOALS(fast_tac HOL_cs));
3fd66f245ad7 converted IOA with curried function application
clasohm
parents:
diff changeset
    15
val optE = store_thm("optE", standard(result() RS disjE));
1052
e044350bfa52 Olafs new version.
nipkow
parents: 966
diff changeset
    16
e044350bfa52 Olafs new version.
nipkow
parents: 966
diff changeset
    17
goal Option.thy "x=None | (? y.x=Some(y))"; 
e044350bfa52 Olafs new version.
nipkow
parents: 966
diff changeset
    18
by (Option.option.induct_tac "x" 1);
1266
3ae9fe3c0f68 added local simpsets
clasohm
parents: 1052
diff changeset
    19
by (Asm_full_simp_tac 1);
1052
e044350bfa52 Olafs new version.
nipkow
parents: 966
diff changeset
    20
by (rtac disjI2 1);
e044350bfa52 Olafs new version.
nipkow
parents: 966
diff changeset
    21
by (rtac exI 1);
1266
3ae9fe3c0f68 added local simpsets
clasohm
parents: 1052
diff changeset
    22
by (Asm_full_simp_tac 1);
3ae9fe3c0f68 added local simpsets
clasohm
parents: 1052
diff changeset
    23
qed"opt_cases";